annotate changeReservation.php @ 27:a34f2ff49097

add: editable title & description
author yoneda <epgrec@park.mda.or.jp>
date Sun, 26 Jul 2009 18:00:11 +0900
parents 82c1375ddb4a
children e5f9aa34d06f
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");
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
5
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
6 if( !isset( $_POST['reserve_id'] ) ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
7 exit("Error: IDが指定されていません" );
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 $reserve_id = $_POST['reserve_id'];
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
10
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
11 $dbh = false;
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
12 if( defined("MEDIATOMB_UPDATE") ) {
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
13 if( MEDIATOMB_UPDATE ) {
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
14 $dbh = @mysql_connect( DB_HOST, DB_USER, DB_PASS );
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
15 if( $dbh !== false ) {
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
16 $sqlstr = "use ".DB_NAME;
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
17 @mysql_query( $sqlstr );
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
18 $sqlstr = "set NAME utf8";
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
19 @mysql_query( $sqlstr );
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
20 }
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
21 }
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
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
24 try {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
25 $rec = new DBRecord(TBL_PREFIX.RESERVE_TBL, "id", $reserve_id );
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
26
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
27 if( isset( $_POST['title'] ) ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
28 $rec->title = trim( $_POST['title'] );
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
29 if( ($dbh !== false) && ($rec->complete == 1) ) {
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
30 $title = trim( mysql_real_escape_string($_POST['title']));
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
31 $title .= "(".date("Y/m/d", toTimestamp($rec->starttime)).")";
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
32 $sqlstr = "update mt_cds_object set dc_title='".$title."' where metadata regexp 'epgrec:id=".$reserve_id."$'";
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
33 mysql_query( $sqlstr );
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
34 }
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
35 }
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 if( isset( $_POST['description'] ) ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
38 $rec->description = trim( $_POST['description'] );
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
39 if( ($dbh !== false) && ($rec->complete == 1) ) {
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
40 $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
41 $desc .= "&epgrec:id=".$reserve_id;
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
42 $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
43 @mysql_query( $sqlstr );
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
44 }
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
45 }
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 catch( Exception $e ) {
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
48 exit("Error: ". $e->getMessage());
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
26
82c1375ddb4a modified: changeReservation.php
yoneda <epgrec@park.mda.or.jp>
parents: 25
diff changeset
51 exit("complete");
25
03107333d942 add: editable reserve program's title & description
yoneda <epgrec@park.mda.or.jp>
parents:
diff changeset
52
27
a34f2ff49097 add: editable title & description
yoneda <epgrec@park.mda.or.jp>
parents: 26
diff changeset
53 ?>