チェンジセット 122
- コミット日時:
- 2010/10/07 10:43:38 (14 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/perl/db/Pg.pl
r121 r122 74 74 75 75 'xmltv2foltia.replaceepg.1' => "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? AND startdatetime > ?", 76 'xmltv2foltia.replaceepg.2' => "SELECT * FROM foltia_epg WHERE startdatetime = ? AND enddatetime = ? AND ontvchannel = ? ", 76 77 'xmltv2foltia.commitdb.1' => "DELETE FROM foltia_epg WHERE epgid = ?", 77 78 'xmltv2foltia.commitdb.2' => "INSERT INTO foltia_epg VALUES ( nextval('foltia_epg_epgid_seq'), ?, ?, ?, ?, ?, ?, ?)" , trunk/install/perl/xmltv2foltia.pl
r121 r122 127 127 chomp(); 128 128 $item{title} = &removetag($_); 129 $item{title} =~ s/【.* 】//g;#【解】とか130 $item{title} =~ s/\[.* \]//g;#[二]とか129 $item{title} =~ s/【.*?】//g;#【解】とか 130 $item{title} =~ s/\[.*?\]//g;#[二]とか 131 131 #print Dumper($_) ; 132 132 #print "$result \n"; … … 232 232 #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); 233 233 }#end while 234 235 #上書きを消す 236 $sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.2'}); 237 $sth->execute($foltiastarttime , $foltiaendtime , $ontvepgchannel); 238 while (@data = $sth->fetchrow_array()) { 239 push(@deleteepgid,$data[0]); 240 #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);"); 241 }#end while 242 234 243 }#endsub replaceepg 235 244 … … 241 250 my $desc = $_[4]; 242 251 my $category = $_[5]; 252 253 #Encode::JP::H2Z::z2h(\$string); 254 $title = jcode($title)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}'); 255 $desc = jcode($desc)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}'); 243 256 244 257 #&writelog("xmltv2foltia DEBUG $foltiastarttime:$foltiaendtime"); … … 288 301 $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.1'}); 289 302 $sth->execute( $delid ) || warn "$delid\n"; 290 # &writelog("xmltv2foltia DEBUG : DELETE FROM foltia_epg WHERE epgid =$delid");303 #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.1'}/$delid"); 291 304 } 292 305 #追加 … … 294 307 $sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.2'}); 295 308 $sth->execute( $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i]) || warn "error: $foltiastarttime, $foltiaendtime, $lengthmin, $channel, $title, $desc, $category\n"; 296 #&writelog("xmltv2foltia DEBUG : INSERT INTO foltia_epg VALUES ( NULL , $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i])");309 #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.2'}/$foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i]"); 297 310 }# end for 298 311 $dbh->commit; trunk/install/php/reserveepg.php
r94 r122 201 201 </table> 202 202 203 <input type=\"hidden\" name=\"epgid\" value=\"$epgid\" /> 203 204 <input type=\"hidden\" name=\"stationid\" value=\"$stationid\" /> 204 205 <input type=\"hidden\" name=\"subtitle\" value=\"$progname $progdesc\" /> trunk/install/php/reserveepgcomp.php
r94 r122 52 52 <?php 53 53 54 $stationid = getnumform(stationid);54 /* $stationid = getnumform(stationid); 55 55 $subtitle = getform(subtitle); 56 56 $startdatetime = getnumform(startdatetime); 57 57 $enddatetime = getnumform(enddatetime); 58 $lengthmin = getnumform(lengthmin); 58 $lengthmin = getnumform(lengthmin); */ 59 $epgid = getnumform(epgid); 59 60 60 if ($ stationid == "" || $startdatetime < 0 || $enddatetime < 0 || $lengthmin < 0) {61 if ($epgid == "" ) { 61 62 print " <title>foltia:EPG予約:Error</title></head>\n"; 62 63 die_exit("登録番組がありません<BR>"); … … 65 66 </head>\n"; 66 67 $now = date("YmdHi"); 68 //タイトル取得 69 $query = " 70 SELECT epgid,startdatetime,enddatetime,lengthmin, ontvchannel,epgtitle,epgdesc,epgcategory , 71 stationname , stationrecch ,stationid 72 FROM foltia_epg , foltia_station 73 WHERE epgid = ? AND foltia_station.ontvcode = foltia_epg.ontvchannel 74 "; 75 $rs = sql_query($con, $query, "DBクエリに失敗しました",array($epgid)); 76 $rowdata = $rs->fetch(); 77 if (! $rowdata) { 78 die_exit("登録番組がありません。もう一度EPGに戻り操作して下さい。<BR>"); 79 }else{ 80 $stationid = $rowdata[10]; 81 $subtitle = $rowdata[5] . $rowdata[6]; 82 $startdatetime = $rowdata[1]; 83 $enddatetime = $rowdata[2]; 84 $lengthmin = $rowdata[3]; 85 } 86 87 88 67 89 // - DB登録作業 68 90 … … 147 169 148 170 149 print "<table width=\"100%\" border=\"0\"> 150 <tr><td>放送開始</td><td>$startdatetime</td></tr> 151 <tr><td>放送終了</td><td>$enddatetime</td></tr> 152 <tr><td>局コード</td><td>$stationid</td></tr> 153 <tr><td>尺(分)</td><td>$lengthmin</td></tr> 154 <tr><td>番組名</td><td>$subtitle</td></tr> 155 156 </tbody> 157 </table>"; 171 print "<table width=\"100%\" border=\"0\">\n"; 172 print "<tr><td>放送開始</td><td>".htmlspecialchars($startdatetime)."</td></tr>"; 173 print "<tr><td>放送終了</td><td>".htmlspecialchars($enddatetime)."</td></tr>\n"; 174 print "<tr><td>局コード</td><td>".htmlspecialchars($stationid)."</td></tr>\n"; 175 print "<tr><td>尺(分)</td><td>".htmlspecialchars($lengthmin)."</td></tr>\n"; 176 print "<tr><td>番組名</td><td>".htmlspecialchars($subtitle)."</td></tr>\n"; 177 print "</tbody>\n</table>"; 158 178 159 179 ?>