コード例 #1
0
ファイル: orderlist.php プロジェクト: h2dvnnet/eLib
 function show_orderlist()
 {
     global $orderlist_model;
     if ($_SESSION['userid'] != NULL) {
         $count = $orderlist_model->get_num();
         echo "<div class='goods-page'>\n\t\t\t<p style='display: none' id='emptyorder'>Danh sách đơn sách bạn trống</p>\n\t\t\t\t\t<div class='goods-data clearfix' id='content2order'>\n\t\t\t\t\t\t<div class='table-wrapper-responsive'>\n\t\t\t\t\t\t<table summary='Shopping cart'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th class='goods-page-image'>#</th>\n\t\t\t\t\t\t\t<th class='goods-page-title'>Thời gian</th>\n\t\t\t\t\t\t\t<th class='goods-page-description'>Số sách</th>\n\t\t\t\t\t\t\t<th class='goods-page-stock' width='1%'>Tình trạng</th>\n\t\t\t\t\t\t\t<th class='goods-page-stock' colspan='2' width='1%'></th>\n\t\t\t\t\t\t</tr>";
         $orderlist = $orderlist_model->get();
         if ($orderlist != NULL) {
             foreach ($orderlist as $data) {
                 echo "<tr id='order" . $data['id'] . "'>\n\t\t\t\t\t<td class='goods-page-image'>\n\t\t\t\t\t\t" . $data['id'] . "\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='goods-page-title'>\n\t\t\t\t\t\t" . ti_me($data['time']) . "\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='goods-page-description'>\n\t\t\t\t\t\t" . $data['count'] . "\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='goods-page-stock'>";
                 $status = '<span id="orderTus' . $data['id'] . '"class="label label-';
                 switch ($data['status']) {
                     case '0':
                         $status .= 'warning">Chưa xác nhận';
                         break;
                     case '1':
                         $status .= 'default">Chưa mượn';
                         break;
                     case '2':
                         $status .= 'primary">Đang mượn';
                         break;
                     case '3':
                         $status .= 'success">Đã trả';
                         break;
                     case '4':
                         $status .= 'danger">Đã hủy';
                         break;
                 }
                 if ($data['status'] == 0) {
                     if ($data['reconfirm'] == 1) {
                         $status .= ' - Đang xác nhận lại';
                     } else {
                         if ($data['reconfirm'] == 2) {
                             $status .= ' - Đã xác nhận lại';
                         }
                     }
                 }
                 $status .= '</span>';
                 echo $status;
                 echo "</td>\n\t\t\t\t\t<td class='goods-page-time'>\n\t\t\t\t\t\t<a href='../../donsach/" . $data['id'] . "' class='btn btn-xs default btn-editable'><i class='fa fa-pencil'></i> Xem</a>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='del-goods-col'>";
                 if ($data['status'] == 0 || $data['status'] == 1) {
                     echo "<a class='del-goods' alt='Hủy đơn sách' id='btncancel" . $data['id'] . "' onclick='cancelorder(" . $data['id'] . ")'></a>";
                 }
                 echo "</td>\n\t\t\t\t\t</tr>";
             }
         }
         echo "<div id='contentorder' count='" . $count . "'></div></table>\n               </div>\n             </div>\n           </div>\n         ";
     }
 }
コード例 #2
0
ファイル: wishlist.php プロジェクト: h2dvnnet/eLib
 function show_wishlist()
 {
     global $wishlist_model;
     if ($_SESSION['userid'] != NULL) {
         $count = $wishlist_model->get_num();
         echo "<div class='goods-page'>\n\t\t\t<p style='display: none' id='emptywish'>Sách yêu thích của bạn trống</p>\n\t\t\t\t\t<div class='goods-data clearfix' id='content2wish'>\n\t\t\t\t\t\t<div class='table-wrapper-responsive'>\n\t\t\t\t\t\t<table summary='Shopping cart'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th class='goods-page-image'>Hình ảnh</th>\n\t\t\t\t\t\t\t<th class='goods-page-title'>Tên sách</th>\n\t\t\t\t\t\t\t<th class='goods-page-description'>Mô tả</th>\n\t\t\t\t\t\t\t<th class='goods-page-stock'>Sách còn</th>\n\t\t\t\t\t\t\t<th class='goods-page-time' colspan='2'>Thời gian thêm</th>\n\t\t\t\t\t\t</tr>";
         $wishlist = $wishlist_model->get();
         if ($wishlist != NULL) {
             foreach ($wishlist as $data) {
                 echo "<tr id='wish" . $data['id'] . "'>\n\t\t\t\t\t<td class='goods-page-image'>\n\t\t\t\t\t\t<a href='../../" . sf($data['title'], 0) . "." . $data['id'] . ".html'><img src='../../135x180/" . $data['img1'] . "'></a>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='goods-page-title'>\n\t\t\t\t\t\t<h3><a href='../../" . sf($data['title'], 0) . "." . $data['id'] . ".html'>" . $data['title'] . "</a></h3>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='goods-page-description'>\n\t\t\t\t\t\t<p>" . $data['des'] . "</p>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='goods-page-stock'>";
                 if ($data['remain'] != 0) {
                     echo $data['remain'];
                 } else {
                     echo 'Đã hết sách';
                 }
                 echo "</td>\n\t\t\t\t\t<td class='goods-page-time'>\n\t\t\t\t\t\t<p>" . ti_me($data[timeadd]) . "</p>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='del-goods-col'>\n\t\t\t\t\t\t<a class='del-goods' onclick='delwish2(" . $data[id] . ")'></a>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
             }
         }
         echo "<div id='contentwish' count='" . $count . "'></div></table>\n               </div>\n             </div>\n           </div>\n         ";
     }
 }
コード例 #3
0
ファイル: notify.php プロジェクト: h2dvnnet/eLib
    function show_data()
    {
        echo '<div class="goods-data clearfix" id="content2wish">
				<div class="table-wrapper-responsive">
					<table summary="Shopping cart">
						<tbody id="data-noti">';
        if ($_SESSION['userid'] != NULL) {
            global $notify_model;
            if ($notify_model->record != 0) {
                $result = $notify_model->data;
                foreach ($result as $data) {
                    echo '<tr>';
                    if ($data['seen'] != 1) {
                        echo "<td class='new-noti' onclick='seen_notify(" . $data['id'] . ")'>";
                    } else {
                        echo '<td>';
                    }
                    echo "\n\t\t\t\t\t\t<a href='" . $data['link'] . "' class='nohighlight'>\n\t\t\t\t\t\t\t<p>" . $data['content'] . "</p>\n\t\t\t\t\t\t\t<div class='notitime'>" . ti_me($data['time']) . "</div>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
                }
            } else {
                echo "<center><p>Không có thông báo nào</p></center>";
            }
        } else {
            echo "<center><p>Bạn chưa đăng nhập, không thể xem thông báo</p></center>";
        }
        echo '		</tbody>
				</table>
            </div>';
        global $notify_model;
        if ($_SESSION['userid'] != NULL && $notify_model->record > 10) {
            echo '<div class="goods-page" style="margin-top:20px">
					<center><button class="btn btn-default" id="load_more" style="float: none">Xem thêm <i class="fa fa-circle-o-notch"></i></button></center>
				</div>';
        }
        echo '</div>';
    }
コード例 #4
0
ファイル: get-wishlist.php プロジェクト: h2dvnnet/eLib
                    return -1;
                }
            }
        }
        break;
}
usort($wishlist, 'compare');
$iTotalRecords = count($x) - 1;
// Tổng số sách lấy được
$iDisplayLength = intval($_REQUEST['length']);
// Số sách trên 1 trang
$iDisplayLength = $iDisplayLength < 0 ? $iTotalRecords : $iDisplayLength;
// Kiểm tra
$iDisplayStart = intval($_REQUEST['start']);
// Bắt đầu lấy
$sEcho = intval($_REQUEST['draw']);
// Số lần get (Đéo cần quan tâm)
$records["data"] = array();
$end = $iDisplayStart + $iDisplayLength;
// Kết thúc lấy
$end = $end > $iTotalRecords ? $iTotalRecords : $end;
// Kiểm tra
for ($i = $iDisplayStart; $i < $end; $i++) {
    if ($wishlist[$i] != NULL) {
        $records["data"][] = array('<input type="checkbox" name="id[]" value="' . $wishlist[$i][0] . '">', $wishlist[$i][0], $wishlist[$i][1], ti_me($wishlist[$i][2]), '<a href="book-edit.php?id=' . $row2['id'] . '" class="btn btn-xs default btn-editable"><i class="fa fa-pencil"></i> Sửa</a>');
    }
}
$records["draw"] = $sEcho;
$records["recordsTotal"] = $iTotalRecords;
$records["recordsFiltered"] = $iTotalRecords;
die(json_encode($records));
コード例 #5
0
ファイル: header.php プロジェクト: h2dvnnet/eLib
 function show_noti()
 {
     global $header_model;
     if ($_SESSION['userid'] != NULL) {
         echo "\n\t\t\t<div class='top-cart-block'>\n\t\t\t<div class='top-cart-info'>";
         $count = $header_model->get_noti_num();
         if ($countnoti > 0) {
             echo "<script>\$(document).attr('title','(" . $count . ") '+title);</script>";
         }
         echo "\n\t\t\t\t<a href='javascript:void(0);' class='top-cart-info-count' id='noticount'>" . $count . "</a>\n\t\t\t\t<a href='javascript:void(0);' class='top-cart-info-value'></a>\n\t\t\t</div>\n\t\t\t<i class='fa fa-bell'></i>\n\t\t\t<div class='top-cart-content-wrapper'>\n\t\t\t\t<div class='top-cart-content'>\n\t\t\t\t<ul class='scroller' style='height: 250px;' id='noticontent'>";
         $noti = $header_model->get_noti();
         if ($noti != NULL) {
             foreach ($noti as $data) {
                 echo "<li><strong class='noticontent2'><a onclick='seen_notify(" . $data['id'] . ")' href='" . $data['link'] . "'>" . $data['content'] . "</a></strong><div class='notitime'>" . ti_me($data['time']) . "</div></li>";
             }
         } else {
             echo "<center>Bạn không có thông báo mói</center>";
         }
         echo "\n\t\t\t\t</ul>\n\t\t\t\t<div class='text-right'>\n\t\t\t\t\t<a href='../../thong-bao' class='btn btn-default'>Xem tất cả</a>\n\t\t\t\t\t<a onclick='seen_all()' class='btn btn-primary'>Đã xem</a>\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>            \n\t\t\t</div>";
     }
 }
コード例 #6
0
ファイル: get-unseen-notify.php プロジェクト: h2dvnnet/eLib
            } else {
                if ($hours <= 24) {
                    return $time_ago = "Cách đây {$hours} tiếng";
                } else {
                    if ($days <= 7) {
                        return $time_ago = 'Cách đây ' . $days . ' ngày';
                    } else {
                        if ($weeks <= 4.3) {
                            return $time_ago = 'Cách đây ' . $weeks . ' tuần';
                        } else {
                            if ($months <= 12) {
                                return $time_ago = 'Cách đây ' . $months . ' tháng';
                            } else {
                                return $time_ago = 'Cách đây ' . $years . ' năm';
                            }
                        }
                    }
                }
            }
        }
    }
    require_once '../assets/config.php';
    if ($_SESSION['userid'] != NULL) {
        $querynoti = @mysql_query("SELECT * FROM `notification` where `userid`='" . $_SESSION['userid'] . "' and `seen`='0' ORDER BY `id` DESC");
        while ($rownoti = @mysql_fetch_assoc($querynoti)) {
            $rownoti['time'] = ti_me($rownoti['time']);
            $result[] = $rownoti;
        }
    }
    die(json_encode($result));
}
コード例 #7
0
ファイル: order-view.php プロジェクト: h2dvnnet/eLib
														<div class="col-md-5 name">
															Thời gian mượn
														</div>
														<div class="col-md-7 value">
															<?php 
    echo ti_me($row['timestart']);
    ?>
														</div>
													</div>
													<div class="row static-info">
														<div class="col-md-5 name">
															Thời gian trả
														</div>
														<div class="col-md-7 value">
															<?php 
    echo ti_me($row['timestop']);
    ?>
														</div>
													</div>
												</div>
											</div>
										</div>
										<div class="col-md-6 col-sm-12">
											<div class="portlet blue-hoki box">
												<div class="portlet-title">
													<div class="caption">
														<i class="fa fa-cogs"></i>Thông tin người đặt
													</div>
													<div class="actions">
														<a target='_blank' href="user-edit.php?id=<?php 
    echo $row2['id'];
コード例 #8
0
ファイル: get-request2.php プロジェクト: h2dvnnet/eLib
// Bắt đầu lấy
$sEcho = intval($_REQUEST['draw']);
// Số lần get (Đéo cần quan tâm)
$records["data"] = array();
$end = $iDisplayStart + $iDisplayLength;
// Kết thúc lấy
$end = $end > $iTotalRecords ? $iTotalRecords : $end;
// Kiểm tra
$query2 = @mysql_query($sql . " LIMIT " . $iDisplayStart . "," . $end);
while ($row2 = @mysql_fetch_assoc($query2)) {
    switch ($row2['status']) {
        case '0':
            $status = '<span class="label label-sm label-warning">Chưa xác nhận</span>';
            break;
        case '1':
            $status = '<span class="label label-sm label-default">Chưa đáp ứng</span>';
            break;
        case '2':
            $status = '<span class="label label-sm label-success">Đã đáp ứng</span>';
            break;
        case '3':
            $status = '<span class="label label-sm label-danger">Không đáp ứng</span>';
            break;
    }
    $records["data"][] = array('<input type="checkbox" name="id[]" value="' . $row2['id'] . '">', $row2['id'], $row2['title'], $row2['userid'], ti_me($row2['time']), $status, '<a href="request-view.php?id=' . $row2['id'] . '" class="btn btn-xs default btn-editable"><i class="fa fa-pencil"></i> Chi tiết</a>');
}
$records["sql"] = $sql;
$records["draw"] = $sEcho;
$records["recordsTotal"] = $iTotalRecords;
$records["recordsFiltered"] = $iTotalRecords;
die(json_encode($records));
コード例 #9
0
ファイル: test.php プロジェクト: h2dvnnet/dekiemtra
                $row = @mysql_fetch_array($query);
                $sql1 = "SELECT * FROM `cate1` where `id`='" . $row[id1] . "'";
                $query1 = @mysql_query($sql1);
                $row1 = @mysql_fetch_array($query1);
                $sql2 = "SELECT * FROM `cate2` where `id`='" . $row1[id2] . "'";
                $query2 = @mysql_query($sql2);
                $row2 = @mysql_fetch_array($query2);
                $this3 = $row2[id3];
                $view = $row[view] + 1;
                $sqlview = "update `tests` set `view`='" . $view . "' where `id`='" . $_GET['it'] . "'";
                $queryview = @mysql_query($sqlview);
                require_once "header.php";
                $sql = "SELECT * FROM `tests` where `id`='" . $_GET['it'] . "'";
                $query = @mysql_query($sql);
                $row = @mysql_fetch_array($query);
                echo "<center><p><h1><i>Làm thử đề kiểm tra</i><br/>" . $row[title] . "</h1></p></center>\n\t<form name='cd' class='nothidden2'>\n\t<div id='timer'>\n\t<div class='timer'>\n\t<p style='margin-top:95px; font-size: 1.3em; color: #fff !important;' id='timerText'>\n\t<input readonly style='border: 0; width: 70%; font-weight: bold; font-size: 115%; border-radius:3px; padding-top: 1px; text-align: center;' name='disp' value='" . $row[time2] . ":00'/></b>\n\t</p>\n\t</div>\n\t</div>\n\t</form>\n\t<div class='time'>" . ti_me($row[time]) . "</div>\n\t<div class='finish'>" . $row[fnum] . "</div>\n\t<form action='' method='post' class='nothidden'>\n\t<center><p><input type='submit' name='start' class='button' value='Bắt đầu làm'/></p></center>\n\t<br/>\n\t</form>";
                if (isset($_POST["start"])) {
                    $timee = time();
                    ?>
	<script language="JavaScript" type="text/javascript" >
	$(".nothidden").addClass('hidden');
	setTimeout("notExit()",<?php 
                    echo $row[time2];
                    ?>
*60000+5000);
	setTimeout("document.test.submit()",<?php 
                    echo $row[time2];
                    ?>
*60000+5000);
	window.onbeforeunload = function (e) {
		e = e || window.event;
コード例 #10
0
ファイル: get-eachorder.php プロジェクト: h2dvnnet/eLib
$query2 = @mysql_query($sql . " LIMIT " . $iDisplayStart . "," . $end);
while ($row2 = @mysql_fetch_assoc($query2)) {
    $sql4 = "SELECT * FROM `order` WHERE `id`='" . $row2['oid'] . "'";
    $query4 = @mysql_query($sql4);
    $row4 = @mysql_fetch_assoc($query4);
    switch ($row4['status']) {
        case '0':
            $status = '<span class="label label-sm label-warning">Chưa xác nhận</span>';
            break;
        case '1':
            $status = '<span class="label label-sm label-default">Chưa mượn</span>';
            break;
        case '2':
            $status = '<span class="label label-sm label-primary">Đang mượn</span>';
            break;
        case '3':
            $status = '<span class="label label-sm label-success">Đã trả</span>';
            break;
        case '4':
            $status = '<span class="label label-sm label-danger">Đã hủy</span>';
            break;
    }
    $sql3 = "SELECT * FROM `user` WHERE `id`='" . $row4['userid'] . "'";
    $query3 = @mysql_query($sql3);
    $row3 = @mysql_fetch_assoc($query3);
    $records["data"][] = array('<input type="checkbox" name="id[]" value="' . $row2['id'] . '">', $row2['id'], ti_me($row4['timestart']), ti_me($row4['timestop']), $row3['name'], '#' . $row2['oid'], $status, '<a href="ecommerce_products_edit.html" class="btn btn-xs default btn-editable"><i class="fa fa-pencil"></i> Chi tiết</a>');
}
$records["draw"] = $sEcho;
$records["recordsTotal"] = $iTotalRecords;
$records["recordsFiltered"] = $iTotalRecords;
die(json_encode($records));
コード例 #11
0
ファイル: order.php プロジェクト: h2dvnnet/eLib
    function show_page()
    {
        if ($_SESSION['userid'] != NULL) {
            global $order_controller;
            if ($order_controller->check_exist == true) {
                if ($order_controller->check_owner == true) {
                    global $order_model;
                    $order = $order_model->order;
                    $eachorder = $order_model->eachorder;
                    $status = '<span class="label label-';
                    switch ($order['status']) {
                        case '0':
                            $status .= 'warning">Chưa xác nhận';
                            break;
                        case '1':
                            $status .= 'default">Chưa mượn';
                            break;
                        case '2':
                            $status .= 'primary">Đang mượn';
                            break;
                        case '3':
                            $status .= 'success">Đã trả';
                            break;
                        case '4':
                            $status .= 'danger">Đã hủy';
                            break;
                    }
                    if ($order['status'] == 0) {
                        if ($order['reconfirm'] == 1) {
                            $status .= ' - Đang xác nhận lại';
                        } else {
                            if ($order['reconfirm'] == 2) {
                                $status .= ' - Đã xác nhận lại';
                            }
                        }
                    }
                    $status .= '</span>';
                    ?>
			<div class="row">
				<div class="col-md-12">
					<!-- Begin: life time stats -->
					<div class="portlet light">
						<div class="portlet-title">
							<div class="caption">
								<i class="icon-basket font-green-sharp"></i>
								<span class="caption-subject font-green-sharp bold uppercase">
								#<?php 
                    echo $order['id'];
                    ?>
 </span>
								<?php 
                    echo $status;
                    ?>
							</div>
							<div class="actions btn-set">
								<a href="../../donsach" class="btn btn-default">
								<i class="fa fa-angle-left"></i>
								<span class="hidden-480">
								Quay lại </span>
								</a>
								<?php 
                    if ($order['status'] == 0 && $order['reconfirm'] == 1) {
                        ?>
									<button type="button" onclick="reConfirmOrder(<?php 
                        echo $order['id'];
                        ?>
)" class="btn blue-madison"><i class="fa fa-bell"></i> Xác nhận lại</button>	
								<?php 
                    }
                    if ($order['status'] == 0 || $order['status'] == 1) {
                        ?>
									<button type="button" onclick="cancelorder2(<?php 
                        echo $order['id'];
                        ?>
)" class="btn red"><i class="fa fa-remove"></i> Hủy đơn</button>
								<?php 
                    }
                    ?>
							</div>
						</div>
						<div class="portlet-body">
							<?php 
                    if ($order['status'] == 0 || $order['status'] == 1) {
                        ?>
							<div class="row">
								<div class="col-md-12 col-sm-12">
									<div class="note note-info">
										<h4 class="block">Yêu cầu xác nhận lại đơn sách</h4>
										<p>Đơn sách của bạn đã được BQT thay đổi, nếu bạn đồng ý với những thay đổi này, bạn hãy xác nhận lại và mượn sách, nếu không bạn có thể hủy đơn sách!</p>
									</div>
								</div>
							</div>
							<?php 
                    }
                    ?>
							<div class="row">
								<div class="col-md-6 col-sm-12">
									<div class="portlet yellow-crusta box">
										<div class="portlet-title">
											<div class="caption">
												<i class="fa fa-cogs"></i>Thông tin đơn sách
											</div>
										</div>
										<div class="portlet-body">
											<div class="row static-info">
												<div class="col-md-5 name">
													Đơn sách #:
												</div>
												<div class="col-md-7 value">
													<?php 
                    echo $order['id'];
                    ?>
												</div>
											</div>
											<div class="row static-info">
												<div class="col-md-5 name">
													 Thời gian đặt sách
												</div>
												<div class="col-md-7 value">
													 <?php 
                    echo ti_me($order['time']);
                    ?>
												</div>
											</div>
											<div class="row static-info">
												<div class="col-md-5 name">
													 Tình trạng
												</div>
												<div class="col-md-7 value">
													<?php 
                    echo $status;
                    ?>
												</div>
											</div>
											<div class="row static-info">
												<div class="col-md-5 name">
													 Số sách
												</div>
												<div class="col-md-7 value">
													 <?php 
                    echo $order['count'];
                    ?>
												</div>
											</div>
											<div class="row static-info">
												<div class="col-md-5 name">
													Hình thức 
												</div>
												<div class="col-md-7 value">
												<span id='editMethodSn'><?php 
                    switch ($order['method']) {
                        case '1':
                            echo 'Đọc tại chỗ';
                            break;
                        case '2':
                            echo 'Mượn về';
                            break;
                    }
                    ?>
</span>
												<?php 
                    if ($order['status'] == 0 || $order['status'] == 1) {
                        ?>
												<a class="pull-right btn btn-xs grey-cascade" style='position: inherit;' id='editMethodBtn' onclick='editMethod(<?php 
                        echo $order['id'];
                        ?>
)'>
												<i class="fa fa-pencil"></i> Sửa</a>
												<?php 
                    }
                    ?>
												</div>
											</div>
											<div class="row static-info">
												<div class="col-md-5 name">
													Thời gian mượn
												</div>
												<div class="col-md-7 value">
													<?php 
                    echo ti_me($order['timestart']);
                    ?>
												</div>
											</div>
											<div class="row static-info">
												<div class="col-md-5 name">
													Thời gian trả
												</div>
												<div class="col-md-7 value">
													<?php 
                    echo ti_me($order['timestop']);
                    ?>
												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="col-md-6 col-sm-12">
									<div class="portlet red box">
										<div class="portlet-title">
											<div class="caption">
												<i class="fa fa-cogs"></i>Ghi chú
											</div>
											<div class="actions">
												<a class="btn btn-default btn-sm" id='editNoteBtn' onclick='editNote(<?php 
                    echo $order['id'];
                    ?>
)'>
												<i class="fa fa-pencil"></i> Sửa</a>
											</div>
										</div>
										<div class="portlet-body">
											<div class="row static-info" style='margin-bottom:0'>
												<div class="col-md-12" style='font-size: 14px;'>
													<span id='editNoteSn'><?php 
                    echo $order['note'] != NULL ? $order['note'] : 'Không có';
                    ?>
</span>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="row">
								<div class="col-md-12 col-sm-12">
									<div class="portlet purple box" style='margin-bottom: 0'>
										<div class="portlet-title">
											<div class="caption">
												<i class="fa fa-cogs"></i>Sách trong giỏ <span class="badge badge-success"><?php 
                    echo $order['count'];
                    ?>
</span>
											</div>
										</div>
										<div class="portlet-body">
											<div class="table-responsive">
												<table class="table table-hover table-bordered table-striped" style='margin-bottom: 0'>
												<thead>
												<tr>
													<th width='1%'>
														Hình ảnh
													</th>
													<th width='20%'>
														Tên sách
													</th>
													<th>
														Mô tả
													</th>
													<th>
														Tình trạng
													</th>
													<?php 
                    if ($order['status'] == 0) {
                        echo '<th></th>';
                    }
                    ?>
												</tr>
												</thead>
												<tbody>
												<?php 
                    foreach ($eachorder as $data) {
                        ?>
												<tr id="eachorder<?php 
                        echo $data['id'];
                        ?>
">
													<td>
														<a href='../../<?php 
                        echo sf($data['book']['title'], 0) . "." . $data['book']['id'];
                        ?>
.html'>
															<img src="../../135x180/<?php 
                        echo $data['book']['img1'];
                        ?>
">
														</a>
													</td>
													<td class='static-info'>
														<a href='../../<?php 
                        echo sf($data['book']['title'], 0) . "." . $data['book']['id'];
                        ?>
.html' class='value'><?php 
                        echo $data['book']['title'];
                        ?>
</a>
													</td>
													<td>
														<?php 
                        echo $data['book']['des'];
                        ?>
													</td>
													<td>
													<?php 
                        if ($data['book']['remain'] > 0) {
                            echo '<span class="label label-sm label-success">Còn sách</span>';
                        } else {
                            echo '<span class="label label-sm label-danger">Hết sách</span>';
                        }
                        ?>
														
													</td>
													<?php 
                        if ($order['status'] == 0) {
                            echo '<td><a class="del-goods" alt="Bỏ khỏi đơn sách" title="Bỏ khỏi đơn sách" onclick="delEachOrder(' . $data['id'] . ',' . $order['id'] . ')">&nbsp;</a></td>';
                        }
                        ?>
												</tr>
												<?php 
                    }
                    ?>
												</tbody>
												</table>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		<?php 
                } else {
                    echo '<div class="product-page">
					<div class="alert alert-danger" id="errscode" style="margin-bottom: 0">
					Bạn không có quyền xem đơn sách này
					</div>
					</div>';
                }
            } else {
                echo '<div class="product-page">
				<div class="alert alert-danger" id="errscode" style="margin-bottom: 0">
				Đơn sách này không có thật
				</div>
				</div>';
            }
        } else {
            echo '<div class="product-page">
			<div class="alert alert-danger" id="errscode" style="margin-bottom: 0">
			Bạn chưa đăng nhập, không thể xem đơn sách này
			</div>
			</div>';
        }
    }
コード例 #12
0
ファイル: listdown.php プロジェクト: h2dvnnet/dekiemtra
 // Lấy CSDL
 echo "<fieldset class='fieldset'>\n<legend href='#'><a href='#' style='color: #fff;'>Danh sách đề đã tải của " . account($id, username) . " <i>(" . @mysql_num_rows($query) . " đề kiểm tra)</i></a></legend>";
 while ($row2 = @mysql_fetch_array($query2)) {
     // Lấy cate1
     $sql11 = "SELECT * FROM `cate1` where `id`='" . $row2[id1] . "'";
     $query11 = @mysql_query($sql11);
     $row11 = @mysql_fetch_array($query11);
     // Lấy cate2
     $sql22 = "SELECT * FROM `cate2` where `id`='" . $row11[id2] . "'";
     $query22 = @mysql_query($sql22);
     $row22 = @mysql_fetch_array($query22);
     // Lấy cate3
     $sql33 = "SELECT * FROM `cate3` where `id`='" . $row22[id3] . "'";
     $query33 = @mysql_query($sql33);
     $row33 = @mysql_fetch_array($query33);
     echo "\n<table class='lololol' width='100%'>\n<tr>\n<td rowspan='3' align='center'>\n<img src='" . $row2['thumb'] . "' width='60' height='61' class='img2'>\n</td>\n<td class='title' colspan=2 width='100%'>\n<a href='./" . strtolower(str_filter($row2['title'])) . "." . $row2['id'] . ".php'><div class='more2'>Xem</div></a>\n<a href='./" . strtolower(str_filter($row2['title'])) . "." . $row2['id'] . ".php' style='font-size: 1.2em;'><b>" . cu_t($row2[title], 40) . "</b></a>\n</td>\n</tr>\n<tr>\n<td width='*'>\nNgày đăng: <i id='yeah'>" . ti_me($row2[time]) . "</i>\n</td>\n<td width='100px' rowspan='2'>\nLượt xem: <i id='yeah'>" . $row2[view] . "</i>\n</td>\n</tr>\n<tr>\n<td width='*'>\nDanh mục: <i id='yeah'><a href='./" . strtolower(str_filter($row33[title])) . "." . $row33[id] . "'>" . $row33[title] . "</a> > <a href='./" . strtolower(str_filter($row33[title])) . "/" . strtolower(str_filter($row22[title])) . "." . $row22[id] . "'>" . $row22[title] . "</a> > <a href='./" . strtolower(str_filter($row33[title])) . "/" . strtolower(str_filter($row22[title])) . "/" . strtolower(str_filter($row11[title])) . "." . $row11[id] . "'>" . $row11[title] . "</a></i></td>\n</tr>\n</table>\n";
 }
 echo "</fieldset>";
 if ($page > 1) {
     echo "<ul class='pagination' align='center'>";
     $prev = $p - 1;
     $next = $p + 1;
     if ($p - 1 > 1) {
         echo "<li><b><a href='./danh-sach-de-da-tai-cua-" . strtolower(str_filter(account($id, username))) . "-" . $id . "' title='Trang đầu tiên - 1'>&laquo;</a></b></li>&nbsp;";
     }
     if ($p > 1) {
         echo "<li><b><a href='./danh-sach-de-da-tai-cua-" . strtolower(str_filter(account($id, username))) . "-" . $id . "_" . $prev . "' title='Trang trước - " . $prev . "' alt='Trang trước - " . $prev . "'><font face='arial'>◄</font></a></b></li>&nbsp;";
         echo "<li><b><a href='./danh-sach-de-da-tai-cua-" . strtolower(str_filter(account($id, username))) . "-" . $id . "_" . $prev . "' title='Trang " . $prev . "' alt='Trang " . $prev . "'>" . $prev . "</a></b></li>&nbsp;";
     }
     echo "<li><b><a title='Trang hiện tại' alt='Trang hiện tại' class='current'>" . $p . "</a></b></li>&nbsp;";
     if ($p < $page) {
コード例 #13
0
ファイル: book.php プロジェクト: h2dvnnet/eLib
 function show_comment()
 {
     global $book_model;
     $book = $book_model->book;
     echo "<div class='tab-pane fade' id='Comments'>";
     if ($book_model->get_comment_nums() == NULL) {
         echo "<div class='review-item clearfix' id='nocomment'>\n\t\t\t<p>Chưa có bình luận nào</p>\n\t\t\t</div>";
     } else {
         $result = $book_model->get_comment();
         foreach ($result as $data) {
             echo "<div class='review-item clearfix'>\n\t\t\t\t<div class='review-item-submitted'>\n\t\t\t\t<strong>" . $data['data']['name'] . "</strong>\n\t\t\t\t<em>" . ti_me($data['time']) . "</em>\n\t\t\t\t</div>                                              \n\t\t\t\t<div class='review-item-content'>\n\t\t\t\t<p>" . $data['content'] . "</p>\n\t\t\t\t</div>\n\t\t\t\t</div>";
         }
     }
     if ($_SESSION['userid'] != NULL) {
         echo "<form class='reviews-form' role='form' id='comment' onsubmit='return comment(" . $book['id'] . ")'>\n\t\t\t<div class='alert alert-danger nodisplay' id='err2'></div>\n\t\t\t<h2>Viết bình luận</h2>\n\t\t\t<div class='form-group'>\n\t\t\t<textarea class='form-control' rows='8' id='content2'></textarea>\n\t\t\t</div>\n\t\t\t<div class='padding-top-0'>                  \n\t\t\t<button type='submit' class='btn btn-primary'><i class='fa fa-comment'></i>&nbsp;&nbsp;Gửi</button>\n\t\t\t</div>\n\t\t\t</form>";
     } else {
         // echo "<div class='review-item clearfix'><p>Đăng nhập để bình luận hoặc bình luận bằng Facebook</p></div>";
     }
     echo "</div>";
 }
コード例 #14
0
ファイル: showttest.php プロジェクト: h2dvnnet/dekiemtra
             $kt = 2;
             foreach ($y as $id2) {
                 if ($id2 == $_SESSION["userid"]) {
                     $kt = 1;
                 }
             }
         } else {
             $kt = 3;
         }
         echo "\n<table style='margin-bottom: 3px;'>\n<tr><td valign='top' class='cmtAvatar'>\n<a href='thong-tin-thanh-vien-" . strtolower(str_filter(account($rowcmt[uid], username))) . "-" . $rowcmt[uid] . "'>";
         if (account($rowcmt[uid], avatar) == NULL) {
             $ava = "./images/noavatar.jpg";
         } else {
             $ava = account($rowcmt[uid], avatar);
         }
         echo "\n<img src='" . $ava . "' width='52' height='52' class='img3'/></a>\n</td>\n<td width='100%'>\n<div class='cmtContent'>\n<div class='cmtHeader'>\n<a href='thong-tin-thanh-vien-" . strtolower(str_filter(account($rowcmt[uid], username))) . "-" . $rowcmt[uid] . "'>\n" . account($rowcmt[uid], username) . "</a>\n<span class='cmtTime'>" . ti_me($rowcmt[time]) . "</span>\n</div>\n<p>" . $rowcmt[content] . "</p>\n<div class='cmtFooter'>";
         if ($kt == 3) {
             echo "<a href='?lightbox[width]=*&lightbox[height]=*#login-to-cmt' class='cmtLike lightbox'>Thích</a>";
         } else {
             if ($kt == 2) {
                 echo "<a href='uplike.php?id=" . $rowcmt[id] . "&lightbox[iframe]=true&lightbox[width]=330&lightbox[height]=60' class='cmtLike lightbox'>Thích</a>";
             } else {
                 if ($kt == 1) {
                     echo "<a href='unlike.php?id=" . $rowcmt[id] . "&lightbox[iframe]=true&lightbox[width]=330&lightbox[height]=60' class='cmtLike cmtLiked lightbox'>Bỏ thích</a>";
                 }
             }
         }
         echo "\n&nbsp;Có " . $rowcmt[liked] . " người thích điều này<rr/>\n</div></p>\n</div></td></tr>\n</table>\n";
     }
 }
 ?>
コード例 #15
0
ファイル: showall.php プロジェクト: h2dvnnet/dekiemtra
     $sql11 = "SELECT * FROM `cate1` where `id`='" . $row2[id1] . "'";
     $query11 = @mysql_query($sql11);
     $row11 = @mysql_fetch_array($query11);
     // Lấy cate2
     $sql22 = "SELECT * FROM `cate2` where `id`='" . $row11[id2] . "'";
     $query22 = @mysql_query($sql22);
     $row22 = @mysql_fetch_array($query22);
     // Lấy cate3
     $sql33 = "SELECT * FROM `cate3` where `id`='" . $row22[id3] . "'";
     $query33 = @mysql_query($sql33);
     $row33 = @mysql_fetch_array($query33);
     echo "\n<table class='lololol' width='100%'>\n<tr>\n<td rowspan='3' align='center'>\n<img src='" . $row2['thumb'] . "' width='60' height='61' class='img2'>\n</td>\n<td class='title' colspan=2 width='100%'>\n<a href='./" . strtolower(str_filter($row2['title'])) . "." . $row2['id'] . ".php'><div class='more2'>Xem</div></a>\n<a href='./" . strtolower(str_filter($row2['title'])) . "." . $row2['id'] . ".php' style='font-size: 1.2em;' alt='" . $row2['title'] . "' title='" . $row2['title'] . "'><b>" . cu_t($row2[title], 50) . "</a></b>";
     if ($row2[rt] != 0) {
         echo "&nbsp;<img src='./images/blue-tick.png' width='18px' alt='Có thể làm thử đề kiểm tra' title='Có thể làm thử đề kiểm tra'>";
     }
     echo "\n</td>\n</tr>\n<tr>\n<td width='*'>\n<img src='./images/clock2.png' width='15px' style='margin-top: 0; margin-bottom: -2px'/>&nbsp;<i id='yeah'>" . ti_me($row2[time]) . "</i>\n</td>\n<td width='100px'>\n<img src='./images/eye.png' width='20px' style='margin-top: 0; margin-bottom: -5px'/>&nbsp;<span id='yeah'>" . $row2[view] . "</span>\n</td>\n</tr>\n<tr>\n<td width='*'>\n<img src='./images/list.png' width='16px' style='margin-top: 0; margin-bottom: -2px'/>&nbsp;<i id='yeah'><a href='./" . strtolower(str_filter($row33[title])) . "." . $row33[id] . "'>" . $row33[title] . "</a> > <a href='./" . strtolower(str_filter($row33[title])) . "/" . strtolower(str_filter($row22[title])) . "." . $row22[id] . "'>" . $row22[title] . "</a> > <a href='./" . strtolower(str_filter($row33[title])) . "/" . strtolower(str_filter($row22[title])) . "/" . strtolower(str_filter($row11[title])) . "." . $row11[id] . "'>" . $row11[title] . "</a></i></td>\n<td>\n<img src='./images/like.png' width='20px' style='margin-top: -5px; margin-bottom: -2px'/>&nbsp;<span id='yeah'>" . $row2[liked] . "</span>\n</td>\n</tr>\n</table>\n";
 }
 echo "</fieldset>";
 if ($page > 1) {
     echo "<ul class='pagination' align='center'>";
     $prev = $p - 1;
     $next = $p + 1;
     if ($p - 1 > 1) {
         echo "<li><b><a href='./latest_1' title='Trang đầu tiên - 1'>&laquo;</a></b></li>&nbsp;";
     }
     if ($p > 1) {
         echo "<li><b><a href='./latest_" . $prev . "' title='Trang trước - " . $prev . "' alt='Trang trước - " . $prev . "'><font face='arial'>◄</font></a></b></li>&nbsp;";
         echo "<li><b><a href='./latest_" . $prev . "' title='Trang " . $prev . "' alt='Trang " . $prev . "'>" . $prev . "</a></b></li>&nbsp;";
     }
     echo "<li><b><a title='Trang hiện tại' alt='Trang hiện tại' class='current'>" . $p . "</a></b></li>&nbsp;";
     if ($p < $page) {
コード例 #16
0
ファイル: get-review2.php プロジェクト: h2dvnnet/eLib
    case '6':
        $sql .= " ORDER BY `nthanks` " . $_REQUEST['order']['0']['dir'];
        break;
    default:
        $sql .= " ORDER BY `id` " . $_REQUEST['order']['0']['dir'];
        break;
}
$query = @mysql_query($sql);
$iTotalRecords = @mysql_num_rows($query);
// Tổng số sách lấy được
$iDisplayLength = intval($_REQUEST['length']);
// Số sách trên 1 trang
$iDisplayLength = $iDisplayLength < 0 ? $iTotalRecords : $iDisplayLength;
// Kiểm tra
$iDisplayStart = intval($_REQUEST['start']);
// Bắt đầu lấy
$sEcho = intval($_REQUEST['draw']);
// Số lần get (Đéo cần quan tâm)
$records["data"] = array();
$end = $iDisplayStart + $iDisplayLength;
// Kết thúc lấy
$end = $end > $iTotalRecords ? $iTotalRecords : $end;
// Kiểm tra
$query2 = @mysql_query($sql . " LIMIT " . $iDisplayStart . "," . $end);
while ($row2 = @mysql_fetch_assoc($query2)) {
    $records["data"][] = array('<input type="checkbox" name="id[]" value="' . $row2['id'] . '">', $row2['id'], $row2['idb'], ti_me($row2['time']), $row2['rating'], $row2['content'], $row2['nthanks'], '<a href="ecommerce_products_edit.html" class="btn btn-xs default btn-editable"><i class="fa fa-pencil"></i> Sửa</a>');
}
$records["draw"] = $sEcho;
$records["recordsTotal"] = $iTotalRecords;
$records["recordsFiltered"] = $iTotalRecords;
die(json_encode($records));
コード例 #17
0
ファイル: dash.php プロジェクト: h2dvnnet/eLib
							<div class="caption caption-md">
								<i class="icon-bar-chart theme-font-color hide"></i>
								<span class="caption-subject theme-font-color bold uppercase">Nhận xét mới</span>
								<span class="badge badge-success">0</span>
							</div>
						</div>
						<div class="portlet-body">
							<div class="scroller" style="height: 305px;" data-always-visible="1" data-rail-visible1="0" data-handle-color="#D7DCE2">
								<div class="general-item-list">
								<?php 
while ($newreview = @mysql_fetch_assoc($query)) {
    echo '<div class="item">
										<div class="item-head">
											<div class="item-details">
												<a href="user-edit.php?id=' . $newreview['userid'] . '" class="item-name primary-link">' . $newreview['userid'] . '</a>
												<span class="item-label">' . ti_me($newreview['time']) . '</span>&nbsp;
												<span class="item-label"><b>' . $newreview['rating'] . '</b></span>
											</div>
											<span class="item-status"><a href="review-edit.php?id=' . $newreview['id'] . '"><span class="badge badge-success">Xem</span></a></span>
										</div>
										<div class="item-body">
											 ' . $newreview['content'] . '</div>
									</div>';
}
?>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
コード例 #18
0
ファイル: review-edit.php プロジェクト: h2dvnnet/eLib
												<label class="col-md-2 control-label">Thành viên: <span class="required">*</span></label>
												<div class="col-md-10">
												<div class='input-icon right'>
													<i class='fa fa-info-circle tooltips' data-original-title='Mục này là bắt buộc' data-container='body' id='erruser'></i>
													<input type="text" class="form-control" id="user" value="<?php 
    echo $row['userid'];
    ?>
">
												</div>
												</div>
											</div>
											<div class="form-group" id='timediv'>
												<label class="col-md-2 control-label">Thời gian: </label>
												<div class="col-md-10">
													<input type="text" class="form-control" id="time" readonly value="<?php 
    echo ti_me($row['time']);
    ?>
">
												</div>
											</div>
											<div class="form-group" id='ratingdiv'>
												<label class="col-md-2 control-label">Đánh giá: <span class="required">*</span></label>
													<div class="col-md-10">
													<div class='input-icon right'>
														<i class='fa fa-info-circle tooltips' data-original-title='Mục này là bắt buộc' data-container='body' id='errrating'></i>
														<input type="text" class="form-control" id="rating" value="<?php 
    echo $row['rating'];
    ?>
">
													</div>
												</div>
コード例 #19
0
ファイル: allttest.php プロジェクト: h2dvnnet/dekiemtra
     $sqlt = "SELECT * FROM `tests` where `id`='" . $row2[it] . "'";
     $queryt = @mysql_query($sqlt);
     $rowt = @mysql_fetch_array($queryt);
     // Lấy cate1
     $sql11 = "SELECT * FROM `cate1` where `id`='" . $rowt[id1] . "'";
     $query11 = @mysql_query($sql11);
     $row11 = @mysql_fetch_array($query11);
     // Lấy cate2
     $sql22 = "SELECT * FROM `cate2` where `id`='" . $row11[id2] . "'";
     $query22 = @mysql_query($sql22);
     $row22 = @mysql_fetch_array($query22);
     // Lấy cate3
     $sql33 = "SELECT * FROM `cate3` where `id`='" . $row22[id3] . "'";
     $query33 = @mysql_query($sql33);
     $row33 = @mysql_fetch_array($query33);
     echo "\n<table class='lololol' width='100%'>\n<tr>\n<td rowspan='3' align='center'>\n<img src='" . $rowt['thumb'] . "' width='60' height='61' class='img2'>\n</td>\n<td class='title' colspan=2 width='100%'>\n<a href='./bao-cao-lam-thu/" . strtolower(str_filter(account($row2[uid], username))) . "/" . strtolower(str_filter($rowt[title])) . "-" . $row2['id'] . "'><div class='more2'>Xem</div></a>\n<a href='./bao-cao-lam-thu/" . strtolower(str_filter(account($row2[uid], username))) . "/" . strtolower(str_filter($rowt[title])) . "-" . $row2['id'] . "' style='font-size: 1.2em;' alt='" . $rowt['title'] . "' title='" . $rowt['title'] . "'><b>" . cu_t($rowt[title], 50) . "</a></b>\n</td>\n</tr>\n<tr>\n<td width='*'>\nNgày làm: <i id='yeah'>" . ti_me($row2[time]) . "</i>\n</td>\n<td width='100px'>\nĐiểm: <i id='yeah'>" . $row2[score] . "</i>\n</td>\n</tr>\n<tr>\n<td width='*'>\nDanh mục: <i id='yeah'><a href='./" . strtolower(str_filter($row33[title])) . "." . $row33[id] . "'>" . $row33[title] . "</a> > <a href='./" . strtolower(str_filter($row33[title])) . "/" . strtolower(str_filter($row22[title])) . "." . $row22[id] . "'>" . $row22[title] . "</a> > <a href='./" . strtolower(str_filter($row33[title])) . "/" . strtolower(str_filter($row22[title])) . "/" . strtolower(str_filter($row11[title])) . "." . $row11[id] . "'>" . $row11[title] . "</a></i></td>\n<td>\nThời gian hoàn thành: " . $row2[comp] . " phút\n</td>\n</tr>\n</table>\n";
 }
 echo "</fieldset>";
 if ($page > 1) {
     echo "<ul class='pagination' align='center'>";
     $prev = $p - 1;
     $next = $p + 1;
     if ($p - 1 > 1) {
         echo "<li><b><a href='./danh-sach-bao-cao-lam-thu-moi-nhat' title='Trang đầu tiên - 1'>&laquo;</a></b></li>&nbsp;";
     }
     if ($p > 1) {
         echo "<li><b><a href='./danh-sach-bao-cao-lam-thu-moi-nhat_" . $prev . "' title='Trang trước - " . $prev . "' alt='Trang trước - " . $prev . "'><font face='arial'>◄</font></a></b></li>&nbsp;";
         echo "<li><b><a href='./danh-sach-bao-cao-lam-thu-moi-nhat_" . $prev . "' title='Trang " . $prev . "' alt='Trang " . $prev . "'>" . $prev . "</a></b></li>&nbsp;";
     }
     echo "<li><b><a title='Trang hiện tại' alt='Trang hiện tại' class='current'>" . $p . "</a></b></li>&nbsp;";
     if ($p < $page) {
コード例 #20
0
ファイル: get-problem.php プロジェクト: h2dvnnet/eLib
// Số lần get (Đéo cần quan tâm)
$records["data"] = array();
$end = $iDisplayStart + $iDisplayLength;
// Kết thúc lấy
$end = $end > $iTotalRecords ? $iTotalRecords : $end;
// Kiểm tra
$records["sql"] = $sql;
$query2 = @mysql_query($sql . " LIMIT " . $iDisplayStart . "," . $end);
while ($row2 = @mysql_fetch_assoc($query2)) {
    if ($row2['verify'] != '1') {
        $verify = '<span class="label label-sm label-danger">Chưa xác nhận</span>';
    } else {
        $verify = '<span class="label label-sm label-success">Đã xác nhận</span>';
    }
    switch ($row2['type']) {
        case '1':
            $type = '<span class="label label-sm label-warning">Hỏng sách</span>';
            break;
        case '2':
            $type = '<span class="label label-sm label-danger">Mất sách</span>';
            break;
        case '3':
            $type = '<span class="label label-sm label-default">Khác</span>';
            break;
    }
    $records["data"][] = array('<input type="checkbox" name="id[]" value="' . $row2['id'] . '">', $row2['id'], $row2['bid'], $row2['userid'], $type, ti_me($row2['time']), '<a href="problem-edit.php?id=' . $row2['id'] . '" class="btn btn-xs default btn-editable"><i class="fa fa-pencil"></i> Xem</a>');
}
$records["draw"] = $sEcho;
$records["recordsTotal"] = $iTotalRecords;
$records["recordsFiltered"] = $iTotalRecords;
die(json_encode($records));
コード例 #21
0
ファイル: get-review3.php プロジェクト: h2dvnnet/eLib
        $sql .= " ORDER BY `time` " . $_REQUEST['order']['0']['dir'];
        break;
    default:
        $sql .= " ORDER BY `id` " . $_REQUEST['order']['0']['dir'];
        break;
}
$query = @mysql_query($sql);
$iTotalRecords = @mysql_num_rows($query);
// Tổng số sách lấy được
$iDisplayLength = intval($_REQUEST['length']);
// Số sách trên 1 trang
$iDisplayLength = $iDisplayLength < 0 ? $iTotalRecords : $iDisplayLength;
// Kiểm tra
$iDisplayStart = intval($_REQUEST['start']);
// Bắt đầu lấy
$sEcho = intval($_REQUEST['draw']);
// Số lần get (Đéo cần quan tâm)
$records["data"] = array();
$end = $iDisplayStart + $iDisplayLength;
// Kết thúc lấy
$end = $end > $iTotalRecords ? $iTotalRecords : $end;
// Kiểm tra
//$records["sql"]=$sql;
$query2 = @mysql_query($sql . " LIMIT " . $iDisplayStart . "," . $end);
while ($row2 = @mysql_fetch_assoc($query2)) {
    $records["data"][] = array('<input type="checkbox" name="id[]" value="' . $row2['id'] . '">', $row2['id'], $row2['userid'], $row2['idb'], $row2['content'], $row2['rating'], ti_me($row2['time']), '<a href="review-edit.php?id=' . $row2['id'] . '" class="btn btn-xs default btn-editable"><i class="fa fa-pencil"></i> Sửa</a>');
}
$records["draw"] = $sEcho;
$records["recordsTotal"] = $iTotalRecords;
$records["recordsFiltered"] = $iTotalRecords;
die(json_encode($records));