Esempio n. 1
0
 function insertRPTOPRecord($rptop)
 {
     if (is_array($rptop)) {
         $db = new DB_RPTS();
         $sql = sprintf("INSERT INTO %s(" . "rptopNumber" . ", rptopDate" . ", taxableYear" . ", cityTreasurer" . ", cityAssessor" . ", landTotalMarketValue" . ", landTotalAssessedValue" . ", plantTotalMarketValue" . ", plantTotalAssessedValue" . ", bldgTotalMarketValue" . ", bldgTotalAssessedValue" . ", machTotalMarketValue" . ", machTotalAssessedValue" . ", totalMarketValue" . ", totalAssessedValue" . ", dateCreated" . ", createdBy" . ", dateModified" . ", modifiedBy" . ") VALUES(" . "'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s'" . ",'%s','%s','%s','%s','%s','%s','%s','%s','%s');", RPTOP_TABLE, fixQuotes($rptop["rptopNumber"]), fixQuotes(date("Y-m-d"), strtotime("now")), fixQuotes($rptop["taxableYear"]), fixQuotes($rptop["cityTreasurer"]), fixQuotes($rptop["cityAssessor"]), fixQuotes($rptop["landTotalMarketValue"]), fixQuotes($rptop["landTotalAssessedValue"]), fixQuotes($rptop["plantTotalMarketValue"]), fixQuotes($rptop["plantTotalAssessedValue"]), fixQuotes($rptop["bldgTotalMarketValue"]), fixQuotes($rptop["bldgTotalAssessedValue"]), fixQuotes($rptop["machTotalMarketValue"]), fixQuotes($rptop["machTotalAssessedValue"]), fixQuotes($rptop["totalMarketValue"]), fixQuotes($rptop["totalAssessedValue"]), fixQuotes(time()), fixQuotes($rptop["createdBy"]), fixQuotes(time()), fixQuotes($rptop["modifiedBy"]));
         $db->beginTransaction();
         $db->query($sql);
         $rptopID = $db->insert_id();
         if ($db->Errno != 0) {
             $db->rollbackTransaction();
             $db->resetErrors();
             return false;
         } else {
             $db->endTransaction();
             return $rptopID;
         }
     } else {
         return false;
     }
 }