OSDN Git Service

add: editable reserve program's title & description
[epgrec/epgrec.git] / changeReservation.php
1 <?php
2 include_once('config.php');
3 include_once(INSTALL_PATH."/DBRecord.class.php");
4
5 if( !isset( $_POST['reserve_id'] ) ) {
6         exit("Error: IDが指定されていません" );
7 }
8 $reserve_id = $_POST['reserve_id'];
9
10 try {
11         $rec = new DBRecord(TBL_PREFIX.RESERVE_TBL, "id", $reserve_id );
12         
13         if( isset( $_POST['title'] ) ) {
14                 $rec->title = trim( $_POST['title'] );
15         }
16         
17         if( isset( $_POST['description'] ) ) {
18                 $rec->description = trim( $_POST['description'] );
19         }
20 }
21 catch( Exception $e ) {
22         exit("Error: ". $e->getMessage());
23 }
24
25 exit("complete");y
26
27 ?>