Mercurial > epgrec.yaz
comparison cancelReservation.php @ 161:84220382fea8
mod: ?????????????????????????????
| author | epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp> |
|---|---|
| date | Sun, 04 Apr 2010 17:10:17 +0900 |
| parents | 42f6eb738567 |
| children | c6c6bd734f18 |
comparison
equal
deleted
inserted
replaced
| 157:00b5ed67d792 | 161:84220382fea8 |
|---|---|
| 6 include_once( INSTALL_PATH . '/Settings.class.php' ); | 6 include_once( INSTALL_PATH . '/Settings.class.php' ); |
| 7 | 7 |
| 8 $program_id = 0; | 8 $program_id = 0; |
| 9 $reserve_id = 0; | 9 $reserve_id = 0; |
| 10 $settings = Settings::factory(); | 10 $settings = Settings::factory(); |
| 11 $rec = null; | |
| 12 $path = ""; | |
| 11 | 13 |
| 12 if( isset($_GET['program_id'])) { | 14 if( isset($_GET['program_id'])) { |
| 13 $program_id = $_GET['program_id']; | 15 $program_id = $_GET['program_id']; |
| 14 } | 16 } |
| 15 else if(isset($_GET['reserve_id'])) { | 17 else if(isset($_GET['reserve_id'])) { |
| 16 $reserve_id = $_GET['reserve_id']; | 18 $reserve_id = $_GET['reserve_id']; |
| 17 try { | 19 try { |
| 18 $rec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); | 20 $rec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); |
| 19 $program_id = $rec->program_id; | 21 $program_id = $rec->program_id; |
| 20 | |
| 21 if( isset( $_GET['delete_file'] ) ) { | |
| 22 if( $_GET['delete_file'] == 1 ) { | |
| 23 // ファイルを削除 | |
| 24 if( file_exists( INSTALL_PATH."/".$settings->spool."/".$rec->path ) ) { | |
| 25 @unlink(INSTALL_PATH."/".$settings->spool."/".$rec->path); | |
| 26 @unlink(INSTALL_PATH."/".$settings->thumbs."/".$rec->path.".jpg"); | |
| 27 } | |
| 28 } | |
| 29 } | |
| 30 } | 22 } |
| 31 catch( Exception $e ) { | 23 catch( Exception $e ) { |
| 32 // 無視 | 24 // 無視 |
| 33 } | 25 } |
| 34 } | 26 } |
| 35 | |
| 36 | |
| 37 | 27 |
| 38 // 手動取り消しのときには、その番組を自動録画対象から外す | 28 // 手動取り消しのときには、その番組を自動録画対象から外す |
| 39 if( $program_id ) { | 29 if( $program_id ) { |
| 40 try { | 30 try { |
| 41 $rec = new DBRecord(PROGRAM_TBL, "id", $program_id ); | 31 $rec = new DBRecord(PROGRAM_TBL, "id", $program_id ); |
| 43 } | 33 } |
| 44 catch( Exception $e ) { | 34 catch( Exception $e ) { |
| 45 // 無視 | 35 // 無視 |
| 46 } | 36 } |
| 47 } | 37 } |
| 38 if( $rec == null ) exit( "Error: 予約レコードが取得出来ません" ); | |
| 39 | |
| 40 if( isset( $_GET['delete_file'] ) ) { | |
| 41 if( $_GET['delete_file'] == 1 ) { | |
| 42 $path = INSTALL_PATH."/".$settings->spool."/".$rec->path; | |
| 43 } | |
| 44 } | |
| 45 | |
| 48 | 46 |
| 49 // 予約取り消し実行 | 47 // 予約取り消し実行 |
| 50 try { | 48 try { |
| 51 Reservation::cancel( $reserve_id, $program_id ); | 49 Reservation::cancel( $reserve_id, $program_id ); |
| 50 if( isset( $_GET['delete_file'] ) ) { | |
| 51 if( $_GET['delete_file'] == 1 ) { | |
| 52 // ファイルを削除 | |
| 53 if( file_exists( $path) ) { | |
| 54 @unlink($path); | |
| 55 @unlink($path.".jpg"); | |
| 56 } | |
| 57 } | |
| 58 } | |
| 52 } | 59 } |
| 53 catch( Exception $e ) { | 60 catch( Exception $e ) { |
| 54 exit( "Error" . $e->getMessage() ); | 61 exit( "Error" . $e->getMessage() ); |
| 55 } | 62 } |
| 56 exit(); | 63 exit(); |
