Esempio n. 1
0
 function generateTDHistory($tdID)
 {
     $td = new TD();
     $td->selectRecord($tdID);
     $afsID = $td->getAfsID();
     //		echo("afsID=$afsID<br>");
     $afs = new AFS();
     $afs->selectRecord($afsID);
     $odID = $afs->getOdID();
     //	echo("odID=$odID<br>");
     $condition = sprintf(" WHERE presentODID='%s' ", fixQuotes($odID));
     $odHistoryRecords = new ODHistoryRecords();
     $odHistoryRecords->selectRecords($condition);
     if (count($odHistoryRecords->arrayList) > 0) {
         //	echo("count>0<br>");
         foreach ($odHistoryRecords->arrayList as $key => $odHistory) {
             $previousODID = $odHistory->getPreviousODID();
             $presentODID = $odHistory->getPresentODID();
             $previousAFS = new AFS();
             $previousAFS->selectRecord($afsID = "", $limit = "", $previousODID);
             $previousAFSID = $previousAFS->getAfsID();
             $previousTD = new TD();
             $previousTD->selectRecord($tdID = "", $previousAFSID);
             $previousTDID = $previousTD->getTdID();
             $this->tdHistory[] = $previousTD;
             $this->generateTDHistory($previousTDID);
         }
     } else {
         //echo("count==0<br>");
         return false;
     }
 }
Esempio n. 2
0
 function selectRecordsForList($condition = "")
 {
     //		$sql = sprintf("select * from %s order by tdID desc %s;",TD_TABLE, $condition);
     $sql = "SELECT " . TD_TABLE . ".tdID as tdID, " . TD_TABLE . ".afsID, " . AFS_TABLE . ".odID, " . TD_TABLE . ".taxDeclarationNumber as taxDeclarationNumber, " . "(" . TD_TABLE . ".ceasesWithTheYear - " . TD_TABLE . ".taxBeginsWithTheYear) as year, " . "CONCAT(" . PERSON_TABLE . ".lastName," . PERSON_TABLE . ".firstName," . PERSON_TABLE . ".middleName) as PersonFullName, " . COMPANY_TABLE . ".companyName " . "FROM " . TD_TABLE . " " . "LEFT JOIN " . AFS_TABLE . " " . "ON " . TD_TABLE . ".afsID = " . AFS_TABLE . ".afsID " . "LEFT JOIN " . OWNER_TABLE . " " . "ON " . AFS_TABLE . ".odID = " . OWNER_TABLE . ".odID " . "LEFT JOIN " . OWNER_PERSON_TABLE . " " . "ON " . OWNER_TABLE . ".ownerID = " . OWNER_PERSON_TABLE . ".ownerID " . "LEFT JOIN " . PERSON_TABLE . " " . "ON " . OWNER_PERSON_TABLE . ".personID = " . PERSON_TABLE . ".personID " . "LEFT JOIN " . OWNER_COMPANY_TABLE . " " . "ON " . OWNER_TABLE . ".ownerID = " . OWNER_COMPANY_TABLE . ".ownerID " . "LEFT JOIN " . COMPANY_TABLE . " " . "ON " . OWNER_COMPANY_TABLE . ".companyID = " . COMPANY_TABLE . ".companyID ";
     $sql = $sql . " " . $condition;
     $this->setDB();
     $dummySQL = sprintf("INSERT INTO dummySQL(queryString) VALUES('%s');", fixQuotes($sql));
     $this->db->query($dummySQL);
     $this->db->query($sql);
     while ($this->db->next_record()) {
         $idArray[] = $this->db->f("tdID");
     }
     $idArray = array_unique($idArray);
     foreach ($idArray as $key => $tdID) {
         $td = new TD();
         $td->selectRecord($tdID);
         $this->arrayList[] = $td;
     }
     if (count($this->arrayList) > 0) {
         $this->setDomDocument();
         return true;
     } else {
         return false;
     }
     /*
     $this->setDB();
     		$this->db->query($sql);
     		while ($this->db->next_record()) {
                 $td = new TD;
     			$td->selectRecord($this->db->f("tdID"));
     			$this->arrayList[] = $td;
     		}
     		if(count($this->arrayList) > 0){
     			$this->setDomDocument();
     			return true;
     		}
     		else {
     			return false;
     		}
     */
 }
Esempio n. 3
0
 function updateRecord()
 {
     if (is_numeric($this->barangay)) {
         $this->barangayID = $this->barangay;
     }
     if (is_numeric($this->district)) {
         $this->districtID = $this->district;
     }
     if (is_numeric($this->municipalityCity)) {
         $this->municipalityCityID = $this->municipalityCity;
     }
     if (is_numeric($this->province)) {
         $this->provinceID = $this->province;
     }
     $sql = sprintf("update %s set " . "number = '%s'" . ", street = '%s'" . ", barangayID = '%s'" . ", district = '%s'" . ", municipalityCity = '%s'" . ", province = '%s'" . " where locationAddressID = %s", LOCATIONADDRESS_TABLE, fixQuotes($this->number), fixQuotes($this->street), fixQuotes($this->barangayID), fixQuotes($this->districtID), fixQuotes($this->municipalityCityID), fixQuotes($this->provinceID), $this->locationAddressID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     $locationAddressID = $this->db->insert_id();
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->locationAddressID;
     }
     return $ret;
 }
Esempio n. 4
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " penaltyLUT = '%s'" . ", annualDueDate = '%s'" . ", pctRPTax = '%s'" . ", pctSEF = '%s'" . ", pctIdle = '%s'" . ", discountPercentage = '%s'" . ", discountPeriod = '%s'" . ", advancedDiscountPercentage = '%s'" . ", q1AdvancedDiscountPercentage = '%s'" . ";", TREASURY_SETTINGS_TABLE, fixQuotes($this->penaltyLUT), fixQuotes($this->annualDueDate), fixQuotes($this->pctRPTax), fixQuotes($this->pctSEF), fixQuotes($this->pctIdle), fixQuotes($this->discountPercentage), fixQuotes($this->discountPeriod), fixQuotes($this->advancedDiscountPercentage), fixQuotes($this->q1AdvancedDiscountPercentage));
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = true;
     }
     return $ret;
 }
Esempio n. 5
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " companyName = '%s'" . ", tin = '%s'" . ", telephone = '%s'" . ", fax = '%s'" . ", email = '%s'" . ", website = '%s'" . " where companyID = '%s'" . ";", COMPANY_TABLE, fixQuotes($this->companyName), fixQuotes($this->tin), fixQuotes($this->telephone), fixQuotes($this->fax), fixQuotes($this->email), fixQuotes($this->website), $this->companyID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         foreach ($this->addressArray as $key => $value) {
             $addressID = $value->updateRecord();
         }
         $ret = $this->companyID;
     }
     return $ret;
 }
Esempio n. 6
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " presentODID = '%s'" . ", previousODID = '%s'" . ", transactionCode = '%s'" . " where odHistoryID = '%s';", ODHISTORY_TABLE, fixQuotes($this->presentODID), fixQuotes($this->previousODID), fixQuotes($this->transactionCode), $this->odHistoryID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->eRPTSSettingsID;
     }
     return $ret;
 }
Esempio n. 7
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " code = '%s'" . ", description = '%s'" . ", value = '%s'" . ", status = '%s'" . " where propAssessUsesID = '%s';", PROPASSESSUSES_TABLE, fixQuotes($this->code), fixQuotes($this->description), fixQuotes($this->value), fixQuotes($this->status), $this->propAssessUsesID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->propAssessUsesID;
     }
     return $ret;
 }
Esempio n. 8
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " personType = '%s'" . ", lastName = '%s'" . ", firstName = '%s'" . ", middleName = '%s'" . ", gender = '%s'" . ", birthday = '%s'" . ", maritalStatus = '%s'" . ", tin = '%s'" . ", telephone = '%s'" . ", mobileNumber = '%s'" . ", email = '%s'" . " where personID = '%s';", PERSON_TABLE, fixQuotes($this->personType), fixQuotes($this->lastName), fixQuotes($this->firstName), fixQuotes($this->middleName), fixQuotes($this->gender), toMysqlDate($this->birthday), fixQuotes($this->maritalStatus), fixQuotes($this->tin), fixQuotes($this->telephone), fixQuotes($this->mobileNumber), fixQuotes($this->email), $this->personID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         foreach ($this->addressArray as $key => $value) {
             //$value = $this->addressArray;
             if ($value->addressID) {
                 $addressID = $value->updateRecord();
             } else {
                 $addressID = $value->insertRecord();
                 $sql = sprintf("insert into %s (" . "personID" . ", addressID" . ")" . " values (%s, %s);", PERSON_ADDRESS_TABLE, $this->personID, $addressID);
                 $this->db->beginTransaction();
                 $this->db->query($sql);
                 if ($this->db->Errno != 0) {
                     $this->db->rollbackTransaction();
                     $this->db->resetErrors();
                     $ret = false;
                 } else {
                     $this->db->endTransaction();
                 }
             }
         }
         $ret = $this->personID;
     }
     return $ret;
 }
Esempio n. 9
0
File: OD.php Progetto: armic/erpts
 function archiveRecord($odID, $archiveValue, $userID)
 {
     $sql = sprintf("update %s " . "  set " . "  archive = '%s'" . ", modifiedBy = '%s'" . ", dateModified = '%s'" . " where odID = '%s';", OD_TABLE, fixQuotes($archiveValue), fixQuotes($userID), fixQuotes(time()), fixQuotes($odID));
     $this->setDB();
     //$dummySQL = sprintf("INSERT INTO dummySQL(queryString) VALUES('%s');",fixQuotes($sql));
     //$this->db->query($dummySQL);
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = true;
     }
     return $ret;
 }
Esempio n. 10
0
 function updateStorey()
 {
     $sql = sprintf("update %s set " . "improvementsBuildingsID = '%s', floorNumber = '%s', " . "area = '%s', materials = '%s', " . "value = '%s', foundation = '%s', " . "columnsBeams = '%s', trussFraming = '%s', " . "roof = '%s', exteriorWall = '%s', " . "flooring = '%s', doors = '%s', " . "windows = '%s', stairs = '%s', " . "wallFinish = '%s', electrical = '%s', " . "toiletAndBath = '%s', plumbingSewer = '%s', " . "fixtures = '%s'" . "where storeyID = '%s';", STOREY_TABLE, fixQuotes($this->improvementsBuildingsID), fixQuotes($this->floorNumber), fixQuotes($this->area), fixQuotes($this->materials), fixQuotes($this->value), fixQuotes($this->foundation), fixQuotes($this->columnsBeams), fixQuotes($this->trussFraming), fixQuotes($this->roof), fixQuotes($this->exteriorWall), fixQuotes($this->flooring), fixQuotes($this->doors), fixQuotes($this->windows), fixQuotes($this->stairs), fixQuotes($this->wallFinish), fixQuotes($this->electrical), fixQuotes($this->toiletAndBath), fixQuotes($this->plumbingSewer), fixQuotes($this->fixtures), $this->storeyID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->storeyID;
     }
     return $ret;
 }
Esempio n. 11
0
 function countSearchRecords($searchKey, $fields)
 {
     $condition = "where (";
     foreach ($fields as $key => $value) {
         if ($key == 0) {
             $condition = $condition . $value . " like '%" . $searchKey . "%'";
         } else {
             $condition = $condition . " or " . $value . " like '%" . $searchKey . "%' ";
         }
     }
     $sql = "SELECT DISTINCT COUNT(" . RPTOP_TABLE . ".rptopID) as count \r\n                FROM " . RPTOP_TABLE . "\r\n\t\t\t\tLEFT JOIN " . OWNER_TABLE . "\r\n\t\t\t\tON " . RPTOP_TABLE . ".rptopID = " . OWNER_TABLE . ".rptopID\r\n                LEFT JOIN " . OWNER_COMPANY_TABLE . "\r\n                ON " . OWNER_TABLE . ".ownerID = " . OWNER_COMPANY_TABLE . ".ownerID\r\n                LEFT JOIN " . COMPANY_TABLE . "\r\n                ON " . OWNER_COMPANY_TABLE . ".companyID = " . COMPANY_TABLE . ".companyID\r\n                LEFT JOIN " . OWNER_PERSON_TABLE . "\r\n                ON " . OWNER_TABLE . ".ownerID = " . OWNER_PERSON_TABLE . ".ownerID\r\n                LEFT JOIN " . PERSON_TABLE . "\r\n                ON " . OWNER_PERSON_TABLE . ".personID = " . PERSON_TABLE . ".personID\r\n                LEFT JOIN " . RPTOPTD_TABLE . "\r\n                ON " . RPTOP_TABLE . ".rptopID = " . RPTOPTD_TABLE . ".rptopID\r\n                LEFT JOIN " . TD_TABLE . "\r\n                ON " . RPTOPTD_TABLE . ".tdID = " . TD_TABLE . ".tdID ";
     $sql = $sql . $condition . ")" . $limit;
     $this->setDB();
     $dummySql = sprintf("INSERT INTO dummySQL(queryString) VALUES('%s');", fixQuotes($sql));
     $this->db->query($dummySql);
     $this->db->query($sql);
     if ($this->db->next_record()) {
         $ret = $this->db->f("count");
     } else {
         $ret = false;
     }
     return $ret;
 }
Esempio n. 12
0
File: User.php Progetto: armic/erpts
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " userType = '%s'" . ", username = '******'" . ", password = '******'" . ", personID = '%s'" . ", dateModified = '%s'" . ", status = '%s'" . " where userID = '%s';", AUTH_USER_MD5_TABLE, fixQuotes($this->userType), fixQuotes($this->username), fixQuotes($this->password), fixQuotes($this->personID), fixQuotes(time()), fixQuotes($this->status), $this->userID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->userID;
     }
     return $ret;
 }
Esempio n. 13
0
 function selectRecords($condition = "")
 {
     $sql = "SELECT distinct (" . OD_TABLE . ".odID) as odID\r\n\t\t\t\t  , CONCAT(" . PERSON_TABLE . ".lastName," . PERSON_TABLE . ".firstName," . PERSON_TABLE . ".middleName) as PersonFullName\r\n\t\t\t\t  FROM " . OD_TABLE . "\r\n\t\t\t\t  LEFT JOIN " . LOCATION_TABLE . "\r\n\t\t\t\t  ON " . OD_TABLE . ".odID = " . LOCATION_TABLE . ".odID\r\n\t\t\t\t  LEFT JOIN " . OWNER_TABLE . "\r\n\t\t\t\t  ON " . LOCATION_TABLE . ".odID = " . OWNER_TABLE . ".odID\r\n                  LEFT JOIN " . OWNER_COMPANY_TABLE . "\r\n                  ON " . OWNER_TABLE . ".ownerID = " . OWNER_COMPANY_TABLE . ".ownerID\r\n                  LEFT JOIN " . COMPANY_TABLE . "\r\n                  ON " . OWNER_COMPANY_TABLE . ".companyID = " . COMPANY_TABLE . ".companyID\r\n                  LEFT JOIN " . OWNER_PERSON_TABLE . "\r\n                  ON " . OWNER_TABLE . ".ownerID = " . OWNER_PERSON_TABLE . ".ownerID\r\n                  LEFT JOIN " . PERSON_TABLE . "\r\n                  ON " . OWNER_PERSON_TABLE . ".personID = " . PERSON_TABLE . ".personID\r\n\r\n                  LEFT JOIN " . LOCATIONADDRESS_TABLE . "\r\n                  ON " . LOCATION_TABLE . ".locationAddressID=" . LOCATIONADDRESS_TABLE . ".locationAddressID\r\n\r\n                  LEFT JOIN " . BARANGAY_TABLE . "\r\n                  ON " . BARANGAY_TABLE . ".barangayID=" . LOCATIONADDRESS_TABLE . ".barangayID \r\n\r\n\t\t\t\t  LEFT JOIN " . DISTRICT_TABLE . "\r\n\t\t\t\t  ON " . DISTRICT_TABLE . ".districtID=" . LOCATIONADDRESS_TABLE . ".district \r\n\t\t\t\t  LEFT JOIN " . MUNICIPALITYCITY_TABLE . "\r\n\t\t\t\t  ON " . MUNICIPALITYCITY_TABLE . ".municipalityCityID=" . LOCATIONADDRESS_TABLE . ".municipalityCity \r\n\t\t\t\t  LEFT JOIN " . PROVINCE_TABLE . "\r\n\t\t\t\t  ON " . PROVINCE_TABLE . ".provinceID=" . LOCATIONADDRESS_TABLE . ".province";
     $sql = $sql . $condition;
     $this->setDB();
     $dummySql = sprintf("INSERT INTO dummySQL(queryString) VALUES('%s');", fixQuotes($sql));
     $this->db->query($dummySql);
     $this->db->query($sql);
     while ($this->db->next_record()) {
         $tmpArray[] = $this->db->f("odID");
     }
     if (is_array($tmpArray)) {
         $idArray = array_unique($tmpArray);
         foreach ($idArray as $key => $odID) {
             $od = new OD();
             $od->selectRecord($odID);
             $this->arrayList[] = $od;
         }
     }
     if (count($this->arrayList) > 0) {
         $this->setDomDocument();
         return true;
     } else {
         return false;
     }
 }
Esempio n. 14
0
 function update()
 {
     //create a DB object
     $rptsDB = new DB_RPTS();
     // prepare an SQL update statement
     // programming option: it is decided to use direct access to attributes
     //                     when saving and creating the object from database
     $strUpDate = date("Y-m-d H:i:s", time());
     // changed from $this->updateDate
     $sqlupdate = sprintf("update %s set " . "  basic = '%s'" . ", penalty = '%s'" . ", sef = '%s'" . ", idle = '%s'" . ", tdID = '%s'" . ", currentDate = '%s'" . ", paidBasic = '%s'" . ", paidSEF = '%s'" . ", paidPenalty = '%s'" . ", paidIdle = '%s'" . ", paidQuarters = '%s'" . ", paymentMode = '%s'" . ", amnesty = '%s'" . " where dueID = %s", dues, fixQuotes($this->basic), fixQuotes($this->penalty), fixQuotes($this->sef), fixQuotes($this->idle), fixQuotes($this->tdID), fixQuotes($strUpDate), fixQuotes($this->paidBasic), fixQuotes($this->paidSEF), fixQuotes($this->paidPenalty), fixQuotes($this->paidIdle), fixQuotes($this->paidQuarters), fixQuotes($this->paymentMode), $this->amnesty, $this->dueID);
     //query the database
     //echo("$sqlupdate<br>");
     $queryID = $rptsDB->query($sqlupdate);
     if ($queryID) {
         return true;
     } else {
         return false;
     }
 }
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " code = '%s'" . ", reportCode = '%s'" . ", description = '%s'" . ", rangeLowerBound = '%s'" . ", rangeUpperBound = '%s'" . ", value = '%s'" . ", status = '%s'" . " where improvementsBuildingsActualUsesID = '%s';", IMPROVEMENTSBUILDINGS_ACTUALUSES_TABLE, fixQuotes($this->code), fixQuotes($this->reportCode), fixQuotes($this->description), fixQuotes($this->rangeLowerBound), fixQuotes($this->rangeUpperBound), fixQuotes($this->value), fixQuotes($this->status), $this->improvementsBuildingsActualUsesID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->improvementsBuildingsActualUsesID;
     }
     return $ret;
 }
 function Main()
 {
     $this->setPageDetailPerms();
     switch ($this->formArray["formAction"]) {
         case "search":
             $condition = " (" . COMPANY_TABLE . ".companyName LIKE '%" . fixQuotes($this->formArray["searchKey"]) . "%') ";
             $searchCount = $this->countRecords($condition);
             if ($searchCount == 0 || $searchCount == false) {
                 $this->displayPageNavigation();
                 $this->displayRecords();
                 $this->formArray["listType"] = "All";
                 $this->formArray["resultsMessage"] = "| &nbsp; 0 results found for \"<b>" . $this->formArray["searchKey"] . "</b>\"";
             } else {
                 $this->displayPageNavigation($condition);
                 $this->displayRecords($condition);
                 $this->formArray["listType"] = "Search Results";
                 if ($searchCount > 1) {
                     $s = "s";
                 } else {
                     $s = "";
                 }
                 $this->formArray["resultsMessage"] = "| &nbsp; " . $searchCount . " result" . $s . " found for \"<b>" . $this->formArray["searchKey"] . "</b>\"";
             }
             break;
         case "list":
         default:
             $this->displayPageNavigation();
             $this->displayRecords();
             $this->formArray["listType"] = "All";
             $this->formArray["resultsMessage"] = "";
             break;
     }
     $this->setForm();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->tpl->set_var("sessionID", $this->sess->id);
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Esempio n. 17
0
            $key = '123456789012345678901234567890123456789012345678901234567890';
            $vpwd = mcrypt_cbc(MCRYPT_RIJNDAEL_128, substr($key, 0, 32), $vpwd, MCRYPT_ENCRYPT, substr($key, 32, 16));
            $vpwd = bin2hex($vpwd);
            if ($vnif != "") {
                $sql = "select max(id_login) as max_id_login from LOGIN";
                $result = mysql_query($sql);
                $row = mysql_fetch_assoc($result);
                if (!isset($row['max_id_login'])) {
                    $vid_login = 1;
                } else {
                    $vid_login = $row['max_id_login'] + 1;
                }
                $sqlstring = "INSERT INTO LOGIN ";
                $sqlstring .= "(id_login,NIF,nom,cognoms,login,clau,direccio,CP,poblacio,telefon,mobil,mail) values (";
                $sqlstring .= $vid_login . ",'" . $vnif . "','" . fixQuotes($vnom) . "','" . fixQuotes($vcognoms) . "','" . fixQuotes($vlogin) . "','" . $vpwd . "',";
                $sqlstring .= "'" . fixQuotes($vdireccio) . "','" . $vcp . "','" . fixQuotes($vpoblacio) . "','" . $vtelefon . "','" . $vmobil . "','" . $vmail . "')";
                //echo $sqlstring;
                $result = mysql_query($sqlstring);
                echo "<p><b>El usuario '" . $vnom . "' se ha registrado correctamente</b></p>";
            }
        }
        include "close_db.php";
    } else {
        echo "<p><b>Debes rellenar todos los campos en negrita!</b></p>";
    }
}
?>

		<form name="form_registre" method="post" action="registre.php" >

			<fieldset>
Esempio n. 18
0
File: LGU.php Progetto: armic/erpts
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " LGUName = '%s'" . ", LGUBiz = '%s'" . ", LGUDB = '%s'" . ", LGUusername = '******'" . ", LGUpassword = '******'" . " where LGUID = '%s';", AFS_TABLE, fixQuotes($this->LGUName), fixQuotes($this->LGUBiz), fixQuotes($this->LGUDB), fixQuotes($this->LGUusername), fixQuotes($this->LGUpassword), $this->LGUID);
     //echo $sql;
     //*
     $db = new DB_Records();
     $db->beginTransaction();
     $db->query($sql);
     if ($db->Errno != 0) {
         $db->rollbackTransaction();
         $db->resetErrors();
         $ret = false;
     } else {
         $db->endTransaction();
         $ret = $this->afsID;
     }
     //*/
     return $ret;
 }
 function displayPostingSummary($afs)
 {
     // previous
     $presentODID = $afs->odID;
     $condition = sprintf("WHERE presentODID='%s'", fixQuotes($presentODID));
     $odHistoryRecords = new ODHistoryRecords();
     if ($odHistoryRecords->selectRecords($condition)) {
         $odHistory = $odHistoryRecords->arrayList[0];
         $previousODID = $odHistory->previousODID;
         $previousAFS = new AFS();
         if ($previousAFS->selectRecord("", "", $previousODID, "")) {
             $this->formArray["previous1"] = $previousAFS->propertyIndexNumber;
             $this->formArray["previous2"] = $previousAFS->arpNumber;
             $this->formArray["prevPIN"] = $previousAFS->propertyIndexNumber;
             $this->formArray["prevTD"] = $previousAFS->arpNumber;
         }
     }
     // present
     $this->formArray["present1"] = $afs->propertyIndexNumber;
     $this->formArray["present2"] = $afs->arpNumber;
     $this->formArray["presPIN"] = $afs->propertyIndexNumber;
     $this->formArray["presTD"] = $afs->arpNumber;
 }
Esempio n. 20
0
 function getSucceedingODList($previousODID)
 {
     $condition = sprintf("WHERE previousODID='%s'", fixQuotes($previousODID));
     return $this->getODHistoryList($condition);
 }
Esempio n. 21
0
 function updateRecord()
 {
     if ($this->propertyAdministrator->personID == "") {
         $this->propertyAdministrator->personID = $this->propertyAdministrator->insertRecord();
     } else {
         $this->propertyAdministrator->personID = $this->propertyAdministrator->updateRecord();
     }
     $sql = sprintf("update %s set" . " afsID = '%s'" . ", arpNumber = '%s'" . ", propertyIndexNumber = '%s'" . ", propertyAdministrator = '%s'" . ", verifiedBy = '%s'" . ", plottingsBy = '%s'" . ", notedBy = '%s'" . ", marketValue = '%s'" . ", kind = '%s'" . ", actualUse = '%s'" . ", adjustedMarketValue = '%s'" . ", assessmentLevel = '%s'" . ", assessedValue = '%s'" . ", previousOwner = '%s'" . ", previousAssessedValue = '%s'" . ", taxability = '%s'" . ", effectivity = '%s'" . ", appraisedBy = '%s'" . ", appraisedByDate = '%s'" . ", recommendingApproval = '%s'" . ", recommendingApprovalDate = '%s'" . ", approvedBy = '%s'" . ", approvedByDate = '%s'" . ", memoranda = '%s'" . ", postingDate = '%s'" . ", landPin = '%s'" . ", foundation = '%s'" . ", columnsBldg = '%s'" . ", beams = '%s'" . ", trussFraming = '%s'" . ", roof = '%s'" . ", exteriorWalls = '%s'" . ", flooring = '%s'" . ", doors = '%s'" . ", ceiling = '%s'" . ", structuralTypes = '%s'" . ", buildingClassification = '%s'" . ", buildingPermit = '%s'" . ", buildingAge = '%s'" . ", cctNumber = '%s'" . ", numberOfStoreys = '%s'" . ", windows = '%s'" . ", stairs = '%s'" . ", partition = '%s'" . ", wallFinish = '%s'" . ", electrical = '%s'" . ", toiletAndBath = '%s'" . ", plumbingSewer = '%s'" . ", fixtures = '%s'" . ", dateConstructed = '%s'" . ", dateOccupied = '%s'" . ", dateCompleted = '%s'" . ", areaOfGroundFloor = '%s'" . ", totalBuildingArea = '%s'" . ", unitValue = '%s'" . ", buildingCoreAndAdditionalItems = '%s'" . ", addItems = '%s'" . ", depreciationRate = '%s'" . ", accumulatedDepreciation = '%s'" . ", depreciatedMarketValue = '%s'" . ", dateModified = '%s'" . ", modifiedBy = '%s'" . "where propertyID = '%s';", IMPROVEMENTSBUILDINGS_TABLE, fixQuotes($this->afsID), fixQuotes($this->arpNumber), fixQuotes($this->propertyIndexNumber), fixQuotes($this->propertyAdministrator->personID), fixQuotes($this->verifiedBy), fixQuotes($this->plottingsBy), fixQuotes($this->notedBy), fixQuotes($this->marketValue), fixQuotes($this->kind), fixQuotes($this->actualUse), fixQuotes($this->adjustedMarketValue), fixQuotes($this->assessmentLevel), fixQuotes($this->assessedValue), fixQuotes($this->previousOwner), fixQuotes($this->previousAssessedValue), fixQuotes($this->taxability), fixQuotes($this->effectivity), fixQuotes($this->appraisedBy), fixQuotes($this->appraisedByDate), fixQuotes($this->recommendingApproval), fixQuotes($this->recommendingApprovalDate), fixQuotes($this->approvedBy), fixQuotes($this->approvedByDate), fixQuotes($this->memoranda), fixQuotes($this->postingDate), fixQuotes($this->landPin), fixQuotes($this->foundation), fixQuotes($this->columnsBldg), fixQuotes($this->beams), fixQuotes($this->trussFraming), fixQuotes($this->roof), fixQuotes($this->exteriorWalls), fixQuotes($this->flooring), fixQuotes($this->doors), fixQuotes($this->ceiling), fixQuotes($this->structuralTypes), fixQuotes($this->buildingClassification), fixQuotes($this->buildingPermit), fixQuotes($this->buildingAge), fixQuotes($this->cctNumber), fixQuotes($this->numberOfStoreys), fixQuotes($this->windows), fixQuotes($this->stairs), fixQuotes($this->partition), fixQuotes($this->wallFinish), fixQuotes($this->electrical), fixQuotes($this->toiletAndBath), fixQuotes($this->plumbingSewer), fixQuotes($this->fixtures), fixQuotes($this->dateConstructed), fixQuotes($this->dateOccupied), fixQuotes($this->dateCompleted), fixQuotes($this->areaOfGroundFloor), fixQuotes($this->totalBuildingArea), fixQuotes($this->unitValue), fixQuotes($this->buildingCoreAndAdditionalItems), fixQuotes($this->addItems), fixQuotes($this->depreciationRate), fixQuotes($this->accumulatedDepreciation), fixQuotes($this->depreciatedMarketValue), fixQuotes(time()), fixQuotes($this->modifiedBy), $this->propertyID);
     //echo $sql;
     $this->setDB();
     $dummySql = sprintf("INSERT INTO dummySQL(queryString) VALUES('%s');", fixQuotes($sql));
     $this->db->query($dummySql);
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->propertyID;
         $this->setDomDocument();
     }
     return $ret;
 }
Esempio n. 22
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " code = '%s'" . ", reportCode = '%s'" . ", description = '%s'" . ", value = '%s'" . ", status = '%s'" . " where machineriesDepreciationID = '%s';", MACHINERIES_DEPRECIATION_TABLE, fixQuotes($this->code), fixQuotes($this->reportCode), fixQuotes($this->description), fixQuotes($this->value), fixQuotes($this->status), $this->machineriesDepreciationID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->machineriesDepreciationID;
     }
     return $ret;
 }
Esempio n. 23
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " paymentID = '%s'" . ", tdID = '%s'" . ", dueID = '%s'" . ", dueType = '%s'" . ", backtaxTDID = '%s'" . ", taxDue = '%s'" . ", earlyPaymentDiscount = '%s'" . ", advancedPaymentDiscount = '%s'" . ", penalty = '%s'" . ", amnesty = '%s'" . ", balanceDue = '%s'" . ", amountPaid = '%s'" . ", dueDate = '%s'" . ", paymentDate = '%s'" . ", ownerID = '%s'" . ", status = '%s'" . " where paymentID = '%s'", PAYMENT_TABLE, fixQuotes($this->paymentID), fixQuotes($this->tdID), fixQuotes($this->dueID), fixQuotes($this->dueType), fixQuotes($this->backtaxTDID), fixQuotes($this->taxDue), fixQuotes($this->earlyPaymentDiscount), fixQuotes($this->advancedPaymentDiscount), fixQuotes($this->penalty), fixQuotes($this->amnesty), fixQuotes($this->balanceDue), fixQuotes($this->amountPaid), fixQuotes($this->dueDate), fixQuotes($this->paymentDate), fixQuotes($this->ownerID), fixQuotes($this->status), fixQuotes($this->paymentID));
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->paymentID;
     }
     return $ret;
 }
Esempio n. 24
0
 function run($barangayID)
 {
     // get od list by barangay
     $this->formArray["progressLog"] = "gathering RPUs...";
     $db = new DB_RPTS();
     $sql = "SELECT " . OD_TABLE . ".odID as odID " . "FROM " . OD_TABLE . " " . "LEFT JOIN " . LOCATION_TABLE . " " . "ON " . OD_TABLE . ".odID = " . LOCATION_TABLE . ".odID " . "LEFT JOIN " . LOCATIONADDRESS_TABLE . " " . "ON " . LOCATION_TABLE . ".locationAddressID=" . LOCATIONADDRESS_TABLE . ".locationAddressID " . "LEFT JOIN " . BARANGAY_TABLE . " " . "ON " . BARANGAY_TABLE . ".barangayID=" . LOCATIONADDRESS_TABLE . ".barangayID " . "LEFT JOIN " . ODHISTORY_TABLE . " " . "ON " . OD_TABLE . ".odID = " . ODHISTORY_TABLE . ".previousODID " . "WHERE " . BARANGAY_TABLE . ".barangayID='" . fixQuotes($barangayID) . "' " . "AND " . ODHISTORY_TABLE . ".previousODID IS NULL " . "AND ((" . OD_TABLE . ".transactionCode='GR' AND " . OD_TABLE . ".dateCreated <= " . fixQuotes($this->formArray["countBackDaysTimeStr"]) . ") " . "OR (" . OD_TABLE . ".transactionCode!='GR'))";
     $db->query($sql);
     $this->formArray["totalCreated"] = 0;
     $ctr = 0;
     $this->formArray["progressLog"] = "RPUs gathered...";
     $total = $db->nf();
     while ($db->next_record()) {
         $ctr++;
         // NCC Modification checked and implemented by K2 : November 17, 2005
         // details:
         //		commented out link 659 that uses $this->RunGeneralRevision();
         //		added line 660 that uses $this->RunGeneralRevisionBrgy();
         //$newODID = $this->RunGeneralRevision($db->f("odID"),$this->userID,"GR");
         $newODID = $this->RunGeneralRevisionBrgy($db->f("odID"), $this->userID, "GR");
         if ($newODID == "" || $newODID == false || is_numeric($newODID) == false) {
             // skipped
             $this->formArray["progressLog"] = "[" . $ctr . "/" . $total . "]...[skipped odID:" . $db->f("odID") . "]" . "\n" . $this->formArray["progressLog"];
         } else {
             // ran
             $this->formArray["progressLog"] = "[" . $ctr . "/" . $total . "]...[archived odID:" . $db->f("odID") . " | created odID:" . $newODID . "]" . "\n" . $this->formArray["progressLog"];
             $this->formArray["totalCreated"]++;
         }
     }
     $this->formArray["totalArchived"] = $db->num_rows();
 }
Esempio n. 25
0
 function updateRecordTotals()
 {
     $sql = sprintf("update %s set" . " landTotalMarketValue = '%s'" . ", landTotalAssessedValue = '%s'" . ", plantTotalMarketValue = '%s'" . ", plantTotalAssessedValue = '%s'" . ", bldgTotalMarketValue = '%s'" . ", bldgTotalAssessedValue = '%s'" . ", machTotalMarketValue = '%s'" . ", machTotalAssessedValue = '%s'" . ", totalMarketValue = '%s'" . ", totalAssessedValue = '%s'" . ", dateModified = '%s'" . ", modifiedBy = '%s'" . ", archive = '%s'" . " where rptopID = '%s';", RPTOP_TABLE, fixQuotes($this->landTotalMarketValue), fixQuotes($this->landTotalAssessedValue), fixQuotes($this->plantTotalMarketValue), fixQuotes($this->plantTotalAssessedValue), fixQuotes($this->bldgTotalMarketValue), fixQuotes($this->bldgTotalAssessedValue), fixQuotes($this->machTotalMarketValue), fixQuotes($this->machTotalAssessedValue), fixQuotes($this->totalMarketValue), fixQuotes($this->totalAssessedValue), fixQuotes(time()), fixQuotes($this->modifiedBy), fixQuotes($this->archive), $this->rptopID);
     //echo $sql;
     //*
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->rptopID;
     }
     //*/
     return $ret;
 }
Esempio n. 26
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " provincialCityShare = '%s'" . ", municipalShare = '%s'" . ", barangayShare = '%s'" . ";", SHARES_TABLE, fixQuotes($this->provincialCityShare), fixQuotes($this->municipalShare), fixQuotes($this->barangayShare));
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = true;
     }
     return $ret;
 }
Esempio n. 27
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " code = '%s'" . ", districtID = '%s'" . ", description = '%s'" . ", status = '%s'" . " where barangayID = '%s';", BARANGAY_TABLE, fixQuotes($this->code), fixQuotes($this->districtID), fixQuotes($this->description), fixQuotes($this->status), $this->barangayID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->barangayID;
     }
     return $ret;
 }
Esempio n. 28
0
File: Land.php Progetto: armic/erpts
 function updateRecord()
 {
     if ($this->propertyAdministrator->personID == "") {
         $this->propertyAdministrator->setPersonType("propertyAdmin");
         $this->propertyAdministrator->personID = $this->propertyAdministrator->insertRecord();
     } else {
         $this->propertyAdministrator->setPersonType("propertyAdmin");
         $this->propertyAdministrator->personID = $this->propertyAdministrator->updateRecord();
     }
     $sql = sprintf("update %s set" . " afsID = '%s'" . ", arpNumber = '%s'" . ", propertyIndexNumber = '%s'" . ", propertyAdministrator = '%s'" . ", verifiedBy = '%s'" . ", plottingsBy = '%s'" . ", notedBy = '%s'" . ", marketValue = '%s'" . ", kind = '%s'" . ", actualUse = '%s'" . ", adjustedMarketValue = '%s'" . ", assessmentLevel = '%s'" . ", assessedValue = '%s'" . ", previousOwner = '%s'" . ", previousAssessedValue = '%s'" . ", taxability = '%s'" . ", effectivity = '%s'" . ", appraisedBy = '%s'" . ", appraisedByDate = '%s'" . ", recommendingApproval = '%s'" . ", recommendingApprovalDate = '%s'" . ", approvedBy = '%s'" . ", approvedByDate = '%s'" . ", memoranda = '%s'" . ", postingDate = '%s'" . ", octTctNumber = '%s'" . ", surveyNumber = '%s'" . ", north = '%s'" . ", east = '%s'" . ", south = '%s'" . ", west = '%s'" . ", boundaryDescription = '%s'" . ", classification = '%s'" . ", subClass = '%s'" . ", area = '%s'" . ", unit = '%s'" . ", unitValue = '%s'" . ", adjustmentFactor = '%s'" . ", percentAdjustment = '%s'" . ", valueAdjustment = '%s'" . ", idle = '%s'" . ", contested = '%s'" . ", dateModified = '%s'" . ", modifiedBy = '%s'" . "where propertyID = '%s';", LAND_TABLE, fixQuotes($this->afsID), fixQuotes($this->arpNumber), fixQuotes($this->propertyIndexNumber), fixQuotes($this->propertyAdministrator->personID), fixQuotes($this->verifiedBy), fixQuotes($this->plottingsBy), fixQuotes($this->notedBy), fixQuotes($this->marketValue), fixQuotes($this->kind), fixQuotes($this->actualUse), fixQuotes($this->adjustedMarketValue), fixQuotes($this->assessmentLevel), fixQuotes($this->assessedValue), fixQuotes($this->previousOwner), fixQuotes($this->previousAssessedValue), fixQuotes($this->taxability), fixQuotes($this->effectivity), fixQuotes($this->appraisedBy), fixQuotes($this->appraisedByDate), fixQuotes($this->recommendingApproval), fixQuotes($this->recommendingApprovalDate), fixQuotes($this->approvedBy), fixQuotes($this->approvedByDate), fixQuotes($this->memoranda), fixQuotes($this->postingDate), fixQuotes($this->octTctNumber), fixQuotes($this->surveyNumber), fixQuotes($this->north), fixQuotes($this->east), fixQuotes($this->south), fixQuotes($this->west), fixQuotes($this->boundaryDescription), fixQuotes($this->classification), fixQuotes($this->subClass), fixQuotes($this->area), fixQuotes($this->unit), fixQuotes($this->unitValue), fixQuotes($this->adjustmentFactor), fixQuotes($this->percentAdjustment), fixQuotes($this->valueAdjustment), fixQuotes($this->idle), fixQuotes($this->contested), fixQuotes(time()), fixQuotes($this->modifiedBy), $this->propertyID);
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->propertyID;
         $this->setDomDocument();
     }
     return $ret;
 }
Esempio n. 29
0
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " basicReceiptAmount = '%s'" . ", basicReceiptNumber = '%s'" . ", basicPreviousReceiptNumber = '%s'" . ", basicPreviousReceiptDate = '%s'" . ", basicReceiptIDCSV = '%s'" . ", sefReceiptAmount = '%s'" . ", sefReceiptNumber = '%s'" . ", sefPreviousReceiptNumber = '%s'" . ", sefPreviousReceiptDate = '%s'" . ", sefReceiptIDCSV = '%s'" . ", idleReceiptAmount = '%s'" . ", idleReceiptNumber = '%s'" . ", idlePreviousReceiptNumber = '%s'" . ", idlePreviousReceiptDate = '%s'" . ", idleReceiptIDCSV = '%s'" . ", paymentMode = '%s'" . ", checkNumber = '%s'" . ", dateOfCheck = '%s'" . ", draweeBank = '%s'" . ", cityTreasurer = '%s'" . ", deputyTreasurer = '%s'" . ", receiptDate = '%s'" . ", receivedFrom = '%s'" . ", receivedFromName = '%s'" . ", status = '%s'" . ", dateModified = NOW()" . ", modifiedBy = '%s'" . " WHERE mergedReceiptID='%s' " . ";", $this->MERGEDRECEIPT_TABLE, fixQuotes($this->basicReceiptAmount), fixQuotes($this->basicReceiptNumber), fixQuotes($this->basicPreviousReceiptNumber), fixQuotes($this->basicPreviousReceiptDate), fixQuotes($this->basicReceiptIDCSV), fixQuotes($this->sefReceiptAmount), fixQuotes($this->sefReceiptNumber), fixQuotes($this->sefPreviousReceiptNumber), fixQuotes($this->sefPreviousReceiptDate), fixQuotes($this->sefReceiptIDCSV), fixQuotes($this->idleReceiptAmount), fixQuotes($this->idleReceiptNumber), fixQuotes($this->idlePreviousReceiptNumber), fixQuotes($this->idlePreviousReceiptDate), fixQuotes($this->idleReceiptIDCSV), fixQuotes($this->paymentMode), fixQuotes($this->checkNumber), fixQuotes($this->dateOfCheck), fixQuotes($this->draweeBank), fixQuotes($this->cityTreasurer), fixQuotes($this->deputyTreasurer), fixQuotes($this->receiptDate), fixQuotes($this->receivedFrom), fixQuotes($this->receivedFromName), fixQuotes($this->status), fixQuotes($this->modifiedBy), fixQuotes($this->mergedReceiptID));
     //echo $sql;
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = true;
     }
     return $ret;
 }
Esempio n. 30
0
File: Due.php Progetto: armic/erpts
 function updateRecord()
 {
     $sql = sprintf("update %s set" . " dueID = '%s'" . ", tdID = '%s'" . ", dueType = '%s'" . ", dueDate = '%s'" . ", basicTax = '%s'" . ", basicTaxRate = '%s'" . ", sefTax = '%s'" . ", sefTaxRate = '%s'" . ", idleTax = '%s'" . ", idleTaxRate = '%s'" . " where dueID = '%s';", DUE_TABLE, fixQuotes($this->dueID), fixQuotes($this->tdID), fixQuotes($this->dueType), toMysqlDate($this->dueDate), fixQuotes($this->basicTax), fixQuotes($this->basicTaxRate), fixQuotes($this->sefTax), fixQuotes($this->sefTaxRate), fixQuotes($this->idleTax), fixQuotes($this->idleTaxRate), fixQuotes($this->dueID));
     $this->setDB();
     $this->db->beginTransaction();
     $this->db->query($sql);
     if ($this->db->Errno != 0) {
         $this->db->rollbackTransaction();
         $this->db->resetErrors();
         $ret = false;
     } else {
         $this->db->endTransaction();
         $ret = $this->dueID;
     }
     return $ret;
 }