comparison customReservation.php @ 23:f3bf1be1a51b

Change: using ajax in custom reservation method
author yoneda <yoneda@recorder.localnet.mda.or.jp>
date Thu, 23 Jul 2009 23:35:43 +0900
parents f5a9f0eb4858
children e5f9aa34d06f
comparison
equal deleted inserted replaced
22:95629ba1f043 23:f3bf1be1a51b
5 include_once( INSTALL_PATH . "/Reservation.class.php" ); 5 include_once( INSTALL_PATH . "/Reservation.class.php" );
6 6
7 $program_id = 0; 7 $program_id = 0;
8 if( isset( $_POST['program_id'] ) ) $program_id = $_POST['program_id']; 8 if( isset( $_POST['program_id'] ) ) $program_id = $_POST['program_id'];
9 9
10
11 if(!(
12 isset($_POST['shour']) &&
13 isset($_POST['smin']) &&
14 isset($_POST['smonth']) &&
15 isset($_POST['sday']) &&
16 isset($_POST['syear']) &&
17 isset($_POST['ehour']) &&
18 isset($_POST['emin']) &&
19 isset($_POST['emonth']) &&
20 isset($_POST['eday']) &&
21 isset($_POST['eyear']) &&
22 isset($_POST['channel_id']) &&
23 isset($_POST['title']) &&
24 isset($_POST['description']) &&
25 isset($_POST['category_id']) &&
26 isset($_POST['record_mode']))
27 ) {
28 exit("Error:予約に必要な値がセットされていません");
29 }
30
31
10 $start_time = @mktime( $_POST['shour'], $_POST['smin'], 0, $_POST['smonth'], $_POST['sday'], $_POST['syear'] ); 32 $start_time = @mktime( $_POST['shour'], $_POST['smin'], 0, $_POST['smonth'], $_POST['sday'], $_POST['syear'] );
11 if( ($start_time < 0) || ($start_time === false) ) { 33 if( ($start_time < 0) || ($start_time === false) ) {
12 if( $program_id ) jdialog( "開始時間が不正です" , "reservation.php?program_id=".$program_id ); 34 exit("Error:開始時間が不正です" );
13 else jdialog("開始時間が不正です" );
14 } 35 }
15 36
16 $end_time = @mktime( $_POST['ehour'], $_POST['emin'], 0, $_POST['emonth'], $_POST['eday'], $_POST['eyear'] ); 37 $end_time = @mktime( $_POST['ehour'], $_POST['emin'], 0, $_POST['emonth'], $_POST['eday'], $_POST['eyear'] );
17 if( ($end_time < 0) || ($end_time === false) ) { 38 if( ($end_time < 0) || ($end_time === false) ) {
18 if( $program_id ) jdialog( "終了時間が不正です" , "reservation.php?program_id=".$program_id ); 39 exit("Error:終了時間が不正です" );
19 else jdialog("終了時間が不正です" );
20 } 40 }
21 41
22 $channel_id = $_POST['channel_id']; 42 $channel_id = $_POST['channel_id'];
23 $title = $_POST['title']; 43 $title = $_POST['title'];
24 $description = $_POST['description']; 44 $description = $_POST['description'];
39 0, // 自動録画 59 0, // 自動録画
40 $mode // 録画モード 60 $mode // 録画モード
41 ); 61 );
42 } 62 }
43 catch( Exception $e ) { 63 catch( Exception $e ) {
44 if( $progarm_id ) jdialog( $e->getMessage(), "reservation.php?program_id=".$program_id ); 64 exit( "Error:".$e->getMessage() );
45 else jdialog( $e->getMessage() );
46 } 65 }
47 66 exit( "".$program_id );
48 jdialog("予約しました:job番号".$rval);
49
50 ?> 67 ?>