<div class="breadcrumbs" id="breadcrumbs">
	<ul class="breadcrumb">
		<li>
			<i class="icon-home home-icon"></i>
			<a href="#">Trang chủ</a>
		</li>
		<li><a href="#">Báo cáo</a></li>
		<li class="active">SMS logs</li>
	</ul><!-- .breadcrumb -->

	<div class="nav-search" id="nav-search">
		<form class="form-search">
			<span class="input-icon">
				<input type="text" placeholder="Tìm kiếm ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
				<i class="icon-search nav-search-icon"></i>
			</span>
		</form>
	</div><!-- #nav-search -->
</div>

<div class="page-content">

	<div class="row">
		<div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <div style="padding-bottom:4px" class="table-header">
                Danh sách log
            </div>
			<!-- PAGE CONTENT BEGINS -->
			<div class="table-responsive">
                <div role="grid" class="dataTables_wrapper" id="sample-table-2_wrapper">
                    <form onsubmit="return false;" id="smslog" >
                        <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>
							<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 == 'sender') {echo $sorting_order;} else {echo "sorting";} ?>" id="sender" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Người gửi: activate to sort column ascending">Người gửi</th>
							<th class="<?php if ($sorting_field == 'us_id') {echo $sorting_order;} else {echo "sorting";} ?>" id="us_id" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Tài khoản: activate to sort column ascending">Tài khoản</th>
							<th class="<?php if ($sorting_field == 'mobody') {echo $sorting_order;} else {echo "sorting";} ?>" id="mobody" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="MO: activate to sort column ascending">MO</th>
							<th class="<?php if ($sorting_field == 'mtbody') {echo $sorting_order;} else {echo "sorting";} ?>" id="mtbody" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="MT: activate to sort column ascending">MT</th>
							<th class="<?php if ($sorting_field == 'created_time') {echo $sorting_order;} else {echo "sorting";} ?>" id="created_time" class="hidden-480" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Thời gian: activate to sort column ascending">
								<i class="icon-time bigger-110 hidden-480"></i>
								Thời gian gửi
							</th>
						</tr>
					</thead>

					<tbody role="alert" aria-live="polite" aria-relevant="all">
						<?php foreach ($smslogs as $smslog): ?>
						<tr>
							<td class="center">
								<label>
									<input type="checkbox" class="ace" />
									<span class="lbl"></span>
								</label>
							</td>

							<td>
								<a href="#"><?php echo $smslog['sender']; ?></a>
							</td>
							<td><?php echo $smslog['username']; ?></td>
							<td><?php echo $smslog['mobody']; ?></td>
							<td><?php echo $smslog['mtbody']; ?></td>
							<td><?php echo $smslog['created_time']; ?></td>
						</tr>
						<?php endforeach; ?>
					</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><!-- /.table-responsive -->

			<!-- PAGE CONTENT ENDS -->
		</div><!-- /.col -->
	</div><!-- /.row -->
</div><!-- /.page-content -->
<script type="text/javascript">
    window.onload = function ()
    {
        init_page();
    }


</script>