1
|
1 <?php
|
|
2 include_once('config.php');
|
|
3 include_once( INSTALL_PATH . "/DBRecord.class.php" );
|
|
4 include_once( INSTALL_PATH . "/Smarty/Smarty.class.php" );
|
|
5 include_once( INSTALL_PATH . "/reclib.php" );
|
|
6
|
|
7 if( ! isset( $_GET['program_id'] ) ) exit("Error: 番組IDが指定されていません" );
|
|
8 $program_id = $_GET['program_id'];
|
|
9
|
|
10 try {
|
|
11 $prec = new DBRecord( TBL_PREFIX.PROGRAM_TBL, "id", $program_id );
|
|
12
|
|
13 sscanf( $prec->starttime, "%4d-%2d-%2d %2d:%2d:%2d", $syear, $smonth, $sday, $shour, $smin, $ssec );
|
|
14 sscanf( $prec->endtime, "%4d-%2d-%2d %2d:%2d:%2d", $eyear, $emonth, $eday, $ehour, $emin, $esec );
|
|
15
|
|
16 $crecs = DBRecord::createRecords( TBL_PREFIX.CATEGORY_TBL );
|
|
17 $cats = array();
|
|
18 foreach( $crecs as $crec ) {
|
|
19 $cat = array();
|
|
20 $cat['id'] = $crec->id;
|
|
21 $cat['name'] = $crec->name_jp;
|
|
22 $cat['selected'] = $prec->category_id == $cat['id'] ? "selected" : "";
|
|
23
|
|
24 array_push( $cats , $cat );
|
|
25 }
|
|
26
|
|
27 $smarty = new Smarty();
|
|
28
|
|
29 $smarty->assign( "syear", $syear );
|
|
30 $smarty->assign( "smonth", $smonth );
|
|
31 $smarty->assign( "sday", $sday );
|
|
32 $smarty->assign( "shour", $shour );
|
|
33 $smarty->assign( "smin" ,$smin );
|
|
34 $smarty->assign( "eyear", $eyear );
|
|
35 $smarty->assign( "emonth", $emonth );
|
|
36 $smarty->assign( "eday", $eday );
|
|
37 $smarty->assign( "ehour", $ehour );
|
|
38 $smarty->assign( "emin" ,$emin );
|
|
39
|
|
40 $smarty->assign( "type", $prec->type );
|
|
41 $smarty->assign( "channel", $prec->channel );
|
|
42 $smarty->assign( "channel_id", $prec->channel_id );
|
|
43 $smarty->assign( "record_mode" , $RECORD_MODE );
|
|
44
|
|
45 $smarty->assign( "title", $prec->title );
|
|
46 $smarty->assign( "description", $prec->description );
|
|
47
|
|
48 $smarty->assign( "cats" , $cats );
|
|
49
|
|
50 $smarty->assign( "program_id", $prec->id );
|
|
51
|
|
52 $smarty->assign( "sitetitle" , "詳細予約" );
|
|
53
|
|
54 $smarty->display("reservation.html");
|
|
55 }
|
|
56 catch( exception $e ) {
|
|
57 exit( "Error:". $e->getMessage() );
|
|
58 }
|
|
59 ?>
|