Mercurial > epgrec.yaz
annotate templates/programTable.html @ 23:f3bf1be1a51b
Change: using ajax in custom reservation method
author | yoneda <yoneda@recorder.localnet.mda.or.jp> |
---|---|
date | Thu, 23 Jul 2009 23:35:43 +0900 |
parents | f5a9f0eb4858 |
children | f0ef6fb63aa4 |
rev | line source |
---|---|
1 | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
2 "http://www.w3.org/TR/html4/loose.dtd"> | |
3 | |
4 <html> | |
5 <head> | |
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
7 <title>{$sitetitle}</title> | |
8 <meta http-equiv="Content-Style-Type" content="text/css"> | |
9 | |
10 {literal} | |
11 <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
12 <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script> |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
13 <link rel="stylesheet" href="start/jquery-ui-1.7.2.custom.css" type="text/css"> |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
14 <script type="text/javascript" src="js/mdabasic.js"></script> |
1 | 15 <script type="text/javascript"> |
16 var PRG = { | |
17 rec:function(id){ | |
18 $.get(INISet.prgRecordURL, { program_id: id } ,function(data){ | |
19 if(data.match(/^error/i)){ | |
20 alert(data); | |
21 }else{ | |
22 $('#resid_' + id).addClass('prg_rec'); | |
23 } | |
24 }); | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
25 }, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
26 customform:function(id) { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
27 $('#floatBox4Dialog').dialog('close'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
28 $.get('reservationform.php', { program_id: id }, function(data) { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
29 if(data.match(/^error/i)){ |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
30 alert(data); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
31 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
32 else { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
33 var str = data; |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
34 str += '<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.customrec()" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">予約する</a></div>'; |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
35 $('#floatBox4Dialog').html(str); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
36 $('#floatBox4Dialog').dialog('open', 'center'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
37 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
38 }); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
39 }, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
40 customrec:function() { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
41 var id_syear = $('#id_syear').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
42 var id_smonth = $('#id_smonth').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
43 var id_sday = $('#id_sday').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
44 var id_shour = $('#id_shour').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
45 var id_smin = $('#id_smin').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
46 var id_eyear = $('#id_eyear').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
47 var id_emonth = $('#id_emonth').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
48 var id_eday = $('#id_eday').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
49 var id_ehour = $('#id_ehour').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
50 var id_emin = $('#id_emin').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
51 var id_channel_id = $('#id_channel_id').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
52 var id_record_mode = $('#id_record_mode').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
53 var id_title = $('#id_title').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
54 var id_description = $('#id_description').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
55 var id_category_id = $('#id_category_id ').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
56 var id_program_id = $('#id_program_id').val(); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
57 var with_program_id = $('#id_program_id').attr('checked'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
58 |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
59 if( ! with_program_id ) id_program_id = 0; |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
60 |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
61 $.post('customReservation.php', { syear: id_syear, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
62 smonth: id_smonth, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
63 sday: id_sday, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
64 shour: id_shour, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
65 smin: id_smin, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
66 eyear: id_eyear, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
67 emonth: id_emonth, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
68 eday: id_eday, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
69 ehour: id_ehour, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
70 emin: id_emin, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
71 channel_id: id_channel_id, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
72 record_mode: id_record_mode, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
73 title: id_title, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
74 description: id_description, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
75 category_id: id_category_id, |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
76 program_id: id_program_id }, function(data) { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
77 if(data.match(/^error/i)){ |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
78 $('#floatBox4Dialog').dialog('close'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
79 alert(data); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
80 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
81 else { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
82 var id = parseInt(data); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
83 if( id ) { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
84 $('#resid_' + id).addClass('prg_rec'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
85 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
86 $('#floatBox4Dialog').dialog('close'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
87 } |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
88 }); |
1 | 89 } |
90 } | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
91 |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
92 $(document).ready(function () { |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
93 var DG = $('#floatBox4Dialog'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
94 DG.dialog({title:'録画予約',width:600}); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
95 DG.dialog('close'); |
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
96 }); |
1 | 97 </script> |
98 <style type="text/css"> | |
99 <!-- | |
100 body {padding:4px;margin:0;font-size:10pt;} | |
101 a {text-decoration:none;} | |
102 | |
103 table#reservation_table { | |
104 width: 800px; | |
105 border: 1px #BBB solid; | |
106 border-collapse: collapse; | |
107 border-spacing: 0; | |
108 } | |
109 | |
110 table#reservation_table th { | |
111 padding: 5px; | |
112 border: #E3E3E3 solid; | |
113 border-width: 0 0 1px 1px; | |
114 background: #BBB; | |
115 font-weight: bold; | |
116 line-height: 120%; | |
117 text-align: center; | |
118 } | |
119 table#reservation_table td { | |
120 padding: 5px; | |
121 border: 1px #BBB solid; | |
122 border-width: 0 0 1px 1px; | |
123 text-align: center; | |
124 } | |
125 | |
126 table#reservation_table tr.ctg_news, #category_select a.ctg_news {background-color: #FFFFD8;} | |
127 table#reservation_table tr.ctg_etc, #category_select a.ctg_etc {background-color: #FFFFFF;} | |
128 table#reservation_table tr.ctg_information, #category_select a.ctg_information {background-color: #F2D8FF;} | |
129 table#reservation_table tr.ctg_sports, #category_select a.ctg_sports {background-color: #D8FFFF;} | |
130 table#reservation_table tr.ctg_cinema, #category_select a.ctg_cinema {background-color: #FFD8D8;} | |
131 table#reservation_table tr.ctg_music, #category_select a.ctg_music {background-color: #D8D8FF;} | |
132 table#reservation_table tr.ctg_drama, #category_select a.ctg_drama {background-color: #D8FFD8;} | |
133 table#reservation_table tr.ctg_anime, #category_select a.ctg_anime {background-color: #FFE4C8;} | |
134 table#reservation_table tr.ctg_variety, #category_select a.ctg_variety {background-color: #FFD2EB;} | |
135 table#reservation_table tr.ctg_10, #category_select a.ctg_10 {background-color: #E4F4F4;} | |
136 table#reservation_table tr.prg_rec {background-color: #F55;color:#FEE} | |
137 | |
138 | |
139 --> | |
140 </style> | |
141 {/literal} | |
142 | |
143 </head> | |
144 | |
145 <body> | |
146 | |
147 <h2>{$sitetitle}</h2> | |
148 | |
149 | |
150 | |
151 <div><a href="index.php">番組表に戻る</a>/<a href="keywordTable.php">自動録画キーワード管理へ</a></div> | |
152 | |
153 <div> | |
154 絞り込み: | |
155 <form method="post" action="programTable.php"> | |
156 <input type="hidden" name="do_search" value="1" /> | |
157 検索語句<input type="text" size="20" name="search" value="{$search}" /> | |
158 正規表現使用<input type="checkbox" name="use_regexp" value="1" {if $use_regexp}checked{/if} /> | |
159 種別<select name="type"> | |
160 {foreach from=$types item=type} | |
161 <option value="{$type.value}" {$type.selected}>{$type.name}</option> | |
162 {/foreach} | |
163 </select> | |
164 局<select name="station"> | |
165 {foreach from=$stations item=st} | |
166 <option value="{$st.id}" {$st.selected}>{$st.name}</option> | |
167 {/foreach} | |
168 </select> | |
169 カテゴリ<select name="category_id"> | |
170 {foreach from=$cats item=cat} | |
171 <option value="{$cat.id}" {$cat.selected}>{$cat.name}</option> | |
172 {/foreach} | |
173 </select> | |
174 <input type="submit" value="絞り込む" /> | |
175 </form> | |
176 </div> | |
177 | |
178 | |
179 | |
180 {if count($programs)} | |
181 <table id="reservation_table"> | |
182 <tr> | |
183 <th>種別</th> | |
184 <th>局名</th> | |
185 <th>番組開始</th> | |
186 <th>番組終了</th> | |
187 <th>タイトル</th> | |
188 <th>内容</th> | |
189 <th>簡易録画</th> | |
190 <th>詳細録画</th> | |
191 </tr> | |
192 | |
193 {foreach from=$programs item=program} | |
194 <tr id="resid_{$program.id}" class="ctg_{$program.cat}{if $program.rec > 0} prg_rec{/if}"> | |
195 <td>{$program.type}</td> | |
196 <td>{$program.station_name}</td> | |
197 <td>{$program.starttime}</td> | |
198 <td>{$program.endtime}</td> | |
199 <td>{$program.title|escape}</td> | |
200 <td>{$program.description|escape}</td> | |
201 <td><input type="button" value="録画" onClick="javascript:PRG.rec('{$program.id}')" /></td> | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
202 <td><input type="button" value="詳細" onClick="javascript:PRG.customform('{$program.id}')" /></td> |
1 | 203 </tr> |
204 {/foreach} | |
205 </table> | |
206 {else} | |
207 該当する番組はありません | |
208 {/if} | |
209 <div>{$programs|@count}件ヒット</div> | |
210 {if count($programs) >= 300}<div>表示最大300件まで</div>{/if} | |
211 {if $do_keyword} | |
212 {if (count($programs) < 300)} | |
213 <div> | |
214 <form method="post" action="keywordTable.php"> | |
215 <b>語句:</b>{$search|escape} | |
216 <b>正規表現:</b>{if $use_regexp}使う{else}使わない{/if} | |
217 <b>種別:</b>{if $k_type == "*"}すべて{else}{$k_type}{/if} | |
218 <b>局:</b>{if $k_station == 0}すべて{else}{$k_station_name}{/if} | |
219 <b>カテゴリ:</b>{if $k_category == 0}すべて{else}{$k_category_name}{/if} | |
220 <b>件数:</b>{$programs|@count} | |
221 <input type="hidden" name="add_keyword" value="{$do_keyword}" /> | |
222 <input type="hidden" name="k_use_regexp" value="{$use_regexp}" /> | |
223 <input type="hidden" name="k_search" value="{$search}" /> | |
224 <input type="hidden" name="k_type" value="{$k_type}" /> | |
225 <input type="hidden" name="k_category" value="{$k_category}" /> | |
226 <input type="hidden" name="k_station" value="{$k_station}" /> | |
227 <input type="submit" value="この絞り込みを自動録画キーワードに登録" /> | |
228 </form> | |
229 </div> | |
230 {/if} | |
231 {/if} | |
232 | |
23
f3bf1be1a51b
Change: using ajax in custom reservation method
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
1
diff
changeset
|
233 <div id="floatBox4Dialog">jQuery UI Dialog</div> |
1 | 234 |
235 {literal} | |
236 <script type="text/javascript"> | |
237 var INISet = { | |
238 prgRecordURL : 'simpleReservation.php', // 簡易予約 | |
239 prgRecordPlusURL : 'recordp.php', // 詳細予約 | |
240 prgCancelURL : 'cancelReservation.php' // 予約キャンセル | |
241 } | |
242 </script> | |
243 {/literal} | |
244 </body> | |
245 </html> |