comparison Reservation.class.php @ 135:9c5e597ef6c6

mod: ログ機能を追加
author epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
date Sat, 20 Mar 2010 23:59:01 +0900
parents 58791b90221b
children a18df712fc7e 481e789605e3
comparison
equal deleted inserted replaced
134:58791b90221b 135:9c5e597ef6c6
1 <?php 1 <?php
2 include_once('config.php'); 2 include_once('config.php');
3 include_once( INSTALL_PATH . "/DBRecord.class.php" ); 3 include_once( INSTALL_PATH . "/DBRecord.class.php" );
4 include_once( INSTALL_PATH . "/reclib.php" ); 4 include_once( INSTALL_PATH . "/reclib.php" );
5 include_once( INSTALL_PATH . "/Settings.class.php" ); 5 include_once( INSTALL_PATH . "/Settings.class.php" );
6 include_once( INSTALL_PATH . "/recLog.inc.php" );
6 7
7 8
8 // 篋膣 9 // 篋膣
9 10
10 class Reservation { 11 class Reservation {
176 // 鴻durationс 177 // 鴻durationс
177 if( $duration < ($settings->former_time + 60) ) { // 60腱篁ヤ腟綣障 178 if( $duration < ($settings->former_time + 60) ) { // 60腱篁ヤ腟綣障
178 throw new Exception( "腟ゃゃ/腟c腟с" ); 179 throw new Exception( "腟ゃゃ/腟c腟с" );
179 } 180 }
180 181
181
182 // <ゃ 182 // <ゃ
183 /* 183 /*
184 %TITLE% 腟帥ゃ 184 %TITLE% 腟帥ゃ
185 %ST% 紮ユ鐚ex.200907201830) 185 %ST% 紮ユ鐚ex.200907201830)
186 %ET% 腟篋ユ 186 %ET% 腟篋ユ
298 fclose( $pipes[2] ); 298 fclose( $pipes[2] );
299 proc_close( $process ); 299 proc_close( $process );
300 } 300 }
301 else { 301 else {
302 $rrec->delete(); 302 $rrec->delete();
303 reclog( "Reservation::custom at絎茵紊掩罔≧", E_ERROR);
303 throw new Exception("AT絎茵"); 304 throw new Exception("AT絎茵");
304 } 305 }
305 // job垩冴 306 // job垩冴
306 $rarr = array(); 307 $rarr = array();
307 $tok = strtok( $rstring, " \n" ); 308 $tok = strtok( $rstring, " \n" );
311 } 312 }
312 $key = array_search("job", $rarr); 313 $key = array_search("job", $rarr);
313 if( $key !== false ) { 314 if( $key !== false ) {
314 if( is_numeric( $rarr[$key+1]) ) { 315 if( is_numeric( $rarr[$key+1]) ) {
315 $rrec->job = $rarr[$key+1]; 316 $rrec->job = $rarr[$key+1];
317 reclog( "Reservation::custom 吾с".$rrec->job."牙祉吾с脂");
316 return $rrec->job; // 318 return $rrec->job; //
317 } 319 }
318 } 320 }
319 // 321 //
320 $rrec->delete(); 322 $rrec->delete();
323 reclog( "Reservation::custom job垩緇紊掩",E_ERROR );
321 throw new Exception( "job垩緇紊掩" ); 324 throw new Exception( "job垩緇紊掩" );
322 } 325 }
323 catch( Exception $e ) { 326 catch( Exception $e ) {
324 if( $rrec != null ) { 327 if( $rrec != null ) {
325 if( $rrec->id ) { 328 if( $rrec->id ) {
347 if( $rec == null ) { 350 if( $rec == null ) {
348 throw new Exception("ID絎≦鴻с"); 351 throw new Exception("ID絎≦鴻с");
349 } 352 }
350 if( ! $rec->complete ) { 353 if( ! $rec->complete ) {
351 // 絎茵篋膣с 354 // 絎茵篋膣с
352 if( toTimestamp($rec->starttime) < (time() + PADDING_TIME + $settings->former_time) ) 355 if( toTimestamp($rec->starttime) < (time() + PADDING_TIME + $settings->former_time) ) {
353 throw new Exception("サ牙私膣с"); 356 reclog("Reservation::cancel 絎茵篋膣羔絎茵", E_ERROR );
357 }
354 exec( $settings->atrm . " " . $rec->job ); 358 exec( $settings->atrm . " " . $rec->job );
359 reclog("Reservation::cancel 吾с".$rec->job."");
355 } 360 }
356 $rec->delete(); 361 $rec->delete();
357 } 362 }
358 catch( Exception $e ) { 363 catch( Exception $e ) {
364 reclog("Reservation::cancel 篋膣c潟祉DB・膓障≪祉鴻紊掩罔≧", E_ERROR );
359 throw $e; 365 throw $e;
360 } 366 }
361 } 367 }
362 } 368 }
363 ?> 369 ?>