<?php require_once('header.php'); ?>
<section class="content-header" style="background-color: white;">
    <div class="row">
		<div class="col-md-4" style="text-align: left;">
			<h4><i class="fa fa-users"></i>Customer Bulk Upload </h4>
		</div>
		<div class="col-md-8" style="text-align: right;"> 
	        <a href="Sample Excel Format/Pickup-Entry-Sample-Data.csv" target="_blank" class="btn btn-warning btn-sm"><i class="fa fa-plus"></i>Download Sample File Format </a>
	        <a href="customer.php" class="btn btn-success btn-sm"><i class="fa fa-arrow-left"></i> List All</a>
		</div>
	</div> 
	<div class="row">
		<div class="col-md-12">

			<?php if($error_message): ?>
			<div class="callout callout-danger">
				<p>
					<?php echo $error_message; ?>
				</p>
			</div>
			<?php endif; ?>

			<?php if($success_message): ?>
			<div class="callout callout-success">
				<p><?php echo $success_message; ?></p>
			</div>
			<?php endif; ?>

			<form class="form-horizontal" action="customer_bulk_upload_status.php" method="post" enctype="multipart/form-data">
				<div class="box box-info">
					<div class="box-body">
					    <div class="form-group">
							<label for="" class="col-sm-2 control-label">Select Client <span>*</span></label>
							<div class="col-sm-6">
							    <select name="client_id" class="form-control">
							          <?php if($clientType=='Admin'){ $where_cus="";?>  <option value='0'>--Select Client--</option> <?php }elseif($_SESSION['user']['role_type']==3) { $where_cus=" and id=".$clientId; }else{ $where_cus=" and id=".$_SESSION['user']['branch_id'];} ?>
							        
							        <?php 
							        	$statement = $pdo->prepare("SELECT * FROM tbl_user where (role='client' or role='Modicare' or role='Cargo') $where_cus order by full_name asc");
            							$statement->execute();
            							$result = $statement->fetchAll(PDO::FETCH_ASSOC);
            						 foreach($result as $rows)
            						 {?>
            						     <option value="<?php echo $rows['id']; ?>"><?php echo $rows['full_name']; ?></option>
            						<?php }
							        ?>
							        
							    </select>
							</div>
						</div>
						<div class="form-group">
							<label for="" class="col-sm-2 control-label">Bulk Upload Pickup Entry <span>*</span></label>
							<div class="col-sm-9" style="padding-top:5px">
								<input type="file" name="file" accept=".csv" required>(Only CSV Format)
							</div>
						</div>
						<div class="form-group">
							<label for="" class="col-sm-2 control-label"></label>
							<div class="col-sm-6">
								<button type="submit" class="btn btn-success pull-left" name="Import">Submit</button>
							</div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>

</section>


<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Delete Confirmation</h4>
            </div>
            <div class="modal-body">
                <p>Are you sure want to delete this item?</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                <a class="btn btn-danger btn-ok">Delete</a>
            </div>
        </div>
    </div>
</div>


<?php require_once('footer.php'); ?>