Depreciate MySQL and GD image graphs
[contractdashboard.git] / lib / common.inc.php
blob:a/lib/common.inc.php -> blob:b/lib/common.inc.php
--- a/lib/common.inc.php
+++ b/lib/common.inc.php
@@ -10,10 +10,12 @@
 	die("A database error occurred.\n");

 }

 

-//    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

+ //   $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

 function databaseError($errMsg)

 {

-	die($errMsg);

+    if ($errMsg[2] != "") {

+	die(print_r($errMsg,true));

+    }

 }

 

 function ucsmart($str) {

@@ -57,7 +59,7 @@
 $year = filter_var($_REQUEST['year'], FILTER_SANITIZE_NUMBER_INT);

 if ($year != "") $yearQ = "YEAR(publishDate) = " . $year . " AND ";

 

-$standardQ = ' "childCN" = 0 '; // AND YEAR(contractStart) >= 2007 AND YEAR(contractStart) <= 2010';

+$standardQ = ' "childCN" is null '; // AND YEAR(contractStart) >= 2007 AND YEAR(contractStart) <= 2010';

 $start =0.0;

 

 function include_header($title) {

@@ -207,5 +209,6 @@
    echo '<div id="ft"><p>'."Processing time: ". sprintf("%.4f", ($end-$start))." seconds".'</p></div>'; 

    echo '</div> </body> </html>';

 } 

+include ("graphs.inc.php");

 ?>