| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
include("./foltialib.php"); |
|---|
| 23 |
$con = m_connect(); |
|---|
| 24 |
|
|---|
| 25 |
if ($useenvironmentpolicy == 1){ |
|---|
| 26 |
if (!isset($_SERVER['PHP_AUTH_USER'])) { |
|---|
| 27 |
header("WWW-Authenticate: Basic realm=\"foltia\""); |
|---|
| 28 |
header("HTTP/1.0 401 Unauthorized"); |
|---|
| 29 |
redirectlogin(); |
|---|
| 30 |
exit; |
|---|
| 31 |
} else { |
|---|
| 32 |
login($con,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']); |
|---|
| 33 |
} |
|---|
| 34 |
} |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
?> |
|---|
| 38 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|---|
| 39 |
<html lang="ja"> |
|---|
| 40 |
<head> |
|---|
| 41 |
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> |
|---|
| 42 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
|---|
| 43 |
<link rel="stylesheet" type="text/css" href="graytable.css"> |
|---|
| 44 |
<body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > |
|---|
| 45 |
|
|---|
| 46 |
<?php |
|---|
| 47 |
|
|---|
| 48 |
printhtmlpageheader(); |
|---|
| 49 |
?> |
|---|
| 50 |
<p align="left"><font color="#494949" size="6">番組予約</font></p> |
|---|
| 51 |
<hr size="4"> |
|---|
| 52 |
<?php |
|---|
| 53 |
|
|---|
| 54 |
$stationid = getnumform(stationid); |
|---|
| 55 |
$subtitle = getform(subtitle); |
|---|
| 56 |
$startdatetime = getnumform(startdatetime); |
|---|
| 57 |
$enddatetime = getnumform(enddatetime); |
|---|
| 58 |
$lengthmin = getnumform(lengthmin); |
|---|
| 59 |
|
|---|
| 60 |
if ($stationid == "" || $startdatetime < 0 || $enddatetime < 0 || $lengthmin < 0) { |
|---|
| 61 |
print " <title>foltia:EPG予約:Error</title></head>\n"; |
|---|
| 62 |
die_exit("登録番組がありません<BR>"); |
|---|
| 63 |
} |
|---|
| 64 |
print " <title>foltia:EPG予約:完了</title> |
|---|
| 65 |
</head>\n"; |
|---|
| 66 |
$now = date("YmdHi"); |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
if (($startdatetime > $now ) && ($enddatetime > $now ) && ($enddatetime > $startdatetime ) ){ |
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
$query = "SELECT min(pid) FROM foltia_subtitle "; |
|---|
| 74 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 75 |
$maxrows = pg_num_rows($rs); |
|---|
| 76 |
if ($maxrows == 0){ |
|---|
| 77 |
$insertpid = -1 ; |
|---|
| 78 |
}else{ |
|---|
| 79 |
$rowdata = pg_fetch_row($rs, 0); |
|---|
| 80 |
$insertpid = $rowdata[0]; |
|---|
| 81 |
$insertpid-- ; |
|---|
| 82 |
} |
|---|
| 83 |
|
|---|
| 84 |
$query = "SELECT max(countno) FROM foltia_subtitle WHERE tid = 0"; |
|---|
| 85 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 86 |
$maxrows = pg_num_rows($rs); |
|---|
| 87 |
if ($maxrows == 0){ |
|---|
| 88 |
$nextcno = 1 ; |
|---|
| 89 |
}else{ |
|---|
| 90 |
$rowdata = pg_fetch_row($rs, 0); |
|---|
| 91 |
$nextcno = $rowdata[0]; |
|---|
| 92 |
$nextcno++ ; |
|---|
| 93 |
} |
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 |
if ($demomode){ |
|---|
| 97 |
print "下記予約を完了いたしました。<br>"; |
|---|
| 98 |
}else{ |
|---|
| 99 |
$userclass = getuserclass($con); |
|---|
| 100 |
if ( $userclass <= 2){ |
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
$memberid = getmymemberid($con); |
|---|
| 118 |
$query = " |
|---|
| 119 |
insert into foltia_subtitle (pid ,tid ,stationid , countno ,subtitle , |
|---|
| 120 |
startdatetime ,enddatetime ,startoffset , lengthmin , epgaddedby ) |
|---|
| 121 |
values ( '$insertpid','0','$stationid', |
|---|
| 122 |
'$nextcno','$subtitle','$startdatetime','$enddatetime','0' ,'$lengthmin' , '$memberid')"; |
|---|
| 123 |
|
|---|
| 124 |
$rs = m_query($con, $query, "DBクエリに失敗しました"); |
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
//キュー入れプログラムをキック |
|---|
| 128 |
//引数 TID チャンネルID |
|---|
| 129 |
//echo("$toolpath/perl/addatq.pl $tid $station"); |
|---|
| 130 |
|
|---|
| 131 |
$oserr = system("$toolpath/perl/addatq.pl 0 0"); |
|---|
| 132 |
print "下記予約を完了いたしました。<br>"; |
|---|
| 133 |
}else{ |
|---|
| 134 |
print "EPG予約を行う権限がありません。"; |
|---|
| 135 |
} |
|---|
| 136 |
} |
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
}else{ |
|---|
| 141 |
print "時刻が不正なために予約できませんでした。 <br>"; |
|---|
| 142 |
|
|---|
| 143 |
} |
|---|
| 144 |
|
|---|
| 145 |
?> |
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 |
<?php |
|---|
| 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>"; |
|---|
| 158 |
|
|---|
| 159 |
?> |
|---|
| 160 |
</body> |
|---|
| 161 |
</html> |
|---|
| 162 |
|
|---|