本文整理汇总了PHP中Operator::saveAttendence方法的典型用法代码示例。如果您正苦于以下问题:PHP Operator::saveAttendence方法的具体用法?PHP Operator::saveAttendence怎么用?PHP Operator::saveAttendence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operator
的用法示例。
在下文中一共展示了Operator::saveAttendence方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DatePeriod
$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();
///save leave entry
$appliedid = $op->getOperatorID();
$op->deleteLeaveEntries();
//delete old leave entries
//add new entries because there may be change in dates
$from = new DateTime($_POST['leavefromadb']);
$to = new DateTime($_POST['leavetoadb']);