annotate reservationform.php @ 139:3303335825a3

drop video/index.html
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sun, 21 Mar 2010 05:16:43 +0900
parents 8965ef108821
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
1 <?php
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
2 include_once('config.php');
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
3 include_once( INSTALL_PATH . "/DBRecord.class.php" );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
4 include_once( INSTALL_PATH . "/Smarty/Smarty.class.php" );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
5 include_once( INSTALL_PATH . "/reclib.php" );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
6
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
7 if( ! isset( $_GET['program_id'] ) ) exit("Error: 番組IDが指定されていません" );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
8 $program_id = $_GET['program_id'];
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
9
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
10 try {
39
8965ef108821 change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents: 23
diff changeset
11 $prec = new DBRecord( PROGRAM_TBL, "id", $program_id );
23
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
12
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
13 sscanf( $prec->starttime, "%4d-%2d-%2d %2d:%2d:%2d", $syear, $smonth, $sday, $shour, $smin, $ssec );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
14 sscanf( $prec->endtime, "%4d-%2d-%2d %2d:%2d:%2d", $eyear, $emonth, $eday, $ehour, $emin, $esec );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
15
39
8965ef108821 change: modify all scripts for web base setting.
Sushi-k <epgrec@park.mda.or.jp>
parents: 23
diff changeset
16 $crecs = DBRecord::createRecords( CATEGORY_TBL );
23
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
17 $cats = array();
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
18 foreach( $crecs as $crec ) {
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
19 $cat = array();
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
20 $cat['id'] = $crec->id;
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
21 $cat['name'] = $crec->name_jp;
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
22 $cat['selected'] = $prec->category_id == $cat['id'] ? "selected" : "";
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
23
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
24 array_push( $cats , $cat );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
25 }
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
26
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
27 $smarty = new Smarty();
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
28
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
29 $smarty->assign( "syear", $syear );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
30 $smarty->assign( "smonth", $smonth );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
31 $smarty->assign( "sday", $sday );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
32 $smarty->assign( "shour", $shour );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
33 $smarty->assign( "smin" ,$smin );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
34 $smarty->assign( "eyear", $eyear );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
35 $smarty->assign( "emonth", $emonth );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
36 $smarty->assign( "eday", $eday );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
37 $smarty->assign( "ehour", $ehour );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
38 $smarty->assign( "emin" ,$emin );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
39
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
40 $smarty->assign( "type", $prec->type );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
41 $smarty->assign( "channel", $prec->channel );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
42 $smarty->assign( "channel_id", $prec->channel_id );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
43 $smarty->assign( "record_mode" , $RECORD_MODE );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
44
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
45 $smarty->assign( "title", $prec->title );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
46 $smarty->assign( "description", $prec->description );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
47
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
48 $smarty->assign( "cats" , $cats );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
49
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
50 $smarty->assign( "program_id", $prec->id );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
51
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
52 $smarty->display("reservationform.html");
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
53 }
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
54 catch( exception $e ) {
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
55 exit( "Error:". $e->getMessage() );
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
56 }
f3bf1be1a51b Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
57 ?>