Mercurial > epgrec.yaz
annotate recomplete.php @ 77:cb7da56c4198
modified: Keyword.class.php
modified: config.php.sample
modified: index.php
modified: install/step1.php
modified: keywordTable.php
modified: programTable.php
modified: simpleReservation.php
modified: templates/index.html
modified: templates/keywordTable.html
modified: templates/programTable.html
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Wed, 24 Feb 2010 20:22:19 +0900 |
parents | f8f6e0d3acaf |
children | 3bed74eca373 |
rev | line source |
---|---|
1 | 1 #!/usr/bin/php |
2 <?php | |
3 include_once( "config.php" ); | |
4 include_once( INSTALL_PATH . "/DBRecord.class.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(); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
8 |
1 | 9 $reserve_id = $argv[1]; |
10 | |
11 try{ | |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
12 $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); |
1 | 13 |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
14 if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) { |
1 | 15 // 予約完了 |
16 $rrec->complete = '1'; | |
49 | 17 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
|
18 // ちょっと待った方が確実っぽい |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
19 @exec("sync"); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
20 sleep(15); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
21 $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
|
22 if( $dbh !== false ) { |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
23 $sqlstr = "use ".$settings->db_name; |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
24 @mysql_query( $sqlstr ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
25 // 別にやらなくてもいいが |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
26 $sqlstr = "set NAME utf8"; |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
27 @mysql_query( $sqlstr ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
28 $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'"; |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
29 @mysql_query( $sqlstr ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
30 $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
31 @mysql_query( $sqlstr ); |
11
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
32 } |
16
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
33 } |
1 | 34 } |
35 else { | |
36 // 予約失敗 | |
37 $rrec->delete(); | |
38 } | |
39 } | |
40 catch( exception $e ) { | |
41 exit( $e->getMessage() ); | |
42 } | |
43 | |
49 | 44 ?> |