<?php


  if(stripos($_SERVER['SCRIPT_NAME'],"/admin/")===false?false:true){
		
?>
	
<?php
  }elseif(!$isCustomer){
?>

<!-- myCustomers Last Login MODAL -->
			<style>
				#lastLoginTable thead tr{
						display:block;
				}
				
				.mcll-an{
					width:150px;//fixed width
				}
				.mcll-name{
					width:350px;//fixed width
				}
				.mcll-daysll{
					width:200px;//fixed width
				}
				.mcll-dayslo{
					width:200px;//fixed width
				}
				
				#lastLoginTable  tbody{
					display:block;
					
					overflow:auto;//set tbody to auto
				}
				#lastLoginTable{
					
				}
			</style>
    	<div class="modal fade" id="myCustomersModal" tabindex="-1" role="dialog" aria-labelledby="myCustomersModal" aria-hidden="true">
          <div class="modal-dialog modal-lg">
            <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="myCustomersModalTitle">My Customers - Last Login</h4>
              </div>
              <div class="modal-body">
								<div class="container-fluid">
									<div class="row">
										<table class="table table-condensed" id="lastLoginTable">
											<thead>
												<tr>
													<th class="mcll-an">Account Number</th>
													<th class="mcll-name">Name</th>
													<th class="mcll-dayslo">Days Since Last Order</th>
													<th class="mcll-daysll">Days Since Last Login</th>
													
													
													
												</tr>
											</thead>
											<tbody id="myCustomersModalTableBody">
												
												
											</tbody>
											
										</table>
									</div>
								</div>
							</div>
              <div class="modal-footer">
								<a id="myCustomersModalClose" data-dismiss="modal" class="btn btn-danger">Close</a>
							</div>
            </div>
          </div>
        </div>
        <script type="text/javascript">
				var myCustomers
        function openMyCustomers(){
					$('#myCustomersModal').modal('show');
					$.get('mod.php?p=mycustomers&a=functions&f=getMyCustomers&sid=' + "<?= $_SESSION['SalesmanID']  ?>", function(data){
							data = JSON.parse(data);
							myCustomers = data;
							$('#myCustomersModalTableBody').html('');
							for(var i=0; i< data.length; i++){
								
								$('#myCustomersModalTableBody').append('<tr  id="myCustomerRow-' + i + '"><td class="mcll-an">' + data[i].AccountNumber +'</td><td class="mcll-name">' + data[i].Name + ' - ' + data[i].City + '</td><td class="mcll-dayslo">' + data[i].LastOrderDays +'</td><td class="mcll-daysll">' + data[i].LastLoginDays +'</td></tr>');	
							}
							
							
							
					});
				}
        
            
        </script>
        <!-- END SALESMAN customer MODAL -->
				

<?php
		
  }

?>