本文整理汇总了PHP中ExceptionHandler::GetExceptionCount方法的典型用法代码示例。如果您正苦于以下问题:PHP ExceptionHandler::GetExceptionCount方法的具体用法?PHP ExceptionHandler::GetExceptionCount怎么用?PHP ExceptionHandler::GetExceptionCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExceptionHandler
的用法示例。
在下文中一共展示了ExceptionHandler::GetExceptionCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changePass
function changePass()
{
require_once '../../../header.inc.php';
require_once inc_response;
require_once inc_dataReader;
$pdoAcc = PdoDataAccess::getPdoObject(config::$db_servers['master']["host"], config::$db_servers['master']["framework_user"], config::$db_servers['master']["framework_pass"], "framework");
$dt = PdoDataAccess::runquery("select * from AccountSpecs \n\t\t\t\t\t\t\t\t\t\twhere personID=:psid", array(":psid" => $_SESSION['PersonID']), $pdoAcc);
if (count($dt) == 0) {
echo "false";
die;
}
$password = md5($_POST["cur_pass"]);
$stored_seed = substr($dt[0]["pswd1"], 40, 10);
if (sha1($stored_seed . $password . $stored_seed) . $stored_seed != $dt[0]["pswd1"]) {
echo "CurPassError";
die;
}
$seed = '';
$password2 = md5($_POST["new_pass"]);
for ($i = 1; $i <= 10; $i++) {
$seed .= substr('0123456789abcdef', rand(0, 15), 1);
}
PdoDataAccess::RUNQUERY("update AccountSpecs set pswd1=:pswd where personID=:psid", array(":pswd" => sha1($seed . $password2 . $seed) . $seed, ":psid" => $_SESSION['PersonID']), $pdoAcc);
if (ExceptionHandler::GetExceptionCount() != 0) {
echo "CurPassError";
die;
}
//PdoDataAccess::AUDIT("AccountSpecs","تغییر رمز عبور", "");
echo "true";
die;
}
示例2: make_success_row
function make_success_row($person_rec)
{
if (ExceptionHandler::GetExceptionCount() == 0) {
$this->s_count++;
fwrite($this->s_content, "\r\n\t\t\t<tr style='font-family:tahoma;font-size:11px;font-weight:bold;color:#1A58A6;border-bottom:solid 1px #1A58A6;'>\r\n\t <td height=21px>شماره شناسايي :{$person_rec['staff_id']}</td>\r\n\t <td>نام : {$person_rec['pfname']}</td>\r\n\t <td>نام خانوادگي : {$person_rec['plname']}</td>\r\n\t <td>شماره حکم : {$person_rec['writ_id']}</td>\r\n\t </tr>");
} else {
self::make_unsuccess_rows($person_rec);
}
}
示例3: Remove
public function Remove($pdo = null)
{
$res = parent::runquery("select count(*) from CNT_contracts where TemplateID = ? limit 1", array($this->TemplateID), $pdo);
if ($res[0]['count(*)'] > 0) {
parent::runquery("update " . static::TableName . " set IsActive='NO' where TemplateID=?", array($this->TemplateID));
return ExceptionHandler::GetExceptionCount() == 0;
}
parent::runquery("delete from CNT_TemplateItems where TemplateID=?", array($this->TemplateID), $pdo);
return parent::Remove($pdo);
}
示例4: remove
static function remove($staff_id, $PersonID = "")
{
if ($staff_id != "") {
$whereParam = array(":staff_id" => $staff_id);
$return = PdoDataAccess::delete("staff_details", "staff_id=:staff_id", $whereParam);
if ($return == "0") {
return false;
}
$daObj = new DataAudit();
$daObj->ActionType = DataAudit::Action_delete;
$daObj->MainObjectID = $staff_id;
$daObj->TableName = "staff_details";
$daObj->execute();
return true;
}
if ($PersonID != "") {
$query = "delete sd\n\t\t\t\t\t\tfrom staff_details sd join staff s using(staff_id) where s.PersonID=?";
PdoDataAccess::runquery($query, array($PersonID));
if (ExceptionHandler::GetExceptionCount() != 0) {
return false;
}
return true;
}
}
示例5: SaveMessage
function SaveMessage()
{
$obj = new OFC_messages();
PdoDataAccess::FillObjectByArray($obj, $_POST);
$obj->PersonID = $_SESSION["USER"]["PersonID"];
$obj->MsgDate = PDONOW;
$pdo = PdoDataAccess::getPdoObject();
$pdo->beginTransaction();
if (!$obj->Add($pdo)) {
$pdo->rollBack();
echo Response::createObjectiveResponse(false, "خطا در ایجاد پیام");
die;
}
$receivers = json_decode($_POST["receivers"]);
foreach ($receivers as $PersonID) {
$obj2 = new OFC_MessageReceivers();
$obj2->MessageID = $obj->MessageID;
$obj2->PersonID = $PersonID;
$obj2->Add($pdo);
}
if (ExceptionHandler::GetExceptionCount() != 0) {
$pdo->rollBack();
echo Response::createObjectiveResponse(false, "خطا در ارسال پیام");
die;
}
$pdo->commit();
echo Response::createObjectiveResponse(true, "");
die;
}
示例6: in
$TotalQuery = $QUERY_SELECT;
$TotalQuery .= $rptobj->query;
$TotalQuery .= " where " . $QUERY_WHERE . " AND persons.person_type in(" . manage_access::getValidPersonTypes() . ")";
// bahar
$TotalQuery .= $QUERY_GROUP != "" ? " group by " . $QUERY_GROUP : "";
$TotalQuery .= $QUERY_ORDER != "" ? " order by " . $QUERY_ORDER : "";
if (!isset($_REQUEST["excel"])) {
echo "<div style='display:none'>" . $TotalQuery . "<br>";
print_r($whereParam);
echo "</div>";
}
if (isset($_REQUEST["preview"])) {
$TotalQuery .= " limit 10";
}
$statement = PdoDataAccess::runquery_fetchMode($TotalQuery, $whereParam);
if (ExceptionHandler::GetExceptionCount() != 0) {
print_r(ExceptionHandler::PopAllExceptions());
}
if ($statement->rowCount() == 0) {
$output = "<span class='reportGenerator'>گزارش مورد نظر خالی می باشد.</span>";
} else {
if ($rptobj->refer_page != "") {
/*for($i=0; $i<count($data); $i++)
{
for($k=0; $k<count($columns); $k++)
{
if(in_array($columns[$k]["used_type"], array("group", "order", "separation", "formula_column", "condition", "filter")))
continue;
if($columns[$k]["renderer"] != "")
{
示例7: importStudent
function importStudent()
{
$dt = PdoDataAccess::runquery("select * from StudentPersonMap where StNo=?", array($_POST["StNo"]));
if (count($dt) > 0) {
echo Response::createObjectiveResponse(false, "Duplicate");
die;
}
$pdo = PdoDataAccess::getPdoObject();
$pdo->beginTransaction();
$query = "insert into \n\t\tpersons(person_type,pfname,plname,efname,elname,father_name,idcard_no,birth_date,national_code,\n\t\t\t\tsex,address1,home_phone1,mobile_phone,email,comment)\n\t\tselect " . $_POST["person_type"] . ",PFName,PLName,EFName,ELName,DadName,BCN,BirthDate,NID,\n\t\t\t\tsex,address1,PhoneNo,mobile,EMail,concat('انتقال اطلاعات دانشجو با شماره دانشجویی', StNo)\n\t\tfrom students where StNo=?";
PdoDataAccess::runquery($query, array($_POST["StNo"]), $pdo);
if (ExceptionHandler::GetExceptionCount() > 0) {
$pdo->rollBack();
echo Response::createObjectiveResponse(false, "1");
//print_r(ExceptionHandler::PopAllExceptions());
die;
}
//--------------------------------------------------------------------------
$personID = PdoDataAccess::InsertID();
$staff_id = PdoDataAccess::GetLastID("staff", "staff_id", "", array(), $pdo) + 1;
PdoDataAccess::runquery("insert into staff(staff_id,PersonID,person_type) \n\t\t\tvalues({$staff_id}, {$personID}, " . $_POST["person_type"] . ")", array(), $pdo);
if (ExceptionHandler::GetExceptionCount() > 0) {
$pdo->rollBack();
echo Response::createObjectiveResponse(false, "2");
//print_r(ExceptionHandler::PopAllExceptions());
die;
}
//--------------------------------------------------------------------------
$query = "insert into StudentPersonMap\tvalues({$personID}," . $_POST["StNo"] . ")";
PdoDataAccess::runquery($query, array(), $pdo);
if (ExceptionHandler::GetExceptionCount() > 0) {
$pdo->rollBack();
//print_r(ExceptionHandler::PopAllExceptions());
echo Response::createObjectiveResponse(false, "5");
die;
}
//--------------------------------------------------------------------------
$query = "select RFID from educ.StudentSpecs where StNo=?";
$dt = PdoDataAccess::runquery($query, array($_POST["StNo"]), $pdo);
if (ExceptionHandler::GetExceptionCount() > 0) {
$pdo->rollBack();
echo Response::createObjectiveResponse(false, "3");
//print_r(ExceptionHandler::PopAllExceptions());
die;
}
if (count($dt) > 0 && $dt[0][0] != "") {
$id = PdoDataAccess::GetLastID("pas.PersonSettings", "PersonSettingsID");
$query = "insert into pas.PersonSettings(PersonSettingsID,PersonID,CardStatus,CardNumber,WorkGroupID,CalendarID)\n\t\t\tvalues(" . ($id + 1) . ",{$personID},'ENABLE',NULL,0,0)";
PdoDataAccess::runquery($query, array(), $pdo);
if (ExceptionHandler::GetExceptionCount() > 0) {
$pdo->rollBack();
print_r(ExceptionHandler::PopAllExceptions());
echo Response::createObjectiveResponse(false, "4");
die;
}
}
//--------------------------------------------------------------------------
$pdo->commit();
$result = ExceptionHandler::GetExceptionCount() == 0 ? "true" : "false";
echo Response::createObjectiveResponse($result, "");
die;
}
示例8: change_writ_state
/**
* اين تابع وضعيت حکم را تغيير مي دهد
* اگر در تاريخ اجراي حکم، احکام ديگري با وضعيت جديد وجود داشته باشند ثبت سابقه می شوند
* اگر در تاريخ اجراي حکم، احکام ديگري با وضعيت قبلي وجود داشته باشند که ثبت سابقه هستند فعال می شوند
*/
static function change_writ_state($old_state, $new_state, $writ_id, $writ_ver, $staff_id, $execute_date, $DB = "")
{
if ($DB == "") {
$pdo = PdoDataAccess::getPdoObject();
/*@var $pdo PDO*/
$pdo->beginTransaction();
} else {
$pdo = $DB;
}
if ($old_state > $new_state) {
//_______________________________________________
// تغيير وضعيت حکم
$query = "UPDATE HRM_writs\n\t\t\t\t\t\tSET state = " . $new_state . "\n\t\t\t\t\t\tWHERE writ_id=" . $writ_id . " AND\n\t\t\t\t\t\t\t writ_ver=" . $writ_ver . " AND\n\t\t\t\t\t\t\t staff_id=" . $staff_id;
PdoDataAccess::runquery($query, array());
//..................................................
if ($new_state == 2) {
$qry = " UPDATE HRM_writs\n SET writ_recieve_date = NULL\n WHERE writ_id=" . $writ_id . " AND\n\t\t\t\t\t\t\t writ_ver=" . $writ_ver . " AND\n\t\t\t\t\t\t\t staff_id=" . $staff_id;
PdoDataAccess::runquery($qry, array());
}
if ($new_state == 1) {
$qry = " UPDATE HRM_writs\n SET writ_transfer_date = NULL\n WHERE writ_id=" . $writ_id . " AND\n\t\t\t\t\t\t\t writ_ver=" . $writ_ver . " AND\n\t\t\t\t\t\t\t staff_id=" . $staff_id;
PdoDataAccess::runquery($qry, array());
}
//..................................................
if (ExceptionHandler::GetExceptionCount() != 0) {
if ($DB == "") {
$pdo->rollBack();
}
return false;
}
//_______________________________________________
// فعال کردن نسخه قبلي حکم
$query = "UPDATE HRM_writs\n\t\t\t\t\t\tSET history_only=0\n\t\t\t\t\t\tWHERE staff_id=" . $staff_id . "\n\t\t\t\t\t\t\t AND execute_date='" . $execute_date . "'\n\t\t\t\t\t\t\t AND state=" . $old_state . "\n\t\t\t\t\t\t\t AND (writ_id=" . $writ_id . " OR writ_ver<" . $writ_ver . ")";
PdoDataAccess::runquery($query, array());
if (ExceptionHandler::GetExceptionCount() != 0) {
if ($DB == "") {
$pdo->rollBack();
}
return false;
}
if (PdoDataAccess::AffectedRows() != 0) {
if ($DB == "") {
$pdo->commit();
}
return true;
}
//_______________________________________________
//پيدا کردن حکم قبلی و فعال کردن آن
$query = "SELECT writ_id , writ_ver , staff_id\n\t\t\t\t\t\tFROM writs\n\t\t\t\t\t\tWHERE \tstaff_id = " . $staff_id . "\n\t\t\t\t\t\t\t\tAND execute_date = '" . $execute_date . "'\n\t\t\t\t\t\t\t\tAND corrective = 0\n\t\t\t\t\t\t\t\tAND state = " . $old_state . "\n\t\t\t\t\t\t\t\tAND (writ_id <> " . $writ_id . ")\n\t\t\t\t\t\tORDER BY writ_id DESC , writ_ver DESC";
$temp = PdoDataAccess::runquery($query, array());
if (count($temp) != 0) {
$query = "UPDATE writs\n\t\t\t\t\t\t\tSET history_only = 0\n\t\t\t\t\t\t\tWHERE writ_id = :wid AND writ_ver = :wver AND staff_id = :stid";
PdoDataAccess::runquery($query, array(":wid" => $temp[0]["writ_id"], ":wver" => $temp[0]["writ_ver"], ":stid" => $temp[0]["staff_id"]));
if (ExceptionHandler::GetExceptionCount() != 0) {
if ($DB == "") {
$pdo->rollBack();
}
return false;
}
}
if ($DB == "") {
$pdo->commit();
}
} else {
$temp = PdoDataAccess::runquery("SELECT staff_id , writ_id , writ_ver , execute_date\n\t\t\t\tFROM writs\n\t\t\t\tWHERE (history_only=0 OR history_only IS NULL)\n \t\t\t \tAND (dont_transfer = 0 OR dont_transfer IS NULL)\n \t\t\t \tAND (correct_completed !=" . WRIT_CORRECTING . ")\n \t\t\t \tAND writ_id=" . $writ_id . " AND writ_ver=" . $writ_ver . " AND staff_id=" . $staff_id);
if (count($temp) == 0) {
if ($DB == "") {
$pdo->commit();
}
return true;
}
$return = PdoDataAccess::runquery("update writs set state=" . $new_state . " where writ_id=" . $writ_id . " AND writ_ver=" . $writ_ver . " AND staff_id=" . $staff_id);
//..................................................
if ($new_state == 2) {
$qry = " UPDATE writs\n SET writ_transfer_date = now()\n WHERE writ_id=" . $writ_id . " AND\n\t\t\t\t\t\t\t writ_ver=" . $writ_ver . " AND\n\t\t\t\t\t\t\t staff_id=" . $staff_id;
PdoDataAccess::runquery($qry, array());
}
if ($new_state == 3) {
$qry = " UPDATE writs\n SET writ_recieve_date = now()\n WHERE writ_id=" . $writ_id . " AND\n\t\t\t\t\t\t\t writ_ver=" . $writ_ver . " AND\n\t\t\t\t\t\t\t staff_id=" . $staff_id;
PdoDataAccess::runquery($qry, array());
//......................بررسی جهت خالی کردن مرکز هزینه ..............
$obj = new manage_writ($writ_id, $writ_ver, $staff_id);
$PrevItm = $obj->get_prior_writ("", true);
if ($PrevItm == 0 && manage_writ_item::compute_writ_items_sum($writ_id, $writ_ver, $staff_id) > 0) {
$qry = " UPDATE writs\n SET cost_center_id = null\n WHERE writ_id=" . $writ_id . " AND\n\t\t\t\t\t\t\t writ_ver=" . $writ_ver . " AND\n\t\t\t\t\t\t\t staff_id=" . $staff_id;
PdoDataAccess::runquery($qry, array());
}
//......................
}
//..................................................
if (ExceptionHandler::GetExceptionCount() != 0) {
if ($DB == "") {
$pdo->rollBack();
}
return false;
//.........这里部分代码省略.........
示例9: changePass
function changePass()
{
$dt = PdoDataAccess::runquery("select * from BSC_persons where PersonID=:p", array(":p" => $_SESSION['USER']["PersonID"]));
if (count($dt) == 0) {
echo Response::createObjectiveResponse(false, "");
die;
}
$hash_cost_log2 = 8;
$hasher = new PasswordHash($hash_cost_log2, true);
if (!$hasher->CheckPassword($_POST["cur_pass"], $dt[0]["UserPass"])) {
echo Response::createObjectiveResponse(false, "CurPassError");
die;
}
PdoDataAccess::RUNQUERY("update BSC_persons set UserPass=? where PersonID=?", array($hasher->HashPassword($_POST["new_pass"]), $_SESSION["USER"]["PersonID"]));
if (ExceptionHandler::GetExceptionCount() != 0) {
echo Response::createObjectiveResponse(false, "CurPassError");
die;
}
echo Response::createObjectiveResponse(true, "");
die;
}
示例10: make_unsuccess_rows
function make_unsuccess_rows($person_rec)
{
$this->u_count++;
fwrite($this->u_content, "\r\n\t\t\t<tr style='font-family:tahoma;font-size:11px;font-weight:bold;color:#1A58A6;border-bottom:solid 1px #1A58A6;'>\r\n\t <td height=21px>شماره خطا </td>\r\n\t <td>شماره شناسايي :{$person_rec['staff_id']}</td>\r\n\t <td>نام : {$person_rec['pfname']}</td>\r\n\t <td>نام خانوادگي : {$person_rec['plname']}</td>\r\n\t <td>شماره حکم : {$person_rec['writ_id']}</td>\r\n\t </tr>");
$i = 0;
while (ExceptionHandler::GetExceptionCount() != 0) {
$i++;
fwrite($this->u_content, "<tr>\r\n\t\t\t\t\t<td height=21px style='font-family:tahoma;font-size:11px;color:red'>{$i}</td>\r\n\t\t\t\t\t<td colspan='4' style='font-family:tahoma;font-size:12px;color:red'>" . ExceptionHandler::popExceptionDescription() . "</td>\r\n </tr>");
}
}
示例11: EndObjectFlow
static function EndObjectFlow($FlowID, $ObjectID, $pdo = null)
{
switch ($FlowID * 1) {
case 3:
$EndStepID = 105;
PdoDataAccess::runquery("update PLN_plans set StepID=? where PlanID=?", array($EndStepID, $ObjectID), $pdo);
return ExceptionHandler::GetExceptionCount() == 0;
case 4:
$EndStepID = 110;
PdoDataAccess::runquery("update WAR_requests set StatusID=? where RequestID=?", array($EndStepID, $ObjectID), $pdo);
return ExceptionHandler::GetExceptionCount() == 0;
}
return true;
}
示例12: SaveOperation
//.........这里部分代码省略.........
$PersonObj->OperationID = $obj->OperationID;
$PersonObj->PersonID = $PersonID;
for ($j = 1; $j < count($data->sheets[0]['cells'][$i]); $j++) {
eval("\$PersonObj->col{$j} = '" . $data->sheets[0]['cells'][$i][$j] . "';");
}
$PersonObj->Add($pdo);
}
}
}
$dt = NTC_persons::Get(" AND OperationID=?", array($obj->OperationID), $pdo);
if ($dt->rowCount() == 0) {
$pdo->rollBack();
echo Response::createObjectiveResponse(false, "در فایل ارسالی هیچ فرد معتبری یافت نشد");
die;
}
$dt = $dt->fetchAll();
//----------- create letter -------------
if ($obj->SendType == "LETTER" && $obj->GroupLetter == "YES") {
$LetterObj = new OFC_letters();
$LetterObj->LetterType = "INNER";
$LetterObj->LetterTitle = $obj->title;
$LetterObj->LetterDate = PDONOW;
$LetterObj->RegDate = PDONOW;
$LetterObj->PersonID = $_SESSION["USER"]["PersonID"];
$LetterObj->context = $obj->context;
if (!$LetterObj->AddLetter($pdo)) {
ExceptionHandler::PushException("خطا در ثبت نامه");
}
}
//---------------------------------------
foreach ($dt as $row) {
$context = $obj->context;
for ($i = 1; $i < 10; $i++) {
$context = preg_replace("/\\[col" . $i . "\\]/", $row["col" . $i], $context);
}
switch ($obj->SendType) {
case "SMS":
break;
//------------------------------------------------------------------
//------------------------------------------------------------------
case "EMAIL":
$email = $row["email"];
if ($email == "") {
ExceptionHandler::PushException("فاقد ایمیل");
continue;
}
$result = SendEmail($email, $obj->title, $context);
if (!$result) {
ExceptionHandler::PushException("خطا در ارسال ایمیل");
}
break;
//------------------------------------------------------------------
//------------------------------------------------------------------
case "LETTER":
if ($obj->GroupLetter == "NO") {
$LetterObj = new OFC_letters();
$LetterObj->LetterType = "INNER";
$LetterObj->LetterTitle = $obj->title;
$LetterObj->LetterDate = PDONOW;
$LetterObj->RegDate = PDONOW;
$LetterObj->PersonID = $_SESSION["USER"]["PersonID"];
$LetterObj->context = $context;
$LetterObj->AddLetter($pdo);
$SendObj = new OFC_send();
$SendObj->LetterID = $LetterObj->LetterID;
$SendObj->FromPersonID = $LetterObj->PersonID;
$SendObj->ToPersonID = $row["PersonID"];
$SendObj->SendDate = PDONOW;
$SendObj->SendType = 1;
if (!$SendObj->AddSend($pdo)) {
ExceptionHandler::PushException("خطا در ثبت نامه");
}
} else {
$Cobj = new OFC_LetterCustomers();
$Cobj->LetterID = $LetterObj->LetterID;
$Cobj->PersonID = $row["PersonID"];
$Cobj->IsHide = "NO";
$Cobj->LetterTitle = $obj->title;
if (!$Cobj->Add($pdo)) {
ExceptionHandler::PushException("خطا در ثبت ذینفع نامه");
}
}
break;
//------------------------------------------------------------------
}
if (ExceptionHandler::GetExceptionCount() == 0) {
$PObj = new NTC_persons();
$PObj->RowID = $row["RowID"];
$PObj->IsSuccess = "YES";
if ($obj->SendType == "LETTER") {
$PObj->LetterID = $LetterObj->LetterID;
}
$PObj->Edit($pdo);
}
}
$pdo->commit();
//print_r(ExceptionHandler::PopAllExceptions());
echo Response::createObjectiveResponse($result, ExceptionHandler::GetExceptionsToString());
die;
}
示例13: EndWarrantyDoc
function EndWarrantyDoc($ReqObj, $pdo)
{
/*@var $ReqObj WAR_requests */
//------------- get CostCodes --------------------
$CostCode_warrenty = FindCostID("300");
$CostCode_warrenty_commitment = FindCostID("700");
$CostCode_wage = FindCostID("750-07");
$CostCode_FutureWage = FindCostID("760-07");
$CostCode_fund = FindCostID("100");
$CostCode_seporde = FindCostID("690");
$CostCode_pasandaz = FindCostID("209-10");
$CostCode_guaranteeAmount_zemanati = FindCostID("904-02");
$CostCode_guaranteeAmount_daryafti = FindCostID("904-04");
$CostCode_guaranteeAmount2_zemanati = FindCostID("905-02");
$CostCode_guaranteeAmount2_daryafti = FindCostID("905-04");
//------------------------------------------------
$CycleID = substr(DateModules::miladi_to_shamsi($ReqObj->StartDate), 0, 4);
//------------------ find tafsilis ---------------
$PersonTafsili = FindTafsiliID($ReqObj->PersonID, TAFTYPE_PERSONS);
if (!$PersonTafsili) {
ExceptionHandler::PushException("تفصیلی مربوطه یافت نشد.[" . $ReqObj->PersonID . "]");
return false;
}
//---------------- add doc header --------------------
$DocObj = new ACC_docs();
$DocObj->RegDate = PDONOW;
$DocObj->regPersonID = $_SESSION['USER']["PersonID"];
$DocObj->DocDate = PDONOW;
$DocObj->CycleID = $CycleID;
$DocObj->BranchID = $ReqObj->BranchID;
$DocObj->DocType = DOCTYPE_WARRENTY_END;
$DocObj->description = "خاتمه ضمانت نامه " . $ReqObj->_TypeDesc . " به شماره " . $ReqObj->RequestID . " به نام " . $ReqObj->_fullname;
if (!$DocObj->Add($pdo)) {
ExceptionHandler::PushException("خطا در ایجاد سند");
return false;
}
//----------------- add Doc items ------------------------
$itemObj = new ACC_DocItems();
$itemObj->DocID = $DocObj->DocID;
$itemObj->TafsiliType = TAFTYPE_PERSONS;
$itemObj->TafsiliID = $PersonTafsili;
$itemObj->SourceType = DOCTYPE_WARRENTY_END;
$itemObj->SourceID = $ReqObj->RequestID;
$itemObj->SourceID2 = $ReqObj->ReqVersion;
$itemObj->locked = "YES";
$itemObj->CostID = $CostCode_warrenty;
$itemObj->CreditorAmount = $ReqObj->amount;
$itemObj->DebtorAmount = 0;
if (!$itemObj->Add($pdo)) {
ExceptionHandler::PushException("خطا در ثبت ردیف ضمانت نامه");
return false;
}
unset($itemObj->ItemID);
$itemObj->CostID = $CostCode_warrenty_commitment;
$itemObj->CreditorAmount = 0;
$itemObj->DebtorAmount = $ReqObj->amount;
if (!$itemObj->Add($pdo)) {
ExceptionHandler::PushException("خطا در ثبت ردیف تعهد ضمانت نامه");
return false;
}
//---------------------------- block Cost ----------------------------
if ($ReqObj->IsBlock == "YES") {
$dt = PdoDataAccess::runquery("select * from ACC_blocks where SourceType=? AND SourceID=?", array(DOCTYPE_WARRENTY, $ReqObj->RequestID));
if (count($dt) > 0) {
$blockObj = new ACC_CostBlocks($dt[0]["BlockID"]);
$blockObj->IsActive = "NO";
$blockObj->Edit($pdo);
}
}
//---------- ردیف های تضمین ----------
$SumAmount = 0;
$countAmount = 0;
$dt = PdoDataAccess::runquery("\r\n\t\tSELECT DocumentID, ParamValue, InfoDesc as DocTypeDesc\r\n\t\t\tFROM DMS_DocParamValues\r\n\t\t\tjoin DMS_DocParams using(ParamID)\r\n\t\t\tjoin DMS_documents d using(DocumentID)\r\n\t\t\tjoin BaseInfo b on(InfoID=d.DocType AND TypeID=8)\r\n\t\t\tleft join ACC_DocItems on(SourceType=" . DOCTYPE_DOCUMENT . " AND SourceID=DocumentID)\r\n\t\twhere ItemID is null AND b.param1=1 AND \r\n\t\t\tparamType='currencyfield' AND ObjectType='warrenty' AND ObjectID=?", array($ReqObj->RequestID), $pdo);
foreach ($dt as $row) {
unset($itemObj->ItemID);
$itemObj->CostID = $CostCode_guaranteeAmount_zemanati;
$itemObj->DebtorAmount = 0;
$itemObj->CreditorAmount = $row["ParamValue"];
$itemObj->TafsiliType = TAFTYPE_PERSONS;
$itemObj->TafsiliID = $PersonTafsili;
$itemObj->SourceType = DOCTYPE_DOCUMENT;
$itemObj->SourceID = $row["DocumentID"];
$itemObj->details = $row["DocTypeDesc"];
$itemObj->Add($pdo);
$SumAmount += $row["ParamValue"] * 1;
$countAmount++;
}
if ($SumAmount > 0) {
unset($itemObj->ItemID);
unset($itemObj->TafsiliType);
unset($itemObj->TafsiliID);
unset($itemObj->details);
$itemObj->CostID = $CostCode_guaranteeAmount2_zemanati;
$itemObj->DebtorAmount = $SumAmount;
$itemObj->CreditorAmount = 0;
$itemObj->Add($pdo);
}
if (ExceptionHandler::GetExceptionCount() > 0) {
return false;
}
//.........这里部分代码省略.........
示例14: registerDoc
function registerDoc()
{
require_once '../../../../accountancy/import/salary/salary.class.php';
$AccDocObj = new ImportSalary($_POST["pay_year"], $_POST["pay_month"]);
if ($AccDocObj->InitialImportance($_POST["PersonType"] == "contract") === false) {
echo Response::createObjectiveResponse(false, ExceptionHandler::GetExceptionsToString("<br>"));
die;
}
$query = "\t\n\t\tselect c.CostCenterID,\n\t\t\t\tc.Title,\n\t\t\t\tsit.CostID,\n\t\t\t\tsit.CostType,\n\t\t\t\tcase s.person_type when 1 then if(w.emp_state=11, 'ConditionalProf', 'Prof')\n\t\t\t\t\t\t\t\t when 2 then 'Staff'\n\t\t\t\t\t\t\t\t when 3 then 'Worker'\n\t\t\t\t\t\t\t\t when 5 then 'Contract' end PersonType, \n\t\t\t\ts.last_retired_pay,\n\t\t\t\tw.emp_state,\n\t\t\t\tc.AccUnitID,\t\t\t\t\n\t\t\t\tpit.salary_item_type_id,\n\t\t\t\tsum(pit.pay_value) pay_value,\n\t\t\t\tsum(pit.diff_value_coef * pit.diff_pay_value) diff_pay_value,\n\t\t\t\tsum(param7) param7,\n\t\t\t\tsum(diff_param7_coef * diff_param7) diff_param7,\n\t\t\t\tsum(param2) param2,\n\t\t\t\tsum(diff_param2_coef * diff_param2) diff_param2,\n\t\t\t\tsum(param3) param3,\n\t\t\t\tsum(diff_param3_coef * diff_param3) diff_param3\n\t\t\t\t\n\t\tFROM payments p \n\t\t\tJOIN staff s ON s.staff_id = p.staff_id\n\t\t\tJOIN writs w\n\t\t\t\tON(p.writ_id = w.writ_id AND\n\t\t\t\t p.writ_ver = w.writ_ver AND\n\t\t\t\t p.staff_id = w.staff_id AND w.state=3)\n\n\t\t\tJOIN payment_items pit \n\t\t\t\tON(p.pay_year = pit.pay_year AND p.pay_month = pit.pay_month AND\n\t\t\t\t p.staff_id = pit.staff_id AND p.payment_type = pit.payment_type)\n\n\t\t\tJOIN persons per ON (per.personid = s.personid )\n\t\t\tJOIN banks b ON b.bank_id = p.bank_id\n\t\t\tJOIN CostCenterPlan c ON c.CostCenterID = w.CostCenterID\n\t\t\tJOIN salary_item_types sit using(salary_item_type_id)\n\t\t\t\n\t\tWHERE p.pay_year = :py and p.pay_month = :pm and p.payment_type = 1 \n\t\t\tand s.person_type in(" . ($_POST["PersonType"] == "contract" ? "5" : "1,2,3") . ") AND sit.CostID>0\n\n\t\tgroup by c.CostCenterID , s.person_type , p.payment_type , pit.salary_item_type_id\n\t\torder by c.CostCenterID,pit.salary_item_type_id";
$dt = PdoDataAccess::runquery_fetchMode($query, array(":py" => $_POST["pay_year"], ":pm" => $_POST["pay_month"]));
$AccError = "";
while ($row = $dt->fetch()) {
$amount = 0;
switch ($row["salary_item_type_id"]) {
case 44:
if ($row["PersonType"] == "ConditionalProf") {
$row["CostID"] = 19023;
}
$amount = $row["pay_value"] + $row["diff_pay_value"];
break;
//..................................................................
//..................................................................
case 143:
case 38:
$coef_dolat = 1.7 / 1.65;
$amount = $row["param7"] + $row["diff_param7"] + ($row["param7"] + $row["diff_param7"]) * $coef_dolat;
break;
//..................................................................
//..................................................................
case 9920:
case 144:
$amount = $row["param2"] + $row["diff_param2"];
break;
case 145:
$amount = $row["param2"] + $row["diff_param2"] + $row["param3"] + $row["diff_param3"];
break;
case 744:
$amount = $row["param2"] + $row["diff_param2"];
break;
//..................................................................
//..................................................................
case 149:
case 150:
case 750:
$amount = $row["param3"] + $row["diff_param3"];
break;
//..................................................................
//..................................................................
case 9931:
if ($row["PersonType"] == "Staff" || $row["PersonType"] == "Contract") {
$row["CostID"] = 341;
}
if ($row["PersonType"] == "Worker") {
$row["CostID"] = 342;
}
$amount = $row["pay_value"] + $row["diff_pay_value"];
break;
//..................................................................
//..................................................................
default:
$amount = $row["pay_value"] + $row["diff_pay_value"];
}
$AccDocObj->AddItem($row["AccUnitID"], $row["CostID"], $amount, $row["PersonType"]);
if (ExceptionHandler::GetExceptionCount() > 0) {
$AccError .= "مرکز هزینه : " . $row["Title"] . "<br><hr><br>";
$AccError .= "<span style=color:red><h3>" . ExceptionHandler::GetExceptionsToString("<br>") . "</h3></span>";
}
ExceptionHandler::PopAllExceptions();
}
$AccDocObj->CommitImportance();
echo Response::createObjectiveResponse($AccError == "", $AccError);
die;
}
示例15: SaveFilledForm
function SaveFilledForm()
{
$pdo = PdoDataAccess::getPdoObject();
$pdo->beginTransaction();
PdoDataAccess::runquery("insert into VOT_FilledForms values(?,?," . PDONOW . ")", array($_POST["FormID"], $_SESSION["USER"]["PersonID"]), $pdo);
$arr = array_keys($_POST);
for ($i = 0; $i < count($arr); $i++) {
if (strpos($arr[$i], "elem_") === false) {
continue;
}
$ItemID = str_replace("elem_", "", $arr[$i]);
$value = $_POST[$arr[$i]];
PdoDataAccess::runquery("insert into VOT_FilledItems values(?,?,?,?)", array($_POST["FormID"], $_SESSION["USER"]["PersonID"], $ItemID, $value), $pdo);
}
if (ExceptionHandler::GetExceptionCount() > 0) {
$pdo->rollBack();
print_r(ExceptionHandler::PopAllExceptions());
echo Response::createObjectiveResponse(false, "");
die;
}
$pdo->commit();
echo Response::createObjectiveResponse(true, "");
die;
}