Mercurial > epgrec.yaz
annotate recomplete.php @ 19:9648e3af1777
change: field type ( title, path )
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Thu, 16 Jul 2009 16:36:44 +0900 |
parents | cf19005e65d1 |
children | 19bd80c60009 |
rev | line source |
---|---|
1 | 1 #!/usr/bin/php |
2 <?php | |
3 include_once( "config.php" ); | |
4 include_once( INSTALL_PATH . "/DBRecord.class.php" ); | |
5 | |
6 $reserve_id = $argv[1]; | |
7 | |
8 try{ | |
9 $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id" , $reserve_id ); | |
10 | |
11 if( file_exists( INSTALL_PATH . SPOOL . "/". $rrec->path ) ) { | |
12 // 予約完了 | |
13 $rrec->complete = '1'; | |
16
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
14 if( defined(MEDIATOMB_UPDATE) ) { |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
15 if( MEDIATOMB_UPDATE ) { |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
16 $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS ); |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
17 if( $dbh !== false ) { |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
18 $sqlstr = "use ".DB_NAME; |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
19 mysql_query( $sqlstr ); |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
20 // 別にやらなくてもいいが |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
21 $sqlstr = "set NAME utf8"; |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
22 mysql_query( $sqlstr ); |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
23 $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."' where dc_title='".$rrec->path."'"; |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
24 mysql_query( $sqlstr ); |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
25 $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
26 mysql_query( $sqlstr ); |
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
27 } |
11
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
28 } |
16
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
29 } |
1 | 30 } |
31 else { | |
32 // 予約失敗 | |
33 $rrec->delete(); | |
34 } | |
35 } | |
36 catch( exception $e ) { | |
37 exit( $e->getMessage() ); | |
38 } | |
39 | |
40 ?> |