function checkHisData($no = "")
 {
     $user_id = @$this->request['user_id'];
     if ($no == "") {
         $name = "[電カル連携(メイン)]";
         $send_date = $this->request['send_date'];
         $staffcode = $this->request['staffcode'];
         $kanjiname = $this->request['kanjiname'];
         $kananame = $this->request['kananame'];
         $password = $this->request['password'];
         $wardcode = $this->request['wardcode'];
         $professioncode = $this->request['professioncode'];
         $gradecode = $this->request['gradecode'];
         $deptcode = $this->request['deptcode'];
         $appcode = $this->request['appcode'];
         $validstartdate = $this->request['validstartdate'];
         $validenddate = $this->request['validenddate'];
     } else {
         $name = "[電カル連携(サブ" . $no . ")]";
         $send_date = $this->request['sub_send_date'][$no];
         $staffcode = $this->request['sub_staffcode'][$no];
         $kanjiname = $this->request['sub_kanjiname'][$no];
         $kananame = $this->request['sub_kananame'][$no];
         $password = $this->request['sub_password'][$no];
         $wardcode = $this->request['sub_wardcode'][$no];
         $professioncode = $this->request['sub_professioncode'][$no];
         $gradecode = $this->request['sub_gradecode'][$no];
         $deptcode = $this->request['sub_deptcode'][$no];
         $appcode = $this->request['sub_appcode'][$no];
         $validstartdate = $this->request['sub_validstartdate'][$no];
         $validenddate = $this->request['sub_validenddate'][$no];
     }
     // 送信日
     if (!$this->oMgr->checkEmpty($send_date)) {
         // エラーメッセージをセット
         $this->oMgr->setErr('E001', $name . "有効開始日");
     } else {
         if (!$this->oMgr->checkDateFormat($send_date)) {
             // エラーメッセージをセット
             $param = array();
             $param[0] = $name . "有効開始日";
             $param[1] = "yyyy/mm/dd";
             $this->oMgr->setErr('E004', $param);
         } else {
             if (!$this->oMgr->checkDate($send_date)) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E013', $name . "有効開始日");
             }
         }
     }
     // ログインID
     if (!$this->oMgr->checkEmpty($staffcode)) {
         $this->oMgr->setErr('E001', $name . "ログインID");
     } else {
         if (!string::checkNumber($staffcode, 8)) {
             // エラーメッセージをセット
             $param = array();
             $param[0] = $name . "ログインID";
             $param[1] = "半角数字8桁";
             $this->oMgr->setErr('E004', $param);
         } else {
             if ($this->oMgr->existsStaffcode($staffcode, $user_id)) {
                 $this->oMgr->setErr('E017', $name . "ログインID");
             }
         }
     }
     // 漢字氏名
     if (!$this->oMgr->checkEmpty($kanjiname)) {
         // エラーメッセージをセット
         $this->oMgr->setErr('E001', $name . "漢字氏名");
     }
     // カナ姓
     $kananame = str_replace(" ", "", $kananame);
     if (!$this->oMgr->checkEmpty($kananame)) {
         // エラーメッセージをセット
         $this->oMgr->setErr('E001', $name . "カナ氏名");
     } else {
         if (!string::chackKatakana3($kananame)) {
             // エラーメッセージをセット
             $param = array();
             $param[0] = $name . 'カナ氏名';
             $param[1] = 'カタカナ';
             $this->oMgr->setErr('E004', $param);
         }
     }
     // HISパスワード
     if (!$this->oMgr->checkEmpty($password)) {
         // 任意
     } else {
         //if (!string::checkAlphanumWide($password, 6, 10) || !ereg("[0-9]", $password) || !ereg("[a-z]", $password) || !ereg("[A-Z]", $password))
         if (!string::checkAlphanumWide($password, 4, 10)) {
             $param = array();
             $param[0] = $name . "HISパスワード";
             $param[1] = "半角英数字4~10文字";
             // エラーメッセージをセット
             $this->oMgr->setErr('E004', $param);
         }
     }
     // 部署
     if (!$this->oMgr->checkEmpty($wardcode)) {
         // エラーメッセージをセット
         $this->oMgr->setErr('E007', $name . "部署");
     }
     // 職種
     if (!$this->oMgr->checkEmpty($professioncode)) {
         // エラーメッセージをセット
         $this->oMgr->setErr('E007', $name . "職種");
     }
     // 役職
     if (!$this->oMgr->checkEmpty($gradecode)) {
         // エラーメッセージをセット
         $this->oMgr->setErr('E007', $name . "役職");
     }
     // 診療科
     if (!$this->oMgr->checkEmpty($deptcode)) {
         // エラーメッセージをセット
         $this->oMgr->setErr('E007', $name . "診療科");
     }
     // 予約項目コード
     if (!$this->oMgr->checkEmpty($appcode)) {
         // 任意
     } else {
         if (!string::checkAlphaNum($appcode, 5)) {
             // エラーメッセージをセット
             $param = array();
             $param[0] = $name . "予約項目コード";
             $param[1] = "半角英数字5桁";
             $this->oMgr->setErr('E004', $param);
         }
     }
     $has_validdate_err = false;
     // 有効期間
     if (!$this->oMgr->checkEmpty($validstartdate)) {
         // エラーメッセージをセット
         $this->oMgr->setErr('E001', $name . "有効期間(開始日)");
         $has_validdate_err = true;
     } else {
         if (!$this->oMgr->checkDateFormat($validstartdate)) {
             // エラーメッセージをセット
             $param = array();
             $param[0] = $name . "有効期間(開始日)";
             $param[1] = "yyyy/mm/dd";
             $this->oMgr->setErr('E004', $param);
             $has_validdate_err = true;
         } else {
             if (!$this->oMgr->checkDate($validstartdate)) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E013', $name . "有効期間(開始日)");
                 $has_validdate_err = true;
             }
         }
     }
     // 有効期間
     if (!$this->oMgr->checkEmpty($validenddate)) {
         // エラーメッセージをセット
         $this->oMgr->setErr('E001', $name . "有効期間(終了日)");
         $has_validdate_err = true;
     } else {
         if (!$this->oMgr->checkDateFormat($validenddate)) {
             // エラーメッセージをセット
             $param = array();
             $param[0] = $name . "有効期間(終了日)";
             $param[1] = "yyyy/mm/dd";
             $this->oMgr->setErr('E004', $param);
             $has_validdate_err = true;
         } else {
             if (!$this->oMgr->checkDate($validenddate)) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E013', $name . "有効期間(終了日)");
                 $has_validdate_err = true;
             }
         }
     }
     if (!$has_validdate_err) {
         if (!$this->oMgr->checkDateTerm($validstartdate, $validenddate)) {
             // エラーメッセージをセット
             $param = array();
             $param[0] = $name . "有効期間(開始日)";
             $param[1] = $name . "有効期間(終了日)";
             $this->oMgr->setErr('E012', $param);
         }
     }
 }
 function checkInputdata()
 {
     $user_id = @$this->request['user_id'];
     switch ($this->request['ctrl_mode_name']) {
         case 'base':
             // 個人番号
             if (!$this->oMgr->checkEmpty($this->request['staff_id'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "個人番号");
             } else {
                 if (!string::strlen($this->request['staff_id']) > STAFF_ID_LEN) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "個人番号";
                     $param[1] = "半角" . STAFF_ID_LEN . "桁";
                     $this->oMgr->setErr('E004', $param);
                 } else {
                     if ($this->oMgr->existsStaffId($this->request['staff_id'], $user_id)) {
                         $this->oMgr->setErr('E017', "個人番号");
                     }
                 }
             }
             // 漢字姓
             if (!$this->oMgr->checkEmpty($this->request['kanjisei'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "氏名(姓)");
             }
             // 漢字名
             if (!$this->oMgr->checkEmpty($this->request['kanjimei'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "氏名(名)");
             }
             // カナ姓
             $this->request['kanasei'] = string::han2zen($this->request['kanasei']);
             if (!$this->oMgr->checkEmpty($this->request['kanasei'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "氏名カナ(姓)");
             } else {
                 if (!string::chackKatakana3($this->request['kanasei'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = '氏名カナ(姓)';
                     $param[1] = 'カタカナ';
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // カナ名
             $this->request['kanamei'] = string::han2zen($this->request['kanamei']);
             if (!$this->oMgr->checkEmpty($this->request['kanamei'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "氏名カナ(名)");
             } else {
                 if (!string::chackKatakana3($this->request['kanamei'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = '氏名カナ(名)';
                     $param[1] = 'カタカナ';
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 英字姓
             $this->request['eijisei'] = string::zen2han($this->request['eijisei']);
             $this->request['eijisei'] = strtolower($this->request['eijisei']);
             $chkEijisei = str_replace("-", "", $this->request['eijisei']);
             if (!$this->oMgr->checkEmpty($this->request['eijisei'])) {
                 // 任意
             } else {
                 if (!string::checkAlphabet($chkEijisei)) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = '氏名英字(姓)';
                     $param[1] = '半角英字';
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 英字名
             $this->request['eijimei'] = string::zen2han($this->request['eijimei']);
             $this->request['eijimei'] = strtolower($this->request['eijimei']);
             $chkEijimei = str_replace("-", "", $this->request['eijimei']);
             if (!$this->oMgr->checkEmpty($this->request['eijimei'])) {
                 // 任意
             } else {
                 if (!string::checkAlphabet($chkEijimei)) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = '氏名英字(名)';
                     $param[1] = '半角英字';
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 戸籍氏名カナ姓
             $this->request['kanasei_real'] = string::han2zen($this->request['kanasei_real']);
             if (!$this->oMgr->checkEmpty($this->request['kanasei_real'])) {
                 // エラーメッセージをセット
                 //$this->oMgr->setErr('E001',"戸籍氏名カナ(姓)");
             } else {
                 if (!string::chackKatakana3($this->request['kanasei_real'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = '戸籍氏名カナ(姓)';
                     $param[1] = 'カタカナ';
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 戸籍氏名カナ名
             $this->request['kanamei_real'] = string::han2zen($this->request['kanamei_real']);
             if (!$this->oMgr->checkEmpty($this->request['kanamei_real'])) {
                 // エラーメッセージをセット
                 //$this->oMgr->setErr('E001',"戸籍氏名カナ(名)");
             } else {
                 if (!string::chackKatakana3($this->request['kanamei_real'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = '戸籍氏名カナ(名)';
                     $param[1] = 'カタカナ';
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 性別
             $this->request['sex'] = (string) $this->request['sex'];
             if (!$this->oMgr->checkEmpty($this->request['sex'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "性別");
             }
             // 生年月日
             if (!$this->oMgr->checkEmpty($this->request['birth_year'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "生年月日(年)");
             }
             if (!$this->oMgr->checkEmpty($this->request['birth_mon'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "生年月日(月)");
             }
             if (!$this->oMgr->checkEmpty($this->request['birth_day'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "生年月日(日)");
             } else {
                 if (!checkdate($this->request['birth_mon'], $this->request['birth_day'], $this->request['birth_year'])) {
                     // エラーメッセージをセット
                     $this->oMgr->setErr('E013', "生年月日");
                 }
             }
             // 所属
             if (!$this->oMgr->checkEmpty($this->request['belong_chg_id'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "所属");
             }
             // 職種
             if (!$this->oMgr->checkEmpty($this->request['job_id'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "職種");
             }
             // 役職
             if (!$this->oMgr->checkEmpty($this->request['post_id'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "役職");
             }
             // 常勤/非常勤
             if (!$this->oMgr->checkEmpty($this->request['joukin_kbn'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "常勤/非常勤");
             }
             // PHS番号
             $this->request['pbno'] = string::zen2han($this->request['pbno']);
             if (!$this->oMgr->checkEmpty($this->request['pbno'])) {
                 // 任意
             } else {
                 if (!string::checkNumber($this->request['pbno'], 4)) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "PHS番号";
                     $param[1] = "半角数字4桁";
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 内線
             $this->request['naisen'] = string::zen2han($this->request['naisen']);
             if (!$this->oMgr->checkEmpty($this->request['naisen'])) {
                 // 任意
             } else {
                 if (!string::strlen($this->request['naisen']) > 20) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "内線";
                     $param[1] = "20桁以内";
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 送信日
             if ($this->request['reserve_flg'] == "1") {
                 if (!$this->oMgr->checkEmpty($this->request['reflect_date'])) {
                     // エラーメッセージをセット
                     $this->oMgr->setErr('E001', "反映日");
                 } else {
                     if (!$this->oMgr->checkDateFormat($this->request['reflect_date'])) {
                         // エラーメッセージをセット
                         $param = array();
                         $param[0] = "反映日";
                         $param[1] = "yyyy/mm/dd";
                         $this->oMgr->setErr('E004', $param);
                     } else {
                         if (!$this->oMgr->checkDate($this->request['reflect_date'])) {
                             // エラーメッセージをセット
                             $this->oMgr->setErr('E013', "反映日");
                         } else {
                             list($reflect_y, $reflect_m, $reflect_d) = explode("/", $this->request['reflect_date']);
                             $reflect_date = sprintf("%04d-%02d-%02d", $reflect_y, $reflect_m, $reflect_d);
                             // 即時反映の日付がセットされた場合
                             if (strtotime(date('Y-m-d')) >= strtotime($reflect_date)) {
                                 if ($this->request['edit_mode'] == 'reserve') {
                                     $this->oMgr->pushError("即時反映する場合は予約取消後に通常の編集を行ってください。");
                                 } else {
                                     $this->oMgr->pushError("反映日には未来の日付を入力してください。");
                                 }
                             }
                         }
                     }
                 }
             }
             break;
         case 'ncvc':
             $aryOld = $this->oMgr->getUserNcvcData($user_id);
             $old_login_id = $aryOld['login_id'];
             $old_login_pw = $aryOld['login_passwd'];
             $old_mail_acc = $aryOld['mail_acc'];
             unset($aryOld);
             // 英字姓
             $this->request['eijisei'] = string::zen2han($this->request['eijisei']);
             $this->request['eijisei'] = strtolower($this->request['eijisei']);
             $chkEijisei = str_replace("-", "", $this->request['eijisei']);
             if (!$this->oMgr->checkEmpty($this->request['eijisei'])) {
                 // 任意
             } else {
                 if (!string::checkAlphabet($chkEijisei)) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = '氏名英字(姓)';
                     $param[1] = '半角英字';
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 英字名
             $this->request['eijimei'] = string::zen2han($this->request['eijimei']);
             $this->request['eijimei'] = strtolower($this->request['eijimei']);
             $chkEijimei = str_replace("-", "", $this->request['eijimei']);
             if (!$this->oMgr->checkEmpty($this->request['eijimei'])) {
                 // 任意
             } else {
                 if (!string::checkAlphabet($chkEijimei)) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = '氏名英字(名)';
                     $param[1] = '半角英字';
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 統合ID
             $this->request['login_id'] = string::zen2han($this->request['login_id']);
             //				$this->request['login_id'] = strtolower($this->request['login_id']);
             // 元データと変わってない場合チェックしない
             if ($old_login_id == $this->request['login_id']) {
             } else {
                 if (!$this->oMgr->checkEmpty($this->request['login_id'])) {
                     // 任意
                     if ($this->request['mail_acc'] != "") {
                         $this->oMgr->setErr('E001', "統合ID");
                     }
                 } else {
                     if (string::strlen($this->request['login_id']) > 20) {
                         // エラーメッセージをセット
                         $param = array();
                         $param[0] = '統合ID';
                         $param[1] = '20文字以内';
                         $this->oMgr->setErr('E004', $param);
                     } else {
                         if (!ereg("^[a-z]+\\.[a-z]+\\.[a-z]{2}\$", $this->request['login_id'])) {
                             // エラーメッセージをセット
                             //					$param = array();
                             //					$param[0] = '統合ID';
                             //					$param[1] = '姓.名.規定の英字2文字';
                             //					$this->oMgr->setErr('E004', $param);
                         } else {
                             if ($this->oMgr->existsMailAcc($this->request['login_id'])) {
                                 // メールアカウントとして使用中
                                 $this->oMgr->setErr('E017', "統合ID");
                             } else {
                                 if ($this->oMgr->existsMlistAcc($this->request['login_id'])) {
                                     // メーリングリストとして使用中
                                     $this->oMgr->setErr('E017', "統合ID");
                                 } else {
                                     if ($this->oMgr->existsOldMail($this->request['login_id'])) {
                                         // エイリアスのアカウントとして使用中
                                         $this->oMgr->setErr('E017', "統合ID");
                                     } else {
                                         list($sei, $mei, $rand) = explode(".", $this->request['login_id']);
                                         $aryRandStr = $this->oMgr->getAry('rand_tow_chars');
                                         if (!in_array($rand, $aryRandStr)) {
                                             // エラーメッセージをセット
                                             //						$param = array();
                                             //						$param[0] = '統合ID';
                                             //						$param[1] = '姓.名.規定の英字2文字';
                                             //						$this->oMgr->setErr('E004', $param);
                                         } else {
                                             if ($this->oMgr->existsLoginId($this->request['login_id'], $user_id)) {
                                                 $this->oMgr->setErr('E017', "統合ID");
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             // パスワード
             $this->request['login_passwd'] = string::zen2han($this->request['login_passwd']);
             if (!$this->oMgr->checkEmpty($this->request['login_passwd'])) {
                 // 任意
                 // 未登録の場合、統合IDが入力されていれば必須
                 if ($this->request['login_id'] != "" && $old_login_pw == "") {
                     //						$this->oMgr->setErr('E001',"パスワード");
                 }
             } else {
                 $passwd = $this->request['login_passwd'];
                 if (!string::checkAlphanumWide($passwd, 6, 20) || !ereg("[0-9]", $passwd) || !ereg("[a-z]", $passwd) || !ereg("[A-Z]", $passwd)) {
                     $param = array();
                     $param[0] = "パスワード";
                     $param[1] = "数字、英字大文字、英字小文字を各1文字以上使用し、6~20文字";
                     // エラーメッセージをセット
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             $mailMsg = "";
             // メールアカウント
             // 元データと変わってない場合チェックしない
             if ($old_mail_acc == $this->request['mail_acc']) {
             } else {
                 if (!$this->oMgr->checkEmpty($this->request['mail_acc'])) {
                     //
                 } else {
                     if (!$this->oMgr->checkNcvcMailAcc($this->request['mail_acc'], "メールアカウント", &$mailMsg)) {
                         // エラーメッセージをセット
                         $this->oMgr->pushError($mailMsg);
                     } else {
                         if ($this->oMgr->existsMailAcc($this->request['mail_acc'], $user_id)) {
                             $this->oMgr->setErr('E017', "メールアカウント");
                         } else {
                             if ($this->oMgr->existsMlistAcc($this->request['mail_acc'])) {
                                 // メーリングリストとして使用中
                                 $this->oMgr->setErr('E017', "メールアカウント");
                             } else {
                                 if ($this->oMgr->existsOldMail($this->request['mail_acc'])) {
                                     // エイリアスのアカウントとして使用中
                                     $this->oMgr->setErr('E017', "メールアカウント");
                                 } else {
                                     if ($this->oMgr->existsLoginId($this->request['mail_acc'])) {
                                         if ($this->request['mail_acc'] == $this->request['login_id']) {
                                             $param = array();
                                             $param[0] = "メールアカウント";
                                             $param[1] = "統合ID以外の文字列";
                                             $this->oMgr->setErr('E004', $param);
                                         } else {
                                             // 統合IDとして使用中
                                             $this->oMgr->setErr('E017', "メールアカウント");
                                         }
                                     } else {
                                         if ($this->request['mail_acc'] == $this->request['login_id']) {
                                             $param = array();
                                             $param[0] = "メールアカウント";
                                             $param[1] = "統合ID以外の文字列";
                                             $this->oMgr->setErr('E004', $param);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             // ファイル転送
             if (!$this->oMgr->checkEmpty($this->request['ftrans_user_kbn'])) {
                 if ($this->request['ftrans_user_flg'] == '1') {
                     // エラーメッセージをセット
                     $this->oMgr->setErr('E007', "ファイル転送機能利用の権限");
                 }
             }
             $has_date_err = false;
             // 利用期間
             if (!$this->oMgr->checkEmpty($this->request['start_date'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "利用期間(開始日)");
                 $has_date_err = true;
             } else {
                 if (!$this->oMgr->checkDateFormat($this->request['start_date'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "利用期間(開始日)";
                     $param[1] = "yyyy/mm/dd";
                     $this->oMgr->setErr('E004', $param);
                     $has_date_err = true;
                 } else {
                     if (!$this->oMgr->checkDate($this->request['start_date'])) {
                         // エラーメッセージをセット
                         $this->oMgr->setErr('E013', "利用期間(開始日)");
                         $has_date_err = true;
                     }
                 }
             }
             // 利用期間
             if (!$this->oMgr->checkEmpty($this->request['end_date'])) {
                 // エラーメッセージをセット
                 //$this->oMgr->setErr('E001',"利用期間(終了日)");
                 $has_date_err = true;
             } else {
                 if (!$this->oMgr->checkDateFormat($this->request['end_date'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "利用期間(終了日)";
                     $param[1] = "yyyy/mm/dd";
                     $this->oMgr->setErr('E004', $param);
                     $has_date_err = true;
                 } else {
                     if (!$this->oMgr->checkDate($this->request['end_date'])) {
                         // エラーメッセージをセット
                         $this->oMgr->setErr('E013', "利用期間(終了日)");
                         $has_date_err = true;
                     }
                 }
             }
             if (!$has_date_err) {
                 if (!$this->oMgr->checkDateTerm($this->request['start_date'], $this->request['end_date'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "利用期間(開始日)";
                     $param[1] = "利用期間(終了日)";
                     $this->oMgr->setErr('E012', $param);
                 }
             }
             // 送信日
             if ($this->request['reserve_flg'] == "1") {
                 if (!$this->oMgr->checkEmpty($this->request['reflect_date'])) {
                     // エラーメッセージをセット
                     $this->oMgr->setErr('E001', "反映日");
                 } else {
                     if (!$this->oMgr->checkDateFormat($this->request['reflect_date'])) {
                         // エラーメッセージをセット
                         $param = array();
                         $param[0] = "反映日";
                         $param[1] = "yyyy/mm/dd";
                         $this->oMgr->setErr('E004', $param);
                     } else {
                         if (!$this->oMgr->checkDate($this->request['reflect_date'])) {
                             // エラーメッセージをセット
                             $this->oMgr->setErr('E013', "反映日");
                         } else {
                             list($reflect_y, $reflect_m, $reflect_d) = explode("/", $this->request['reflect_date']);
                             $reflect_date = sprintf("%04d-%02d-%02d", $reflect_y, $reflect_m, $reflect_d);
                             // 即時反映の日付がセットされた場合
                             if (strtotime(date('Y-m-d')) >= strtotime($reflect_date)) {
                                 if ($this->request['edit_mode'] == 'reserve') {
                                     $this->oMgr->pushError("即時反映する場合は予約取消後に通常の編集を行ってください。");
                                 } else {
                                     $this->oMgr->pushError("反映日には未来の日付を入力してください。");
                                 }
                             }
                         }
                     }
                 }
             }
             // エラーがあればヘッダ用の基本情報をとっておく
             if (sizeof($this->oMgr->aryErrMsg) > 0) {
                 $aryTmp = $this->oMgr->getUserBaseData($this->request['user_id']);
                 $this->setOutputData($aryTmp);
             }
             break;
         case 'mail':
             break;
         case 'his':
             // 送信日
             if ($this->request['edit_mode'] == 'history') {
                 // チェックしない
                 break;
             }
             $this->request['staffcode'] = string::zen2han($this->request['staffcode']);
             $this->request['kananame'] = string::han2zen($this->request['kananame']);
             $this->request['password'] = string::zen2han($this->request['password']);
             $this->request['appcode'] = string::zen2han($this->request['appcode']);
             if ($this->request['immediate_flg'] == "1") {
                 // チェックしない
             } else {
                 if (!$this->oMgr->checkEmpty($this->request['send_date'])) {
                     // エラーメッセージをセット
                     $this->oMgr->setErr('E001', "反映日");
                 } else {
                     if (!$this->oMgr->checkDateFormat($this->request['send_date'])) {
                         // エラーメッセージをセット
                         $param = array();
                         $param[0] = "反映日";
                         $param[1] = "yyyy/mm/dd";
                         $this->oMgr->setErr('E004', $param);
                     } else {
                         if (!$this->oMgr->checkDate($this->request['send_date'])) {
                             // エラーメッセージをセット
                             $this->oMgr->setErr('E013', "反映日");
                         } else {
                             list($send_y, $send_m, $send_d) = explode("/", $this->request['send_date']);
                             $send_date = sprintf("%04d-%02d-%02d", $send_y, $send_m, $send_d);
                             // 即時反映の日付がセットされた場合
                             if (strtotime(date('Y-m-d')) >= strtotime($send_date)) {
                                 if ($this->request['edit_mode'] == 'reserve') {
                                     $this->oMgr->pushError("即時反映する場合は予約取消後に通常の編集を行ってください。");
                                 } else {
                                     $this->oMgr->pushError("反映日には未来の日付を入力してください。");
                                 }
                             }
                         }
                     }
                 }
             }
             if ($this->request['edit_mode'] == "" || $this->request['edit_mode'] == 'reserve') {
                 // ログインID
                 if (!$this->oMgr->checkEmpty($this->request['staffcode'])) {
                     $this->oMgr->setErr('E001', "ログインID");
                 } else {
                     if (!string::checkNumber($this->request['staffcode'], 8)) {
                         // エラーメッセージをセット
                         $param = array();
                         $param[0] = "ログインID";
                         $param[1] = "半角数字8桁";
                         $this->oMgr->setErr('E004', $param);
                     } else {
                         if ($this->oMgr->existsStaffcode($this->request['staffcode'], $this->request['user_id'])) {
                             $this->oMgr->setErr('E017', "ログインID");
                         }
                     }
                 }
             }
             // 漢字氏名
             $rtn = "";
             if (!$this->oMgr->checkEmpty($this->request['kanjiname'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "漢字氏名");
             } else {
                 if (!string::chkJIS3over($this->request['kanjiname'], &$rtn)) {
                     $param = array();
                     $param[0] = "漢字氏名";
                     $param[1] = $rtn;
                     $this->oMgr->setErr('E019', $param);
                 }
             }
             // カナ姓
             $kananame = str_replace(" ", "", $this->request['kananame']);
             if (!$this->oMgr->checkEmpty($kananame)) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "カナ氏名");
             } else {
                 if (!string::chackKatakana3($kananame)) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = 'カナ氏名';
                     $param[1] = 'カタカナ';
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // HISパスワード
             if (!$this->oMgr->checkEmpty($this->request['password'])) {
                 // 任意
             } else {
                 //if (!string::checkAlphanumWide($password, 6, 10) || !ereg("[0-9]", $password) || !ereg("[a-z]", $password) || !ereg("[A-Z]", $password))
                 if (!string::checkAlphanumWide($this->request['password'], 4, 10)) {
                     $param = array();
                     $param[0] = "HISパスワード";
                     $param[1] = "半角英数字4~10文字";
                     // エラーメッセージをセット
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // 部署
             if (!$this->oMgr->checkEmpty($this->request['wardcode'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "部署");
             }
             // 職種
             if (!$this->oMgr->checkEmpty($this->request['professioncode'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "職種");
             }
             // 役職
             if (!$this->oMgr->checkEmpty($this->request['gradecode'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "役職");
             }
             // 診療科
             if (!$this->oMgr->checkEmpty($this->request['deptcode'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E007', "診療科");
             }
             // 予約項目コード
             if (!$this->oMgr->checkEmpty($this->request['appcode'])) {
                 // 任意
             } else {
                 if (!string::checkAlphaNum($this->request['appcode'], 5)) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "予約項目コード";
                     $param[1] = "半角英数字5桁";
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             $has_validdate_err = false;
             // 有効期間
             if (!$this->oMgr->checkEmpty($this->request['validstartdate'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "有効期間(開始日)");
                 $has_validdate_err = true;
             } else {
                 if (!$this->oMgr->checkDateFormat($this->request['validstartdate'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "有効期間(開始日)";
                     $param[1] = "yyyy/mm/dd";
                     $this->oMgr->setErr('E004', $param);
                     $has_validdate_err = true;
                 } else {
                     if (!$this->oMgr->checkDate($this->request['validstartdate'])) {
                         // エラーメッセージをセット
                         $this->oMgr->setErr('E013', "有効期間(開始日)");
                         $has_validdate_err = true;
                     }
                 }
             }
             // 有効期間
             if (!$this->oMgr->checkEmpty($this->request['validenddate'])) {
                 // エラーメッセージをセット
                 $this->oMgr->setErr('E001', "有効期間(終了日)");
                 $has_validdate_err = true;
             } else {
                 if (!$this->oMgr->checkDateFormat($this->request['validenddate'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "有効期間(終了日)";
                     $param[1] = "yyyy/mm/dd";
                     $this->oMgr->setErr('E004', $param);
                     $has_validdate_err = true;
                 } else {
                     if (!$this->oMgr->checkDate($this->request['validenddate'])) {
                         // エラーメッセージをセット
                         $this->oMgr->setErr('E013', "有効期間(終了日)");
                         $has_validdate_err = true;
                     }
                 }
             }
             if (!$has_validdate_err) {
                 if (!$this->oMgr->checkDateTerm($this->request['validstartdate'], $this->request['validenddate'])) {
                     // エラーメッセージをセット
                     $param = array();
                     $param[0] = "有効期間(開始日)";
                     $param[1] = "有効期間(終了日)";
                     $this->oMgr->setErr('E012', $param);
                 }
             }
             // エラーがあればヘッダ用の基本情報をとっておく
             if (sizeof($this->oMgr->aryErrMsg) > 0) {
                 $this->setHisErrorPageData();
             }
             break;
         case 'salary':
             // パスワード
             $this->request['salary_passwd'] = string::zen2han($this->request['salary_passwd']);
             if (!$this->oMgr->checkEmpty($this->request['salary_passwd'])) {
                 $this->oMgr->setErr('E001', "パスワード");
             } else {
                 $passwd = $this->request['salary_passwd'];
                 if (!string::checkAlphanumWide($passwd, 6, 20) || !ereg("[0-9a-zA-Z]", $passwd)) {
                     $param = array();
                     $param[0] = "パスワード";
                     $param[1] = "数字、英字大文字、英字小文字を使用し、6~20文字";
                     // エラーメッセージをセット
                     $this->oMgr->setErr('E004', $param);
                 }
             }
             // エラーがあればヘッダ用の基本情報をとっておく
             if (sizeof($this->oMgr->aryErrMsg) > 0) {
                 // 共通ヘッダの情報作成
                 $this->setCommonHeaderData();
             }
             break;
         case 'card':
             break;
     }
     /*
     
     
     
     // HIS連携する場合
     if ($this->request['his_flg'] == '1')
     {
     	$this->request['staffcode'] = string::zen2han($this->request['staffcode']);
     	$this->request['kananame'] = string::han2zen($this->request['kananame']);
     	$this->request['password'] = string::zen2han($this->request['password']);
     	$this->request['appcode'] = string::zen2han($this->request['appcode']);
     	$this->checkHisData();
     }
     
     // 複数HIS連携データがある場合
     if (is_array($this->request['sub_his_flg']))
     {
     	foreach ($this->request['sub_his_flg'] AS $no => $val)
     	{
     		if ($val != "1")
     		{
     			continue;
     		}
     
     		$this->request['sub_staffcode'][$no] = string::zen2han($this->request['sub_staffcode'][$no]);
     		$this->request['sub_kananame'][$no] = string::han2zen($this->request['sub_kananame'][$no]);
     		$this->request['sub_password'][$no] = string::zen2han($this->request['sub_password'][$no]);
     		$this->request['sub_appcode'][$no] = string::zen2han($this->request['sub_appcode'][$no]);
     		$this->checkHisData($no);
     	}
     }
     */
     // エラーなし
     if (sizeof($this->oMgr->aryErrMsg) == 0) {
         return true;
     }
     // エラー発生
     $this->errMsg = $this->oMgr->getErrMsg();
     return false;
 }