File: /home/mostafedeg/public_html/erp/models/mysql/ext/MInsuranceMySqlExtDAO.class.php
<?php
/**
* Class that operate on table 'm_insurance'. Database Mysql.
*
* @author: http://phpdao.com
* @date: 2014-09-28 10:14
*/
class MInsuranceMySqlExtDAO extends MInsuranceMySqlDAO{
public function updateInsuranceGoEX($stageIdBefore,$currentStage,$shipNameGo,$shipCompanyGo,$shipPersonalGo,$shipCostGo,$insuranceDate,$ourSerial){
$sql = 'UPDATE m_insurance SET stageIdBefore = '.$stageIdBefore.',
currentStage = '.$currentStage.', shipNameGo = '.$shipNameGo.', shipCompanyGo = '.$shipCompanyGo.',
shipPersonalGo = '.$shipPersonalGo.', shipCostGo = '.$shipCostGo.', insuranceDate = "'.$insuranceDate.'"
WHERE ourSerial = "'.$ourSerial.'" and returned=0';
$sqlQuery = new SqlQuery($sql);
//print_r($sql);
return $this->executeUpdate($sqlQuery);
}
public function updateInsuranceReturnEX($ourSerial,$stageIdBefore,$currentStage,$shipNameReturn,$shipCompanyReturn,$shipPersonalReturn,$shipCostReturn,$insuranceDate ,$type,$oldSN,$newSN,$insuranceCost,$insuranceDiscount){
$sql = 'UPDATE m_insurance SET stageIdBefore = '.$stageIdBefore.',
currentStage = '.$currentStage.', shipNameReturned = '.$shipNameReturn.', shipCompanyReturned = '.$shipCompanyReturn.',
shipPersonalReturned = '.$shipPersonalReturn.', shipCostReturned = '.$shipCostReturn.', insuranceDate = "'.$insuranceDate.'"
, returned = 1 ,type = '.$type.',oldSN = "'.$oldSN.'",newSN = "'.$newSN.'",insuranceCost = '.$insuranceCost.',insuranceDiscount = '.$insuranceDiscount.'
WHERE ourSerial = "'.$ourSerial.'" and returned=0';
$sqlQuery = new SqlQuery($sql);
//print_r($sql);
return $this->executeUpdate($sqlQuery);
}
public function updateInsuranceCurrentStage($stageIdBefore,$currentStage,$ourSerial){
$sql = 'UPDATE m_insurance SET stageIdBefore = '.$stageIdBefore.',currentStage = '.$currentStage.'
WHERE ourSerial = "'.$ourSerial.'" and returned=0';
$sqlQuery = new SqlQuery($sql);
return $this->executeUpdate($sqlQuery);
}
public function getinsuranceIdUsingourserial($ourSerial){
$sql = 'SELECT insuranceId
FROM m_insurance
WHERE ourSerial = "'.$ourSerial.'"
and returned=0';
$sqlQuery = new SqlQuery($sql);
//print_r($sql);
return $this->querySingleResult($sqlQuery);
}
}
?>