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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
1 #!/usr/bin/php
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
2 <?php
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
3 include_once( "config.php" );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
4 include_once( INSTALL_PATH . "/DBRecord.class.php" );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
5
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
6 $reserve_id = $argv[1];
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
7
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
8 try{
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
9 $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id" , $reserve_id );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
10
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
11 if( file_exists( INSTALL_PATH . SPOOL . "/". $rrec->path ) ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
12 // 予約完了
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
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
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
30 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
31 else {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
32 // 予約失敗
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
33 $rrec->delete();
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
34 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
35 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
36 catch( exception $e ) {
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
37 exit( $e->getMessage() );
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
38 }
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
39
f5a9f0eb4858 deleted: LICENSE.ja
Sushi-k <epgrec@park.mda.or.jp>
parents:
diff changeset
40 ?>