Mercurial > epgrec.yaz
diff 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 |
line wrap: on
line diff
--- a/cancelReservation.php Tue Mar 30 19:00:39 2010 +0900 +++ b/cancelReservation.php Sun Apr 04 17:10:17 2010 +0900 @@ -8,6 +8,8 @@ $program_id = 0; $reserve_id = 0; $settings = Settings::factory(); +$rec = null; +$path = ""; if( isset($_GET['program_id'])) { $program_id = $_GET['program_id']; @@ -17,24 +19,12 @@ try { $rec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); $program_id = $rec->program_id; - - if( isset( $_GET['delete_file'] ) ) { - if( $_GET['delete_file'] == 1 ) { - // ファイルを削除 - if( file_exists( INSTALL_PATH."/".$settings->spool."/".$rec->path ) ) { - @unlink(INSTALL_PATH."/".$settings->spool."/".$rec->path); - @unlink(INSTALL_PATH."/".$settings->thumbs."/".$rec->path.".jpg"); - } - } - } } catch( Exception $e ) { // 無視 } } - - // 手動取り消しのときには、その番組を自動録画対象から外す if( $program_id ) { try { @@ -45,10 +35,27 @@ // 無視 } } +if( $rec == null ) exit( "Error: 予約レコードが取得出来ません" ); + +if( isset( $_GET['delete_file'] ) ) { + if( $_GET['delete_file'] == 1 ) { + $path = INSTALL_PATH."/".$settings->spool."/".$rec->path; + } +} + // 予約取り消し実行 try { Reservation::cancel( $reserve_id, $program_id ); + if( isset( $_GET['delete_file'] ) ) { + if( $_GET['delete_file'] == 1 ) { + // ファイルを削除 + if( file_exists( $path) ) { + @unlink($path); + @unlink($path.".jpg"); + } + } + } } catch( Exception $e ) { exit( "Error" . $e->getMessage() );
