comparison templates/reservationTable.html @ 25:03107333d942

add: editable reserve program's title & description
author yoneda <epgrec@park.mda.or.jp>
date Sat, 25 Jul 2009 21:29:32 +0900
parents f5a9f0eb4858
children 84220382fea8
comparison
equal deleted inserted replaced
24:f0ef6fb63aa4 25:03107333d942
7 <title>{$sitetitle}</title> 7 <title>{$sitetitle}</title>
8 <meta http-equiv="Content-Style-Type" content="text/css"> 8 <meta http-equiv="Content-Style-Type" content="text/css">
9 9
10 {literal} 10 {literal}
11 <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> 11 <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
12 <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
13 <link rel="stylesheet" href="start/jquery-ui-1.7.2.custom.css" type="text/css">
12 <script type="text/javascript"> 14 <script type="text/javascript">
13 var PRG = { 15 var PRG = {
14 rec:function(id){ 16 rec:function(id){
15 $.get(INISet.prgCancelURL, { reserve_id: id } ,function(data){ 17 $.get(INISet.prgCancelURL, { reserve_id: id } ,function(data){
16 18
19 } 21 }
20 else { 22 else {
21 $('#resid_' + id ).hide(); 23 $('#resid_' + id ).hide();
22 } 24 }
23 }); 25 });
26 },
27 editdialog:function(id) {
28 var str;
29 str = '<div class="prg_title">予約ID:' + id + '</div>';
30 str += '<input type="hidden" name="reserve_id" id="id_reserve_id" value="' + id + '" />';
31 str += '<div><span class="labelLeft">タイトル</span><input name="title" id="id_title" size="30" value="'+ $('#tid_' + id ).html() + '" /></div>';
32 str += '<div><span class="labelLeft">概要</span><textarea name="description" id="id_description" cols="30" rows="5" >' + $('#did_' + id ).html() + '</textarea></div>';
33 str += '<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.edit()" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">変更する</a></div>';
34
35 $('#floatBox4Dialog').html(str);
36 $('#floatBox4Dialog').dialog('open','center');
37 },
38 edit:function() {
39 var id_reserve_id = $('#id_reserve_id').val();
40 var id_title = $('#id_title').val();
41 var id_description = $('#id_description').val();
42
43 $.post('changeReservation.php', { reserve_id: id_reserve_id,
44 title: id_title,
45 description: id_description }, function( data ) {
46 if(data.match(/^error/i)){
47 alert(data);
48 $('#floatBox4Dialog').dialog('close');
49
50 }
51 else {
52 $('#tid_' + id_reserve_id ).html( id_title );
53 $('#did_' + id_reserve_id ).html( id_description );
54 $('#floatBox4Dialog').dialog('close');
55 }
56 });
24 } 57 }
25 } 58 }
59 $(document).ready(function () {
60 var DG = $('#floatBox4Dialog');
61 DG.dialog({title:'予約編集',width:500});
62 DG.dialog('close');
63 });
64
26 </script> 65 </script>
27 <style type="text/css"> 66 <style type="text/css">
28 <!-- 67 <!--
29 body {padding:4px;margin:0;font-size:10pt;} 68 body {padding:4px;margin:0;font-size:10pt;}
30 a {text-decoration:none;} 69 a {text-decoration:none;}
61 table#reservation_table tr.ctg_drama, #category_select a.ctg_drama {background-color: #D8FFD8;} 100 table#reservation_table tr.ctg_drama, #category_select a.ctg_drama {background-color: #D8FFD8;}
62 table#reservation_table tr.ctg_anime, #category_select a.ctg_anime {background-color: #FFE4C8;} 101 table#reservation_table tr.ctg_anime, #category_select a.ctg_anime {background-color: #FFE4C8;}
63 table#reservation_table tr.ctg_variety, #category_select a.ctg_variety {background-color: #FFD2EB;} 102 table#reservation_table tr.ctg_variety, #category_select a.ctg_variety {background-color: #FFD2EB;}
64 table#reservation_table tr.ctg_10, #category_select a.ctg_10 {background-color: #E4F4F4;} 103 table#reservation_table tr.ctg_10, #category_select a.ctg_10 {background-color: #E4F4F4;}
65 104
105 #floatBox4Dialog .prg_title{font-size:120%;font-weight:bold;padding:0.4em 0;text-align:center;}
106 #floatBox4Dialog .prg_rec_cfg{background:#EEE;padding:1em 2em;margin:0.4em 0;}
107 #floatBox4Dialog .labelLeft {width:8em;float:left;text-align:right;}
108 #floatBox4Dialog .button {padding:0.4em 1em;}
109
66 110
67 --> 111 -->
68 </style> 112 </style>
69 {/literal} 113 {/literal}
70 114
93 137
94 {foreach from=$reservations item=reserve} 138 {foreach from=$reservations item=reserve}
95 <tr id="resid_{$reserve.id}" class="ctg_{$reserve.cat}"> 139 <tr id="resid_{$reserve.id}" class="ctg_{$reserve.cat}">
96 <td>{$reserve.id}</td> 140 <td>{$reserve.id}</td>
97 <td>{$reserve.type}</td> 141 <td>{$reserve.type}</td>
98 <td>{$reserve.channel}</td> 142 <td id="chid_{$reserve.id}">{$reserve.channel}</td>
99 <td>{$reserve.starttime}</td> 143 <td id="stid_{$reserve.id}">{$reserve.starttime}</td>
100 <td>{$reserve.endtime}</td> 144 <td>{$reserve.endtime}</td>
101 <td>{$reserve.mode}</td> 145 <td>{$reserve.mode}</td>
102 <td>{$reserve.title|escape}</td> 146 <td style="cursor: pointer" id="tid_{$reserve.id}" onClick="javascript:PRG.editdialog('{$reserve.id}')">{$reserve.title|escape}</td>
103 <td>{$reserve.description|escape}</td> 147 <td style="cursor: pointer" id="did_{$reserve.id}" onClick="javascript:PRG.editdialog('{$reserve.id}')">{$reserve.description|escape}</td>
104 <td>{if $reserve.autorec}{$reserve.autorec}{/if}</td> 148 <td>{if $reserve.autorec}{$reserve.autorec}{/if}</td>
105 <td><input type="button" value="削除" onClick="javascript:PRG.rec('{$reserve.id}')" /></td> 149 <td><input type="button" value="削除" onClick="javascript:PRG.rec('{$reserve.id}')" /></td>
106 </tr> 150 </tr>
107 {/foreach} 151 {/foreach}
108 </table> 152 </table>
109 {else} 153 {else}
110 現在、予約はありません 154 現在、予約はありません
111 {/if} 155 {/if}
112 156
157 <div id="floatBox4Dialog">jQuery UI Dialog</div>
113 158
114 159
115 {literal} 160 {literal}
116 <script type="text/javascript"> 161 <script type="text/javascript">
117 var INISet = { 162 var INISet = {