Mercurial > epgrec.yaz
annotate cancelReservation.php @ 14:bbbc4f1ecf1d
added: remove video with real file.
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 14 Jul 2009 20:11:42 +0900 |
parents | f5a9f0eb4858 |
children | e5f9aa34d06f |
rev | line source |
---|---|
1 | 1 <?php |
2 include_once('config.php'); | |
3 include_once( INSTALL_PATH . '/DBRecord.class.php' ); | |
4 include_once( INSTALL_PATH . '/Reservation.class.php' ); | |
5 include_once( INSTALL_PATH . '/reclib.php' ); | |
6 | |
7 $program_id = 0; | |
8 $reserve_id = 0; | |
9 | |
10 if( isset($_GET['program_id'])) { | |
11 $program_id = $_GET['program_id']; | |
12 } | |
13 else if(isset($_GET['reserve_id'])) { | |
14 $reserve_id = $_GET['reserve_id']; | |
15 try { | |
16 $rec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id" , $reserve_id ); | |
17 $program_id = $rec->program_id; | |
14
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
18 |
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
19 if( isset( $_GET['delete_file'] ) ) { |
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
20 if( $_GET['delete_file'] == 1 ) { |
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
21 // ファイルを削除 |
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
22 if( file_exists( INSTALL_PATH."/".SPOOL."/".$rec->path ) ) { |
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
23 @unlink(INSTALL_PATH."/".SPOOL."/".$rec->path); |
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
24 } |
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
25 } |
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
26 } |
1 | 27 } |
28 catch( Exception $e ) { | |
29 // 無視 | |
30 } | |
31 } | |
32 | |
14
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
33 |
bbbc4f1ecf1d
added: remove video with real file.
Sushi-k <epgrec@park.mda.or.jp>
parents:
1
diff
changeset
|
34 |
1 | 35 // 手動取り消しのときには、その番組を自動録画対象から外す |
36 if( $program_id ) { | |
37 try { | |
38 $rec = new DBRecord(TBL_PREFIX.PROGRAM_TBL, "id", $program_id ); | |
39 $rec->autorec = 0; | |
40 } | |
41 catch( Exception $e ) { | |
42 // 無視 | |
43 } | |
44 } | |
45 | |
46 // 予約取り消し実行 | |
47 try { | |
48 Reservation::cancel( $reserve_id, $program_id ); | |
49 } | |
50 catch( Exception $e ) { | |
51 exit( "Error" . $e->getMessage() ); | |
52 } | |
53 exit(); | |
54 ?> |