コード例 #1
0
ファイル: prc.php プロジェクト: argonaise/cmireserve
 case "prc_delete_check":
     $table = $DB->table("roomreserve");
     list($tel) = $table->selectfetch("", "rr_phone", "rr_no='" . $_GET["rr_no"] . "'");
     if ($tel == trim($_GET["tel"])) {
         $table->update("rr_deleted='1', rr_update_date=now(), rr_update_ip='" . $_SERVER["REMOTE_ADDR"] . "'", "rr_no='" . $_GET["rr_no"] . "'");
         print json_encode(array("result" => "삭제 성공", "message" => "예약이 삭제되었습니다"));
         exit;
     } else {
         print json_encode(array("result" => "삭제 실패", "message" => "예약 시 입력한 전화번호와 일치하지 않습니다"));
         exit;
     }
     break;
 case "prc_write":
     // 겹치는 시간이 없으면 바로 정보 등록!
     $table = $DB->table("roomreserve");
     $row = new rowedit();
     $time_begin = time_format($_POST["rr_time_begin"]);
     $time_end = time_format($_POST["rr_time_end"]);
     if (sizeof($_POST["rr_repeat_week"]) > 0) {
         // 먼저 등록할 일자들을 뽑음..
         $dates_to_check = array();
         list($y, $m, $d) = explode("-", $_POST["rr_repeat_begin"]);
         $s_begin = mktime(0, 0, 0, $m, $d, $y);
         list($y, $m, $d) = explode("-", $_POST["rr_repeat_end"]);
         $s_end = mktime(0, 0, 0, $m, $d, $y);
         $w = array();
         foreach ($_POST["rr_repeat_week"] as $week) {
             switch ($week) {
                 case "월":
                     $w["week_1"] = "true";
                     break;
コード例 #2
0
ファイル: prc.php プロジェクト: argonaise/cmireserve
     $row = new rowedit();
     $row->init();
     $row->data("di_ip", $_POST["di_ip"]);
     $row->data("di_room", $_POST["di_room"]);
     $row->data("di_update_date", "FN:now()");
     $table->insert($row->values(), $row->fields());
     print "<SCRIPT> location.href='index.php?mode=device' </SCRIPT>";
     break;
 case "prc_delip":
     $table = $DB->table("deviceinfo");
     $table->delete("di_no='" . $_GET["di_no"] . "'");
     print "<SCRIPT> location.href='index.php?mode=device' </SCRIPT>";
     break;
 case "prc_addnotice":
     $table = $DB->table("noticeinfo");
     $row = new rowedit();
     $row->init();
     $row->data("ni_active", "FN:1");
     $row->data("ni_subject", $_POST["ni_subject"]);
     $row->data("ni_seq", "FN:IF(max(ni_seq) is NULL,1,max(ni_seq)+1)");
     $row->data("ni_update_date", "FN:now()");
     $row->data("ni_update_ip", $_SERVER["REMOTE_ADDR"]);
     $table->query("insert into noticeinfo (" . $row->fields() . ") select " . $row->values() . " from noticeinfo");
     //$table->lastsql();
     print "<SCRIPT> location.href='index.php?mode=notice' </SCRIPT>";
     break;
 case "prc_delnotice":
     $table = $DB->table("noticeinfo");
     $table->delete("ni_no='" . $_GET["ni_no"] . "'");
     print "<SCRIPT> location.href='index.php?mode=notice' </SCRIPT>";
     break;