<?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='.'"'.Config::BASE_URL.'/index.php/backend/settings'.'"'.'>'.'<image src='.'"'.Config::BASE_URL.'/leftarrow.png'.'"'. 'width='.'"'.'100'.'"'. 'height='.'"'.'50'.'"'.'>'.'</a>'.'<br>';

    ?>
    <div class="text-center">
        <h1>Amjay Software Send Reminders Report</h1>
        <p class="lead">
            List All Sent Reminders
        </p>
    </div>
    <form method="post">
        <div class="row">
            <div class="col-md-8 offset-md-2">
                <div class="form-group">
                <?php
                DateRangePicker::create(array(
                    "name"=>"dateRange"
                ))
                ?>
                </div>
        
        <div class="col-md-6">
                        
                        
                            <br><br><strong>Select Service</strong>
                        <?php
                        Select2::create(array(
                            "name"=>"customers",
                            "dataStore"=>  $this->dataStore("customers"),
                        
                            "dataBind"=>"name", 
                            "attributes"=>array(
                                "class"=>"form-control",
                            )
                        ));
                        ?>  
                    </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
 
 

        Table::create(array(
            "dataStore"=>$this->dataStore("myappts"),
            "removeDuplicate"=>array("name", "concatday", "end_datetime"),

            "cssClass"=>array(
                "table"=>"table table-bordered"
            ),
             "columns"=>array(
                    "name"=>array(
                    "label"=>"Service Name",
                ),
                "concatday"=>array(
                    "label"=>"Start-date",
                ),
                 "time"=>array(
                    "label"=>"Start-time",
                ),
                "endtime"=>array(
                    "label"=>"End-time",
                ),
                "first_name"=>array(
                    "label"=>"First Name",
                ),
                "last_name"=>array(
                    "label"=>"Last Name",
                ),
                "email"=>array(
                    "label"=>"Email",
                ),
                "date_sent"=>array(
                    "label"=>"Date Sent ",
                ),
                 "email_header"=>array(
                    "label"=>"Email Header Sent ",
                ),
                "email_description"=>array(
                    "label"=>"Email Desc Sent ",
                ),
                "status"=>array(
                    "label"=>"Status ",
                ),

                 
)
            
           ));
   ?>
</div>
