本文整理汇总了PHP中Operator::saveLeaveEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP Operator::saveLeaveEntry方法的具体用法?PHP Operator::saveLeaveEntry怎么用?PHP Operator::saveLeaveEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operator
的用法示例。
在下文中一共展示了Operator::saveLeaveEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Operator
require_once 'autoload.php';
date_default_timezone_set('Asia/Calcutta');
$op = new Operator();
if (isset($_POST['Leave_Reason'])) {
//print_r($_POST);
$from = new DateTime($_POST['leavefromdb']);
$to = new DateTime($_POST['leavetodb']);
$to = $to->modify('+1 day');
///to include end day also
$leaveremarks = $_POST['Leave_Reason'];
$noofdays = DateInterval::CreateFromDateString('1 Day');
$period = new DatePeriod($from, $noofdays, $to);
$op->setValue('fromdate', $_POST['leavefromdb']);
$op->setValue('todate', $_POST['leavetodb']);
$op->setValue('leaveremarks', $leaveremarks);
$op->saveLeaveEntry();
///save leave entry
$leaveid = $op->getValue('leaveid');
foreach ($period as $dt) {
//print_r($dt);
$op->setValue('datedb', $dt->format("Y-m-d"));
$op->setValue('attstatusid', 3);
$op->saveAttendence();
}
} else {
if (isset($_POST['forwarderremarks'])) {
$op->setValue('forwarderremarks', $_POST['forwarderremarks']);
$op->setValue('fromdate', $_POST['leavefromadb']);
$op->setValue('todate', $_POST['leavetoadb']);
$op->setValue('leaveid', $_POST['Leave_ID']);
$op->saveLeaveEntry();