| Server IP : 104.21.37.246 / Your IP : 104.23.243.33 [ 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 : /home2/cp648411/public_html/simded.com/themes/ |
Upload File : |
<?php
$sql_number_post = '';
if(isset($_POST['num_post']))//ค้นหาจากตำแหน่งเลข
{
$_SESSION['s_num_post'] = $_POST['num_post_sim'];
$i = 2;
$post_number = $_POST['num_post_sim'];
/*
$post_number = '0';
foreach( $_POST['num_post'] as $value )
{
$post = $value;
if($value == '')
{
$post = '_';
}
$post_number = $post_number . $post;
$i++;
}
*/
$sql_number_post = 'AND phonenumber.phonenumber like "'.$post_number.'"';
}
$sql_number_sum = '';
if($_POST['total'] <> '')//ผลรวม
{
$_SESSION['s_total'] = $_POST['total'];
$sql_number_sum = ' AND phonenumber.total = "'.$_POST['total'].'"';
}
$sql_number_style = '';
if($_POST['stylenum'] <> '')//หมวดหมู่
{
$_SESSION['s_stylenum'] = $_POST['stylenum'];
$sql_number_style = ' AND phonenumber.styleid = "'.$_POST['stylenum'].'"';
}
$sql_number_cat='';
if($_POST['category'] <> '')//ตามหมวดหมู่
{
$_SESSION['s_category'] = $_POST['category'];
$sql_number_cat = ' AND ' . $Phone_class->cat_number($_POST['category']);
}
$sql_number_price_re = '';
if($_POST['price_range'] <> '')//ช่วงราคา
{
$_SESSION['s_price_range'] = $_POST['price_range'];
$_POST['price_range'] = trim($_POST['price_range']);
$arr = explode('-',$_POST['price_range']);
$arr0 = str_replace(',', '',$arr[0]);
$arr0 = trim($arr0);
if( is_numeric($arr0) )
{
$arr[0] = str_replace(',', '', $arr[0]);
$arr[1] = str_replace(',', '', $arr[1]);
$sql_price = ' AND ( phonenumber.price >= "' .$arr[0]. '" AND phonenumber.price <= "' .$arr[1]. '" )';
}
else
{
$arr = explode(' ',$_POST['price_range']);
if( $arr[0] == 'ไม่เกิน' )
{
$price = str_replace(',', '', str_replace(',', '',$arr[1]));
$sql_price = ' AND phonenumber.price <= "' .$price. '"';
}
else
{
$price = str_replace(',', '', str_replace(',', '',$arr[1]));
$sql_price = ' AND phonenumber.price >= "' .$price. '"';
}
}
}
$sql_number_like = '';
if($_SESSION['number_like'] <> '')//ค้นหาจากเลขที่ชอบ
{
foreach( $_SESSION['number_like'] as $key => $value )
{
$like = ' AND phonenumber.phonenumber LIKE "%___'.$value.'%"';
$sql_number_like = $sql_number_like . $like ;
}
}
$sql_number_dislike = '';
if($_SESSION['number_dislike'] <> '')//ค้นหาจากเลขที่ชอบ
{
foreach( $_SESSION['number_dislike'] as $key => $value )
{
$dislike = ' AND phonenumber.phonenumber NOT LIKE "%___'.$value.'%"';
$sql_number_dislike = $sql_number_dislike . $dislike ;
}
}
$sql_number_setlike = '';
if($_POST['FavoriteSet'][1]<> '')//ค้นหาจากเลขที่ชอบ
{
$_SESSION['s_FavoriteSet'] = $_POST['FavoriteSet'];
$like = ' AND phonenumber.phonenumber LIKE "%'.$_POST['FavoriteSet'][1].'%"';
$sql_number_setlike = $sql_number_setlike . $like ;
}
$sql_number_network = '';
if($_POST['network']<> '')//ค้นหาจากเลขที่ชอบ
{
$_SESSION['s_network'] = $_POST['network'];
$sql_number_network = ' AND phonenumber.mobilenetwork = "'.$_POST['network'].'"';
}
?>
<?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" ' . $sql_number_post . $sql_number_sum . $sql_number_style .
$sql_number_price_re . $sql_price . $sql_number_like . $sql_number_dislike . $sql_number_setlike .$sql_number_network .$sql_number_cat ;
$max_rows = 12; // แสดงจำนวนแถวต่อหน้า
$page_number = 0;
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 = mysql_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">
<div class="col-md-12" style="margin-bottom:20px;margin-top:20px;">
<div style="margin-top:0px;">
<?php
if($_POST['total'] <> '')//ผลรวม
{
$list_sum = array('table'=>'totalnumber','where'=>'number = "'.$_POST['total'].'"','order'=> "ORDER BY id DESC");
$view_sum = $view_db->view($list_sum);
$row_sum = $view_db->q($view_sum);
if($row_sum['id'])
{
?>
<div class="row" style="margin-bottom:40px;">
<div class="col-md-12" >
<span class="" style="font-size:30px;">ผลรวม <?php echo $row_sum['number'] .' '. $row_sum['title'];?></span>
</div>
<div class="col-md-12" style="font-size:20px;text-align:left;text-indent: 40px;"><?php echo $row_sum['detail']?> </div>
</div>
<?php
}
}
?>
<div class="row">
<div class="col-md-6" style="margin-bottom:5px;">
<p class="HeadTextL"> ผลการค้าหา</p>
</div>
<!-- <div class="col-md-6 BerDedToday-page">
<?php
/*if($total_rows_num > 0)
{
page_news($page_number,$total_pages,'index.php','');
}*/
?>
</div>-->
</div>
<div class="row">
<?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);
$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;
$list_phr = array('table'=>'phonenumber','where'=>'phonenumber = "'.$row['phonenumber'].'" ');
$view_phr = $view_db->view($list_phr);
$row_phr = $view_db->q($view_phr);
?>
<div class="col-12 col-md-4">
<div class="BoxRecom rounded-sim2 box-s">
<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:24px;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="auto" 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-12 col-md-6 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>
<?php
if($total_rows_num == 0)
{
?><div align="center" style="padding-top:20px;color:#F00;font-size:18px;">--- ไม่พบข้อมูล ---</div><?php
}
?>
<div class="row">
<div class="col-md-12 d-flex justify-content-center">
<?php
if($total_rows_num > 0)
{
page_news2($page_number,$total_pages,'index.php','');
}
?>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function reset_search()
{
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
window.location.href = '../search/index.php';
}
};
xmlhttp.open("GET", "../include/ajax_reset_search.php", true);
xmlhttp.send();
}
</script>
<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');
$("#alert_cart").html(data);
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById('alert_cart_ok').innerHTML = this.responseText;
$('#alert_cart_ok').dropdown('toggle');
window.location.reload();
}
};
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>