:::

3-12 (舊版FooTable)/templates/phone_book_index_b3.html

<{$toolbar}>

<!--顯示某一筆資料-->
<{if $now_op=="show_one_phone_book"}>

  <{$jeditable_set}>

  <h2 class="text-center" id="name"><{$name}></h2>

  <!--分類編號-->
  <div class="row">
    <label class="col-md-3 text-right">
      <{$smarty.const._MD_PHONEBOOK_CATE_SN}>
    </label>
    <div class="col-md-9" id="cate_sn">
      <{$cate_sn_title}>
    </div>
  </div>

  <!--生日-->
  <div class="row">
    <label class="col-md-3 text-right">
      <{$smarty.const._MD_PHONEBOOK_BIRTHDAY}>
    </label>
    <div class="col-md-9">
      <{$birthday}>
    </div>
  </div>

  <!--電話-->
  <div class="row">
    <label class="col-md-3 text-right">
      <{$smarty.const._MD_PHONEBOOK_PHONE}>
    </label>
    <div class="col-md-9">
      <{$phone}>
    </div>
  </div>

  <!--電子信箱-->
  <div class="row">
    <label class="col-md-3 text-right">
      <{$smarty.const._MD_PHONEBOOK_EMAIL}>
    </label>
    <div class="col-md-9">
      <{$email}>
    </div>
  </div>


  <!--地址-->
  <div class="row">
    <label class="col-md-3 text-right">
      <{$smarty.const._MD_PHONEBOOK_ADDR}>
    </label>
    <div class="col-md-9">
      <{$zip}><{$county}><{$city}><{$addr}>
    </div>
  </div>

  <!--備註-->
  <div class="row">
    <label class="col-md-3 text-right">
      <{$smarty.const._MD_PHONEBOOK_NOTE}>
    </label>
    <div class="col-md-9">
      <pre class="well" id="note"><{$note}></pre>
    </div>
  </div>

  <div class="text-right">
    <{if $isAdmin}>
      <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>
      <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>
      <a href="<{$xoops_url}>/modules/phone_book/admin/main.php?op=phone_book_form" class="btn btn-primary"><{$smarty.const._TAD_ADD}></a>
    <{/if}>
    <a href="<{$action}>" class="btn btn-success"><{$smarty.const._TAD_HOME}></a>
  </div>
<{/if}>

<!--列出所有資料-->
<{if $now_op=="list_phone_book"}>

  <script type="text/javascript">

    $(document).ready(function(){

      $( "#keyword" ).autocomplete({
        source: "get_name.php"
      });

      <{if $def_cate_sn or $def_county or $def_city or $def_keyword}>
        $("#search_bar").show();
        $("#open_bar").toggle(function() {
          $("#open_bar").html("開啟搜尋").removeClass('btn-danger').addClass('btn-info');
          $("#search_bar").fadeOut("slow");
        }, function() {
          $("#open_bar").html("關閉搜尋").removeClass('btn-info').addClass('btn-danger');
          $("#search_bar").fadeIn("slow");
        });
      <{else}>
        $("#search_bar").hide();
        $("#open_bar").toggle(function() {
          $("#open_bar").html("關閉搜尋").removeClass('btn-info').addClass('btn-danger');
          $("#search_bar").fadeIn("slow");
        }, function() {
          $("#open_bar").html("開啟搜尋").removeClass('btn-danger').addClass('btn-info');
          $("#search_bar").fadeOut("slow");
        });
      <{/if}>

      $("#cate_sn").change(function(){
        location.href = "index.php?cate_sn=" + $("#cate_sn").val() + "&city=" + $("#city").val();
      });

      $("#county").change(function(){
        var county_val = $("#county").val();
        $.post("ajax.php", { "county": county_val} ,
          function(data) {
            $("#city").html(data);
          });
      });


      $("#city").change(function(){
        location.href = "index.php?cate_sn=" + $("#cate_sn").val() + "&city=" + $("#city").val();
      });

    });
  </script>

  <form action="index.php">
    <div class="row">

      <div class="col-md-2">

        <{if $def_cate_sn or $def_county or $def_city or $def_keyword}>
          <button type="button" id="open_bar" class="btn btn-danger">關閉搜尋</button>
        <{else}>
          <button type="button" id="open_bar" class="btn btn-info">開啟搜尋</button>
        <{/if}>


      </div>

      <div class="col-md-10">
        <div class="row" id="search_bar">
          <{if $cate_arr}>
            <div class="col-md-2">
              <!-- 分類選單 -->
              <select name="cate_sn" id="cate_sn" class="form-control">
                <option value=""></option>
                <{foreach from=$cate_arr item=cate}>
                  <option value="<{$cate.cate_sn}>" <{if $def_cate_sn==$cate.cate_sn}>selected<{/if}>><{$cate.cate_title}></option>
                <{/foreach}>
              </select>
            </div>
          <{/if}>

          <div class="col-md-2">
            <!-- 縣市選單 -->
            <select name="county" id="county" class="form-control">
              <option value="">請選擇縣市</option>
              <{foreach from=$county_arr item=county}>
                <option value="<{$county}>" <{if $def_county==$county}>selected<{/if}>><{$county}></option>
              <{/foreach}>
            </select>

          </div>
          <div class="col-md-2">
            <!-- 鄉鎮市區選單 -->
            <select name="city" id="city" class="form-control">
              <option value="">選擇鄉鎮市區</option>

            </select>

          </div>
          <div class="col-md-3">
            <input type="text" name="keyword" id="keyword" class="form-control" placeholder="請輸入關鍵字" value="<{$def_keyword}>">
          </div>
          <div class="col-md-3">
            <button type="submit" class="btn btn-info">搜尋</button>
          </div>
        </div>
      </div>

    </div>
  </form>

  <{if $all_content}>
    <table class="table table-striped table-hover footable">
      <thead>
        <tr>
          <!--姓名-->
          <th data-class='expand'>
            <{$smarty.const._MD_PHONEBOOK_NAME}>
          </th>
          <!--生日-->
          <th data-hide="phone">
            <{$smarty.const._MD_PHONEBOOK_BIRTHDAY}>
          </th>
          <!--電話-->
          <th>
            <{$smarty.const._MD_PHONEBOOK_PHONE}>
          </th>
          <!--電子信箱-->
          <th data-hide="phone">
            <{$smarty.const._MD_PHONEBOOK_EMAIL}>
          </th>
          <!--地址-->
          <th data-hide="phone,tablet">
            <{$smarty.const._MD_PHONEBOOK_ADDR}>
          </th>
          <!--分類-->
          <th data-hide="phone,tablet">
            <{$smarty.const._MD_PHONEBOOK_CATE_SN}>
          </th>
          <{if $isAdmin}>
            <th data-hide="phone,tablet"><{$smarty.const._TAD_FUNCTION}></th>
          <{/if}>
        </tr>
      </thead>

      <tbody>
        <{foreach from=$all_content item=data}>
          <tr>

            <td>
              <!--姓名-->
              <a href="<{$action}>?sn=<{$data.sn}>"><{$data.name}></a>
            </td>

            <td>
              <!--生日-->
              <{$data.birthday}>
            </td>

            <td>
              <!--電話-->
              <{$data.phone}>
            </td>

            <td>
              <!--電子信箱-->
              <{$data.email}>
            </td>

            <td>
              <!--郵遞區號-->
              <{$data.zip}>
              <!--縣市-->
              <{$data.county}>
              <!--鄉鎮市區-->
              <{$data.city}>
              <!--地址-->
              <{$data.addr}>
            </td>

            <td>
              <!--分類-->
              <{$data.cate_title}>
            </td>

            <{if $isAdmin}>
              <td>
                <a href="<{$xoops_url}>/modules/phone_book/admin/main.php?op=delete_phone_book&sn=<{$data.sn}>" class="btn btn-xs btn-danger"><{$smarty.const._TAD_DEL}></a>
                <a href="<{$xoops_url}>/modules/phone_book/admin/main.php?op=phone_book_form&sn=<{$data.sn}>" class="btn btn-xs btn-warning"><{$smarty.const._TAD_EDIT}></a>
              </td>
            <{/if}>
          </tr>
        <{/foreach}>
      </tbody>
    </table>


    <{if $isAdmin}>
      <div class="text-right">
        <a href="<{$xoops_url}>/modules/phone_book/admin/main.php?op=phone_book_form" class="btn btn-info"><{$smarty.const._TAD_ADD}></a>
      </div>
    <{/if}>

    <{$bar}>
  <{else}>
    <{if $isAdmin}>
      <div class="jumbotron text-center">
        <a href="<{$xoops_url}>/modules/phone_book/admin/main.php?op=phone_book_form" class="btn btn-info"><{$smarty.const._TAD_ADD}></a>
      </div>
    <{/if}>
  <{/if}>
<{/if}>

 


:::

搜尋

QR Code 區塊

https%3A%2F%2Fwww.tad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D39%26tbdsn%3D1232

書籍目錄

展開 | 闔起

線上使用者

38人線上 (7人在瀏覽線上書籍)

會員: 0

訪客: 38

更多…