Ejemplo n.º 1
0
 public function payroll($year = null, $month = null)
 {
     if ($year == null) {
         $year = date('Y');
     }
     if ($month == null) {
         $month = date('m');
     }
     $this->view->year = $year;
     $date = new DateTime();
     $date->setDate($year, $month, 26);
     $date->setTime(0, 0, 0);
     $this->view->date = $date->format("F Y");
     $date->modify('+1 year');
     $this->view->nextYear = $date->format('Y');
     $date->modify('-2 year');
     $this->view->previousYear = $date->format('Y');
     $this->view->month = $date->format('m');
     $date->modify('-1 month');
     $this->view->previousMonth = $date->format('m');
     $date->modify('+2 month');
     $this->view->nextMonth = $date->format('m');
     $date2 = new DateTime();
     $date2->setDate($year, $month, 25);
     $date2->setTime(24, 0, 0);
     $interval = date_diff($date, $date2);
     $this->view->span = $interval->days;
     $reports = new reportModel($year, $month);
     $this->view->report = $reports->payroll($year, $month);
     $this->view->startDate = $date->format("F jS Y");
     $days = $interval->days - 1;
     $date->modify("+{$days} days");
     $this->view->endDate = $date->format("F jS Y");
     $date = new dateTime();
     $date->setDate($year, $month, 25);
     $this->view->currentDate = $date->format('Y-m-d');
     $this->view->previousDate = $date->modify('-1 month +1 day')->format('Y-m-d');
     $codes = new codeModel();
     $this->view->codes = $codes->allCodes();
 }
Ejemplo n.º 2
0
 public function modifyThisDateWithoutCloning(\dateTime $date)
 {
     $date->modify('+1 day');
 }
Ejemplo n.º 3
0
        $leap = false;
    }
    if ($leap == true and $_POST['tmonth'] == '02' and ($_POST['tday'] == '30' or $_POST['tday'] == '31')) {
        $_POST['tday'] = '29';
    }
    if ($leap == false and $_POST['tmonth'] == '02' and ($_POST['tday'] == '29' or $_POST['tday'] == '30' or $_POST['tday'] == '31')) {
        $_POST['tday'] = '28';
    }
    if (($_POST['tmonth'] == '04' or $_POST['tmonth'] == '06' or $_POST['tmonth'] == '09' or $_POST['tmonth'] == '11') and $_POST['tday'] == '31') {
        $_POST['tday'] = '30';
    }
    $end_date = new dateTime($_POST['tyear'] . $_POST['tmonth'] . $_POST['tday'] . $_POST['ttime'], $target_timezone);
    $end_date->setTimezone($UK_time);
    if ($_POST['timezone'] < 0) {
        $start_date->modify("+" . abs($_POST['timezone']) . " hour");
        $end_date->modify("+" . abs($_POST['timezone']) . " hour");
    } elseif ($_POST['timezone'] > 0) {
        $start_date->modify("-" . $_POST['timezone'] . " hour");
        $end_date->modify("-" . $_POST['timezone'] . " hour");
    }
    $tmp_start_date = $start_date->format("YmdHis");
    $tmp_end_date = $end_date->format("YmdHis");
    $timezone = $_POST['timezone'];
}
// Process the posted modules
$modules = array();
$first = true;
for ($i = 0; $i < $_POST['module_no']; $i++) {
    if (isset($_POST['mod' . $i])) {
        $module_code = module_utils::get_moduleid_from_id($_POST['mod' . $i], $mysqli);
        if ($first == true) {