annotate changeReservation.php @ 106:57676bb30f64

add: 時間帯で絞り込みを追加
author Sushi-k <epgrec@park.mda.or.jp>
date Mon, 08 Mar 2010 18:07:19 +0900
parents f8f6e0d3acaf
children 481e789605e3
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'] );
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
30 if( ($dbh !== false) && ($rec->complete == 1) ) {
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
31 $title = trim( mysql_real_escape_string($_POST['title']));
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
32 $title .= "(".date("Y/m/d", toTimestamp($rec->starttime)).")";
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
33 $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
34 @mysql_query( $sqlstr );
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
35 }
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
36 }
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 if( isset( $_POST['description'] ) ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
39 $rec->description = trim( $_POST['description'] );
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
40 if( ($dbh !== false) && ($rec->complete == 1) ) {
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
41 $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
42 $desc .= "&epgrec:id=".$reserve_id;
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
43 $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
44 @mysql_query( $sqlstr );
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
45 }
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
46 }
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
47 }
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
48 catch( Exception $e ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
49 exit("Error: ". $e->getMessage());
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
50 }
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
51
26
82c1375ddb4a modified: changeReservation.php
yoneda <epgrec@park.mda.or.jp>
parents: 25
diff changeset
52 exit("complete");
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
53
49
f8f6e0d3acaf fix: bug
Sushi-k <epgrec@park.mda.or.jp>
parents: 37
diff changeset
54 ?>