updated update script and merged lobbylens admin scripts
[contractdashboard.git] / admin / updateReport.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
include_once("../lib/common.inc.php");
$query = "SELECT DATE(importDate) as importday, count(*) as count, min(publishDate) as start, max(publishDate) as end 
FROM `contractnotice` WHERE childCN = 0 AND parentCN = 0 AND DATE(importDate) in (select * from (SELECT DATE(importDate) 
FROM `contractnotice` ORDER BY `importDate` DESC limit 1) alias)";
$result = mysql_query($query);
$stats = mysql_fetch_array($result, MYSQL_BOTH);
echo $stats["count"] . " new records in period " . $stats["start"] . "  to " . $stats["end"] ."<br>";
 
$query = "SELECT DATE(importDate) as importday, count(*) as count, min(publishDate) as start, max(publishDate) as end 
FROM `contractnotice` WHERE (childCN != 0 OR parentCN != 0) AND DATE(importDate) in (select * from (SELECT DATE(importDate) 
FROM `contractnotice` ORDER BY `importDate` DESC limit 1) alias)";
$result = mysql_query($query);
$stats = mysql_fetch_array($result, MYSQL_BOTH);
echo $stats["count"] . " updated records in period " . $stats["start"] . "  to " . $stats["end"] ."<br>";
 
$query = "SELECT count(*) as count FROM `agency` WHERE `abn` = '0'";
$result = mysql_query($query);
$stats = mysql_fetch_array($result, MYSQL_BOTH);
echo $stats["count"] . " agencies with no ABN<br>";
 
/*$query = "SELECT count(*) as count FROM `supplierdetails` WHERE `supplierABN` = '0' and supplierCountry LIKE 'Australia'";
$result = mysql_query($query);
$stats = mysql_fetch_array($result, MYSQL_BOTH);
echo $stats["count"] . " Australian suppliers with no ABN<br>";*/
 
 
echo "Last updated: ". $stats["importday"]."<br>";
?>