線上書籍

Home

[1042] XOOPS模組開發進階

<div class="container-fluid"> <!--顯示表單--> <{if $now_op=="phone_book_cate_form"}> <div class="container"> <form action="<{$action}>" method="post" id="myForm" enctype="multipart/form-data" class="form-horizontal" role="form"> <!--分類標題--> <div class="form-group"> <label class="col-md-2 control-label"> <{$smarty.const._MA_PHONEBOOK_CATE_TITLE}> </label> <div class="col-md-5"> <input type="text" name="cate_title" id="cate_title" class="form-control" value="<{$cate_title}>" placeholder="<{$smarty.const._MA_PHONEBOOK_CATE_TITLE}>"> </div> </div> <!--分類排序--> <div class="form-group"> <label class="col-md-2 control-label"> <{$smarty.const._MA_PHONEBOOK_CATE_SORT}> </label> <div class="col-md-2"> <input type="text" name="cate_sort" id="cate_sort" class="form-control " value="<{$cate_sort}>" placeholder="<{$smarty.const._MA_PHONEBOOK_CATE_SORT}>"> </div> </div> <!--狀態--> <div class="form-group"> <label class="col-md-2 control-label"> <{$smarty.const._MA_PHONEBOOK_CATE_ENABLE}> </label> <div class="col-md-10"> <label class="radio-inline"> <input type="radio" name="cate_enable" id="cate_enable_1" value="1" <{if $cate_enable == "1"}>checked="checked"<{/if}>><{$smarty.const._YES}> </label> <label class="radio-inline"> <input type="radio" name="cate_enable" id="cate_enable_0" value="0" <{if $cate_enable == "0"}>checked="checked"<{/if}>><{$smarty.const._NO}> </label> </div> </div> <div class="text-center"> <!--分類編號--> <input type='hidden' name="cate_sn" value="<{$cate_sn}>"> <input type="hidden" name="op" value="<{$next_op}>"> <button type="submit" class="btn btn-primary"><{$smarty.const._TAD_SAVE}></button> </div> </form> </div> <{/if}> <!--列出所有資料--> <{if $now_op=="list_phone_book_cate"}> <script type="text/javascript"> $(document).ready(function(){ $('#sort').sortable({ opacity: 0.6, cursor: 'move', update: function() { var order = $(this).sortable('serialize'); $.post('save_sort.php', order, function(theResponse){ //$('#save_msg').html(theResponse); swal("Good job!", theResponse); }); } }); }); </script> <{if $all_content}> <div id="save_msg"></div> <table class="table table-striped table-hover"> <thead> <tr> <th> <!--分類標題--> <{$smarty.const._MA_PHONEBOOK_CATE_TITLE}> </th> <th> <!--狀態--> <{$smarty.const._MA_PHONEBOOK_CATE_ENABLE}> </th> <th> <{$smarty.const._TAD_FUNCTION}> </th> </tr> </thead> <tbody id="sort"> <{foreach from=$all_content item=data}> <tr id="cate_sn_<{$data.cate_sn}>"> <td> <!--分類標題--> <a href="<{$action}>?cate_sn=<{$data.cate_sn}>"><{$data.cate_title}></a> </td> <td> <!--狀態--> <{$data.cate_enable}> </td> <td> <a href="<{$xoops_url}>/modules/phone_book/admin/cate.php?op=delete_phone_book_cate&cate_sn=<{$data.cate_sn}>" class="btn btn-xs btn-danger"><{$smarty.const._TAD_DEL}></a> <a href="<{$xoops_url}>/modules/phone_book/admin/cate.php?op=phone_book_cate_form&cate_sn=<{$data.cate_sn}>" class="btn btn-xs btn-warning"><{$smarty.const._TAD_EDIT}></a> <img src="<{$xoops_url}>/modules/tadtools/treeTable/images/updown_s.png" style="cursor: s-resize;margin:0px 4px;" alt="<{$smarty.const._TAD_SORTABLE}>" title="<{$smarty.const._TAD_SORTABLE}>"> </td> </tr> <{/foreach}> </tbody> </table> <div class="text-right"> <a href="<{$xoops_url}>/modules/phone_book/admin/cate.php?op=phone_book_cate_form" class="btn btn-info"><{$smarty.const._TAD_ADD}></a> </div> <{$bar}> <{else}> <div class="jumbotron text-center"> <a href="<{$xoops_url}>/modules/phone_book/admin/cate.php?op=phone_book_cate_form" class="btn btn-info"><{$smarty.const._TAD_ADD}></a> </div> <{/if}> <{/if}> </div>