<?php 
    use \koolreport\inputs\DateRangePicker;
    use \koolreport\inputs\Select;
    use \koolreport\inputs\DateTimePicker;
    use \koolreport\inputs\Select2;
    use \koolreport\widgets\koolphp\Table;
use \koolreport\datagrid\DataTables;
use \koolreport\morris_chart;
use \koolreport\sparklines;
use \koolreport\widgets\google;

use \koolreport\core\Utility as Util;
    
?>

              
<div class="report-content">
    <?php
    echo '<a href='.'"'.'logout.php'.'"'.'>'.'<image src='.'"'.Config::BASE_URL.'/leftarrow.png'.'"'. 'width='.'"'.'100'.'"'. 'height='.'"'.'50'.'"'.'>'.'</a>'.'<br>';

    ?>
    <div class="text-center">
        <h1>Amjay Software Waitlist Report</h1>
        <p class="lead">
            Previous Waitlist - people who were on the waitlist but have been removed as they have been sent an email
        </p>
    </div>
    <form method="post">
        <div class="row">
        
        
        <div class="col-md-6">
                        
                        
                          <br><br><strong>Select</strong>
                        <?php
                        Select2::create(array(
                            "name"=>"customers",
                            "dataStore"=>  $this->dataStore("customers"),
                        
                                "dataBind"=>array("text"=>"nameofdropdown","value"=>"servicename"),

                            "attributes"=>array(
                                "class"=>"form-control",
                            )
                        ));
                        ?>  
                    
                        
<br><br><br>

                    </div>
                <div class="form-group text-center">
                    <button class="btn btn-success"><i class="glyphicon glyphicon-refresh"></i> Load</button>     
                    <?php
                             if($this->dataStore("myappts")->countData()>0){

                    ?>
                    <button type="submit" class="btn btn-primary" formaction="exportex.php?type=XLSX">Download XLSX</button>
			<button type="submit" class="btn btn-primary" formaction="exportex.php?type=ODS">Download ODS</button>
			<button type="submit" class="btn btn-primary" formaction="exportex.php?type=CSV">Download CSV</button>
			<button type="submit" class="btn btn-primary" formaction="exportpdf.php?type=cloudPDF">
				PDF</button>
		
			<?php
                             }
			?>
                </div>
            </div>
        </div>
    </form>
       
  
 
			


 <?php
 
 

        DataTables::create(array(
            "dataStore"=>$this->dataStore("myappts"),
            "removeDuplicate"=>array("name", "concatday", "end_datetime"),
 "options"=>array(
     
        "searching"=>true, 
         "order" => [],
    ),
    
    "searchOnEnter" => true,
    "searchMode" => "or", 
            "cssClass"=>array(
                "table"=>"table table-bordered",
            ),
             "columns"=>array(
                    "firstname"=>array(
                    "label"=>"First Name",
                ),
                "lastname"=>array(
                    "label"=>"Last Name",
                ),
                 "phonenumber"=>array(
                    "label"=>"Phone Number",
                ),
                "email"=>array(
                    "label"=>"Email",
                ),
                "notes"=>array(
                    "label"=>"Notes",
                ),
                "status"=>array(
                    "label"=>"Status",
                ),
                "date_sent"=>array(
                    "label"=>"Date Sent",
                ),
                "date_expires"=>array(
                    "label"=>"Date Expires",
                ),
                

                 
)
            
           ));
   ?>
</div>
