| 1 | 
<?php | 
|---|
| 2 | 
 | 
|---|
| 3 | 
 | 
|---|
| 4 | 
 | 
|---|
| 5 | 
 | 
|---|
| 6 | 
 | 
|---|
| 7 | 
 | 
|---|
| 8 | 
 | 
|---|
| 9 | 
 | 
|---|
| 10 | 
 | 
|---|
| 11 | 
 | 
|---|
| 12 | 
 | 
|---|
| 13 | 
 | 
|---|
| 14 | 
 | 
|---|
| 15 | 
 | 
|---|
| 16 | 
 | 
|---|
| 17 | 
 | 
|---|
| 18 | 
 | 
|---|
| 19 | 
 | 
|---|
| 20 | 
 | 
|---|
| 21 | 
?> | 
|---|
| 22 | 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | 
|---|
| 23 | 
<html lang="ja"> | 
|---|
| 24 | 
<head> | 
|---|
| 25 | 
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> | 
|---|
| 26 | 
<meta http-equiv="Content-Style-Type" content="text/css"> | 
|---|
| 27 | 
<link rel="stylesheet" type="text/css" href="graytable.css">  | 
|---|
| 28 | 
<body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > | 
|---|
| 29 | 
 | 
|---|
| 30 | 
<?php  | 
|---|
| 31 | 
  include("./foltialib.php"); | 
|---|
| 32 | 
 | 
|---|
| 33 | 
    printhtmlpageheader(); | 
|---|
| 34 | 
?> | 
|---|
| 35 | 
  <p align="left"><font color="#494949" size="6">番組予約</font></p> | 
|---|
| 36 | 
  <hr size="4"> | 
|---|
| 37 | 
<?php | 
|---|
| 38 | 
 | 
|---|
| 39 | 
$stationid = getnumform(stationid); | 
|---|
| 40 | 
$subtitle = getform(subtitle); | 
|---|
| 41 | 
$startdatetime = getnumform(startdatetime); | 
|---|
| 42 | 
$enddatetime = getnumform(enddatetime); | 
|---|
| 43 | 
$lengthmin = getnumform(lengthmin); | 
|---|
| 44 | 
 | 
|---|
| 45 | 
        if ($stationid == "" || $startdatetime < 0 ||  $enddatetime < 0 || $lengthmin < 0) { | 
|---|
| 46 | 
        print "    <title>foltia:EPG予約:Error</title></head>\n"; | 
|---|
| 47 | 
        die_exit("登録番組がありません<BR>"); | 
|---|
| 48 | 
        } | 
|---|
| 49 | 
print "    <title>foltia:EPG予約:完了</title> | 
|---|
| 50 | 
</head>\n"; | 
|---|
| 51 | 
$con = m_connect(); | 
|---|
| 52 | 
$now = date("YmdHi");    | 
|---|
| 53 | 
 | 
|---|
| 54 | 
 | 
|---|
| 55 | 
 | 
|---|
| 56 | 
if (($startdatetime > $now ) && ($enddatetime > $now ) && ($enddatetime  > $startdatetime ) ){ | 
|---|
| 57 | 
 | 
|---|
| 58 | 
 | 
|---|
| 59 | 
$query = "SELECT min(pid) FROM  foltia_subtitle "; | 
|---|
| 60 | 
    $rs = m_query($con, $query, "DBクエリに失敗しました"); | 
|---|
| 61 | 
    $maxrows = pg_num_rows($rs); | 
|---|
| 62 | 
    if ($maxrows == 0){ | 
|---|
| 63 | 
    $insertpid = -1 ; | 
|---|
| 64 | 
    }else{ | 
|---|
| 65 | 
    $rowdata = pg_fetch_row($rs, 0); | 
|---|
| 66 | 
    $insertpid = $rowdata[0]; | 
|---|
| 67 | 
    $insertpid-- ; | 
|---|
| 68 | 
    } | 
|---|
| 69 | 
 | 
|---|
| 70 | 
$query = "SELECT max(countno) FROM  foltia_subtitle WHERE tid = 0"; | 
|---|
| 71 | 
    $rs = m_query($con, $query, "DBクエリに失敗しました"); | 
|---|
| 72 | 
    $maxrows = pg_num_rows($rs); | 
|---|
| 73 | 
    if ($maxrows == 0){ | 
|---|
| 74 | 
    $nextcno = 1 ; | 
|---|
| 75 | 
    }else{ | 
|---|
| 76 | 
    $rowdata = pg_fetch_row($rs, 0); | 
|---|
| 77 | 
    $nextcno = $rowdata[0]; | 
|---|
| 78 | 
    $nextcno++ ; | 
|---|
| 79 | 
    } | 
|---|
| 80 | 
 | 
|---|
| 81 | 
 | 
|---|
| 82 | 
if ($demomode){ | 
|---|
| 83 | 
}else{ | 
|---|
| 84 | 
 | 
|---|
| 85 | 
$query = " | 
|---|
| 86 | 
insert into foltia_subtitle   | 
|---|
| 87 | 
values ( '$insertpid','0','$stationid', | 
|---|
| 88 | 
    '$nextcno','$subtitle','$startdatetime','$enddatetime','0' ,'$lengthmin')"; | 
|---|
| 89 | 
 | 
|---|
| 90 | 
    $rs = m_query($con, $query, "DBクエリに失敗しました"); | 
|---|
| 91 | 
 | 
|---|
| 92 | 
 | 
|---|
| 93 | 
 | 
|---|
| 94 | 
 | 
|---|
| 95 | 
 | 
|---|
| 96 | 
 | 
|---|
| 97 | 
$oserr = system("$toolpath/perl/addatq.pl 0 0"); | 
|---|
| 98 | 
 | 
|---|
| 99 | 
 | 
|---|
| 100 | 
 | 
|---|
| 101 | 
print "下記予約を完了いたしました。<br>"; | 
|---|
| 102 | 
 | 
|---|
| 103 | 
}else{ | 
|---|
| 104 | 
print "時刻が不正なために予約できませんでした。 <br>"; | 
|---|
| 105 | 
 | 
|---|
| 106 | 
} | 
|---|
| 107 | 
 | 
|---|
| 108 | 
?> | 
|---|
| 109 | 
 | 
|---|
| 110 | 
 | 
|---|
| 111 | 
<?php | 
|---|
| 112 | 
print "<table width=\"100%\" border=\"0\"> | 
|---|
| 113 | 
    <tr><td>放送開始</td><td>$startdatetime</td></tr> | 
|---|
| 114 | 
    <tr><td>放送終了</td><td>$enddatetime</td></tr> | 
|---|
| 115 | 
    <tr><td>局コード</td><td>$stationid</td></tr> | 
|---|
| 116 | 
    <tr><td>尺(分)</td><td>$lengthmin</td></tr> | 
|---|
| 117 | 
    <tr><td>番組名</td><td>$subtitle</td></tr> | 
|---|
| 118 | 
     | 
|---|
| 119 | 
</tbody> | 
|---|
| 120 | 
</table>"; | 
|---|
| 121 | 
 | 
|---|
| 122 | 
?> | 
|---|
| 123 | 
</body> | 
|---|
| 124 | 
</html> | 
|---|
| 125 | 
 | 
|---|