<?php  $this->load->view('master/common/header.php',$data);
$base_name = $data['base_name'];
?>

    <div class="content">
        
        <!-- Start Content-->
        <div class="container-fluid">
            
            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box">
                        <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item"><a href="javascript: void(0);"><?= $base_name;?></a></li>
                                <li class="breadcrumb-item active text-capitalize"><?= $page;?></li>
                            </ol>
                        </div>
                        <h4 class="page-title text-uppercase"><?= $page;?></h4>
                    </div>
                </div>
            </div>     
            <!-- end page title --> 

            <div class="row">
                <div class="col-md-12 col-xl-12">
                    <div class="card-box">
                        <div class="row">
                            <div class="col-sm-12 table-responsive">
							    <table id="key-table" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
                                    <thead>
                                        <tr>
                                            <th>S.no.</th>
            								<th>Full Name</th>
            								<th>Email</th>
            								<th>Phone</th>
            								<th>Status</th>
            								<th>Manage</th>
            							    <th>Action</th>
                                        </tr>
                                    </thead>


                                        <tbody>
                                        
								<?php if (!empty($user)) {
								    $i=0;
								    foreach ($user as $row) {
									    $i++;

									?>
								        <tr>
                                            <td><?= $i;?></td>
        								
                                                <td><?= $row['full_name'];?></td>
                                                <td><?= $row['email'];?></td>
                                                <td><?= $row['phone'];?></td>
                                                <td><?= $row['status'];?></td>
                                              
                                                
                                          	<td>
        									    <a href="<?php echo base_url().'master/Staff/stock/'.$row['id'];?>" class="btn btn-success btn-sm" title="Edit">
        									        <i class="fa fa-plus" aria-hidden="true"></i> Add Invoice</a>
        									    </a> <a href="<?php echo base_url().'master/Staff/invoice/'.$row['id'];?>" class="btn btn-warning btn-sm" title="Edit">
        									        <i class="fa fa-list" aria-hidden="true"></i> Stock
        									    </a>
        									    
        									    </a> <a href="<?php echo base_url().'master/Staff/invoice_list/'.$row['id'];?>" class="btn btn-info btn-sm" title="Edit">
        									        <i class="fa fa-list" aria-hidden="true"></i> Invoice List
        									    </a>
									           
        									</td> 
                                                
                                          	<td>
        									    <a href="<?php echo base_url().'master/Staff/edit/'.$row['id'];?>" class="btn btn-primary btn-sm" title="Edit">
        									        <i class="far fa-edit"></i> Edit
        									    </a>
									            <form class="form-horizontal" onsubmit="return deleteProduct();" action="<?= base_url('master/Staff/delete');?>" method="post" enctype="multipart/form-data">
                                                    <input type="hidden" name="pid" value="<?=$row['id'];?>" />
                                                    <button type="submit" class="btn btn-danger btn-sm" title="Delete">Delete</button>
        										</form>
        									</td>
        								</tr>
								<?php }?>
								<?php } else {?>
								<tr>
									<td colspan="5" class="text-center">Records Not Found</td>
								</tr>
								<?php }?>
							</tbody>
							</table>
							</div>
					    </div>
					</div>
				</div>
				<!-- /.col-md-6 -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.container-fluid -->
	</div>
	<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('master/common/footer.php'); ?>

<script type="text/javascript">
	function deleteProduct() {
		if (confirm("Are You Sure You Want TO Delete Staff ?")) {
            return true;
		}
		return false;
	}
</script>