73 | | $reservedrssametid = m_query($con, $query, "DBクエリに失敗しました"); |
---|
74 | | $reservedmaxrowssameid = pg_num_rows($reservedrssametid); |
---|
75 | | |
---|
76 | | if ($reservedmaxrowssameid > 0 ){ |
---|
77 | | for ($rrow = 0; $rrow < $reservedmaxrowssameid ; $rrow++) { |
---|
78 | | $rowdata = pg_fetch_row($reservedrssametid, $rrow); |
---|
| 73 | // $reservedrssametid = m_query($con, $query, "DBクエリに失敗しました"); |
---|
| 74 | $reservedrssametid = sql_query($con, $query, "DBクエリに失敗しました",array($now)); |
---|
| 75 | $rowdata = $reservedrssametid->fetch(); |
---|
| 76 | if ($rowdata) { |
---|
| 77 | do { |
---|
90 | | foltia_program .tid, |
---|
91 | | stationname, |
---|
92 | | foltia_program .title, |
---|
93 | | foltia_subtitle.countno, |
---|
94 | | foltia_subtitle.subtitle, |
---|
95 | | foltia_subtitle.startdatetime , |
---|
96 | | foltia_subtitle.lengthmin , |
---|
97 | | foltia_tvrecord.bitrate , |
---|
98 | | foltia_subtitle.pid |
---|
| 90 | foltia_program.tid, stationname, foltia_program.title, |
---|
| 91 | foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
| 92 | foltia_subtitle.startdatetime as x, foltia_subtitle.lengthmin, |
---|
| 93 | foltia_tvrecord.bitrate, foltia_subtitle.pid |
---|
104 | | foltia_program .tid, |
---|
105 | | stationname, |
---|
106 | | foltia_program .title, |
---|
107 | | foltia_subtitle.countno, |
---|
108 | | foltia_subtitle.subtitle, |
---|
109 | | foltia_subtitle.startdatetime , |
---|
110 | | foltia_subtitle.lengthmin , |
---|
111 | | foltia_tvrecord.bitrate , |
---|
112 | | foltia_subtitle.pid |
---|
| 99 | foltia_program.tid, stationname, foltia_program.title, |
---|
| 100 | foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
| 101 | foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
| 102 | foltia_tvrecord.bitrate, foltia_subtitle.pid |
---|
118 | | foltia_subtitle.enddatetime >= '$now' ORDER BY \"startdatetime\" ASC |
---|
119 | | LIMIT 1000 |
---|
120 | | "; |
---|
121 | | |
---|
122 | | $reservedrs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
123 | | $reservedmaxrows = pg_num_rows($reservedrs); |
---|
124 | | |
---|
125 | | if ($reservedmaxrows > 0 ){ |
---|
126 | | for ($rrow = 0; $rrow < $reservedmaxrows ; $rrow++) { |
---|
127 | | $rowdata = pg_fetch_row($reservedrs, $rrow); |
---|
| 108 | foltia_subtitle.enddatetime >= '$now' ORDER BY x ASC |
---|
| 109 | LIMIT 1000 |
---|
| 110 | "; |
---|
| 111 | |
---|
| 112 | //$reservedrs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
| 113 | $query = " |
---|
| 114 | SELECT |
---|
| 115 | foltia_program.tid, stationname, foltia_program.title, |
---|
| 116 | foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
| 117 | foltia_subtitle.startdatetime as x, foltia_subtitle.lengthmin, |
---|
| 118 | foltia_tvrecord.bitrate, foltia_subtitle.pid |
---|
| 119 | FROM foltia_subtitle , foltia_program ,foltia_station ,foltia_tvrecord |
---|
| 120 | WHERE foltia_tvrecord.tid = foltia_program.tid AND foltia_tvrecord.stationid = foltia_station .stationid AND foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid |
---|
| 121 | AND foltia_subtitle.enddatetime >= ? |
---|
| 122 | UNION |
---|
| 123 | SELECT |
---|
| 124 | foltia_program.tid, stationname, foltia_program.title, |
---|
| 125 | foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
| 126 | foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
| 127 | foltia_tvrecord.bitrate, foltia_subtitle.pid |
---|
| 128 | FROM foltia_tvrecord |
---|
| 129 | LEFT OUTER JOIN foltia_subtitle on (foltia_tvrecord.tid = foltia_subtitle.tid ) |
---|
| 130 | LEFT OUTER JOIN foltia_program on (foltia_tvrecord.tid = foltia_program.tid ) |
---|
| 131 | LEFT OUTER JOIN foltia_station on (foltia_subtitle.stationid = foltia_station.stationid ) |
---|
| 132 | WHERE foltia_tvrecord.stationid = 0 AND |
---|
| 133 | foltia_subtitle.enddatetime >= ? ORDER BY x ASC |
---|
| 134 | LIMIT 1000 |
---|
| 135 | "; |
---|
| 136 | $reservedrs = sql_query($con, $query, "DBクエリに失敗しました",array($now,$now)); |
---|
| 137 | |
---|
| 138 | $rowdata = $reservedrs->fetch(); |
---|
| 139 | if ($rowdata) { |
---|
| 140 | do { |
---|
140 | | foltia_program .tid, |
---|
141 | | stationname, |
---|
142 | | foltia_program .title, |
---|
143 | | foltia_subtitle.countno, |
---|
144 | | foltia_subtitle.subtitle, |
---|
145 | | foltia_subtitle.startdatetime , |
---|
146 | | foltia_subtitle.lengthmin , |
---|
147 | | foltia_subtitle.pid , |
---|
148 | | foltia_subtitle.startoffset |
---|
| 153 | foltia_program.tid, stationname, foltia_program.title, |
---|
| 154 | foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
| 155 | foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
| 156 | foltia_subtitle.pid, foltia_subtitle.startoffset |
---|
155 | | $rs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
156 | | $maxrows = pg_num_rows($rs); |
---|
157 | | |
---|
158 | | |
---|
| 163 | $query = " |
---|
| 164 | SELECT |
---|
| 165 | foltia_program.tid, stationname, foltia_program.title, |
---|
| 166 | foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
| 167 | foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
| 168 | foltia_subtitle.pid, foltia_subtitle.startoffset |
---|
| 169 | FROM foltia_subtitle , foltia_program ,foltia_station |
---|
| 170 | WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid |
---|
| 171 | AND foltia_subtitle.enddatetime >= ? AND foltia_subtitle.countno = '1' |
---|
| 172 | ORDER BY foltia_subtitle.startdatetime ASC |
---|
| 173 | LIMIT 1000 |
---|
| 174 | "; |
---|
162 | | foltia_program .tid, |
---|
163 | | stationname, |
---|
164 | | foltia_program .title, |
---|
165 | | foltia_subtitle.countno, |
---|
166 | | foltia_subtitle.subtitle, |
---|
167 | | foltia_subtitle.startdatetime , |
---|
168 | | foltia_subtitle.lengthmin , |
---|
169 | | foltia_subtitle.pid , |
---|
170 | | foltia_subtitle.startoffset |
---|
| 178 | foltia_program.tid, stationname, foltia_program.title, |
---|
| 179 | foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
| 180 | foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
| 181 | foltia_subtitle.pid, foltia_subtitle.startoffset |
---|
177 | | $rs = m_query($con, $query, "DBクエリに失敗しました"); |
---|
178 | | $maxrows = pg_num_rows($rs); |
---|
179 | | |
---|
| 188 | $query = " |
---|
| 189 | SELECT |
---|
| 190 | foltia_program.tid, stationname, foltia_program.title, |
---|
| 191 | foltia_subtitle.countno, foltia_subtitle.subtitle, |
---|
| 192 | foltia_subtitle.startdatetime, foltia_subtitle.lengthmin, |
---|
| 193 | foltia_subtitle.pid, foltia_subtitle.startoffset |
---|
| 194 | FROM foltia_subtitle , foltia_program ,foltia_station |
---|
| 195 | WHERE foltia_program.tid = foltia_subtitle.tid AND foltia_station.stationid = foltia_subtitle.stationid |
---|
| 196 | AND foltia_subtitle.enddatetime >= ? |
---|
| 197 | ORDER BY foltia_subtitle.startdatetime ASC |
---|
| 198 | LIMIT 1000 |
---|
| 199 | "; |
---|