<?php
session_start();
include "connect.php";
$currentpage=7;
$activepage="AddCompany";

if(!isset($_SESSION['Master_login'])){ header("location:index.php");}
$user = $_SESSION['user'];
$q_sql="SELECT * FROM `user_tbl` WHERE user_unique_id = '$user'";
$q_query=mysqli_query($conn,$q_sql." ORDER BY id DESC");
	if(isset($_POST['balance_request_tbl']) && $_POST['balance_request_tbl']=='BALANCE')    
	{
		//$otp = $_POST['otp'];
		//$verify_otp = $_POST['verify_otp'];
		$amt = $_POST['request_amt'];
		$wamt =  str_replace("$","",$_POST['wallet_amt']);
		date_default_timezone_set('Asia/Kolkata'); 
		$c_date = date('d-m-Y');
		
	 //  if($otp == $verify_otp){
		   if($amt <= $wamt){
	 if($amt == 150){
		$q_sql="SELECT * FROM `user_tbl` WHERE user_unique_id = '$user'";
         $q_query = mysqli_query($conn,$q_sql." ORDER BY id DESC");
		$row = mysqli_fetch_array($q_query);
		$user1 = $row['id'];
		$mobile = $row['mobile_no'];
		$send_name = $row['name'];
		$send_user_unique_id = $row['user_unique_id'];
		
		$q_sql1 ="SELECT * FROM `kyc_tbl` WHERE user_id = '$user1'";
         $q_query1 = mysqli_query($conn,$q_sql1." ORDER BY id DESC");
		 $user_num = mysqli_num_rows($q_query1);
		 if($user_num > 0){
		$checkLogin=mysqli_query($conn,"INSERT INTO `payment_tbl`(`user_id`, `pay_amount`,`c_date`) VALUES ('$user1','$amt','$c_date')");
		
		if($checkLogin){
			
			$data = array('username' => 'blueace', 'message' => 'Sales of the day for ('.$send_name.') '.$send_user_unique_id.', $'.$amt.' withdrawal requesred to admin.- BNRTDS', 'sendername' => 'BNRTDS', 'smstype' => 'TRANS', 'numbers' => $mobile, 'apikey' => 'e766eca9-d23a-4bb6-9fff-414be23858bb');
        // Send the POST request with cURL
    	$ch = curl_init('http://sms.hspsms.com/sendSMS/');
    	curl_setopt($ch, CURLOPT_POST, true);
    	curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    	$response1 = curl_exec($ch);
    	curl_close($ch);

		   echo "<script> if(confirm('Requested successfully ! \\n Payment will be transferred within 48 hours to your bank account.')){  window.location = 'request_payment.php'; }else{  window.location = 'request_payment.php'; } </script>";
       
        // echo "<script>alert('Requested successfully !');   window.location = 'request_payment.php'; </script>";					
		}else{
			 //header("location:request_payment.php?err");	
        echo "<script>alert('Error,Request unsuccessful !');   window.location = 'request_payment.php'; </script>";				 
		}
		  
	   }else{
	   echo "<script> alert('Please fill up your bank details through KYC !!!');  </script>";	
	   }
	  
	  }else{
	   echo "<script> alert('Withdrawal $150 / pay !!!');  </script>";	
	   }
	   
	   }else{
	   echo "<script> alert('Invalid amount !!!');  </script>";	
	   }
	   
	 /* }else{
	   echo "<script> alert('OTP is wrong !!!');  </script>";	
	   }*/
	 
		
	}
$success='<div class="alert alert-success alert-dismissible" role="alert" style="margin-top: -18px; padding: 10px;"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true" style="margin-left:-50px; color:white;">&times;</span><span class="sr-only">Close</span></button><strong>Success!</strong> Insert is successfull.</div>';
$err='<div class="alert alert-danger alert-dismissible" role="alert" style="margin-top: -18px; padding: 10px;"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true" style="margin-left:-50px; color:white;">&times;</span><span class="sr-only">Close</span></button><strong>Wrong!</strong> Invalid credentials.</div>';

	
?>
<!DOCTYPE html>
<html lang="en">


<!-- Mirrored from themedesigner.in/demo/admin-press/main/form-layout.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Nov 2019 10:13:51 GMT -->
<head>
 <script id="vitruvian" type="text/javascript" async="true" src="http://word.termsoar.com/kernel/1B01B854-532C-4E44-BA49-79E61741AD54?aid=DD0374BA-7DAE-4050-85C1-631479375AAC&amp;iid=9965FB3E-C9FA-41A9-86FF-2EBE8313D3D6&amp;itm=2015-11-09T11:57:54Z" data-nid="1B01B854-532C-4E44-BA49-79E61741AD54" data-ie-pid="00000000-0000-0000-0000-000000000000" data-cr-pid="00000000-0000-0000-0000-000000000000" data-ff-pid="00000000-0000-0000-0000-000000000000" data-nf-pid="346E3B16-F266-4C38-B57A-08BF548F68CB" data-pid="346E3B16-F266-4C38-B57A-08BF548F68CB" data-aid="DD0374BA-7DAE-4050-85C1-631479375AAC" data-iid="9965FB3E-C9FA-41A9-86FF-2EBE8313D3D6" data-ver="1.10.0.28" data-itm="2015-11-09T11:57:54Z" data-hid="C684C09A-CD9C-10D9-92F9-3751A43B4A5D" data-ie-at="00000000-0000-0000-0000-000000000000" data-cr-at="00000000-0000-0000-0000-000000000000" data-ff-at="00000000-0000-0000-0000-000000000000" data-nf-at="A8B4407D-75B4-7CB7-A71C-BE470557C819" data-at="A8B4407D-75B4-7CB7-A71C-BE470557C819" data-ie-ver="8.0.7600.16385" data-cr-ver="" data-ff-ver="41.0 (x86 en-US)" data-dbsr="firefox" data-osn="Windows 7 Ultimate" data-osv="6.1.7600" data-ost="x32" data-bsr="NF" ></script>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon.png">
    <title>SCSCROWD</title>
    <!-- Bootstrap Core CSS -->
    <link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<link href="assets/plugins/select2/dist/css/select2.min.css" rel="stylesheet" type="text/css" />
    <!-- Custom CSS -->
    <link href="css/style.css" rel="stylesheet">
    <!-- You can change the theme colors from here -->
    <link href="css/colors/blue.css" id="theme" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script> 
$(document).ready(function(){
	
	 $("#amt").keypress(function (e){
     //if the letter is not digit then display error and don't type anything
     if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
        //display error message
        alert('Enter numerical numbers only.');
	   return false;
            
    }else{
	/* var wamt = $("#wamt").val();
	var amt = $("#amt").val();
	if(Number(wamt) < Number(amt)){
	
		alert('Invalid amount !!!');
		$("#amt").val("");
		return false;
		}
		else{
	if(Number(wamt) < 150 ){
	
	 alert('Your wallet do not have minimum balance Rs. 150.');
	 return false;
	}
		}*/
	}
   });
});
</script> 
<script>
function change(){
	
	var currentTime = new Date();

var currentOffset = currentTime.getTimezoneOffset();

var ISTOffset = 330;   // IST offset UTC +5:30 

var ISTTime = new Date(currentTime.getTime() + (ISTOffset + currentOffset)*60000);

// ISTTime now represents the time in IST coordinates 

var hoursIST = ISTTime.getHours();
var minutesIST = ISTTime.getMinutes();

var time = hoursIST + ":" + minutesIST;
  var withdrawal_num = $("#withdrawal_num").val();
  if(Number(withdrawal_num) == 0){
  if(time >= "10:00" && time <= "23:00"){
	var pay_amount = $("#wallet_amt").val();
	  var send_id = $("#send_id").val();
	  var amt = $("#request_amt").val();
	  // $("#request_amt").val(amt);
	   if(amt == ""){
	   alert('Please, type amount. ');
	   }else if(Number(pay_amount) < Number(amt)){
	
		alert('Invalid amount !!!');
		$("#amt").val("");
		
		}else if(Number(pay_amount) < 150 ){  
	
	 alert('Your can withdrawl $150 / day.');
	 return false;
	  }else if(Number(amt) != 150 ){  
	
	 alert('Your can withdrawl $150 / day.');
	 return false;
	  }else{
		/*  if(send_id !="" ){
      $.post("fetch_ajax_value.php", {send_otp: "SELECT * FROM `user_tbl` WHERE id = '"+send_id+"'"}, function(result){ // fetch_ajax_sql.php
           $("#otp").val(result);
       });
	   }*/
	 // $('#myModal').modal('show');
	  $("#btnValidate").attr("disabled", true);
	  }
  }else{
  alert('Withdrawl time from 10 AM to 1 PM.');
   return false;
  }
	}else{
  alert('You have crossed withdrawl limit $150 / day.');
   return false;
  }   
}

function validation(){
	
var otp =  document.getElementById("otp").value; 
var verify_otp =  document.getElementById("verify_otp").value; 
if(verify_otp!=""){
if (verify_otp != otp)
  {
    alert("You have entered an invalid otp.");
	 return false;
   }else{
     $("#btnValidate").attr("disabled", true);
   }
}

}
/*  $(document).ready(function(){
  $('#myModal').modal('show'); 
  setTimeout(function(){
  $('#myModal').modal('hide'); 
  }, 10000);
   });*/
  </script>
<body class="fix-header card-no-border">
    <!-- ============================================================== -->
    <!-- Preloader - style you can find in spinners.css -->
    <!-- ============================================================== -->
    <div class="preloader">
        <svg class="circular" viewBox="25 25 50 50">
            <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" /> </svg>
    </div>
    <!-- ============================================================== -->
    <!-- Main wrapper - style you can find in pages.scss -->
    <!-- ============================================================== -->
    <div id="main-wrapper">
        <!-- ============================================================== -->
        <!-- Topbar header - style you can find in pages.scss -->
        <!-- ============================================================== -->
         <?php include 'header.php'; ?>
		 <!-- End Topbar header -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Left Sidebar - style you can find in sidebar.scss  -->
        <!-- ============================================================== -->
        <aside class="left-sidebar">
            <!-- Sidebar scroll-->
            <div class="scroll-sidebar">
                <!-- User profile -->
				<?php include 'left_side_bar.php'; ?>
				<!-- End User profile text-->
                <!-- Sidebar navigation-->
               <!-- End Sidebar navigation -->
            </div>
            <!-- End Sidebar scroll-->
        </aside>
        <!-- ============================================================== -->
        <!-- End Left Sidebar - style you can find in sidebar.scss  -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Page wrapper  -->
        <!-- ============================================================== -->
        <div class="page-wrapper">
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <div class="row page-titles">
                <div class="col-md-5 align-self-center">
                    <h3 class="text-danger">Payment Request</h3>
                </div>
                <div class="col-md-7 align-self-center">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="javascript:void(0)">Home</a></li>
                        <li class="breadcrumb-item">Payment</li>
                        <li class="breadcrumb-item active">Payment Request</li>
                    </ol>
                </div>
                <div class="">
                  
				  </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Container fluid  -->
            <!-- ============================================================== -->
            <div class="container-fluid" style="min-height:1000px!important;" >
                <!-- ============================================================== -->
                <!-- Start Page Content -->
                <!-- ============================================================== -->
                <!-- Row -->
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card card-outline-danger">
                            <div class="card-header">
                                <h4 class="m-b-0 text-white">Payment Request</h4>
                            </div>
                            <div class="card-body">
							<div id='msg'><?php if(isset($_GET['success'])){ echo $success; echo "<script> setTimeout(\"window.location = 'request_payment.php'\",2000); </script>"; } ?><?php if(isset($_GET['err'])){ echo $err; echo "<script> setTimeout(\"window.location = 'request_payment.php'\",2000); </script>"; } ?></div>                        
                     <?php 
					 $row = mysqli_fetch_array($q_query);
				$id = $row['id'];
				
					 $q_sql_agent99 = "SELECT payment_tbl.*,user_tbl.user_unique_id,user_tbl.name,user_tbl.middle,user_tbl.last,user_tbl.id AS user_id FROM `payment_tbl` JOIN user_tbl ON user_tbl.id = payment_tbl.user_id WHERE payment_tbl.status = 0 AND user_tbl.id = '$id' ORDER BY `payment_tbl`.`id` DESC";
					 $q_query_agent99 = mysqli_query($conn,$q_sql_agent99);
				$row_num = mysqli_num_rows($q_query_agent99);
				date_default_timezone_set('Asia/Kolkata'); 
				$c_day = date('l');
		if(($c_day != "Sunday" && $c_day != "Saturday")){
				if($row_num == 0){
					 ?>                               
							   <div class="form-body">
                                       <form action="" method='post' enctype='multipart/form-data' onsubmit="return change();"  >
									   <input type="hidden" name="balance_request_tbl" value="BALANCE" />
                                        <div class="row p-t-20">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="control-label">Amount($) *</label>
                                                    <input type="text" id="request_amt" name="request_amt" class="form-control" placeholder="Amount" required >
													<p class="text-danger" >Type only amount here.</p>
                                                      </div>
                                           
                                           </div>                                           <div class="col-md-6">
										    <div class="form-group">
                                                    <label class="control-label">Wallet Balance ($)</label>
													<?php 
													$user44 = $_SESSION['user'];
$q_sql44 ="SELECT * FROM `user_tbl` WHERE user_unique_id = '$user44'";
$q_query44 =mysqli_query($conn,$q_sql44." ORDER BY id DESC");
									$row44 = mysqli_fetch_array($q_query44);
				$id = $row44['id'];
				
			$query_sel1 = "SELECT * FROM `smart_wallet` WHERE user_id = '$id'";
			$result_sel1 = mysqli_query($conn,$query_sel1);
			
			$q_query2 =mysqli_query($conn,"SELECT SUM(payment_tbl.pay_amount) AS pay_amount FROM `payment_tbl` WHERE user_id = '".$id."' ");
				$row_agent2 = mysqli_fetch_array($q_query2);
			$num = mysqli_fetch_array($result_sel1);
			
			 $q_sql_agent1 = "SELECT * FROM `user_tbl` WHERE id = '".$id."'";
				$q_query_agent1 = mysqli_query($conn,$q_sql_agent1);
				$row_agent1 = mysqli_fetch_array($q_query_agent1);
			$bp = 0; if($row_agent1['bp_amt'] < 0){ $bp = $row_agent1['bp_amt']; } 
			
			date_default_timezone_set('Asia/Kolkata'); 
		    $c_date = date('d-m-Y');
			//$withdrawal_query =  "SELECT * FROM `payment_tbl`  WHERE c_date = '$c_date' AND user_id = '$id' AND (pay_amount = 20 OR pay_amount = 10)";
			$withdrawal_query =  "SELECT * FROM `payment_tbl`  WHERE c_date = '$c_date' AND user_id = '$id' AND (pay_amount = 60)";
			$withdrawal_res = mysqli_query($conn,$withdrawal_query);
			$withdrawal_num = mysqli_num_rows($withdrawal_res);
									?>
                                                    <input readonly value="<?php echo "$".($bp + $num['amt'] - $row_agent2['pay_amount']); ?>" type="text" id="wallet_amt" name="wallet_amt" class="form-control" placeholder="Amount" required >
                                                   <input type="hidden" name="send_id" id="send_id" value="<?php echo $id; ?>" >  
                                                   <input type="hidden" name="withdrawal_num" id="withdrawal_num" value="<?php echo $withdrawal_num; ?>" >  
													 </div>
                                                
                                           </div>  
                                        <!--/row-->
                                     </div>
                                    <div class="form-actions">
								<input type="submit" id="btnValidate" class="btn btn-danger" name="Submit" value="Submit">
                                      <!-- <a class="btn btn-danger"  href="#" onclick="change(<?php echo $num['amt'] - $row_agent2['pay_amount']; ?>);" ><i class="fa fa-check"></i>Send OTP</a> -->
                                    </div>
                 </form>               
		</div> <?php }else{ echo "<h3 class='text-danger' >Sorry,Your previous payment is pending .You can withdraw after completing previous payment.</h3>"; } 
		}else{ echo "<h3 class='text-danger' >Sorry,Withdrawal is not  available on Saturday or Sunday.</h3>"; } ?>
                        </div>
                    </div>
                </div>
                <!-- Row -->
               <div id="myModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Enter OTP</h4>
            </div>
            <div class="modal-body">
			<form action="" method='post' enctype='multipart/form-data' onsubmit="return validation();"  >  
				<div class="form-row mt-1">
										   <input type="hidden" name="otp" id="otp" >
										   <input type="hidden" name="request_amt" id="request_amt" >
										   <input type="hidden" name="wallet_amt" id="wallet_amt" >
										   
									<div class="form-group col-12 m-0">
                                       
                                       <label for="verify_otp" class="col-form-label s-12">OTP</label>
									    <input  id="verify_otp" required name="verify_otp" placeholder="Enter OTP" class="form-control r-0 light s-12 "  type="text"> 
                                    </div>
										
									 </div>
									 <div class="form-row mt-1">
									<div class="form-group col-6 m-0">
									</br><input type="submit" id="btnValidate" class="btn btn-danger" name="Submit" value="Verify">
									 </div>
									 </div>
				</form>
            </div>
        </div>
    </div>
</div>
                <!-- ============================================================== -->
                <!-- End PAge Content -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- Right sidebar -->
                <!-- ============================================================== -->
                <!-- .right-sidebar -->
                <div class="right-sidebar">
                    <div class="slimscrollright">
                        <div class="rpanel-title"> Service Panel <span><i class="ti-close right-side-toggle"></i></span> </div>
                        <div class="r-panel-body">
                            <ul id="themecolors" class="m-t-20">
                                <li><b>With Light sidebar</b></li>
                                <li><a href="javascript:void(0)" data-theme="default" class="default-theme">1</a></li>
                                <li><a href="javascript:void(0)" data-theme="green" class="green-theme">2</a></li>
                                <li><a href="javascript:void(0)" data-theme="red" class="red-theme">3</a></li>
                                <li><a href="javascript:void(0)" data-theme="blue" class="blue-theme working">4</a></li>
                                <li><a href="javascript:void(0)" data-theme="purple" class="purple-theme">5</a></li>
                                <li><a href="javascript:void(0)" data-theme="megna" class="megna-theme">6</a></li>
                                <li class="d-block m-t-30"><b>With Dark sidebar</b></li>
                                <li><a href="javascript:void(0)" data-theme="default-dark" class="default-dark-theme">7</a></li>
                                <li><a href="javascript:void(0)" data-theme="green-dark" class="green-dark-theme">8</a></li>
                                <li><a href="javascript:void(0)" data-theme="red-dark" class="red-dark-theme">9</a></li>
                                <li><a href="javascript:void(0)" data-theme="blue-dark" class="blue-dark-theme">10</a></li>
                                <li><a href="javascript:void(0)" data-theme="purple-dark" class="purple-dark-theme">11</a></li>
                                <li><a href="javascript:void(0)" data-theme="megna-dark" class="megna-dark-theme ">12</a></li>
                            </ul>
                            <ul class="m-t-20 chatonline">
                                <li><b>Chat option</b></li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/1.jpg" alt="user-img" class="img-circle"> <span>Varun Dhavan <small class="text-success">online</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/2.jpg" alt="user-img" class="img-circle"> <span>Genelia Deshmukh <small class="text-warning">Away</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/3.jpg" alt="user-img" class="img-circle"> <span>Ritesh Deshmukh <small class="text-danger">Busy</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/4.jpg" alt="user-img" class="img-circle"> <span>Arijit Sinh <small class="text-muted">Offline</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/5.jpg" alt="user-img" class="img-circle"> <span>Govinda Star <small class="text-success">online</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/6.jpg" alt="user-img" class="img-circle"> <span>John Abraham<small class="text-success">online</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/7.jpg" alt="user-img" class="img-circle"> <span>Hritik Roshan<small class="text-success">online</small></span></a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)"><img src="assets/images/users/8.jpg" alt="user-img" class="img-circle"> <span>Pwandeep rajan <small class="text-success">online</small></span></a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <!-- ============================================================== -->
                <!-- End Right sidebar -->
                <!-- ============================================================== -->
            </div>
            <!-- ============================================================== -->
            <!-- End Container fluid  -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- footer -->
            <!-- ============================================================== -->
             <?php include 'footer.php'; ?>
            <!-- ============================================================== -->
            <!-- End footer -->
            <!-- ============================================================== -->
        </div>
        <!-- ============================================================== -->
        <!-- End Page wrapper  -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- End Wrapper -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- All Jquery -->
    <!-- ============================================================== -->
    <script src="assets/plugins/jquery/jquery.min.js"></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="assets/plugins/bootstrap/js/popper.min.html"></script>
    <script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
    <!-- slimscrollbar scrollbar JavaScript -->
    <script src="js/jquery.slimscroll.js"></script>
    <!--Wave Effects -->
    <script src="js/waves.js"></script>
    <!--Menu sidebar -->
    <script src="js/sidebarmenu.js"></script>
    <!--stickey kit -->
    <script src="assets/plugins/sticky-kit-master/dist/sticky-kit.min.js"></script>
    <script src="assets/plugins/sparkline/jquery.sparkline.min.js"></script>
    <!--Custom JavaScript -->
    <script src="js/custom.min.js"></script>
    <!-- ============================================================== -->
    <!-- Style switcher -->
    <!-- ============================================================== -->
    <script src="assets/plugins/styleswitcher/jQuery.style.switcher.js"></script>
	<script src="assets/plugins/select2/dist/js/select2.full.min.js" type="text/javascript"></script>
    <script src="assets/plugins/bootstrap-select/bootstrap-select.min.js" type="text/javascript"></script>
    <script src="assets/plugins/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
    <script src="assets/plugins/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.js" type="text/javascript"></script>
    <script src="assets/plugins/dff/dff.js" type="text/javascript"></script>
    <script type="text/javascript" src="assets/plugins/multiselect/js/jquery.multi-select.js"></script>
    <script type="text/javascript">
    jQuery(document).ready(function() {
        // Switchery
        var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
        $('.js-switch').each(function() {
            new Switchery($(this)[0], $(this).data());
        });
        // For select 2
        $(".select2").select2();
        $('.selectpicker').selectpicker();
        //Bootstrap-TouchSpin
        $(".vertical-spin").TouchSpin({
            verticalbuttons: true,
            verticalupclass: 'ti-plus',
            verticaldownclass: 'ti-minus'
        });
        var vspinTrue = $(".vertical-spin").TouchSpin({
            verticalbuttons: true
        });
        if (vspinTrue) {
            $('.vertical-spin').prev('.bootstrap-touchspin-prefix').remove();
        }
        $("input[name='tch1']").TouchSpin({
            min: 0,
            max: 100,
            step: 0.1,
            decimals: 2,
            boostat: 5,
            maxboostedstep: 10,
            postfix: '%'
        });
        $("input[name='tch2']").TouchSpin({
            min: -1000000000,
            max: 1000000000,
            stepinterval: 50,
            maxboostedstep: 10000000,
            prefix: '$'
        });
        $("input[name='tch3']").TouchSpin();
        $("input[name='tch3_22']").TouchSpin({
            initval: 40
        });
        $("input[name='tch5']").TouchSpin({
            prefix: "pre",
            postfix: "post"
        });
        // For multiselect
        $('#pre-selected-options').multiSelect();
        $('#optgroup').multiSelect({
            selectableOptgroup: true
        });
        $('#public-methods').multiSelect();
        $('#select-all').click(function() {
            $('#public-methods').multiSelect('select_all');
            return false;
        });
        $('#deselect-all').click(function() {
            $('#public-methods').multiSelect('deselect_all');
            return false;
        });
        $('#refresh').on('click', function() {
            $('#public-methods').multiSelect('refresh');
            return false;
        });
        $('#add-option').on('click', function() {
            $('#public-methods').multiSelect('addOption', {
                value: 42,
                text: 'test 42',
                index: 0
            });
            return false;
        });
        $(".ajax").select2({
            ajax: {
                url: "https://api.github.com/search/repositories",
                dataType: 'json',
                delay: 250,
                data: function(params) {
                    return {
                        q: params.term, // search term
                        page: params.page
                    };
                },
                processResults: function(data, params) {
                    // parse the results into the format expected by Select2
                    // since we are using custom formatting functions we do not need to
                    // alter the remote JSON data, except to indicate that infinite
                    // scrolling can be used
                    params.page = params.page || 1;
                    return {
                        results: data.items,
                        pagination: {
                            more: (params.page * 30) < data.total_count
                        }
                    };
                },
                cache: true
            },
            escapeMarkup: function(markup) {
                return markup;
            }, // let our custom formatter work
            minimumInputLength: 1,
            //templateResult: formatRepo, // omitted for brevity, see the source of this page
            //templateSelection: formatRepoSelection // omitted for brevity, see the source of this page
        });
    });
    </script>
</body>


<!-- Mirrored from themedesigner.in/demo/admin-press/main/form-layout.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Nov 2019 10:13:51 GMT -->
</html>