本文整理汇总了PHP中DateModules::NowDateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP DateModules::NowDateTime方法的具体用法?PHP DateModules::NowDateTime怎么用?PHP DateModules::NowDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateModules
的用法示例。
在下文中一共展示了DateModules::NowDateTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save_to_DataBase
//.........这里部分代码省略.........
if (empty($pay_row['diff_param6'])) {
$pay_row['diff_param6'] = 0;
}
if (empty($pay_row['diff_param7'])) {
$pay_row['diff_param7'] = 0;
}
if (empty($pay_row['diff_param8'])) {
$pay_row['diff_param8'] = 0;
}
if (empty($pay_row['diff_param9'])) {
$pay_row['diff_param9'] = 0;
}
if (empty($pay_row['diff_get_value'])) {
$pay_row['diff_get_value'] = 0;
}
if (empty($pay_row['diff_pay_value'])) {
$pay_row['diff_pay_value'] = 0;
}
if (!isset($pay_row['diff_value_coef'])) {
$pay_row['diff_value_coef'] = 1;
}
echo '(' . $pay_row['diff_get_value'] . ',' . $pay_row['diff_pay_value'] . ',' . $pay_row['pay_year'] . ',' . $pay_row['pay_month'] . ',' . $pay_row['staff_id'] . ',' . $pay_row['salary_item_type_id'] . ',' . $pay_row['pay_value'] . ',' . $pay_row['get_value'] . ',' . $pay_row['param1'] . ',' . $pay_row['param2'] . ',' . $pay_row['param3'] . ',' . $pay_row['param4'] . ',' . $pay_row['param5'] . ',' . $pay_row['param6'] . ',' . $pay_row['param7'] . ',' . $pay_row['param8'] . ',' . $pay_row['param9'] . ',' . $pay_row['diff_param1'] . ',' . $pay_row['diff_param2'] . ',' . $pay_row['diff_param3'] . ',' . $pay_row['diff_param4'] . ',' . $pay_row['diff_param5'] . ',' . $pay_row['diff_param6'] . ',' . $pay_row['diff_param7'] . ',' . $pay_row['diff_param8'] . ',' . $pay_row['diff_param9'] . ',' . $pay_row['cost_center_id'] . ',' . $pay_row['payment_type'] . ',' . $pay_row['diff_value_coef'] . '),';
echo chr(10);
$pure_pay += $pay_row['pay_value'] + $pay_row['diff_pay_value'] * $pay_row['diff_value_coef'] - $pay_row['get_value'] - $pay_row['diff_get_value'] * $pay_row['diff_value_coef'];
}
/*خطا : حقوق فرد منفي شده است لذا ساير قسمتها براي او انجام نمي شود*/
if ($pure_pay < 0 && !$this->backpay) {
// ماه آخر بود
if (!$this->__CALC_NEGATIVE_FICHE) {
$this->log('FAIL', 'حقوق اين شخص به مبلغ ' . CurrencyModulesclass::toCurrency($pure_pay * -1, 'CURRENCY') . ' منفي شده است.');
ob_clean();
return;
} else {
$this->log('FAIL', 'حقوق اين شخص به مبلغ ' . CurrencyModulesclass::toCurrency($pure_pay * -1, 'CURRENCY') . ' منفي شده است.(فيش اين فرد از بخش چاپ فيش در دسترس است، لطفا پس از انجام كنترلهاي لازم فيشهاي منفي را ابطال كنيد)');
}
}
$file_line = str_replace(',,', ',\\N,', ob_get_clean());
//براي اصلاح مقادير null
$file_line = str_replace(',,', ',\\N,', $file_line);
//براي اصلاح مقادير null
$pdo = parent::getPdoObject();
$pdo->beginTransaction();
//if($this->backpay) //در صورتي که محاسبه backpay صورت مي گيرد نيازي به نوشتن ساير فايلها نيست
// return ;
if (!$this->backpay) {
//نوشتن آرايه staff_writs در فايل payment_writs
reset($this->staff_writs);
//$writ_row = '';
foreach ($this->staff_writs[$this->cur_staff_id] as $writ) {
parent::runquery(" insert into hrmstotal.payment_writs (writ_id,writ_ver,staff_id,pay_year,pay_month,payment_type) values \n\t\t\t\t\t\t\t(" . $writ['writ_id'] . "," . $writ['writ_ver'] . "," . $this->cur_staff_id . "," . $this->__YEAR . "," . $this->last_month . "," . NORMAL . ")", array(), $pdo);
/* echo parent::GetLatestQueryString() ;
die();*/
if (parent::AffectedRows() == 0) {
$this->log('FAIL', 'خطا در افزودن اطلاعات به جدول احکام مورد استفاده در ماه جاری ');
$pdo->rollBack();
ob_clean();
return;
}
/*$writ_row .= $writ['writ_id'] . ',' .
$writ['writ_ver'] . ',' .
$this->cur_staff_id . ',' .
$this->__YEAR . ',' .
$this->last_month . ',' .
NORMAL . ',' .
$this->__MSG.chr(10);*/
}
//fwrite($this->payment_writs_file_h,$writ_row);
//نوشتن payment در فايل
$payment_row = $this->cur_staff_id . ',' . $this->__YEAR . ',' . $this->__MONTH . ',' . $writ['writ_id'] . ',' . $writ['writ_ver'] . ",'" . $this->month_start . "','" . $this->month_end . "'," . NORMAL . ',' . $this->__MSG . ',' . $this->staffRow['bank_id'] . ',' . $this->staffRow['account_no'] . ',' . PAYMENT_STATE_NORMAL . ",'" . DateModules::NowDateTime() . "'";
$file_line2 = str_replace(',,', ',\\N,', $payment_row);
//براي اصلاح مقادير null
$file_line2 = str_replace(',,', ',\\N,', $file_line2);
//براي اصلاح مقادير null
parent::runquery(" insert into payments (staff_id,pay_year,pay_month,writ_id,writ_ver,start_date,end_date,payment_type,message,\n\t\t\t\t\t\t bank_id,account_no,state ,calc_date ) value (" . $file_line2 . ") ", array(), $pdo);
//echo parent::GetLatestQueryString() ; die();
if (parent::AffectedRows() == 0) {
$this->log('FAIL', 'خطا در افزودن اطلاعات به جدول پرداختها ');
$pdo->rollBack();
ob_clean();
return;
}
}
//fwrite($this->payment_file_h,$file_line);
//if($this->backpay)
// $tblName = "back_payment_items" ;
//else
$tblName = "corrective_payment_items";
$file_line = substr($file_line, 0, strlen($file_line) - 2);
parent::runquery("insert into " . $tblName . " (diff_get_value, diff_pay_value, pay_year, pay_month, staff_id,\n salary_item_type_id, pay_value, get_value, param1, param2, param3,param4, param5, param6, param7, param8, param9,\n diff_param1,diff_param2,diff_param3,diff_param4,diff_param5,diff_param6,diff_param7,diff_param8,diff_param9,\n cost_center_id, payment_type, diff_value_coef ) values " . $file_line . " ", array(), $pdo);
//echo parent::GetLatestQueryString() ; die() ;
if (parent::AffectedRows() == 0) {
$this->log('FAIL', 'خطا در افزودن اطلاعات به جدول اقلام حقوقی');
$pdo->rollBack();
ob_clean();
return;
}
$this->log('SUCCESS', $pure_pay);
$pdo->commit();
return true;
}
示例2: InsertData
//.........这里部分代码省略.........
if ($start_month < 7) {
$day = 31;
} elseif ($start_month < 12) {
$day = 30;
} elseif ($start_month == 12) {
$day = 29;
}
$sd = (int) $Arr[0] . "/" . (int) $Arr[1] . "/01";
$ed = (int) $Arr[0] . "/" . (int) $Arr[1] . "/" . $day;
$sdate = DateModules::shamsi_to_miladi($sd);
$edate = DateModules::shamsi_to_miladi($ed);
$PID = $resStaff[0]['PersonID'];
//ثبت وام یا کسور جدید..................................................
if ($data->sheets[0]['cells'][$i][3] == 1) {
$qry = " select subtract_id, remainder, instalment \n\t\t\t\t\t\t\t\t\tfrom person_subtracts \n\t\t\t\t\t\t\t\t\t\twhere salary_item_type_id = " . $data->sheets[0]['cells'][$i][1] . " and\n\t\t\t\t\t\t\t\t\t\t\t PersonID =" . $PID . " AND IsFinished = 0 and \n\t\t\t\t\t\t\t\t\t\t\t start_date <= '" . str_replace("/", "-", $sdate) . "' and \n\t\t\t\t\t\t\t\t\t\t\t ( end_date >= '" . str_replace("/", "-", $edate) . "' OR end_date IS NULL OR end_date = '0000-00-00' ) ";
$res = PdoDataAccess::runquery($qry);
if (count($res) > 0 && $res[0]['subtract_id'] > 0) {
$log_obj->make_unsuccess_rows($data->sheets[0]['cells'][$i][0], "-", "این /کسور قبلا در سیستم ثبت گردیده است.");
$unsuccess_count++;
continue;
}
//.......................................................
$subObj->PersonID = $PID;
$subObj->subtract_type = $data->sheets[0]['cells'][$i][2] == 1 ? LOAN : FIX_FRACTION;
$subObj->bank_id = !empty($data->sheets[0]['cells'][$i][4]) ? $resbank[0]['bank_id'] : "";
$subObj->first_value = !empty($data->sheets[0]['cells'][$i][5]) ? $data->sheets[0]['cells'][$i][5] : 0;
$subObj->instalment = !empty($data->sheets[0]['cells'][$i][6]) ? $data->sheets[0]['cells'][$i][6] : 0;
$subObj->remainder = !empty($data->sheets[0]['cells'][$i][5]) ? $data->sheets[0]['cells'][$i][5] : 0;
$subObj->start_date = DateModules::shamsi_to_miladi($sfd);
$subObj->end_date = !empty($data->sheets[0]['cells'][$i][8]) ? DateModules::shamsi_to_miladi($efd) : "";
$subObj->loan_no = !empty($data->sheets[0]['cells'][$i][9]) ? $data->sheets[0]['cells'][$i][9] : "";
$subObj->contract_no = !empty($data->sheets[0]['cells'][$i][10]) ? $data->sheets[0]['cells'][$i][10] : "";
$subObj->salary_item_type_id = $data->sheets[0]['cells'][$i][1];
$subObj->reg_date = DateModules::NowDateTime();
//Isfinished = 0 ;
if ($subObj->Add() === false) {
$log_obj->make_unsuccess_rows($data->sheets[0]['cells'][$i][0], "-", " خطا ");
$unsuccess_count++;
continue;
}
}
// ثبت گردش ...................................................
if ($data->sheets[0]['cells'][$i][3] == 2) {
$qry = " select psf.subtract_id \n\t\t\t\t\t\t\t\t\tfrom person_subtracts ps inner join person_subtract_flows psf \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ton ps.subtract_id = psf.subtract_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\twhere ps.salary_item_type_id = " . $data->sheets[0]['cells'][$i][1] . " and\n\t\t\t\t\t\t\t\t\t\t\t ps.PersonID =" . $PID . " and \n\t\t\t\t\t\t\t\t\t\t\t psf.flow_date >= '" . str_replace("/", "-", $sdate) . "' and \n\t\t\t\t\t\t\t\t\t\t\t psf.flow_date <= '" . str_replace("/", "-", $edate) . "'";
$res = PdoDataAccess::runquery($qry);
if (count($res) > 0 && $res[0]['subtract_id'] > 0) {
//echo PdoDataAccess::GetLatestQueryString() ; die();
$log_obj->make_unsuccess_rows($data->sheets[0]['cells'][$i][0], "-", " این گردش قبلا در سیستم ثبت گردیده است.");
$unsuccess_count++;
continue;
}
//.................................................................
$qry = " select ps.subtract_id, ts.remainder, ps.instalment \n\t\t\t\t\t\t\t\t\tfrom person_subtracts ps left join tmp_SubtractRemainders ts \n\t\t\t\t\t\t\t\t\t on ps.subtract_id = ts.subtract_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\twhere ps.salary_item_type_id = " . $data->sheets[0]['cells'][$i][1] . " and\n\t\t\t\t\t\t\t\t\t\t\t ps.PersonID =" . $PID . " AND ps.IsFinished = 0 AND ps.start_date <= '" . str_replace("/", "-", $sdate) . "' AND \n\t\t\t\t\t\t\t\t\t\t\t( ps.end_date >= '" . str_replace("/", "-", $edate) . "' OR ps.end_date IS NULL OR ps.end_date = '0000-00-00' ) ";
$res = PdoDataAccess::runquery($qry);
// echo PdoDataAccess::GetLatestQueryString() ;
if (count($res) > 0 && $res[0]['subtract_id'] > 0) {
$new_remainder = $new_instalment = 0;
if ($data->sheets[0]['cells'][$i][2] == 1) {
$subFlowObj->subtract_id = $res[0]['subtract_id'];
$subFlowObj->flow_type = REGISTER_NEW_FLOW_TYPE;
$subFlowObj->flow_date = DateModules::NowDateTime();
$subFlowObj->flow_coaf = !empty($data->sheets[0]['cells'][$i][5]) && $data->sheets[0]['cells'][$i][5] * 1 > $res[0]['remainder'] * 1 ? -1 : 1;
$subFlowObj->amount = !empty($data->sheets[0]['cells'][$i][5]) && $data->sheets[0]['cells'][$i][5] * 1 > $res[0]['remainder'] * 1 ? $data->sheets[0]['cells'][$i][5] * 1 - $res[0]['remainder'] * 1 : $res[0]['remainder'] * 1 - $data->sheets[0]['cells'][$i][5] * 1;
$subFlowObj->newRemainder = !empty($data->sheets[0]['cells'][$i][5]) ? $data->sheets[0]['cells'][$i][5] : 0;
$subFlowObj->comments = "گردش دستی";
if ($subFlowObj->Add() == false) {