| Server IP : 172.67.216.113 / Your IP : 172.71.28.145 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/cp648411/www/simded.com/home/ |
Upload File : |
<?php
include('../include/header.php');
include('../themes/menu.php');
?>
<div class="container mt-md-5">
<div class="row">
<div class="col-md-12 justify-content-between d-flex align-items-baseline" >
<p class="HeadTextL mb-2"> ซิมเด็ดแนะนำ </p>
</div>
</div>
<?php
$sql_s = 'shop.id = phonenumber.id_shop AND shop.status = "1" AND shop.status_op = "1" AND shop.activate = "1" AND phonenumber.status = "1" ';
$max_rows = 18; // แสดงจำนวนแถวต่อหน้า
if(!$_GET['page_number']){
$page_number = 0;
}else {
$page_number = $_GET['page_number'];
}
if(isset($_GET['page_number']))
{
$page_number = $_GET['page_number'];
}
$all_array = array('table'=>'phonenumber,shop','where'=>$sql_s);
$start_row = $page_number * $max_rows;
$all_sql = $view_db->view($all_array);
$all_result = $view_db->q_re($all_sql);
$total_rows = $view_db->q_nr($all_result);
$total_rows_num = mysqli_num_rows($all_result);
$total_pages = ceil($total_rows/$max_rows)-1;
////////////////////////////////////////
$list = array('table'=>'phonenumber,shop','where'=>$sql_s, 'limit'=> "$start_row,$max_rows",'order'=> "ORDER BY phonenumber.id DESC");
$view = $view_db->view($list);
$result = $view_db->q_re($view);
$num_tr = 1;
$num = 1+($page_number*$max_rows);
?>
<div class="row" id="berdedrecom">
<?php
while($row = $view_db->q_ro($result))
{
$phonenumber = $Phone_class->format_phonenumber($row['phonenumber'],$row['format']);
$row_mobilenetwork = $actiondata_db->q_one('mobilenetwork','id = "'.$row['mobilenetwork'].'"','image');
$row_totalnumber = $actiondata_db->q_one('totalnumber','number = "'.$row['total'].'"','title');
if($row_totalnumber==2){$row_totalnumber = '';}
$list_shr = array('table'=>'shop','where'=>'id = "'.$row['id_shop'].'" ');
$view_shr = $view_db->view($list_shr);
$row_shr = $view_db->q($view_shr);
$list_phr = array('table'=>'phonenumber','where'=>'phonenumber = "'.$row['phonenumber'].'" ');
$view_phr = $view_db->view($list_phr);
$row_phr = $view_db->q($view_phr);
$countber = $util_class->countber($row_shr['id']);
$txt_phonenumber = $Phone_class->phonecomma($row_shr['phone']);
if($row_shr['image_profile']){ $image_profile = $row_shr['image_profile']; }
else { $image_profile = ''; }
$phonenumber = $Phone_class->format_phonenumber($row['phonenumber'],$row['format']);
$price = $row['price']-1;
?>
<div class="col-12 col-md-4">
<div class="BoxRecom rounded-sim2 box-s mb-2 m-0">
<div class="pt-3 d-flex justify-content-center" align="center" style="cursor:pointer"
onclick="like(<?php echo $_SESSION["simDed_login"];?>,<?php echo $row['id'] ;?>)">
<span id="hidefavorite"></span>
<i class="fa fa-heart" style="font-size:18px;color:gray; "></i>
<span class="text-danger-sim ps-2">เบอร์โปรด</span>
</div>
<div class="" align="center">
<a href="../cart/?p=<?php echo $row['phonenumber'];?>" class="text-decoration-none">
<span class="BerDedToday-ber fs-2"><?php echo $phonenumber; ?></span></a>
</div>
<div class="px-0"><div class="borber-bottom-sim "></div></div>
<div class="row align-items-center">
<?php $css_size=''; if(strlen($row_totalnumber)>= 60){$css_size = 'font-size: 13px;';} ?>
<div class="col-8 ps-4 text-start">
<div class="col-xs-12 BerDedToday-sum fw-bold text-success-sim"> ผลรวม <?php echo $row['total']?> </div>
<div class="col-xs-12 BerDedToday-price fw-bold text-primary-sim" style="<?php echo $css_size; ?>"> <?php echo $row_totalnumber;?> </div>
</div>
<div class="col-4">
<img src="<?php echo $upload ?>mobilenetwork/<?php echo $row_mobilenetwork ?>" width="60" class="img-fluid">
</div>
</div>
<div class="px-0"><div class="borber-bottom-sim "></div></div>
<div class="" align="center">
<div class="col-12 fw-bold fs-3 "> ราคา <?php echo number_format($row['price'])?> บาท </div>
</div>
<div class="row justify-content-center">
<div class="col-9 col-md-9 mb-3">
<a href="#" onclick="cart(<?php echo $row_phr['id']; ?>)"
class="btn btn-danger-sim fs-5 fw-bold rounded-sim w-100 box-sim1 lh-sim">สั่งซื้อเบอร์</a>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<div class="row mb-3" align="center" style="margin-top:5px;">
<div class="col-md-12 d-flex justify-content-center">
<?php
if($total_rows_num > 0)
{
page_ajax2($page_number,$total_pages);
}
?>
</div>
</div>
</div>
<script>
function cart(var1)
{
swal(
'สั่งซื้อสินค้า!',
'เพิ่มสินค้าในตะกร้าเรียบร้อยแล้วค่ะ',
'success'
)
$.ajax({
url: "../include/ajax_cart.php", // Url to which the request is send
type: "POST", // Type of request to be send, called as method
data: 'id='+var1,
cache: false, // To unable request pages to be cached
processData:false, // To send DOMDocument or non processed data file it is set to false
success: function(data) // A function to be called if request succeeds
{
//testHoldon_cl('sk-circle');
var some = screen.width;
if(some<789){
$("#alert_cart2").html(data);
}else{
$("#alert_cart").html(data);
}
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById('alert_cart_ok').focus();
$('.dropdown-toggle').dropdown('update');
if(some<789){
document.getElementById('alert_cart_ok2').innerHTML = this.responseText;
}else{
document.getElementById('alert_cart_ok').innerHTML = this.responseText;
}
}
};
xmlhttp.open("GET", "../include/ajax_cartlist2.php", true);
xmlhttp.send();
}
});
}
function cart2(var1)
{
swal(
'สั่งซื้อสินค้า!',
'เพิ่มสินค้าในตะกร้าเรียบร้อยแล้วค่ะ',
'success'
)
$.ajax({
url: "../include/ajax_cart.php", // Url to which the request is send
type: "POST", // Type of request to be send, called as method
data: 'id='+var1,
cache: false, // To unable request pages to be cached
processData:false, // To send DOMDocument or non processed data file it is set to false
success: function(data) // A function to be called if request succeeds
{
//testHoldon_cl('sk-circle');
$("#alert_cart2").html(data);
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById('alert_cart_ok2').innerHTML = this.responseText;
$('#alert_cart_ok2').dropdown('toggle');
document.getElementById('alert_cart_ok').innerHTML = this.responseText;
$('#alert_cart_ok').dropdown('toggle');
window.location.reload();
}
};
xmlhttp.open("GET", "../include/ajax_cartlist.php", true);
xmlhttp.send();
}
});
}
</script>
<?php
include('../themes/footer.php');
include('../include/footer_js.php');
?>