
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php

session_start();

if($_SESSION['AUTH'] == 'Y'){
 
    
}else{

    $newURL = 'https://honda.core3.agency/export-leads/login/?reason=2';

header('Location: '.$newURL);
    
}

?>

<?php

if(isset($_POST['from']) && isset($_POST['to'])){

$_SESSION['from'] = $_POST['from']; 
$_SESSION['to'] = $_POST['to'];
    
}
//print_r($_POST);
?>

<html lang="en">
<head>
  <title>Honda Saudi Core 3 Data Export</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.11.3/b-2.1.0/b-html5-2.1.0/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.11.3/b-2.1.0/b-html5-2.1.0/datatables.min.js"></script>

<link rel="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css"/>

<link rel="stylesheet" href="//code.jquery.com/ui/1.13.0/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"></script>
</head>

<script>
  $( function() {
    $( "#datepicker1" ).datepicker({
  dateFormat: "yy-mm-dd"
});
});

  $( function() {
    $( "#datepicker2" ).datepicker({
  dateFormat: "yy-mm-dd"
});
});


</script>    

<body>
    
    
    
<div class="container">
    
<div class="row">

<div class="col-6">

<img style="float:left;width:150px;" src="core3logo.jpg">    
    
</div>    
    
<div class="col-6">

<img style="float:right;width:150px;margin-top: 62px;" src="hondalogo.svg">     
    
</div>  

</div>

<div style="width:100%;text-align:center;">

<h2>Honda Saudi Marketing Opt Out List - Core 3</h2>
<?php
if(isset($_SESSION['from']) && isset($_SESSION['to'])){
?>
<p style="color:red;">From <?php echo $_SESSION['from'] ?> To <?php echo $_SESSION['to'];?></p>
<?php
}
?>
    
</div>  
    
<div style="height:32px;"></div>    

<form class="form-inline" method="post" style="margin-left: 22%;">
    <div class="form-group">
      <label style="padding-left: 20px;
    padding-right: 20px;" for="dtef">From</label>
      <input type="text" class="form-control datep" id="datepicker1" placeholder="YYYY-MM-DD"  name="from">
    </div>
    <div class="form-group" style="padding-right: 20px;">
      <label style="padding-left: 20px;
    padding-right: 20px;" for="dtet">To</label>
      <input type="text" class="form-control datep" id="datepicker2" placeholder="YYYY-MM-DD" name="to">
    </div>
    <button type="submit" class="btn btn-default" style="background: red;
    color: white;
    padding-left: 28px;
    padding-right: 28px;">Run</button>
  </form>
  
<div style="height:32px;"></div>   

<a class="btn btn-default" style="background: red;
    color: white;
    padding-left: 28px;
    padding-right: 28px;" href="https://honda.core3.agency/export-leads/portal/">Leads</a>

<div style="height:32px;"></div> 

<table id="example" class="table table-striped table-bordered" style="width:100%">
        <thead>
            <tr>
                <th>Name</th>
                <th>Mobile</th>
                <th>City</th>
                <th>Email Address</th>
                <th>Request Date</th>
                <th>Gender</th>
                <th>Car</th>
                <th>Source</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th>Name</th>
                <th>Mobile</th>
                <th>City</th>
                <th>Email Address</th>
                <th>Request Date</th>
                <th>Gender</th>
                <th>Car</th>
                <th>Source</th>
            </tr>
        </tfoot>
    </table>    
    
</div>    

<script>

$(document).ready(function() {
    $('#example').DataTable( {
        "processing": true,
        "serverSide": true,
        "order": [[ 4, "desc" ]],
        "pageLength": 50,
        "scrollY":'50vh',
        "scrollCollapse": true,
         "dom": 'Bfrtip',
        "buttons": [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ],
        "lengthMenu": [[50, 150, 250, -1], [50, 150, 250, "All"]],
        "buttons": ['excel', 'pageLength'],
        "ajax": "optoutdata-api.php"
    } );
} );
    
</script>