annotate cancelReservation.php @ 99:10b2306693d9

remove limit for maximum hours to show
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 04 Mar 2010 17:09:23 +0900
parents e5f9aa34d06f
children 42f6eb738567
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 . '/Reservation.class.php' );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
5 include_once( INSTALL_PATH . '/reclib.php' );
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 14
diff changeset
6 include_once( INSTALL_PATH . '/Settings.class.php' );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
7
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
8 $program_id = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
9 $reserve_id = 0;
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 14
diff changeset
10 $settings = Settings::factory();
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
11
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
12 if( isset($_GET['program_id'])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
13 $program_id = $_GET['program_id'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
14 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
15 else if(isset($_GET['reserve_id'])) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
16 $reserve_id = $_GET['reserve_id'];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
17 try {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 14
diff changeset
18 $rec = new DBRecord( RESERVE_TBL, "id" , $reserve_id );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
19 $program_id = $rec->program_id;
14
bbbc4f1ecf1d added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
20
bbbc4f1ecf1d added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
21 if( isset( $_GET['delete_file'] ) ) {
bbbc4f1ecf1d added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
22 if( $_GET['delete_file'] == 1 ) {
bbbc4f1ecf1d added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
23 // ファイルを削除
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 14
diff changeset
24 if( file_exists( INSTALL_PATH."/".$settings->spool."/".$rec->path ) ) {
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 14
diff changeset
25 @unlink(INSTALL_PATH."/".$settings->spool."/".$rec->path);
14
bbbc4f1ecf1d added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
26 }
bbbc4f1ecf1d added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
27 }
bbbc4f1ecf1d added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
28 }
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
29 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
30 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
31 // 無視
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
32 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
33 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
34
14
bbbc4f1ecf1d added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
35
bbbc4f1ecf1d added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents: 1
diff changeset
36
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
37 // 手動取り消しのときには、その番組を自動録画対象から外す
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
38 if( $program_id ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
39 try {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 14
diff changeset
40 $rec = new DBRecord(PROGRAM_TBL, "id", $program_id );
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
41 $rec->autorec = 0;
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
42 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
43 catch( Exception $e ) {
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 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
46 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
47
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
48 // 予約取り消し実行
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
49 try {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
50 Reservation::cancel( $reserve_id, $program_id );
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 catch( Exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
53 exit( "Error" . $e->getMessage() );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
54 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
55 exit();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
56 ?>