view cancelReservation.php @ 157:00b5ed67d792

mod: xmlrpcをテスト的に追加(まだ途中)
author Sushi-k <epgrec@park.mda.or.jp>
date Tue, 30 Mar 2010 19:00:39 +0900
parents 42f6eb738567
children 84220382fea8
line wrap: on
line source

<?php
include_once('config.php');
include_once( INSTALL_PATH . '/DBRecord.class.php' );
include_once( INSTALL_PATH . '/Reservation.class.php' );
include_once( INSTALL_PATH . '/reclib.php' );
include_once( INSTALL_PATH . '/Settings.class.php' );

$program_id = 0;
$reserve_id = 0;
$settings = Settings::factory();

if( isset($_GET['program_id'])) {
	$program_id = $_GET['program_id'];
}
else if(isset($_GET['reserve_id'])) {
	$reserve_id = $_GET['reserve_id'];
	try {
		$rec = new DBRecord( RESERVE_TBL, "id" , $reserve_id );
		$program_id = $rec->program_id;
		
		if( isset( $_GET['delete_file'] ) ) {
			if( $_GET['delete_file'] == 1 ) {
				// <ゃ
				if( file_exists( INSTALL_PATH."/".$settings->spool."/".$rec->path ) ) {
					@unlink(INSTALL_PATH."/".$settings->spool."/".$rec->path);
					@unlink(INSTALL_PATH."/".$settings->thumbs."/".$rec->path.".jpg");
				}
			}
		}
	}
	catch( Exception $e ) {
		// ∴
	}
}



// 羔腟牙糸乗院紊
if( $program_id ) {
	try {
		$rec = new DBRecord(PROGRAM_TBL, "id", $program_id );
		$rec->autorec = 0;
	}
	catch( Exception $e ) {
		// ∴
	}
}

// 篋膣羔絎茵
try {
	Reservation::cancel( $reserve_id, $program_id );
}
catch( Exception $e ) {
	exit( "Error" . $e->getMessage() );
}
exit();
?>