3-8
(利用FooTable的分頁+json功能)/templates/phone_book_index_b3.html
004 | <{if $now_op=="show_one_phone_book"}> |
008 | < h2 class = "text-center" id = "name" ><{$name}></ h2 > |
012 | < label class = "col-md-3 text-right" > |
013 | <{$smarty.const._MD_PHONEBOOK_CATE_SN}> |
015 | < div class = "col-md-9" id = "cate_sn" > |
022 | < label class = "col-md-3 text-right" > |
023 | <{$smarty.const._MD_PHONEBOOK_BIRTHDAY}> |
025 | < div class = "col-md-9" > |
032 | < label class = "col-md-3 text-right" > |
033 | <{$smarty.const._MD_PHONEBOOK_PHONE}> |
035 | < div class = "col-md-9" > |
042 | < label class = "col-md-3 text-right" > |
043 | <{$smarty.const._MD_PHONEBOOK_EMAIL}> |
045 | < div class = "col-md-9" > |
053 | < label class = "col-md-3 text-right" > |
054 | <{$smarty.const._MD_PHONEBOOK_ADDR}> |
056 | < div class = "col-md-9" > |
057 | <{$zip}><{$county}><{$city}><{$addr}> |
063 | < label class = "col-md-3 text-right" > |
064 | <{$smarty.const._MD_PHONEBOOK_NOTE}> |
066 | < div class = "col-md-9" > |
067 | < pre class = "well" id = "note" ><{$note}></ pre > |
071 | < div class = "text-right" > |
073 | < a href="<{$xoops_url}>/modules/phone_book/admin/main.php?op=delete_phone_book&sn=<{$sn}>" class="btn btn-danger"><{$smarty.const._TAD_DEL}></ a > |
074 | < a href="<{$xoops_url}>/modules/phone_book/admin/main.php?op=phone_book_form&sn=<{$sn}>" class="btn btn-warning"><{$smarty.const._TAD_EDIT}></ a > |
075 | < a href="<{$xoops_url}>/modules/phone_book/admin/main.php?op=phone_book_form" class="btn btn-primary"><{$smarty.const._TAD_ADD}></ a > |
077 | < a href="<{$action}>" class="btn btn-success"><{$smarty.const._TAD_HOME}></ a > |
082 | <{if $now_op=="list_phone_book"}> |
084 | < script src="<{$xoops_url}>/modules/tadtools/footable-bootstrap/js/footable.min.js" type="text/javascript"></ script > |
085 | < link rel = "stylesheet" href="<{$xoops_url}>/modules/tadtools/footable-bootstrap/css/footable.bootstrap.min.css" type="text/css" /> |
086 | < script type = "text/javascript" > |
088 | $(document).ready(function(){ |
090 | $('#my_table').footable({ |
091 | "columns": $.get('columns.json'), |
092 | "rows": $.get('rows.json') |
095 | $( "#keyword" ).autocomplete({ |
096 | source: "get_name.php" |
099 | $("#search_bar").hide(); |
101 | // $("#open_bar").click(function(){ |
102 | // $("#search_bar").toggle('slow'); |
103 | // $("#open_bar").toggleClass("btn-danger"); |
106 | $("#open_bar").toggle(function() { |
107 | $("#open_bar").html("關閉搜尋").removeClass('btn-info').addClass('btn-danger'); |
108 | $("#search_bar").fadeIn("slow"); |
110 | $("#open_bar").html("開啟搜尋").removeClass('btn-danger').addClass('btn-info'); |
111 | $("#search_bar").fadeOut("slow"); |
114 | $("#cate_sn").change(function(){ |
115 | location.href = "index.php?cate_sn=" + $("#cate_sn").val() + "&city=" + $("#city").val(); |
118 | $("#county").change(function(){ |
119 | var county_val = $("#county").val(); |
120 | $.post("ajax.php", { "county": county_val} , |
122 | $("#city").html(data); |
127 | $("#city").change(function(){ |
128 | location.href = "index.php?cate_sn=" + $("#cate_sn").val() + "&city=" + $("#city").val(); |
134 | < form action = "index.php" > |
137 | < div class = "col-md-2" > |
138 | < button type = "button" id = "open_bar" class = "btn btn-info" >開啟搜尋</ button > |
141 | < div class = "col-md-10" > |
142 | < div class = "row" id = "search_bar" > |
144 | < div class = "col-md-3" > |
146 | < select name = "cate_sn" id = "cate_sn" class = "form-control" > |
147 | < option value = "" ></ option > |
148 | <{foreach from=$cate_arr item=cate}> |
149 | < option value="<{$cate.cate_sn}>" <{if $cate_sn==$cate.cate_sn}>selected<{/if}>><{$cate.cate_title}></ option > |
155 | < div class = "col-md-3" > |
157 | < select name = "county" id = "county" class = "form-control" > |
158 | < option value = "" >請選擇縣市</ option > |
159 | <{foreach from=$county_arr item=county}> |
160 | < option value="<{$county}>"><{$county}></ option > |
165 | < div class = "col-md-3" > |
167 | < select name = "city" id = "city" class = "form-control" > |
168 | < option value = "" >選擇鄉鎮市區</ option > |
173 | < div class = "col-md-3" > |
174 | < input type = "text" name = "keyword" id = "keyword" class = "form-control" placeholder = "請輸入關鍵字" > |
182 | < table id = "my_table" class = "table table-striped table-hover" data-sorting = "true" data-filtering = "true" data-paging = "true" data-paging-size = "20" data-paging-limit = "10" ></ table > |
186 | < div class = "text-right" > |
187 | < a href="<{$xoops_url}>/modules/phone_book/admin/main.php?op=phone_book_form" class="btn btn-info"><{$smarty.const._TAD_ADD}></ a > |