From: root Date: Wed, 26 May 2010 14:35:09 +0000 Subject: tweak year/agency modifer for queries X-Git-Url: http://maxious.lambdacomplex.org/git/?p=contractdashboard.git&a=commitdiff&h=0cc32199bf8fc23ca1ecaa95f5faed570e8dcc68 --- tweak year/agency modifer for queries --- --- a/admin/google-example.htm +++ b/admin/google-example.htm --- a/admin/import.bat +++ b/admin/import.bat --- a/admin/import.php +++ b/admin/import.php @@ -1,6 +1,6 @@ "; $dhandle = opendir($path); --- a/admin/recordsperweek.txt +++ b/admin/recordsperweek.txt --- a/autosuggest_inquisitor.css +++ b/autosuggest_inquisitor.css --- 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/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/backup/index.html +++ b/cutenews/data/backup/index.html --- a/cutenews/data/comments.txt +++ b/cutenews/data/comments.txt --- a/cutenews/data/emoticons/index.html +++ b/cutenews/data/emoticons/index.html --- a/cutenews/data/index.html +++ b/cutenews/data/index.html --- 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/unapproved_news.txt +++ b/cutenews/data/unapproved_news.txt --- a/cutenews/data/upimages/index.html +++ b/cutenews/data/upimages/index.html --- 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/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/tools.mdu +++ b/cutenews/inc/tools.mdu --- a/cutenews/inc/wizards.mdu +++ b/cutenews/inc/wizards.mdu --- a/cutenews/remember.js +++ b/cutenews/remember.js --- 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/skins/cute.js +++ b/cutenews/skins/cute.js --- a/cutenews/skins/rss_style.css +++ b/cutenews/skins/rss_style.css --- a/displayAmendments.php +++ b/displayAmendments.php @@ -1,9 +1,12 @@ 0) a where CNID = ccn order by diff DESC"; +$query = "select CNID, description, value, pvalue, (value - pvalue) as diff from contractnotice, (SELECT CNID as cn, childCN as ccn, value as pvalue FROM contractnotice where childCN > 0) a". +" where ".$agencyQ.$yearQ."CNID = ccn AND (value - pvalue) <> 0 order by diff DESC"; $result = mysql_query($query); +echo $query; echo ""; +if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { setlocale(LC_MONETARY, 'en_US'); $value = number_format(doubleval($row['value']) , 2); @@ -13,6 +16,9 @@ echo ""; echo ""; } +} else { +echo mysql_error(); +} echo "
{$row['description']}\$$pvalue\$$value\$$diff
"; mysql_free_result($result); include_footer(); --- a/graphs/displayCnCGraph.php +++ b/graphs/displayCnCGraph.php @@ -57,7 +57,7 @@ $graph2->Set90AndMargin(105, 45, 45, 45); // Setup a title for the graph $graph2->title->Set($agency); -$graph2->SetUserFont("ttf-liberation/LiberationSans-Regular.ttf"); +$graph2->SetUserFont("liberation/LiberationSans-Regular.ttf"); $graph2->title->SetFont(FF_USERFONT, FS_NORMAL, 12); // Setup font for axis $graph2->xaxis->SetFont(FF_USERFONT, FS_NORMAL, 10); --- a/graphs/displayContractPublishedGraph.php +++ b/graphs/displayContractPublishedGraph.php @@ -32,7 +32,7 @@ // Setup a title for the graph $graph->title->Set('Contracts Starting - All Agencies since July 2008'); -$graph->SetUserFont("ttf-liberation/LiberationSans-Regular.ttf"); +$graph->SetUserFont("liberation/LiberationSans-Regular.ttf"); $graph->title->SetFont(FF_USERFONT,FS_NORMAL,12); // Setup font for axis --- a/graphs/displayContractStartingGraph.php +++ b/graphs/displayContractStartingGraph.php @@ -32,7 +32,7 @@ // Setup a title for the graph $graph->title->Set('Contracts Starting - All Agencies since July 2008'); -$graph->SetUserFont("ttf-liberation/LiberationSans-Regular.ttf"); +$graph->SetUserFont("liberation/LiberationSans-Regular.ttf"); $graph->title->SetFont(FF_USERFONT,FS_NORMAL,12); // Setup font for axis --- a/graphs/displayMethodCountGraph.php +++ b/graphs/displayMethodCountGraph.php @@ -37,7 +37,7 @@ $graph->SetMargin(95, 145, 45, 100); // Setup a title for the graph $graph->title->Set($agencyQ.$supplierQ); -$graph->SetUserFont("ttf-liberation/LiberationSans-Regular.ttf"); +$graph->SetUserFont("liberation/LiberationSans-Regular.ttf"); $graph->title->SetFont(FF_USERFONT, FS_NORMAL, 12); // Setup font for axis $graph->xaxis->SetFont(FF_USERFONT, FS_NORMAL, 10); @@ -80,7 +80,7 @@ $graph2->Set90AndMargin(105, 45, 45, 45); // Setup a title for the graph $graph2->title->Set($agency); -$graph2->SetUserFont("ttf-liberation/LiberationSans-Regular.ttf"); +$graph2->SetUserFont("liberation/LiberationSans-Regular.ttf"); $graph2->title->SetFont(FF_USERFONT, FS_NORMAL, 12); // Setup font for axis $graph2->xaxis->SetFont(FF_USERFONT, FS_NORMAL, 10); --- a/graphs/displayMethodValueGraph.php +++ b/graphs/displayMethodValueGraph.php @@ -37,7 +37,7 @@ $graph->SetMargin(95, 145, 45, 100); // Setup a title for the graph $graph->title->Set($agencyQ.$supplierQ); -$graph->SetUserFont("ttf-liberation/LiberationSans-Regular.ttf"); +$graph->SetUserFont("liberation/LiberationSans-Regular.ttf"); $graph->title->SetFont(FF_USERFONT, FS_NORMAL, 12); // Setup font for axis $graph->xaxis->SetFont(FF_USERFONT, FS_NORMAL, 10); --- a/lib/common.inc.php +++ b/lib/common.inc.php @@ -1,4 +1,6 @@ 0) $supplierQ = "supplierABN = '" . $supplierParts[0] . "' AND"; - else $supplierQ = "supplierName LIKE '%" . $supplierParts[1] . "%' AND"; + if ($supplierParts[0] > 0) $supplierQ = "supplierABN = '" . $supplierParts[0] . "' AND "; + else $supplierQ = "supplierName LIKE '%" . $supplierParts[1] . "%' AND "; } $year = mysql_real_escape_string(stripslashes($_REQUEST['year'])); -if ($year != "") $yearQ = "agencyName = '" . $agency . "' AND"; +if ($year != "") $yearQ = "YEAR(publishDate) = " . $year . " AND "; $start =0.0; @@ -86,7 +90,7 @@ procurement method contractual confidentiality consultancies - consultancies + amendments postcodes