annotate customReservation.php @ 136:6754b6aa50cf

mod: ログ機能のためにconfig.phpを変更
author epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
date Sun, 21 Mar 2010 00:00:58 +0900
parents 8965ef108821
children 481e789605e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1 <?php
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
2 include_once('config.php');
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
3 include_once( INSTALL_PATH . "/DBRecord.class.php" );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
4 include_once( INSTALL_PATH . "/reclib.php" );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
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
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
10 $program_id = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
11 if( isset( $_POST['program_id'] ) ) $program_id = $_POST['program_id'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
12
23
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
13
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
14 if(!(
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
15 isset($_POST['shour']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
16 isset($_POST['smin']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
17 isset($_POST['smonth']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
18 isset($_POST['sday']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
19 isset($_POST['syear']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
20 isset($_POST['ehour']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
21 isset($_POST['emin']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
22 isset($_POST['emonth']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
23 isset($_POST['eday']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
24 isset($_POST['eyear']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
25 isset($_POST['channel_id']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
26 isset($_POST['title']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
27 isset($_POST['description']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
28 isset($_POST['category_id']) &&
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
29 isset($_POST['record_mode']))
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 exit("Error:篋膣綽荀ゃ祉障");
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
32 }
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
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
35 $start_time = @mktime( $_POST['shour'], $_POST['smin'], 0, $_POST['smonth'], $_POST['sday'], $_POST['syear'] );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
36 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
37 exit("Error:紮筝罩cс" );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
38 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
39
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
40 $end_time = @mktime( $_POST['ehour'], $_POST['emin'], 0, $_POST['emonth'], $_POST['eday'], $_POST['eyear'] );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
41 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
42 exit("Error:腟篋筝罩cс" );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
43 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
44
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
45 $channel_id = $_POST['channel_id'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
46 $title = $_POST['title'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
47 $description = $_POST['description'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
48 $category_id = $_POST['category_id'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
49 $mode = $_POST['record_mode'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
50
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
51
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
52 $rval = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
53 try{
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
54 $rval = Reservation::custom(
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
55 toDatetime($start_time),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
56 toDatetime($end_time),
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
57 $channel_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
58 $title,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
59 $description,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
60 $category_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
61 $program_id,
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
62 0, // 牙
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
63 $mode // 牙祉≪若
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
64 );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
65 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
66 catch( Exception $e ) {
23
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
67 exit( "Error:".$e->getMessage() );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
68 }
23
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents: 1
diff changeset
69 exit( "".$program_id );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
70 ?>