<div class="breadcrumb">
    <h1>Customers</h1>
    <ul>
        <li><a href="<?php echo SITE_URL.ADMIN_DIR ?>">Dashboard</a></li>
        <li>Import Customers</li>
    </ul>
</div>
<div class="separator-breadcrumb border-top"></div>
<?php echo (isset($successMsg) && $successMsg!='') ? "<div class='alert alert-success'><button data-dismiss='alert' class='close' type='button'>×</button>".base64_decode($successMsg)."</div>" : '' ; ?>
<?php echo (isset($failedMsg) && $failedMsg!='') ? "<div class='alert alert-danger'><button data-dismiss='alert' class='close' type='button'>×</button>".base64_decode($failedMsg)."</div>" : '' ?>
<div class="row">
    <div class="col-md-12">
        <div class="card mb-4">
            <div class="card-body">
                <form action="" method="post" enctype="multipart/form-data">
                    <div class="row">
                        <div class="col-md-6  mt-3 mt-md-0" id="div_clinic_id">
                            <label for="customer_clinic_id">Clinic</label>
                            <select class="form-control" id="customer_clinic_id" name="customer_clinic_id">
                            <option value="">Select Clinic</option>
                            <?php
                                  $clinicobj = new clinic;
                                  $fields = array('clinic_id,clinic_name');
                                  $clinicArg = array("fields"=>$fields);
                                  $clinicdata = $clinicobj->getAllRecords($clinicArg);
                                  foreach ($clinicdata as $ckey => $clinic_value) 
                                    { 
                                      ?>
                                        <option value="<?php echo $clinic_value->clinic_id; ?>"><?php echo $clinic_value->clinic_name; ?></option>
                              <?php }
                            ?>

                            </select>
                        </div>
                        <div class="col-md-6  mt-3 mt-md-0" id="div_clinic_id">
                            <label for="customer_type">Type</label>
                            <select class="form-control" id="customer_type" name="customer_type">
                                <option value="marketing">Marketing</option>
                                <option value="recall">Recall</option>
                            </select>
                        </div>
                        <div class="col-md-6 form-group mb-3">
                            <label for="import_customer">Import File <span class="asterisk">*</span></label>
                            <input type="file" class="form-control" id="import_customer" name="import_customer">
                            <div class="invalid-tooltip" id="msg_import_customer"></div>
                        </div>
                        <div class="col-md-6 form-group mb-3">
                            <label for="import_customer">Sample File </label></br>
                            <a target="_blank"  href="<?php echo  SITE_URL ?>uploads/files/Sample_Import_Customer.csv"><button class="btn btn-primary">Download the sample file</button> </a>
                            </br>
                            Note : 1) Last column should never be blank in any of the record/field.<br/>2) Never include comma(,) in any of the columns field
                        </div>
                        <input type="hidden" name="customer_created_at" id="customer_created_at" value="<?php echo date("Y-m-d"); ?>">
                        <div class="col-md-12">
                            <button class="btn btn-primary" id="submit" name="submit" type="submit">Import</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<link href="./assets/styles/css/select2.min.css" rel="stylesheet" />
<script src="./assets/js/select2.min.js"></script>
<script type="application/javascript">
    $(document).ready(function() {
        $("#customer_clinic_id").select2({
            tags: true
        });

    });
</script>