<?php
$page_add = get_roll_action_permission('user_permission', 'add', $userroll); 
$page_edit = get_roll_action_permission('user_permission', 'edit', $userroll);
$page_delete = get_roll_action_permission('user_permission', 'delete', $userroll);
?>
<script language="javascript" type="text/javascript" src="userroll/userrole.js"></script> 
    <div class="content-wrapper">
<div class="page-title">
	<div>
    <h1>User Permission List</h1>
    <p></p>
    </div>
    <div>
    <ul class="breadcrumb side">
    <li>List</li>
    <?php if($page_add=='1') { ?> <li class="active"><a href="index1.php?fopen=userroll/form">Create</a><?php } ?></li>
    </ul>
    </div>
</div>

    <!-- Main content -->
    <div class="row">
    <div class="col-md-12">
    <div class="card">
    <div class="card-body">             
				  <table id="bootstrap-data-table" class="table table-bordered table-hover  display nowrap margin-top-10 w-p100">
					<thead>
						<tr>
							<th width="5%">S.No</th>
							<th width="85%">User Type</th>
                            <th width="10%">Action</th>
						</tr>
					</thead>
					<tbody>
                        <?php 
						       $i=0;
						       $sql = $pdo_conn->prepare("SELECT * FROM userroll where delete_status!='1' order by userroll_id DESC");
		                       $sql->execute();
							   $rows=$sql->fetchAll();
		                       foreach($rows as $record){
						      ?>
							 <tr>
                              <td align="center"><?php echo $i=$i+1; ?></td>
                              <td><?php echo $record['roll_name'];?></td>
                              <td align="center"> 
<!--						        <a href="index.php?file=userroll/view&userroll_id=<?php //echo $value['userroll_id']?>" title="Edit"><i class="fa fa-eye" aria-hidden="true"></i></a>  
-->						       <?php if($page_edit=='1') { ?> <a class="mr-10" href="index1.php?fopen=userroll/update&userroll_id=<?php echo $record['userroll_id']?>" title="Edit"><img src="images/edit.png" height="20" width="20" title="Edit"></a> <?php } ?>	
                                <?php if($page_delete=='1') { ?><a href="#" onclick="del(<?php echo $record['userroll_id']?>)" title="Delete"><img src="images/trash.png" height="25" width="25" title="Delete"></a><?php } ?>
						      </td>
                            </tr>
								
					   <?php } ?>

					   </tbody>				  
					
				</table>
				</div>              
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->

        </div>
        <!-- /.col -->
      </div>
      <!-- /.row  </section>
	<!-- /.content -->
