var root_url = "https://sodepabc.com/";
var network="";
var cat="";
var network_select="";
var network_select_url="";
var cat_select="";
var cat_select_url="";
function changepage(last_url)
{
if(last_url=="")
{
squery=document.forms['sortorder_listing'].elements['squery'].value;
if(document.forms['sortorder_listing'].elements['squery'].value=="Chứa dãy số bất kỳ...")
{
squery="";
}
if($(".network-select").length){
network_select=document.forms['sortorder_listing'].elements['network_select'].value;
network_select_url='&network_select=' + network_select;
}
else{
network=document.forms['sortorder_listing'].elements['network'].value;
}
if($(".cat-select").length){
cat_select=document.forms['sortorder_listing'].elements['cat_select'].value;
cat_select_url= '&cat_select=' + cat_select;
}
else {
cat=document.forms['sortorder_listing'].elements['cat'].value;
}
prefix=$('input:radio[name=prefix]:checked').val();
if(prefix==undefined) prefix=document.forms['sortorder_listing'].elements['prefix'].value;
price_from=document.forms['sortorder_listing'].elements['price_from'].value;
price_to=document.forms['sortorder_listing'].elements['price_to'].value;
branch=document.forms['sortorder_listing'].elements['branch'].value;
if($.cookie("view_page_pager")>0) { var display_per_page=$.cookie("view_page_pager"); }
else {var display_per_page="";}
last_url = '&squery=' + squery + '&network=' + network + '&cat=' + cat + '&prefix=' + prefix + '&price_to=' + price_to + '&price_from=' + price_from + '&branch=' + branch + '&display_per_page=' + display_per_page + network_select_url + cat_select_url;
}
$.ajax({
url: root_url + "ajax.php?do=display_sim_list&"+ last_url,
beforeSend: function(){
$("#loadingMask").css('visibility', 'visible');
},
success: function(data) {
$("#loadingMask").css('visibility', 'hidden');
if(data=="")
{ alert("Không tìm thấy dữ liệu sim") }
else
{ $('#bangsim').html(data);}
}
});
}
function tracuuphongthuy()
{
//captcha=document.forms['phongthuy'].elements['captcha'].value;
sodt=document.forms['phongthuy'].elements['sodt'].value;
giosinh=document.forms['phongthuy'].elements['giosinh'].value;
ngaysinh=document.forms['phongthuy'].elements['ngaysinh'].value;
thangsinh=document.forms['phongthuy'].elements['thangsinh'].value;
namsinh=document.forms['phongthuy'].elements['namsinh'].value;
gioitinh=$('input:radio[name=gioitinh]:checked').val();
//lunar=convertSolar2Lunar2(parseInt(ngaysinh), parseInt(thangsinh), parseInt(namsinh), 7);
if(sodt.length<6 || namsinh.length!=4)
{
alert('Vui lòng nhập đầy đủ thông tin tại mẫu phong thủy!')
phongthuy.sodienthoai.focus();
return false;
}
else
{
$.ajax({
url: root_url + "ajax.php?do=fengshui&sodt=" + sodt + '&giosinh=' + giosinh + '&ngaysinh=' + ngaysinh + '&thangsinh=' + thangsinh + '&namsinh=' + namsinh + '&gioitinh=' + gioitinh,
beforeSend: function(){
$("#loadingMask").css('visibility', 'visible');
},
success: function(data) {
$("#loadingMask").css('visibility', 'hidden');
$('#ketqua_phongthuy').html(data);
}
});
}
}
function send_feedback()
{
hoten=document.forms['feedback'].elements['hoten'].value;
noidung=document.forms['feedback'].elements['noidung'].value;
code=document.forms['feedback'].elements['code'].value;
dienthoai=document.forms['feedback'].elements['dienthoai'].value;
if(hoten!="" && noidung!="" && code!="")
{
$.ajax({
url: root_url + "ajax.php?do=send_feedback&hoten=" + hoten + '&dienthoai=' + dienthoai + '&noidung=' + noidung+ '&code=' + code,
beforeSend: function(){
$("#loadingMask").css('visibility', 'visible');
},
success: function(data) {
$("#loadingMask").css('visibility', 'hidden');
$('#lienlac').html(data);
}
});
}
else
{
alert("Thông tin chưa đầy đủ! Vui lòng kiểm tra lại");
}
}
function posta_question()
{
hoten=document.forms['post_question'].elements['hoten'].value;
email=document.forms['post_question'].elements['email'].value;
tieude=document.forms['post_question'].elements['tieude'].value;
noidung=document.forms['post_question'].elements['noidung'].value;
code=document.forms['post_question'].elements['code'].value;
if(hoten!="" && email!="" && tieude!="" &&code!="")
{
$.ajax({
url: root_url + "ajax.php?do=posta_question&hoten=" + hoten + '&tieude=' + tieude + '&email=' + email + '&noidung=' + noidung + '&code=' + code,
beforeSend: function(){
$("#loadingMask").css('visibility', 'visible');
},
success: function(data) {
$("#loadingMask").css('visibility', 'hidden');
document.forms['post_question'].elements['hoten'].disabled=true;
document.forms['post_question'].elements['email'].disabled=true;
document.forms['post_question'].elements['tieude'].disabled=true;
document.forms['post_question'].elements['noidung'].disabled=true;
document.forms['post_question'].elements['code'].disabled=true;
alert(data);
$.ajax({
url: "http://localhost/abc/ajax.php?do=change_page_question&page=1",
success: function(data) {
$('#danhsach_khachhang').html(data);
}
});
}
});
}
else
{
alert("Thông tin chưa đầy đủ! Vui lòng kiểm tra lại");
}
}
function luuvaofavourite(BookmarkURL,BookmarkTitle)
{
if (document.all)
{ window.external.addFavorite(BookmarkURL,BookmarkTitle) }
else if (window.sidebar)
{ // Add to Bookmarks (Mozilla Firefox)
window.sidebar.addPanel(BookmarkTitle, BookmarkURL, "");}
else
{
alert('Chúng tôi chưa hỗ trợ trình duyệt Google Chrome. Quý khách hãy nhấn Ctrl + D');
}
}
function showcase()
{
diaphuong_tmp=document.getElementById("thanhpho").value;
data1=' Giao sim trong nội thành Tp.HCM hoặc HN (Có thể tính thêm phụ phí)
Đến trực tiếp cửa hàng để lấy sim';
data2=' Nhờ người quen tại Tp.HCM hoặc HN giao dịch lấy sim hộ
Đặt cọc trước 50.000-100.000 và thanh toán số tiền còn lại khi bưu điện phát sim (+30.000 phí thu hộ)
Lưu ý: Khách hàng đặt cọc để đảm bảo nhu cầu mua sim, tránh hủy ngang hoặc đặt hàng ảo';
if(diaphuong_tmp.length>3)
{
diaphuong=diaphuong_tmp.replace(" ","-");
if(diaphuong=="Ha-Noi" || diaphuong=="Tp-HoChiMinh")
{
$('.hinhthucmuasim').html(data1);
}
else
{
$('.hinhthucmuasim').html(data2);
}
$.ajax({
url: root_url + "ajax.php?do=showcase&diaphuong_tmp="+ diaphuong,
success: function(data)
{
$('#showcase').html(data);
}
});
}
}
function set_cookie_per_page(number_per_page) { $.cookie("view_page_pager", number_per_page, { path: '/' }); }
function set_sort_type(type) { $.cookie("sort_type", type, { path: '/' }); }