From: maxious Date: Wed, 24 Nov 2010 08:28:02 +0000 Subject: Prettier JQuery tables X-Git-Url: http://maxious.lambdacomplex.org/git/?p=contractdashboard.git&a=commitdiff&h=2168524e9590a454062a4c432b1145dabc8002cb --- Prettier JQuery tables --- --- a/about.php +++ b/about.php @@ -1,6 +1,55 @@ + + +
+

Header-1

+
+orem ipsum dolor sit amet, consectetuer adipiscing elit orem ipsum dolor sit amet, consectetuer adipiscing elit +
+

Header-2

+
+orem ipsum dolor sit amet, consectetuer adipiscing elit orem ipsum dolor sit amet, consectetuer adipiscing elit +
+

Header-3

+
+orem ipsum dolor sit amet, consectetuer adipiscing elit orem ipsum dolor sit amet, consectetuer adipiscing elit +
+
+ sourced from austender Government Agency Information (2009-07-10): National Archives of Australia, http://www.naa.gov.au under Creative Commons - Attribution 2.5 Australia (CC-BY) jpgraph for php ABR Redhat Liberation fonts - + + +"; +$stats = mysql_fetch_array($result, MYSQL_BOTH); +echo $stats["count"] . " new records in period " . $stats["start"] . " to " . $stats["end"] ."
"; + + +$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); +echo "
"; +$stats = mysql_fetch_array($result, MYSQL_BOTH); +echo $stats["count"] . " updated records in period " . $stats["start"] . " to " . $stats["end"] ."
"; + + +echo "Last updated: ". $stats["importday"]."
"; +/* Check for null Procurement method and 0 ABN when not ABN exempt */ + + +include_footer(); +?> --- a/admin/abr-example.php +++ b/admin/abr-example.php --- /dev/null +++ b/admin/agency2portfolio.php @@ -1,1 +1,42 @@ + '', + 'advorgunitfield' => $agency, + 'advrolefield' => '', + 'advsection' => 'All', + 'advsurnamefield' => '', + 'search' => 'Submit Query' + )); + $results = curl_exec($c); + + if (preg_match('##smi', $results, $m)) { + $nextURL = $m[1]; + } else { + $cache[$agency] = false; return false; + } + + curl_setopt($c, CURLOPT_URL, 'http://www.directory.gov.au' . $nextURL); + curl_setopt($c, CURLOPT_HTTPGET, true); + curl_setopt($c, CURLOPT_REFERER, 'http://www.directory.gov.au/searchres.php'); + $results = curl_exec($c); + if (preg_match('#portfolios:\s+([^<]+)#ims', $results, $m)) { + $cache[$agency] = $m[1]; return $m[1]; + } else { + $cache[$agency] = false; return false; + } +} + +?> + --- a/admin/convertToThematicMapping.php +++ b/admin/convertToThematicMapping.php --- /dev/null +++ b/admin/displayRepresentatives.php @@ -1,1 +1,7 @@ +SELECT representative_id,firstname,surname,party,house,division_id, portfolio +FROM portfolio2representative +INNER JOIN representatives +ON portfolio2representative.representative_id=representatives.id +INNER JOIN portfolios +ON portfolio2representative.portfolio_id=portfolios.id --- /dev/null +++ b/admin/displayUNSPSC.php @@ -1,1 +1,25 @@ +"; +while ($row = mysql_fetch_assoc($catsresult)) { + $catName = $unspsc[$row['cat']."000000"].$row['cat']; + if ($row['cat'] = "") $catName = "null"; + + echo "$catName".$row['value'].""; +} +?> --- a/admin/google-example.htm +++ b/admin/google-example.htm --- a/admin/google-example.php +++ b/admin/google-example.php --- a/admin/import.bat +++ b/admin/import.bat --- a/admin/import.php +++ b/admin/import.php @@ -1,119 +1,113 @@ "; -$dhandle = opendir($path); -// define an array to hold the files -$files = array(); - -if ($dhandle) { - // loop through all of the files - while (false !== ($fname = readdir($dhandle))) { - if (($fname != '.') && ($fname != '..')) { - echo "$fname".filesize($path.$fname)."
"; - } - } -} - -} else { -$success =0; -$fname = $_REQUEST["fname"]; -echo " ============== $fname ==============
"; -$row = 1; -$handle = fopen($path.$fname, "r"); -//"t" mode string translates windows line breaks to unix -$datamapping0709 = Array("Agency" => "agencyName", "Parent CN ID" => "parentCN", "CN ID" => "CNID", "Publish Date" => "publishDate", "Amendment Date" => "amendDate", "Status" => "", "StartDate" => "contractStart" , "EndDate" => "contractEnd", "Value" => "value", "Description" => "description", "Agency Ref Id" => "agencyID", "Category" => "category", "Procurement Method" => "procurementMethod", "ATM ID" => "atmID", "SON ID" => "SONID","Confidentiality - Contract" => "confidentialityContract", "Confidentiality - Contract Reason(s)" => "confidentialityContractReason", "Confidentiality - Outputs" => "confidentialityOutputs", "Confidentiality - Outputs Reason(s)" => "confidentialityOutputsReason", "Consultancy" => "consultancy", "Consultancy Reason(s)" => "consultancyReason", "Amendment Reason" => "amendmentReason", "Supplier Name" => "supplierName", "Supplier Address" => "supplierAddress", "Supplier City" => "supplierCity", "Supplier Postcode" => "supplierPostcode", "Supplier Country" => "supplierCountry" , "Supplier ABNExempt" => "supplierABNExempt", "Supplier ABN" => "supplierABN" , "Agency Branch" => "contactBranch","Agency Divison" => "contactDivision", "Agency Postcode" => "contactPostcode" , "" => ""); -$headers; -$contractNoticeFields = Array("agencyName", "parentCN", "CNID", "publishDate", "amendDate", "contractStart" , "contractEnd", "value", "description", "agencyID", "category", "procurementMethod", "atmID", "SONID", "confidentialityContract", "confidentialityContractReason", "confidentialityOutputs", "confidentialityOutputsReason", "consultancy", "consultancyReason", "amendmentReason", "supplierName", "supplierAddress", "supplierCity", "supplierPostcode", "supplierCountry" , "supplierABNExempt", "supplierABN", "contactBranch","contactDivision","contactPostcode" ); -$agencyFields = Array("agencyName"); -$supplierFields = Array("supplierName", "supplierAddress", "supplierCity", "supplierPostcode", "supplierCountry" , "supplierABNExempt", "supplierABN" ); - -while (($data = fgetcsv($handle, 1000, "\t")) !== FALSE) { - $num = count($data); - - if ($row == 3) - { - $headers = $data; - } - else if ($row > 3) - { - if ($num > count($datamapping0709)) - { - die ("Error in data import; data mapping fields out of bounds or changed
".$fname.print_r($data)); - } - $firstCN= false; - $firstSupplier= true; - $firstAgency= true; - $contractNoticeInsert = "INSERT INTO contractnotice (importFile, ".implode(" , ",$contractNoticeFields). ") VALUES ( \"$fname\" "; - $supplierInsert = "INSERT INTO supplierdetails (".implode(" , ",$supplierFields). ") VALUES ("; - $agencyInsert = "INSERT INTO agency (".implode(" , ",$agencyFields). ") VALUES ("; - - $keys = array_keys($datamapping0709); - for ($c=0; $c < $num; $c++) { - $data[$c] = trim($data[$c],"="); - $data[$c] = trim($data[$c], "\""); - - if (in_array(($datamapping0709[$headers[$c]]),$contractNoticeFields)) - { - if (($datamapping0709[$headers[$c]]) == "parentCN" || ($datamapping0709[$headers[$c]]) == "CNID") - { - $data[$c] = substr($data[$c],2); - if ($data[$c] >0) - { - $contractNoticeInsert .= ($firstCN ? "" : ","). mysql_real_escape_string($data[$c]); - } else - { - $contractNoticeInsert .= ($firstCN ? "" : ",")."''"; - } - } else if (($datamapping0709[$headers[$c]]) == "amendDate" || ($datamapping0709[$headers[$c]]) == "publishDate" || ($datamapping0709[$headers[$c]]) == "contractStart" || ($datamapping0709[$headers[$c]]) == "contractEnd") - { - $contractNoticeInsert .= ($firstCN ? "" : ","). "'".date( 'Y-m-d H:i:s', strtotime($data[$c])). "'"; - } else - { - if (strstr("\" =",$data[$c] > 0)) - { - die ("Invalid Description field" . $contractNoticeInsert); - } - $contractNoticeInsert .= ($firstCN ? "" : ",") . "'". mysql_real_escape_string($data[$c])."'"; - - } - $firstCN = false; - } - if (in_array(($datamapping0709[$headers[$c]]),$supplierFields)) - { - $supplierInsert .= ($firstSupplier ? "" : ",") . "'". mysql_real_escape_string($data[$c])."'"; - $firstSupplier = false; - } - if (in_array(($datamapping0709[$headers[$c]]),$agencyFields)) - { - $agencyInsert .= ($firstAgency ? "" : ",") . "'". mysql_real_escape_string($data[$c])."'"; - $firstAgency = false; - } - - } - $contractNoticeInsert .= ");"; - $supplierInsert .= ");"; - $agencyInsert .= ");"; - -$result = mysql_query($contractNoticeInsert); -if ($result) $success++; -else echo $data[2] . " failed CN insert.
". mysql_error() ."
$contractNoticeInsert

\n"; - - //$result = mysql_query($agencyInsert); -if ($result) $success++; -else echo $data[2] . " failed agency insert.
". mysql_error() ."
$agencyInsert

\n"; - - $result = mysql_query($supplierInsert); -if ($result) $success++; -else echo $data[2] . " failed supplier insert.
". mysql_error() ."
$supplierInsert

\n"; - -echo "
\n"; - } - - $row++; -} -echo "
$success records successfully created"; -fclose($handle); -} + include_once("../lib/common.inc.php"); + $path = 'data/'; + if ($_REQUEST["fname"] == "") { + echo "Get files from: https://www.tenders.gov.au/?event=public.reports.list
"; + $dhandle = opendir($path); + // define an array to hold the files + $files = array(); + + if ($dhandle) { + // loop through all of the files + while (false !== ($fname = readdir($dhandle))) { + if (($fname != '.') && ($fname != '..')) { + echo "$fname" . filesize($path . $fname) . "
"; + } + } + } + } else { + $success = 0; + $fname = $_REQUEST["fname"]; + echo " ============== $fname ==============
"; + flush(); + $row = 1; + $handle = fopen($path . $fname, "r"); + //"t" mode string translates windows line breaks to unix + $datamapping0709 = array("Agency" => "agencyName", "Parent CN ID" => "parentCN", "CN ID" => "CNID", "Publish Date" => "publishDate", "Amendment Date" => "amendDate", "Status" => "", "StartDate" => "contractStart", "EndDate" => "contractEnd", "Value" => "value", "Description" => "description", "Agency Ref Id" => "agencyID", "Category" => "category", "Procurement Method" => "procurementMethod", "ATM ID" => "atmID", "SON ID" => "SONID", "Confidentiality - Contract" => "confidentialityContract", "Confidentiality - Contract Reason(s)" => "confidentialityContractReason", "Confidentiality - Outputs" => "confidentialityOutputs", "Confidentiality - Outputs Reason(s)" => "confidentialityOutputsReason", "Consultancy" => "consultancy", "Consultancy Reason(s)" => "consultancyReason", "Amendment Reason" => "amendmentReason", "Supplier Name" => "supplierName", "Supplier Address" => "supplierAddress", "Supplier City" => "supplierCity", "Supplier Postcode" => "supplierPostcode", "Supplier Country" => "supplierCountry", "Supplier ABNExempt" => "supplierABNExempt", "Supplier ABN" => "supplierABN", "Agency Branch" => "contactBranch", "Agency Divison" => "contactDivision", "Agency Postcode" => "contactPostcode", "" => ""); + $headers; + $contractNoticeFields = array("agencyName", "parentCN", "CNID", "publishDate", "amendDate", "contractStart", "contractEnd", "value", "description", "agencyID", "category", "procurementMethod", "atmID", "SONID", "confidentialityContract", "confidentialityContractReason", "confidentialityOutputs", "confidentialityOutputsReason", "consultancy", "consultancyReason", "amendmentReason", "supplierName", "supplierAddress", "supplierCity", "supplierPostcode", "supplierCountry", "supplierABNExempt", "supplierABN", "contactBranch", "contactDivision", "contactPostcode"); + $agencyFields = array("agencyName"); + $supplierFields = array("supplierName", "supplierAddress", "supplierCity", "supplierPostcode", "supplierCountry", "supplierABNExempt", "supplierABN"); + + while (($data = fgetcsv($handle, 1000, "\t")) !== false) { + $num = count($data); + + if ($row == 3) { + $headers = $data; + } elseif ($row > 3) { + if ($num > count($datamapping0709)) { + die("Error in data import; data mapping fields out of bounds or changed
" . $fname . print_r($data)); + } + $firstCN = false; + $firstSupplier = true; + $firstAgency = true; + $contractNoticeInsert = "INSERT INTO contractnotice (importFile, " . implode(" , ", $contractNoticeFields) . ") VALUES ( \"$fname\" "; + $supplierInsert = "INSERT INTO supplierdetails (" . implode(" , ", $supplierFields) . ") VALUES ("; + $agencyInsert = "INSERT INTO agency (" . implode(" , ", $agencyFields) . ") VALUES ("; + + $keys = array_keys($datamapping0709); + for ($c = 0; $c < $num; $c++) { + $data[$c] = trim($data[$c], "="); + $data[$c] = trim($data[$c], "\""); + + if (in_array(($datamapping0709[$headers[$c]]), $contractNoticeFields)) { + if (($datamapping0709[$headers[$c]]) == "parentCN" || ($datamapping0709[$headers[$c]]) == "CNID") { + $data[$c] = substr($data[$c], 2); + if ($data[$c] > 0) { + $contractNoticeInsert .= ($firstCN ? "" : ",") . mysql_real_escape_string($data[$c]); + } else { + $contractNoticeInsert .= ($firstCN ? "" : ",") . "''"; + } + } elseif (($datamapping0709[$headers[$c]]) == "amendDate" || ($datamapping0709[$headers[$c]]) == "publishDate" || ($datamapping0709[$headers[$c]]) == "contractStart" || ($datamapping0709[$headers[$c]]) == "contractEnd") { + $contractNoticeInsert .= ($firstCN ? "" : ",") . "'" . date('Y-m-d H:i:s', strtotime($data[$c])) . "'"; + } else { + if (strstr("\" =", $data[$c] > 0)) { + die("Invalid Description field" . $contractNoticeInsert); + } + $contractNoticeInsert .= ($firstCN ? "" : ",") . "'" . mysql_real_escape_string($data[$c]) . "'"; + } + $firstCN = false; + } + if (in_array(($datamapping0709[$headers[$c]]), $supplierFields)) { + $supplierInsert .= ($firstSupplier ? "" : ",") . "'" . mysql_real_escape_string($data[$c]) . "'"; + $firstSupplier = false; + } + if (in_array(($datamapping0709[$headers[$c]]), $agencyFields)) { + $agencyInsert .= ($firstAgency ? "" : ",") . "'" . mysql_real_escape_string($data[$c]) . "'"; + $firstAgency = false; + } + } + flush(); + $contractNoticeInsert .= ");"; + $supplierInsert .= ");"; + $agencyInsert .= ");"; + + $result = mysql_query($contractNoticeInsert); + if ($result) + $success++; + elseif (strpos(mysql_error(), "Duplicate entry") === false) + echo $data[2] . " failed CN insert.
" . mysql_error() . "
$contractNoticeInsert

\n"; + + $result = mysql_query($agencyInsert); + if ($result) + $success++; + elseif (strpos(mysql_error(), "Duplicate entry") === false) + echo $data[2] . " failed agency insert.
" . mysql_error() . "
$agencyInsert

\n"; + + $result = mysql_query($supplierInsert); + if ($result) + $success++; + elseif (strpos(mysql_error(), "Duplicate entry") === false) + echo $data[2] . " failed supplier insert.
" . mysql_error() . "
$supplierInsert

\n"; + flush(); + + //echo "
\n"; + } + + $row++; + } + echo "
$success records successfully created"; + flush(); + fclose($handle); + } ?> --- a/admin/linkAmendments.php +++ b/admin/linkAmendments.php --- a/admin/recordsperweek.txt +++ b/admin/recordsperweek.txt --- a/admin/setAgencyStatus.php +++ b/admin/setAgencyStatus.php @@ -1,16 +1,24 @@ \n"; else echo "error".mysql_error(); } foreach ($suspended as $agency) { + $agencyParts = explode("|",$agency); + $agency = $agencyParts[1]; + $agencyInsert = "INSERT INTO agency (agencyName) VALUES ('$agency')"; + $result = mysql_query($agencyInsert); $result = mysql_query("UPDATE agency SET status = 'suspended' where agencyName = '".mysql_real_escape_string($agency)."';") ; if ($result) echo $agency. " set to suspended in ". mysql_affected_rows() . " divisions/branches
\n"; else echo "error".mysql_error(); --- a/admin/setAgencyURLABN.php +++ b/admin/setAgencyURLABN.php @@ -26,9 +26,10 @@ $result = mysql_query("UPDATE agency SET website = 'http://" . $result->visibleUrl . "', abn = '{$abn[0]}' WHERE agencyName = '$agency';"); if ($result) echo $agency . " set in " . mysql_affected_rows() . "
\n"; } else { + echo "invalid ABN"; $result = mysql_query("UPDATE agency SET website = 'http://" . $result->visibleUrl . "' WHERE agencyName = '$agency';"); - if ($result) echo $agency . " set in " . mysql_affected_rows() . "
\n"; + if ($result) echo $agency . " set in " . mysql_affected_rows() . "
\n"; } // fi --- /dev/null +++ b/admin/updateReport.php @@ -1,1 +1,30 @@ +"; + +$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"] ."
"; + +$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
"; + +/*$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
";*/ + + +echo "Last updated: ". $stats["importday"]."
"; +?> --- /dev/null +++ b/admin/updateUNSPSC.php @@ -1,1 +1,34 @@ +\n Category not found for: \n"; +// print_r($record); + } else { + $result = mysql_query("UPDATE contractnotice SET categoryUNSPSC = +'".mysql_real_escape_string($unspsc[$record['category']])."' where CNID = +'".mysql_real_escape_string($record['CNID'])."';"); + if ($result) echo $record['CNID']. " set to ". ($unspsc[$record['category']]) . "
\n"; + else echo "error".mysql_error(); + } + } +} else echo "error".mysql_error(); +asort($missing); +print_r($missing); +?> --- /dev/null +++ b/autosuggest_inquisitor.css @@ -1,1 +1,177 @@ +/* +================================================ +autosuggest, inquisitor style +================================================ +*/ +body +{ + position: relative; +} + + +div.autosuggest +{ + position: absolute; + background-image: url(images/img_inquisitor/as_pointer.gif); + background-position: top; + background-repeat: no-repeat; + padding: 10px 0 0 0; +} + +div.autosuggest div.as_header, +div.autosuggest div.as_footer +{ + position: relative; + height: 6px; + padding: 0 6px; + background-image: url(images/img_inquisitor/ul_corner_tr.gif); + background-position: top right; + background-repeat: no-repeat; + overflow: hidden; +} +div.autosuggest div.as_footer +{ + background-image: url(images/img_inquisitor/ul_corner_br.gif); +} + +div.autosuggest div.as_header div.as_corner, +div.autosuggest div.as_footer div.as_corner +{ + position: absolute; + top: 0; + left: 0; + height: 6px; + width: 6px; + background-image: url(images/img_inquisitor/ul_corner_tl.gif); + background-position: top left; + background-repeat: no-repeat; +} +div.autosuggest div.as_footer div.as_corner +{ + background-image: url(images/img_inquisitor/ul_corner_bl.gif); +} +div.autosuggest div.as_header div.as_bar, +div.autosuggest div.as_footer div.as_bar +{ + height: 6px; + overflow: hidden; + background-color: #333; +} + + +div.autosuggest ul +{ + list-style: none; + margin: 0 0 -4px 0; + padding: 0; + overflow: hidden; + background-color: #333; +} + +div.autosuggest ul li +{ + color: #ccc; + padding: 0; + margin: 0 4px 4px; + text-align: left; +} + +div.autosuggest ul li a +{ + color: #ccc; + display: block; + text-decoration: none; + background-color: transparent; + text-shadow: #000 0px 0px 5px; + position: relative; + padding: 0; + width: 100%; +} +div.autosuggest ul li a:hover +{ + background-color: #444; +} +div.autosuggest ul li.as_highlight a:hover +{ + background-color: #1B5CCD; +} + +div.autosuggest ul li a span +{ + display: block; + padding: 3px 6px; + font-weight: bold; +} + +div.autosuggest ul li a span small +{ + font-weight: normal; + color: #999; +} + +div.autosuggest ul li.as_highlight a span small +{ + color: #ccc; +} + +div.autosuggest ul li.as_highlight a +{ + color: #fff; + background-color: #1B5CCD; + background-image: url(images/img_inquisitor/hl_corner_br.gif); + background-position: bottom right; + background-repeat: no-repeat; +} + +div.autosuggest ul li.as_highlight a span +{ + background-image: url(images/img_inquisitor/hl_corner_bl.gif); + background-position: bottom left; + background-repeat: no-repeat; +} + +div.autosuggest ul li a .tl, +div.autosuggest ul li a .tr +{ + background-image: transparent; + background-repeat: no-repeat; + width: 6px; + height: 6px; + position: absolute; + top: 0; + padding: 0; + margin: 0; +} +div.autosuggest ul li a .tr +{ + right: 0; +} + +div.autosuggest ul li.as_highlight a .tl +{ + left: 0; + background-image: url(images/img_inquisitor/hl_corner_tl.gif); + background-position: bottom left; +} + +div.autosuggest ul li.as_highlight a .tr +{ + right: 0; + background-image: url(images/img_inquisitor/hl_corner_tr.gif); + background-position: bottom right; +} + + + +div.autosuggest ul li.as_warning +{ + font-weight: bold; + text-align: center; +} + +div.autosuggest ul em +{ + font-style: normal; + color: #6EADE7; +} --- a/contractDashboard.kpf +++ b/contractDashboard.kpf --- a/cutenews/LICENSE.txt +++ b/cutenews/LICENSE.txt --- a/cutenews/README.htm +++ b/cutenews/README.htm --- a/cutenews/data/.htaccess +++ b/cutenews/data/.htaccess --- a/cutenews/data/Default.tpl +++ b/cutenews/data/Default.tpl --- a/cutenews/data/Headlines.tpl +++ b/cutenews/data/Headlines.tpl --- a/cutenews/data/archives/index.htm +++ b/cutenews/data/archives/index.htm --- a/cutenews/data/auto_archive.db.php +++ b/cutenews/data/auto_archive.db.php --- a/cutenews/data/backup/index.html +++ b/cutenews/data/backup/index.html --- a/cutenews/data/cat.num.php +++ b/cutenews/data/cat.num.php --- a/cutenews/data/category.db.php +++ b/cutenews/data/category.db.php --- a/cutenews/data/comments.txt +++ b/cutenews/data/comments.txt --- a/cutenews/data/config.php +++ b/cutenews/data/config.php --- a/cutenews/data/emoticons/.htaccess +++ b/cutenews/data/emoticons/.htaccess --- a/cutenews/data/emoticons/index.html +++ b/cutenews/data/emoticons/index.html --- a/cutenews/data/flood.db.php +++ b/cutenews/data/flood.db.php --- a/cutenews/data/index.html +++ b/cutenews/data/index.html --- a/cutenews/data/ipban.db.php +++ b/cutenews/data/ipban.db.php --- a/cutenews/data/news.txt +++ b/cutenews/data/news.txt --- a/cutenews/data/postponed_news.txt +++ b/cutenews/data/postponed_news.txt --- a/cutenews/data/rss.tpl +++ b/cutenews/data/rss.tpl --- a/cutenews/data/rss_config.php +++ b/cutenews/data/rss_config.php --- a/cutenews/data/unapproved_news.txt +++ b/cutenews/data/unapproved_news.txt --- a/cutenews/data/upimages/.htaccess +++ b/cutenews/data/upimages/.htaccess --- a/cutenews/data/upimages/index.html +++ b/cutenews/data/upimages/index.html --- a/cutenews/data/users.db.php +++ b/cutenews/data/users.db.php --- a/cutenews/example1.php +++ b/cutenews/example1.php --- a/cutenews/example2.php +++ b/cutenews/example2.php --- a/cutenews/inc/.htaccess +++ b/cutenews/inc/.htaccess --- a/cutenews/inc/about.mdu +++ b/cutenews/inc/about.mdu --- a/cutenews/inc/addnews.mdu +++ b/cutenews/inc/addnews.mdu --- a/cutenews/inc/categories.mdu +++ b/cutenews/inc/categories.mdu --- a/cutenews/inc/debug.mdu +++ b/cutenews/inc/debug.mdu --- a/cutenews/inc/editcomments.mdu +++ b/cutenews/inc/editcomments.mdu --- a/cutenews/inc/editnews.mdu +++ b/cutenews/inc/editnews.mdu --- a/cutenews/inc/editusers.mdu +++ b/cutenews/inc/editusers.mdu --- a/cutenews/inc/functions.inc.php +++ b/cutenews/inc/functions.inc.php --- a/cutenews/inc/help.mdu +++ b/cutenews/inc/help.mdu --- a/cutenews/inc/images.mdu +++ b/cutenews/inc/images.mdu --- a/cutenews/inc/ipban.mdu +++ b/cutenews/inc/ipban.mdu --- a/cutenews/inc/main.mdu +++ b/cutenews/inc/main.mdu --- a/cutenews/inc/massactions.mdu +++ b/cutenews/inc/massactions.mdu --- a/cutenews/inc/options.mdu +++ b/cutenews/inc/options.mdu --- a/cutenews/inc/preview.mdu +++ b/cutenews/inc/preview.mdu --- a/cutenews/inc/shows.inc.php +++ b/cutenews/inc/shows.inc.php --- a/cutenews/inc/tools.mdu +++ b/cutenews/inc/tools.mdu --- a/cutenews/inc/wizards.mdu +++ b/cutenews/inc/wizards.mdu --- a/cutenews/index.php +++ b/cutenews/index.php --- a/cutenews/register.php +++ b/cutenews/register.php --- a/cutenews/remember.js +++ b/cutenews/remember.js --- a/cutenews/rss.php +++ b/cutenews/rss.php --- a/cutenews/rte/blank.htm +++ b/cutenews/rte/blank.htm --- a/cutenews/rte/insert_link.htm +++ b/cutenews/rte/insert_link.htm --- a/cutenews/rte/insert_table.htm +++ b/cutenews/rte/insert_table.htm --- a/cutenews/rte/palette.htm +++ b/cutenews/rte/palette.htm --- a/cutenews/rte/richtext.js +++ b/cutenews/rte/richtext.js --- a/cutenews/rte/rte.css +++ b/cutenews/rte/rte.css --- a/cutenews/search.php +++ b/cutenews/search.php --- a/cutenews/show_archives.php +++ b/cutenews/show_archives.php --- a/cutenews/show_news.php +++ b/cutenews/show_news.php --- a/cutenews/skins/compact.skin.php +++ b/cutenews/skins/compact.skin.php --- a/cutenews/skins/cute.js +++ b/cutenews/skins/cute.js --- a/cutenews/skins/default.skin.php +++ b/cutenews/skins/default.skin.php --- a/cutenews/skins/rss_style.css +++ b/cutenews/skins/rss_style.css --- a/cutenews/skins/simple.skin.php +++ b/cutenews/skins/simple.skin.php --- a/displayAgency.php +++ b/displayAgency.php @@ -19,18 +19,57 @@ --- info website, procurement plan, annual reports + Breakdown of divisions/branches Breakdown percentage,number,value by procurement type Histograph, overlaying number value reported per week over X years Compliance statistics: amendments, delay in reporting average and number completely late*/ + + $query = "SELECT CNID, description, value, agencyName, category, contractStart, supplierName + FROM `contractnotice` + WHERE agencyName = '".mysql_real_escape_string($agency)."' + ORDER BY value DESC"; + echo $query; + $result = mysql_query($query); + + echo " + + + + + + + + + "; + while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { + setlocale(LC_MONETARY, 'en_US'); + $value = number_format(doubleval($row['value']) , 2); + echo (" + + + + + + "); + } + echo "
Contract Notice NumberContract DescriptionTotal Contract ValueAgencyContract Start DateSupplier
{$row['CNID']}{$row['description']}\$$value{$row['agencyName']}{$row['contractStart']}{$row['supplierName']}
"; + mysql_free_result($result); } else { - + /* + split by portfolio + */ include_header("Agencies"); $query = "SELECT SUM(value), agencyName FROM `contractnotice` WHERE childCN = 0 GROUP BY agencyName "; $result = mysql_query($query); - echo ""; + echo "
+ + + + + "; while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { setlocale(LC_MONETARY, 'en_US'); $value = number_format(doubleval($row[0]) , 2); --- /dev/null +++ b/displayAmendments.php @@ -1,1 +1,32 @@ + 0) a". +" where ".$agencyQ.$yearQ."CNID = ccn AND (value - pvalue) <> 0 order by diff DESC"; +$result = mysql_query($query); + echo "
AgencyTotal Contracts Value
+ + + + + + + "; +if ($result) { +while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { + setlocale(LC_MONETARY, 'en_US'); + $value = number_format(doubleval($row['value']) , 2); + $pvalue = number_format(doubleval($row['pvalue']) , 2); + $diff = number_format(doubleval($row['diff']) , 2); + echo (""); + echo ""; + echo ""; +} +} else { +echo mysql_error(); +} +echo "
ContractOriginal ValueAmended ValueDifference
{$row['description']}\$$pvalue\$$value\$$diff
"; +mysql_free_result($result); +include_footer(); +?> --- a/displayCalendar.php +++ b/displayCalendar.php @@ -1,25 +1,77 @@

".$_REQUEST['month']."

"; +$monthParts = explode("-",$_REQUEST['month']); + $query = "SELECT CNID, description, value, agencyName, category, contractStart, supplierName + FROM `contractnotice` + WHERE childCN = 0 + AND YEAR(contractStart) = {$monthParts[1]} + AND MONTH(contractStart) = {$monthParts[0]} + ORDER BY value DESC"; + $result = mysql_query($query); +echo ''; + echo ''; + + echo " + + + + + + + + + "; + while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { + setlocale(LC_MONETARY, 'en_US'); + $value = number_format(doubleval($row['value']) , 2); + echo (" + + + + + + "); + } + echo "
Contract Notice NumberContract DescriptionTotal Contract ValueAgencyContract Start DateSupplier
{$row['CNID']}{$row['description']}\$$value{$row['agencyName']}{$row['contractStart']}{$row['supplierName']}
"; + mysql_free_result($result); +} else { /* + split by year todo: -Year/Month drilldown - largest contracts, agencies, suppliers*/ +Year/Month drilldown - largest contracts, agencies, suppliers +count per month +big picture graphs?*/ -include_header("Months and Years"); +echo ''; +echo ''; + + $query = "SELECT YEAR(contractStart), MONTH(contractStart), -value FROM `contractnotice` WHERE childCN = 0 GROUP BY MONTH(contractStart), YEAR(contractStart) ORDER BY YEAR(contractStart), MONTH(contractStart) "; +SUM(value) as val, count(1) as count FROM `contractnotice` WHERE childCN = 0 GROUP BY MONTH(contractStart), YEAR(contractStart) ORDER BY YEAR(contractStart), MONTH(contractStart) "; $result = mysql_query($query); -echo ""; + echo "
+ + + + + + "; while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { setlocale(LC_MONETARY, 'en_US'); -$value = number_format(doubleval($row["value"]),2); +$value = number_format(doubleval($row["val"]),2); $month_name = date( 'F', mktime(0, 0, 0, $row[1]) ); - echo (""); + echo (""); } echo "
Month/YearTotal Contracts ValueNumber of Contracts
$month_name {$row[0]}\$$value
$month_name {$row[0]}\$$value({$row['count']} contracts)
"; mysql_free_result($result); - +} include_footer(); -?> +?> + --- a/displayCategory.php +++ b/displayCategory.php @@ -9,7 +9,16 @@ AND category = '" . $_REQUEST['category'] . "' ORDER BY value DESC"; $result = mysql_query($query); - echo ""; + echo "
+ + + + + + + + + "; while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { setlocale(LC_MONETARY, 'en_US'); $value = number_format(doubleval($row['value']) , 2); @@ -24,14 +33,21 @@ echo "
Contract Notice NumberContract DescriptionTotal Contract ValueAgencyContract Start DateSupplier
"; mysql_free_result($result); } else { - + /* + split by main categories + */ include_header("Categories"); $query = "SELECT sum(value), category FROM `contractnotice` WHERE childCN = 0 GROUP BY category ORDER BY sum(value) DESC "; $result = mysql_query($query); -echo ""; + echo "
+ + + + + "; while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { setlocale(LC_MONETARY, 'en_US'); $value = number_format(doubleval($row[0]) , 2); --- a/displayConfidentialities.php +++ b/displayConfidentialities.php @@ -1,4 +1,31 @@ -agencies that use alot of consultacies +"; +while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { +setlocale(LC_MONETARY, 'en_US'); +$value = number_format(doubleval($row[0]),2); + echo (""); +} +echo "
CategoryTotal Contracts Value
{$row[1]}\$$value
"; +mysql_free_result($result); +include_footer(); +?> + + + --- a/displayConsultancies.php +++ b/displayConsultancies.php @@ -1,4 +1,31 @@ +"; +while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { +setlocale(LC_MONETARY, 'en_US'); +$value = number_format(doubleval($row[0]),2); + echo ("{$row[1]}\$$value"); +} +echo ""; +mysql_free_result($result); +include_footer(); +?> + + + --- a/displayContract.php +++ b/displayContract.php --- a/displayLatestUpdate.php +++ /dev/null @@ -1,23 +1,1 @@ -"; -$stats = mysql_fetch_array($result, MYSQL_BOTH); -echo $stats["count"] . " new records in period " . $stats["start"] . " to " . $stats["end"] ."
"; - - -$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); -echo ""; -$stats = mysql_fetch_array($result, MYSQL_BOTH); -echo $stats["count"] . " updated records in period " . $