<div id="breadcrumbs" class="breadcrumbs">

    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="#">Trang chủ</a>
        </li>

        <li>
            <a href="#">Quản lý tin nhắn</a>
        </li>
        
    </ul><!-- .breadcrumb -->

    <div id="nav-search" class="nav-search">
        <form class="form-search">
            <span class="input-icon">
                <input type="text" autocomplete="off" id="nav-search-input" class="nav-search-input" placeholder="Tìm kiếm ...">
                <i class="icon-search nav-search-icon"></i>
            </span>
        </form>
    </div><!-- #nav-search -->
</div>
<div class="page-content">
    <div class="page-header">
        <h1>
            Tin nhắn
            <small>
                <i class="icon-double-angle-right"></i>
                Mẫu tin nhắn
            </small>
        </h1>
    </div><!-- /.page-header -->

    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <div style="padding-bottom:4px" class="table-header">
                Tin nhắn

                <button href="#addSms" data-toggle="modal" class="btn btn-success pull-right">
                    <i class="icon-plus"></i>
                    Thêm tin nhắn
                </button>

            </div>

            <div class="table-responsive">
                <div role="grid" class="dataTables_wrapper" id="sample-table-2_wrapper">
                    <form autocomplete="off" onsubmit="return false;" id="collaborator" >
                        <div class="row">
                            <div class="col-sm-6">
                                <div id="sample-table-2_length" class="dataTables_length"><label>Hiện thị 
                                        <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2">                                      
                                            <?php foreach ($itemsoptions as $option) { ?>
                                            <option <?php if($option == $perpage) echo "selected"; ?> value="<?=$option?>"><?=$option?></option>
                                            <?php } ?>
                                        </select> bản ghi</label>

                                </div>
                            </div>

                            <div class="col-sm-6">
                                <div class="dataTables_filter" id="sample-table-2_filter">
                                    <label>Tìm kiếm: 
                                        <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' aria-controls="sample-table-2"></label>
                                </div>
                            </div>
                        </div>
                        <input type="hidden" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order;?>" />
                        <input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field;?>"/>
                    </form>
                    <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info">
                        <thead>
                            <tr role="row">
                                <th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label="">
                                    <label>
                                        <input type="checkbox" class="ace">
                                        <span class="lbl"></span>
                                    </label>
                                </th>
                             
                                <th class="<?php if ($sorting_field == 'sms_content') {echo $sorting_order;} else {echo "sorting";}?>" id="sms_content" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 283px;" aria-label="Họ tên: activate to sort column ascending">Mẫu tin nhắn</th>
                                <th class="<?php if ($sorting_field == 'sms_reply') {echo $sorting_order;} else {echo "sorting";}?>" id="sms_reply" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Số điện thoại: activate to sort column ascending">Trả lời</th>
                                <th class="<?php if ($sorting_field == 'service_id') {echo $sorting_order;} else {echo "sorting";}?>" id="service_id" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Số điện thoại: activate to sort column ascending">Mã dịch vụ</th> 
                                <th class="<?php if ($sorting_field == 'commandcode') {echo $sorting_order;} else {echo "sorting";}?>" id="commandcode" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="Ngày đăng ký: activate to sort column ascending">
                                    
                                    Mã câu lệnh
                                </th>
                                   <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label="">Chức năng</th></tr>
                        </thead>


                        <tbody role="alert" aria-live="polite" aria-relevant="all">
                            
                            <?php
                            foreach ($smstemplates as $smstemplate) {
                                ?>
                            <tr class="odd">
                                <td class="center  sorting_1">
                                    <label>
                                        <input type="checkbox" class="ace">
                                        <span class="lbl"></span>
                                    </label>
                                </td>

                                
                                <td class=" "><?php echo $smstemplate['sms_content']?></td>
                                <td class=" ">
                                    <a href="#"><?php echo $smstemplate['sms_reply']?></a>
                                </td>
                                <td class="hidden-480 "><?php echo $smstemplate['service_id']?></td>
                                <td class=" "><?php echo $smstemplate['commandcode']?></td>

                               

                                <td class=" ">
                                    <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
                                        <a href="#" class="blue">
                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/mau_tin_nhan/xem/<?php echo $smstemplate['sms_id'];?>'  class="icon-zoom-in bigger-130"></i>
                                        </a>

                                        <a href="#" class="green">
                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/mau_tin_nhan/sua/<?php echo $smstemplate['sms_id'];?>' data-toggle="modal" href='#editUser' class="icon-pencil bigger-130"></i>
                                        </a>

                                        <a href="#" class="red">
                                            <i data-toggle="ajaxModal" href='http://viettel.violet.vn/admin/mau_tin_nhan/xoa/<?php echo $smstemplate['sms_id'];?>' data-toggle="modal" href='#deleteUser' class="icon-trash bigger-130"></i>
                                        </a>
                                    </div>

                                    <div class="visible-xs visible-sm hidden-md hidden-lg">
                                        <div class="inline position-relative">
                                            <button data-toggle="dropdown" class="btn btn-minier btn-yellow dropdown-toggle">
                                                <i class="icon-caret-down icon-only bigger-120"></i>
                                            </button>

                                            <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
                                                <li>
                                                    <a title="" data-rel="tooltip" class="tooltip-info" href="#" data-original-title="View">
                                                        <span class="blue">
                                                            <i class="icon-zoom-in bigger-120"></i>
                                                        </span>
                                                    </a>
                                                </li>

                                                <li>
                                                    <a title="" data-rel="tooltip" class="tooltip-success" href="#" data-original-title="Edit">
                                                        <span class="green">
                                                            <i class="icon-edit bigger-120"></i>
                                                        </span>
                                                    </a>
                                                </li>

                                                <li>
                                                    <a title="" data-rel="tooltip" class="tooltip-error" href="#" data-original-title="Delete">
                                                        <span class="red">
                                                            <i class="icon-trash bigger-120"></i>
                                                        </span>
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <?php } ?>







                        </tbody></table><div class="row"><div class="col-sm-6">
                                <div class="dataTables_info" id="sample-table-2_info">Hiển thị <?php echo ($start+1)?> đến <?php echo ($start+$perpage)?> của <?php echo $total?> bản ghi</div>
                                    
                            </div>
                        <div class="col-sm-6">
                            <div class="dataTables_paginate paging_bootstrap">
                                <ul class="pagination">
                                    <?php echo $paging; ?>
                                </ul>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

            
        </div>

        <!-- PAGE CONTENT ENDS -->
    </div><!-- /.col -->
</div>
<script type="text/javascript">
    window.onload = function ()
    {
        init_page();
    }


</script>