annotate changeReservation.php @ 153:4099ae0393eb

mod: do-record.shラッパを追加(まだ途中)
author epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
date Sun, 28 Mar 2010 22:56:00 +0900
parents 481e789605e3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
1 <?php
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
2 include_once('config.php');
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
3 include_once(INSTALL_PATH."/DBRecord.class.php");
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
4 include_once(INSTALL_PATH."/reclib.php");
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
5 include_once(INSTALL_PATH."/Settings.class.php");
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
6
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
7 $settings = Settings::factory();
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
8
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
9 if( !isset( $_POST['reserve_id'] ) ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
10 exit("Error: ID絎障" );
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
11 }
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
12 $reserve_id = $_POST['reserve_id'];
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
13
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
14 $dbh = false;
49
f8f6e0d3acaf fix: bug
Sushi-k <epgrec@park.mda.or.jp>
parents: 37
diff changeset
15 if( $settings->mediatomb_update == 1 ) {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
16 $dbh = @mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass );
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
17 if( $dbh !== false ) {
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
18 $sqlstr = "use ".$settings->db_name;
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
19 @mysql_query( $sqlstr );
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
20 $sqlstr = "set NAME utf8";
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
21 @mysql_query( $sqlstr );
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
22 }
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
23 }
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
24
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
25 try {
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
26 $rec = new DBRecord(RESERVE_TBL, "id", $reserve_id );
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
27
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
28 if( isset( $_POST['title'] ) ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
29 $rec->title = trim( $_POST['title'] );
142
481e789605e3 mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 49
diff changeset
30 $rec->dirty = 1;
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
31 if( ($dbh !== false) && ($rec->complete == 1) ) {
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
32 $title = trim( mysql_real_escape_string($_POST['title']));
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
33 $title .= "(".date("Y/m/d", toTimestamp($rec->starttime)).")";
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
34 $sqlstr = "update mt_cds_object set dc_title='".$title."' where metadata regexp 'epgrec:id=".$reserve_id."$'";
37
e5f9aa34d06f change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents: 27
diff changeset
35 @mysql_query( $sqlstr );
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
36 }
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
37 }
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
38
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
39 if( isset( $_POST['description'] ) ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
40 $rec->description = trim( $_POST['description'] );
142
481e789605e3 mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 49
diff changeset
41 $rec->dirty = 1;
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
42 if( ($dbh !== false) && ($rec->complete == 1) ) {
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
43 $desc = "dc:description=".trim( mysql_real_escape_string($_POST['description']));
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
44 $desc .= "&epgrec:id=".$reserve_id;
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
45 $sqlstr = "update mt_cds_object set metadata='".$desc."' where metadata regexp 'epgrec:id=".$reserve_id."$'";
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
46 @mysql_query( $sqlstr );
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
47 }
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
48 }
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
49 }
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
50 catch( Exception $e ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
51 exit("Error: ". $e->getMessage());
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
52 }
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
53
26
82c1375ddb4a modified: changeReservation.php
yoneda <epgrec@park.mda.or.jp>
parents: 25
diff changeset
54 exit("complete");
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
55
142
481e789605e3 mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 49
diff changeset
56 ?>