<?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 id="key-table" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
                                    <thead>
                                        <tr>
                                            <th width="30%">#ID</th>
        									<th>Title</th>
        									<!--<th>Content</th>-->
        									<th>Status</th>
        									<th>Action</th>
                                        </tr>
                                    </thead>


                                        <tbody>
                                        
								<?php if (!empty($faq)) {?>
									<?php foreach ($faq as $row) {?>
								        <tr>
                                            <td> <?php echo $row['faq_id'];?></td>
        									<td><?php echo $row['faq_title'];?></td>
        									<!--<td><?php echo $row['faq_content'];?></td>-->
        									<td>
        										<?php if ($row['status'] == 1) {?>
        											<span class="badge badge-success">Active</span>
        										<?php } else {?>
        											<span class="badge badge-danger">Block</span>
        										<?php }?>
        									</td>
        									<td>
        									    <div class="row">
        									        <div class="col-sm-6 text-right"><a href="<?php echo base_url().'master/faq/edit/'.$row['faq_id'];?>" class="btn btn-primary btn-sm" title="Edit"><i class="far fa-edit"></i> Edit</a></div>
        									        <div class="col-sm-6 text-left">
        									            <form class="form-horizontal" onsubmit="return deletefaq();" action="<?= base_url('master/action/delete');?>" method="post" enctype="multipart/form-data">
                                                            <input type="hidden" name="table" value="tbl_faq" />
                                                            <input type="hidden" name="page" value="faq" />
                                                            <input type="hidden" name="id" value="<?=$row['faq_id'];?>" />
                                                            <input type="hidden" name="column" value="faq_id" />
                                                            
                                                            <button type="submit" class="btn btn-danger btn-sm" title="Delete">Delete</button>
                										</form>
        									        </div>
        									    </div>
        									</td>
        								</tr>
								<?php }?>
								<?php } else {?>
								<tr>
									<td colspan="4" 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 deletefaq() {
		if (confirm("Are You Sure You Want TO Delete This Faq ?")) {
            return true;
		}
		return false;
	}
</script>