<?php
ob_start();
error_reporting(0);
include("connect.php");
session_start(); 
$ver = $_SESSION["admin_id"];
$admin_id = $_SESSION["admin_id"];
$dis_id = $_SESSION["manager_id"];
$user_type = $_SESSION["user_type"];
$user_session = $_SESSION["user_session"];

$id1 = base64_decode($_GET['id']);
if(!isset($_SESSION["admin_id"])){
   header('location:http://www.btcover.appexperts.net');
}
date_default_timezone_set('Asia/Calcutta');
	$cdate  = date("Y-m-d");
?>
<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>
    <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>BTCOVER : Admin Dashboard</title>
    <!-- Custom CSS -->
    <link rel="stylesheet" type="text/css" href="assets/libs/select2/dist/css/select2.min.css">
    <link rel="stylesheet" type="text/css" href="assets/libs/jquery-minicolors/jquery.minicolors.css">
    <link rel="stylesheet" type="text/css" href="assets/libs/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
    <link rel="stylesheet" type="text/css" href="assets/libs/quill/dist/quill.snow.css">
    <link href="dist/css/style.min.css" rel="stylesheet">
   <script>
	
		function myFunction() {
			var txt;
		
			var r = confirm("Are you sure to reset!");
			if (r == true) {
				window.location.href="add-policy.php";
			} 
		}
		</script>
		<script>
		function addnew(str)
		{
			if(str=='new')
			{
				window.location.href="add-insurance-company.php?id2=addcompany";
				 //document.getElementById('com').style.display="block";
						 
			}
			else
			{
				
		
				var req=new XMLHttpRequest();
			 req.open("POST","https://www.btcover.appexperts.net/get-vehicle.php?id="+str,true);
			 req.send();
			 	
			 req.onreadystatechange=function()
			 {
				
				 if(req.readyState == 4 && req.status == 200)
				 {
					
			 document.getElementById("vehicle_id").innerHTML=req.responseText;
	
			 }
			  }
			
			
			 
			}
			
			
			/* else
			{
				 document.getElementById('com').style.display="none";
				 document.getElementById('com').value='';
			} */
		}
		</script>
		<script>
		function getvehicle(str)
		{
			if(str=='new')
			{
				window.location.href="add-vehicle-category.php?id2=addpolicy";
				
						 
			}
		
			
		}
		</script>
		
		<script>
		function ckeckdate(str)
		{
			var l=str.length;
			if(l==4)
			{
				var d = new Date();
				var n = d.getFullYear();
				if(str>=n)
				alert("year should be less than or equal to Current Year");
			else if(str<='1899')
				alert("enter correct Year");
			}
			else
			{
				alert("Invalid Year");
			}
		}
		</script>
		<script>
		function validate(str)
		{
			
			var t=(str>=0 && str <= 100);
          
            if (!t ) {
                alert("Please enter correct percentage.");
				document.getElementById('cgst').value="";
                document.form.discount.focus();
                return false;
            }
	
		}
	 </script>
		<script>
		function checkphone(str)
		{
			var l=str.length;
			if(l!=10)
			{
				
				alert("Invalid Phone Number");
			}
			
		}
		</script>
		
		<script>
		function checkregistration(str)
		{
		
		var patt = "^[A-Z]{2}[ -][0-9]{1,2}[ -][A-Z0-9]{1,2}[ -][0-9]{4}$";
		var result = patt.test(str);
		alert(result);
		if(!result)
		{
			alert("enter correct registration number");
		}
		}
		</script>
		<script type="text/javascript">
window.onload=function WindowLoad(event)
{			 document.getElementById('ncb').style.display="none";	
			 document.getElementById('cus_name').style.display="none";	
			 document.getElementById('phone').style.display="none";	
			 document.getElementById('cus_email').style.display="none";	
			 document.getElementById('cus_add').style.display="none";	
			 document.getElementById('com_id').style.display="none";	
			 
		
		console.log(admin_id);
	
}
</script>
		<script>
		function exist(str)
		{
			 document.getElementById('cus_name').style.display="none";	
			 document.getElementById('phone').style.display="none";	
			 document.getElementById('cus_email').style.display="none";	
			 document.getElementById('cus_add').style.display="none";	
			 document.getElementById('cus_id').style.display="block";	
		
		}
		</script>
		<script>
		function new1(str)
		{
			 document.getElementById('cus_name').style.display="block";	
			 document.getElementById('phone').style.display="block";	
			 document.getElementById('cus_email').style.display="block";	
			 document.getElementById('cus_add').style.display="block";	
			 document.getElementById('cus_id').style.display="none";	
		
		}
		
		function ncb(str)
		{
		if(str=='Yes')
			{
				document.getElementById('ncb').style.display="block";	
				
			}
			else
			{
				document.getElementById('ncb').style.display="none";	
			}
		}
		</script>
		
</head>

<body>
    <!-- ============================================================== -->
    <!-- Preloader - style you can find in spinners.css -->
    <!-- ============================================================== -->
  
	 <div id="main-wrapper">
   <?php include("header.php"); ?>
    
     <?php include("menu.php"); ?>
	
        <div class="page-wrapper">
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <div class="page-breadcrumb">
                <div class="row">
                    <div class="col-12 d-flex no-block align-items-center">
                        <h4 class="page-title">Add Policy</h4>
                        <div class="ml-auto text-right">
                            <nav aria-label="breadcrumb">
                                <ol class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>
									<?php if($id1!='') 
									{ ?>
                                    <li class="breadcrumb-item"><a href="agent.php">View Policy</a></li>
                                    <?php } ?>
									<?php if($id=='customer') 
									{ ?>
                                    <li class="breadcrumb-item"><a href="customer.php">View Customers</a></li>
                                    <?php } ?>
									<li class="breadcrumb-item active" aria-current="page">Add Policy</li>
                                </ol>
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Container fluid  -->
            <!-- ============================================================== -->
            <div class="container-fluid" >
                <!-- ============================================================== -->
                <!-- Start Page Content -->
                <!-- ============================================================== -->
				<div >
                <div class="row" >
                    <div class="col-md-12">
                        <div class="card" style="float:left; width:100%; overflow-Y: auto; height: 550px;">
                            <form class="form-horizontal" action="add-policy2.php" method="post" name="form"   enctype="multipart/form-data">
                                <div class="card-body">
                                    <h4 class="card-title">Basic Information</h4>
									<div class="form-group row">
                                   
                                    <div class="col-md-2" >
                                        <div class="custom-control custom-radio">
                                            <input type="radio" class="custom-control-input" checked id="customControlValidation1" name="type" value="Existing" onclick="exist(this.value);"   required>
                                            <label class="custom-control-label" for="customControlValidation1"><b>Existing Customer</b></label>
										</div>
										</div>
										<div class="col-md-2">
										 <div class="custom-control custom-radio">
											<input type="radio" class="custom-control-input" id="customControlValidation2" name="type" value="New" onclick="new1(this.value)"  >
                                            <label class="custom-control-label" for="customControlValidation2"><b>New Customer</b></label>
											
                                        </div>
                                        
                                         
                                    </div>
                                </div>
                                   <div class="form-group row">
                                   <div class="col-md-4" id="cus_id">	
									<div class="form-group ">
                                        <label for="fname" class=" text-left control-label col-form-label"><b>Customer Name</b></label>
                                        
                                            <select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="customer_id" id="customer_id" >
                                            <option value='' selected="selected" >Select Customer Name</option>
											<?php 
											if($_SESSION["user_type"]=='Manager')
											$query=mysqli_query($con,"select * from tbl_customer where manager_id='$dis_id' and status='Active'");
											else
												$query=mysqli_query($con,"select * from tbl_customer where tbl_customer.manager_id in (select manager_id from tbl_manager where admin_id='$ver') and status='Active'");
													while($agent=mysqli_fetch_assoc($query))
													{?>
													 <option value="<?php echo $agent['customer_id']?>"><?=$agent['customer_name']?></option>	
														
												<?php	}
											?>
                                      </select>
											</div>
                                </div>
								<div class="col-md-4" id="cus_name">	
									<div class="form-group ">
                                        <label for="cname" class=" text-left control-label col-form-label"><b>Customer Name</b></label>
                                         <input type="text" class="form-control" id="customer_name" name="customer_name" placeholder="Customer Name" >
									</div>
                                </div>
								<div class="col-md-4" id="phone">	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Customer Phone</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' minlength="10" maxlength="10" size="10" onchange="checkphone(this.value)" id="phone_no" name="phone_no" placeholder="Customer Phone" >
									</div>
                                </div>
								<div class="col-md-4" id="cus_email">	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Customer Email</b></label>
                                         <input type="email" class="form-control" id="email" name="email" placeholder="Email" >
									</div>
                                </div>
								<div class="col-md-4" id="cus_add">	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Customer Address</b></label>
                                         <input type="text" class="form-control" id="address" name="address" placeholder="Customer Address" >
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Policy Number</b></label>
                                         <input type="text" class="form-control" id="policy_no" name="policy_no" placeholder="Policy Number"style="text-transform:uppercase;" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Insurance Company Name</b></label>
                                         <select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="company_id" onchange="addnew(this.value)"  required>
                                            <option value='' selected="selected" >Select Company Name</option>
											<?php $query=mysqli_query($con,"select * from tbl_insurance_company where admin_id='$ver' and status='Active'");
													while($agent=mysqli_fetch_assoc($query))
													{?>
													 <option value="<?php echo $agent['company_id']?>"><?=$agent['company_name']?></option>	
														
												<?php	}
											?>
                                      <option value="new"><b>Add New Company</b></option>
                                        </select>
									</div>
                                </div>
								<!--<div class="col-md-4" id="com">	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>New Company Name</b></label>
                                         <input type="text" class="form-control" id="com_id" name="com" placeholder="Company Name" >
									</div>
                                </div>-->
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="fname" class=" text-left control-label col-form-label"><b>Agent Name</b></label>
                                        <select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="agent_id"  required>
                                            <option value='' selected="selected" >Select Agent Name</option>
											<?php 
											if($_SESSION["user_type"]=='Manager')
											$query=mysqli_query($con,"select * from tbl_agent where manager_id='$dis_id' and status='Active'");
										else
											$query=mysqli_query($con,"select * from tbl_agent where manager_id in (select manager_id from tbl_manager where admin_id='$ver') and status='Active'");
													while($agent=mysqli_fetch_assoc($query))
													{?>
													 <option value="<?php echo $agent['agent_id']?>"><?=$agent['agent_name'].'-'.$agent['agent_code']?></option>	
														
												<?php	}
											?>
                                      </select>
                                     </div>
                                </div>
								<?php if($_SESSION["user_type"]=='Admin') { ?>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="fname" class=" text-left control-label col-form-label"><b>Manager Name</b></label>
                                        <select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="manager_id"  required>
                                            <option value='' selected="selected" >Select Manager Name</option>
											<?php 
										
											$query1=mysqli_query($con,"select * from tbl_manager where manager_id in (select manager_id from tbl_manager where admin_id='1') and status='Active'");
													while($manger=mysqli_fetch_assoc($query1))
													{
														?>
													 <option value="<?php echo $manger['manager_id']?>"><?=$manger['manager_name'].'-'.$manger['manager_phone']?></option>	
														
												<?php	}
											?>
                                      </select>
                                     </div>
                                </div>
								<?php } ?>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="fname" class=" text-left control-label col-form-label"><b>Policy Date</b></label>
                                        <div class="input-group">
                                    <input type="text" class="form-control" id="datepicker-autoclose" name="policy_date" placeholder="dd/mm/yyyy">
                                    <div class="input-group-append">
                                        <span class="input-group-text"><i class="fa fa-calendar"></i></span>
                                    </div>
                                </div>
                                     </div>
                                </div>
                               
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="fname" class=" text-left control-label col-form-label"><b>Policy Type</b></label>
                                       <select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="policy_type"  required>
                                            <option value='' selected="selected" >Select Policy Type</option>
											<?php $query=mysqli_query($con,"select * from tbl_policy_type where admin_id='$ver' and status='Active'");
													while($agent=mysqli_fetch_assoc($query))
													{?>
													 <option value="<?php echo $agent['policy_id']?>"><?=$agent['policy_name']?></option>	
														
											<?php	}
											?>
                                      </select>
                                     </div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="fname" class=" text-left control-label col-form-label"><b>Vehicle Type</b></label>
                                       <select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="vehicle_id" id="vehicle_id" onchange="getvehicle(this.value)" required>
                                            <option value='' selected="selected" >Select vehicle Type</option>
											<?php/*  $query=mysqli_query($con,"select * from tbl_vehicle_master where admin_id='$ver' and status='Active'");
													while($agent=mysqli_fetch_assoc($query))
													{?>
													 <option value="<?php echo $agent['vehicle_id']?>"><?=$agent['vehicle_type']?></option>	
														
												<?php	} */
											?>
                                      </select>
                                     </div>
                                </div>
							
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Make & Model</b></label>
                                         <input type="text" class="form-control" id="make_model" name="make_model" placeholder="Make & Model" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Vehicle Total IDV</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="idv" name="idv" placeholder="Vehicle Total IDV" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="pnumber" class=" text-left control-label col-form-label"><b>Registration Number</b></label>
                                         <input type="text" class="form-control" id="reg_no" name="reg_no" pattern="^[A-Z]{2}[ -][0-9]{1,2}[ -][A-Z0-9]{1,2}[ -][0-9]{4}$" title="Format of Registration Number should be (RJ-34-FV-5677)" placeholder="Registration Number" onchange="checkregistration(this.value)" style="text-transform:uppercase;" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="eng_no" class=" text-left control-label col-form-label"><b>Engine Number</b></label>
                                         <input type="text" class="form-control" id="engine_no" name="engine_no" placeholder="Engine Number"style="text-transform:uppercase;" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Chassis Number</b></label>
                                         <input type="text" class="form-control" id="chassis_no" name="chassis_no" placeholder="Chassis Number" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="manufacturing" class=" text-left control-label col-form-label"><b>Manufacturing Year</b></label>
                                         <input type="text" class="form-control" id="mfg_year" name="mfg_year" onkeypress='return event.charCode >= 48 && event.charCode <= 57' size="4" maxlength="4" minlength="4" onchange="ckeckdate(this.value)" placeholder="Manufacturing Year" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Seating Capacity</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="seating_cap" name="seating_cap" placeholder="Seating Capacity" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Body Type</b></label>
                                         <input type="text" class="form-control" id="body_type" name="body_type" placeholder="Body Type" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Fuel Type</b></label>
                                         <input type="text" class="form-control" id="fuel_type" name="fuel_type" placeholder="Fuel Type" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>HP/CC</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="body_type" name="hp" placeholder="Body Type" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Policy Term</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="policy_term" name="policy_term" placeholder="Policy Term" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Term Value</b></label>
                                         <select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="term_value"  required>
                                            <option value='' selected="selected" >Select Term Value</option>
											<option value="Month">Month</option>	
											<option value="Year">Year</option>	
										</select>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>No Claim Bonus</b></label>
                                         <select class="select2 form-control custom-select" style="width: 100%; height:36px;" name="NCB" onchange="ncb(this.value)" required>
                                            <option value="" selected>No Claim Bonus</option>	
                                            <option value="Yes">Yes</option>	
											<option value="No">No</option>	
										</select>
									</div>
                                </div>
								<div class="col-md-4" id="ncb">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>NCB Value</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="NCB_value" name="NCB_value" placeholder="NCB Value" >
									</div>
                                </div>
                                </div>
								 <h4 class="card-title">Section A(Own Damage)</h4>
                                   <div class="form-group row">
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Basic OD</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="policy_term" name="od" placeholder="Basic OD" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>OD Discount</b></label>
                                         <input type="text" class="form-control" id="discount" onkeypress="validate(this.value)" onkeyup="validate(this.value)" name="discount" placeholder="OD Discount" required>
									</div>
                                </div>
                                </div>
								 <h4 class="card-title">Section B(Liability)</h4>
                                   <div class="form-group row">
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="number" class=" text-left control-label col-form-label"><b>Basic Cover Third Party</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="cover" name="cover" placeholder="Basic Cover Third Party" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>PA To Owner Driver</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="pa" name="pa" placeholder="PA To Owner Driver" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Legal Liability To Paid Driver</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="liabilities" name="liabilities" placeholder="Legal Liability To Paid Driver" required>
									</div>
                                </div>
                                </div>
								<h4 class="card-title">Section C(Add On Covers)</h4>
                                   <div class="form-group row">
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Passenger Assist</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="passenger_assist" name="passenger_assist" placeholder="Passenger Assist" required>
									</div>
                                </div>
								<div class="col-md-4">	
									<div class="form-group ">
                                        <label for="chassis" class=" text-left control-label col-form-label"><b>Depreciation Cover</b></label>
                                         <input type="text" class="form-control" onkeypress='return event.charCode >= 48 && event.charCode <= 57' id="depreciation" name="depreciation" placeholder="Depreciation Cover" required>
									</div>
                                </div>
                                </div>
								 </div> 
								<div class="form-group row">
                                 <div class="col-md-4">   
                                <div class="border-top">
                                    <div class="card-body">
                                       <div class="card-body">
                                    <button type="submit" name="sub" class="btn btn-success">Save</button>
                                    <button type="button" onclick="myFunction()" name="subcancel" class="btn btn-primary">Reset</button>
                                    
                                </div>
                                    </div>
                                </div>
                                </div>
                                </div>
                            </form>
			
							
							
                        </div>
                    
          

                    </div>
              
                </div>
                <!-- editor -->
               
                <!-- ============================================================== -->
                <!-- End PAge Content -->
                <!-- ============================================================== -->
                <!-- ============================================================== -->
                <!-- Right sidebar -->
                <!-- ============================================================== -->
                <!-- .right-sidebar -->
                <!-- ============================================================== -->
                <!-- End Right sidebar -->
                <!-- ============================================================== -->
            </div>
            </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Container fluid  -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- footer -->
            <!-- ============================================================== -->
             <footer class="footer text-center">
                  2019 &copy; All Rights Reserved by BTCOVER. Designed and Developed by <a href="http://www.belltechnology.in/">Bell Technology</a>.
            </footer>
          
            <!-- ============================================================== -->
            <!-- End footer -->
            <!-- ============================================================== -->
        </div>
        <!-- ============================================================== -->
        <!-- End Page wrapper  -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- End Wrapper -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- All Jquery -->
    <!-- ============================================================== -->
    <script src="assets/libs/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="assets/libs/popper.js/dist/umd/popper.min.js"></script>
    <script src="assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- slimscrollbar scrollbar JavaScript -->
    <script src="assets/libs/perfect-scrollbar/dist/perfect-scrollbar.jquery.min.js"></script>
    <script src="assets/extra-libs/sparkline/sparkline.js"></script>
    <!--Wave Effects -->
    <script src="dist/js/waves.js"></script>
    <!--Menu sidebar -->
    <script src="dist/js/sidebarmenu.js"></script>
    <!--Custom JavaScript -->
    <script src="dist/js/custom.min.js"></script>
    <!-- This Page JS -->
    <script src="assets/libs/inputmask/dist/min/jquery.inputmask.bundle.min.js"></script>
    <script src="dist/js/pages/mask/mask.init.js"></script>
    <script src="assets/libs/select2/dist/js/select2.full.min.js"></script>
    <script src="assets/libs/select2/dist/js/select2.min.js"></script>
    <script src="assets/libs/jquery-asColor/dist/jquery-asColor.min.js"></script>
    <script src="assets/libs/jquery-asGradient/dist/jquery-asGradient.js"></script>
    <script src="assets/libs/jquery-asColorPicker/dist/jquery-asColorPicker.min.js"></script>
    <script src="assets/libs/jquery-minicolors/jquery.minicolors.min.js"></script>
    <script src="assets/libs/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
    <script src="assets/libs/quill/dist/quill.min.js"></script>
    <script>
        //***********************************//
        // For select 2
        //***********************************//
        $(".select2").select2();

        /*colorpicker*/
        $('.demo').each(function() {
        //
        // Dear reader, it's actually very easy to initialize MiniColors. For example:
        //
        //  $(selector).minicolors();
        //
        // The way I've done it below is just for the demo, so don't get confused
        // by it. Also, data- attributes aren't supported at this time...they're
        // only used for this demo.
        //
        $(this).minicolors({
                control: $(this).attr('data-control') || 'hue',
                position: $(this).attr('data-position') || 'bottom left',

                change: function(value, opacity) {
                    if (!value) return;
                    if (opacity) value += ', ' + opacity;
                    if (typeof console === 'object') {
                        console.log(value);
                    }
                },
                theme: 'bootstrap'
            });

        });
        /*datwpicker*/
        jQuery('.mydatepicker').datepicker();
        jQuery('#datepicker-autoclose').datepicker({
            autoclose: true,
            todayHighlight: true
        });
        var quill = new Quill('#editor', {
            theme: 'snow'
        });

    </script>
</body>

</html>