Mercurial > epgrec.yaz
annotate customReservation.php @ 37:e5f9aa34d06f
change: modify all script for web base setting
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 28 Jul 2009 00:00:04 +0900 |
parents | f3bf1be1a51b |
children | 8965ef108821 |
rev | line source |
---|---|
1 | 1 <?php |
2 include_once('config.php'); | |
3 include_once( INSTALL_PATH . "/DBRecord.class.php" ); | |
4 include_once( INSTALL_PATH . "/reclib.php" ); | |
5 include_once( INSTALL_PATH . "/Reservation.class.php" ); | |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
23
diff
changeset
|
6 include_once( INSTALL_PATH . "/Settings.class.php" ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
23
diff
changeset
|
7 |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
23
diff
changeset
|
8 $settings = Settings::factory(); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
23
diff
changeset
|
9 |
1 | 10 |
11 $program_id = 0; | |
12 if( isset( $_POST['program_id'] ) ) $program_id = $_POST['program_id']; | |
13 | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
14 |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
15 if(!( |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
16 isset($_POST['shour']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
17 isset($_POST['smin']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
18 isset($_POST['smonth']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
19 isset($_POST['sday']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
20 isset($_POST['syear']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
21 isset($_POST['ehour']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
22 isset($_POST['emin']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
23 isset($_POST['emonth']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
24 isset($_POST['eday']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
25 isset($_POST['eyear']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
26 isset($_POST['channel_id']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
27 isset($_POST['title']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
28 isset($_POST['description']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
29 isset($_POST['category_id']) && |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
30 isset($_POST['record_mode'])) |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
31 ) { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
32 exit("Error:予約に必要な値がセットされていません"); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
33 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
34 |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
35 |
1 | 36 $start_time = @mktime( $_POST['shour'], $_POST['smin'], 0, $_POST['smonth'], $_POST['sday'], $_POST['syear'] ); |
37 if( ($start_time < 0) || ($start_time === false) ) { | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
38 exit("Error:開始時間が不正です" ); |
1 | 39 } |
40 | |
41 $end_time = @mktime( $_POST['ehour'], $_POST['emin'], 0, $_POST['emonth'], $_POST['eday'], $_POST['eyear'] ); | |
42 if( ($end_time < 0) || ($end_time === false) ) { | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
43 exit("Error:終了時間が不正です" ); |
1 | 44 } |
45 | |
46 $channel_id = $_POST['channel_id']; | |
47 $title = $_POST['title']; | |
48 $description = $_POST['description']; | |
49 $category_id = $_POST['category_id']; | |
50 $mode = $_POST['record_mode']; | |
51 | |
52 | |
53 $rval = 0; | |
54 try{ | |
55 $rval = Reservation::custom( | |
56 toDatetime($start_time), | |
57 toDatetime($end_time), | |
58 $channel_id, | |
59 $title, | |
60 $description, | |
61 $category_id, | |
62 $program_id, | |
63 0, // 自動録画 | |
64 $mode // 録画モード | |
65 ); | |
66 } | |
67 catch( Exception $e ) { | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
68 exit( "Error:".$e->getMessage() ); |
1 | 69 } |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
70 exit( "".$program_id ); |
1 | 71 ?> |