Index: trunk/install/perl/db/Pg.pl
===================================================================
--- trunk/install/perl/db/Pg.pl (リビジョン 121)
+++ trunk/install/perl/db/Pg.pl (リビジョン 122)
@@ -74,4 +74,5 @@
'xmltv2foltia.replaceepg.1' => "SELECT * FROM foltia_epg WHERE enddatetime > ? AND startdatetime < ? AND ontvchannel = ? AND startdatetime > ?",
+'xmltv2foltia.replaceepg.2' => "SELECT * FROM foltia_epg WHERE startdatetime = ? AND enddatetime = ? AND ontvchannel = ? ",
'xmltv2foltia.commitdb.1' => "DELETE FROM foltia_epg WHERE epgid = ?",
'xmltv2foltia.commitdb.2' => "INSERT INTO foltia_epg VALUES ( nextval('foltia_epg_epgid_seq'), ?, ?, ?, ?, ?, ?, ?)" ,
Index: trunk/install/perl/xmltv2foltia.pl
===================================================================
--- trunk/install/perl/xmltv2foltia.pl (リビジョン 121)
+++ trunk/install/perl/xmltv2foltia.pl (リビジョン 122)
@@ -127,6 +127,6 @@
chomp();
$item{title} = &removetag($_);
- $item{title} =~ s/【.*】//g;#【解】とか
- $item{title} =~ s/\[.*\]//g;#[二]とか
+ $item{title} =~ s/【.*?】//g;#【解】とか
+ $item{title} =~ s/\[.*?\]//g;#[二]とか
#print Dumper($_) ;
#print "$result \n";
@@ -232,4 +232,13 @@
#&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);");
}#end while
+
+#上書きを消す
+$sth = $dbh->prepare($stmt{'xmltv2foltia.replaceepg.2'});
+$sth->execute($foltiastarttime , $foltiaendtime , $ontvepgchannel);
+while (@data = $sth->fetchrow_array()) {
+ push(@deleteepgid,$data[0]);
+ #&writelog("xmltv2foltia DEBUG push(\@deleteepgid,$data[0]);");
+}#end while
+
}#endsub replaceepg
@@ -241,4 +250,8 @@
my $desc = $_[4];
my $category = $_[5];
+
+#Encode::JP::H2Z::z2h(\$string);
+$title = jcode($title)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}');
+$desc = jcode($desc)->tr('A-Za-z0-9!#$%&()*+,−./:;<=>?@[\]^_`{|}','A-Za-z0-9!#$%&()*+,-./:;<=>?@[\]^_`{|}');
#&writelog("xmltv2foltia DEBUG $foltiastarttime:$foltiaendtime");
@@ -288,5 +301,5 @@
$sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.1'});
$sth->execute( $delid ) || warn "$delid\n";
-# &writelog("xmltv2foltia DEBUG : DELETE FROM foltia_epg WHERE epgid = $delid");
+ #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.1'}/$delid");
}
#追加
@@ -294,5 +307,5 @@
$sth = $dbh->prepare($stmt{'xmltv2foltia.commitdb.2'});
$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";
-#&writelog("xmltv2foltia DEBUG : INSERT INTO foltia_epg VALUES ( NULL , $foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i])");
+ #&writelog("xmltv2foltia DEBUG $stmt{'xmltv2foltia.commitdb.2'}/$foltiastarttime[$i],$foltiaendtime[$i], $lengthmin[$i], $channel[$i], $title[$i], $desc[$i], $category[$i]");
}# end for
$dbh->commit;
Index: trunk/install/php/reserveepg.php
===================================================================
--- trunk/install/php/reserveepg.php (リビジョン 94)
+++ trunk/install/php/reserveepg.php (リビジョン 122)
@@ -201,4 +201,5 @@
+
Index: trunk/install/php/reserveepgcomp.php
===================================================================
--- trunk/install/php/reserveepgcomp.php (リビジョン 94)
+++ trunk/install/php/reserveepgcomp.php (リビジョン 122)
@@ -52,11 +52,12 @@
foltia:EPG予約:Error\n";
die_exit("登録番組がありません
");
@@ -65,4 +66,25 @@
\n";
$now = date("YmdHi");
+//タイトル取得
+ $query = "
+ SELECT epgid,startdatetime,enddatetime,lengthmin, ontvchannel,epgtitle,epgdesc,epgcategory ,
+ stationname , stationrecch ,stationid
+ FROM foltia_epg , foltia_station
+ WHERE epgid = ? AND foltia_station.ontvcode = foltia_epg.ontvchannel
+ ";
+ $rs = sql_query($con, $query, "DBクエリに失敗しました",array($epgid));
+$rowdata = $rs->fetch();
+if (! $rowdata) {
+ die_exit("登録番組がありません。もう一度EPGに戻り操作して下さい。
");
+}else{
+$stationid = $rowdata[10];
+$subtitle = $rowdata[5] . $rowdata[6];
+$startdatetime = $rowdata[1];
+$enddatetime = $rowdata[2];
+$lengthmin = $rowdata[3];
+}
+
+
+
// - DB登録作業
@@ -147,13 +169,11 @@
-print "
- 放送開始 | $startdatetime |
- 放送終了 | $enddatetime |
- 局コード | $stationid |
- 尺(分) | $lengthmin |
- 番組名 | $subtitle |
-
-
-
";
+print "\n";
+print "放送開始 | ".htmlspecialchars($startdatetime)." |
";
+print "放送終了 | ".htmlspecialchars($enddatetime)." |
\n";
+print "局コード | ".htmlspecialchars($stationid)." |
\n";
+print "尺(分) | ".htmlspecialchars($lengthmin)." |
\n";
+print "番組名 | ".htmlspecialchars($subtitle)." |
\n";
+print "\n
";
?>