<?php $PAGE = "S_REPORT_MONTHLY_EDIT"; require_once '../_init_auth.php'; require_once 'report/class.Report.php'; require_once 'target/class.Target.php'; try { $param['page'] = $PAGE; $report = new report($request); $target = new target($request); //日付取得 if (isset($request['target_date']) && !empty($request['target_date'])) { //サブメニューから遷移 $date = date('Ymd', strtotime($request['target_date'])); $termid = getTermId($date); $param['date'] = $date; $year = getYear($request['target_date']); $month = getMonth($request['target_date']); $month = sprintf('%01d', $month); $param['target_date'] = $date; } else { $param['errors'][] = "システムエラーが発生しました。"; renderTemplate('error.tpl', $param); exit; } //新入社員情報取得 if (isset($request['id'])) { $employee = $report->getEmpData($request['id']); } else { $param['errors'][] = "システムエラーが発生しました。"; renderTemplate('error.tpl', $param);
$year = date('Y'); $month = date('m'); //$param['date'] = $date; $id = $_SESSION[SESSION_USER_ID]; $name = $_SESSION[SESSION_USER]; $authority = $_SESSION[SESSION_GROUP_CD]; $department_cd = $_SESSION[SESSION_USER_DEPARTMENT_CD]; $division_cd = $_SESSION[SESSION_USER_DIVISION_CD]; $param['id'] = $id; $param['date'] = $date; $param['name'] = $name; $param['authority'] = $authority; // 未記入のアラートのための処理 if (in_array(ACCOUNT_TRAINER, $authority) || in_array(ACCOUNT_ADMIN, $authority)) { // 未記入週報のアラートのため、現在の期間IDを取得 $current_term = getTermId($date); $term = $current_term["id"] - 1; // 未記入ヒアリングシートのアラートのため、前月を取得 $last_month = $month - 1; // 前月最終日を取得(紐付き期間内のもののみ、ヒアリングシートのアラート) // 20150623 ADD R.Kumabe $end_of_last_month = getYYYYMMDD($year, $last_month, "end_of_month"); // 未記入月報のアラートのため、前月の期間IDの最大・最小値を取得 $start = getMonthStart($last_month, $year); $end = getMonthEnd($last_month, $year); // OJT期間前のデータに対してアラートを出さないようにする if ($current_term["id"] < START_TERM) { $w_t_no_data_name = array(); $w_a_no_data_name = array(); } if ($month < START_MONTH) { $m_t_no_data_name = array();
} else { $param['errors'][] = "システムエラーが発生しました。"; renderTemplate('error.tpl', $param); exit; } //新入社員情報取得 if (isset($request['id'])) { $employee = $report->getEmpData($request['id']); } else { $param['errors'][] = "システムエラーが発生しました。"; renderTemplate('error.tpl', $param); exit; } //初日、末日だと不具合が起きるので間をとって15日 $m = sprintf('%04d%02d%02d', $year, $month, 15); $termid = getTermId($m); if (!$termid) { $param['errors'][] = "システムエラーが発生しました。"; renderTemplate('error.tpl', $param); exit; } if (isset($request['unit_id'])) { $unit_id = $request['unit_id']; } if (isset($request['sql_flg'])) { $sql_flg = $request['sql_flg']; } else { throw new Exception('sql_flgがありません。'); } if (isset($request['digest'])) { $digest = $request['digest'];
/** * 週報時制チェック * * @param */ function tenseWeekly($id) { $today_id = getTermId(date('Ymd')); if ($today_id['id'] < $id) { return true; } return false; }