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