<?php 
 include('nf_config.php');
 // include('menu_side.php');
 include('nf_order.php');   
 ?>

<?php 						

include('r_dbc.php');
 		$sql = "select desc_manager,expenses
		from ccmanager_id
		where pid = '".$pid."'
		and mid = '".$mid."'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
      while($row = mysqli_fetch_assoc($result)) {
		$desc_manager 	= $row["desc_manager"];
		$expenses 		= $row["expenses"];		
		}
	}
mysqli_close($conn);		
		
?>


<?php 						
// CHECK IF CENTERS WITH UMC EXIST IN ORDER TO SHOW THEM ON TABLE RESULTS
include('r_dbc.php');
 		$sql = "select count(umc) as umc_cnt
		from centers
		where pid = '".$pid."'
		and umc != '--'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
      while($row = mysqli_fetch_assoc($result)) {
		$umc_cnt 		= $row["umc_cnt"];
		}
	}
mysqli_close($conn);		
		
?>

<!doctype html>
<html lang="en-US" class="no-js">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<title><?php include('title.php'); echo " - ".$desc_manager." ".$nrecords ?></title>
	
    <link rel="stylesheet" href="./bootstrap/css/bootstrap.css" >
    <link rel="stylesheet" href="./fontawesome/css/all.css" >

 <link rel="stylesheet" href="./jqueryui/themes/smoothness/jquery-ui.css">
 <script src="./jqueryui/jquery-1.10.2.js"></script>
<script src="./jqueryui/jquery-ui.js"></script>

<script>
  $(function() {
	$( "#rab_date" ).datepicker({dateFormat: "dd-mm-yy"})
  });
</script>
<?php include('menu_side_css.php'); ?>
<?php include('nf_chosen01.php'); ?>
</head>

<body>

	<?php include('menu_side_body.php'); ?>
	
	<?php
	$condition	=	'';
	if(isset($_REQUEST['code_center']) and $_REQUEST['code_center']!=""){
		$condition	.=	' AND code_center LIKE "%'.$_REQUEST['code_center'].'%" ';
	}	
	if(isset($_REQUEST['code_categ']) and $_REQUEST['code_categ']!=""){
		$condition	.=	' AND code_categ LIKE "%'.$_REQUEST['code_categ'].'%" ';
	}		
	if(isset($_REQUEST['invoice']) and $_REQUEST['invoice']!=""){
		$condition	.=	' AND invoice LIKE "%'.$_REQUEST['invoice'].'%" ';
	}			
	if(isset($_REQUEST['rab_date']) and $_REQUEST['rab_date']!=""){
		$condition	.=	' AND date_format(rab_date,"%d-%m-%Y") LIKE "%'.$_REQUEST['rab_date'].'%" ';
	}				
	if(isset($_REQUEST['rab_qty']) and $_REQUEST['rab_qty']!=""){
		$condition	.=	' AND rab_qty LIKE "%'.$_REQUEST['rab_qty'].'%" ';
	}				
	if(isset($_REQUEST['rab_uc']) and $_REQUEST['rab_uc']!=""){
		$condition	.=	' AND rab_uc LIKE "%'.$_REQUEST['rab_uc'].'%" ';
	}					
	if(isset($_REQUEST['rab_number']) and $_REQUEST['rab_number']!=""){
		$condition	.=	' AND rab_number LIKE "%'.$_REQUEST['rab_number'].'%" ';
	}					
	if(isset($_REQUEST['comms_html']) and $_REQUEST['comms_html']!=""){
		$condition	.=	' AND comms_html LIKE "%'.$_REQUEST['comms_html'].'%" ';
	}							
	$condition = $condition." AND mid = '".$mid."' AND pid = '".$pid."' ".$user_cc." ".$user_ct;
	
	//Main queries
    $pages->default_ipp  =   floatval($f_pagesize); //total records show on per page
    $sql    = $db->getRecFrmQry("SELECT * FROM ccmanager WHERE 1 ".$condition."");
    $pages->items_total  =   count($sql);
    $pages->mid_range    =   9;
    $pages->paginate(); 
      
    $userData   =   $db->getRecFrmQry("SELECT * FROM ccmanager WHERE 1 ".$condition." ORDER BY ".$ordr_qry." ".$pages->limit."");	
	
	
		
	?>
   	<div class="container-fluid">
		<h1><?php echo $desc_manager ?></h1>
		<div class="card">
			<div class="card-header"><i class="fa fa-fw fa-globe"></i> <strong><?php echo $desc_manager." ".$nrecords ?></strong> 
			<?php if ($gcrud == "CRUD" || $gcrud == "CRU") { ?>	
				<a href="nf_manager_add_cc1.php?pid=<?php echo $pid ?>&mid=<?php echo $mid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>" class="float-end btn btn-dark btn-sm"><i class="fa fa-fw fa-plus-circle"></i><?php echo $nadd;  ?></a>
				<?php } ?>				
			</div>
			<div class="card-body">
				<?php
				if(isset($_REQUEST['msg']) and $_REQUEST['msg']=="rds"){
					echo	'<div class="alert alert-success"><i class="fa fa-thumbs-up"></i>'.$recdel.'</div>';
				}elseif(isset($_REQUEST['msg']) and $_REQUEST['msg']=="rus"){
					echo	'<div class="alert alert-success"><i class="fa fa-thumbs-up"></i>'.$recupd.'</div>';
				}elseif(isset($_REQUEST['msg']) and $_REQUEST['msg']=="rnu"){
					echo	'<div class="alert alert-warning"><i class="fa fa-exclamation-triangle"></i>'.$recnochange.'</div>';
				}elseif(isset($_REQUEST['msg']) and $_REQUEST['msg']=="rna"){
					echo	'<div class="alert alert-danger"><i class="fa fa-exclamation-triangle"></i>'.$recwrong.' <strong>'.$rectry.'</strong></div>';
				}
				?>
				<!--
				<div class="col-sm-12">
					<h5 class="card-title"><i class="fa fa-fw fa-search"></i><?php echo $nfind ?></h5>
					<form method="get"  >
						<div class="row">
							<div class="col-sm-2">
								<div class="mb-3">
									<label><?php echo $n_center ?></label>

									<?php
									echo "<select name='code_center' id='code_center' class='form-control' > ";
									printf ("<option value = >Enter Center</option>");
									include('r_dbc.php');
											$sql = "select code_center,desc_center
											from centers c
											where pid = '".$pid."' ".$user_cc."
											and isgroup <> 'GRP1'
											order by 1";
									$result = mysqli_query($conn, $sql);
									if (mysqli_num_rows($result) > 0) {
										  while($row = mysqli_fetch_assoc($result)) {
											printf ("<option value = %s > %s %s </option>", $row["code_center"],$row["code_center"],$row["desc_center"]);
											}
										}
									mysqli_close($conn);
									echo "</select>";
									?>

								</div>
							</div>
							
							
							<div class="col-sm-2">
								<div class="mb-3">
									<label><?php echo $n_categ ?></label>

									<?php
									echo "<select name='code_categ' id='code_categ' class='form-control' > ";
									printf ("<option value = >Enter Categ</option>");
									include('r_dbc.php');
											$sql = "select code_categ,desc_categ
											from categs c
											where pid = '".$pid."' ".$user_ct."
											and isgroup <> 'GRP1'
											order by 1";
									$result = mysqli_query($conn, $sql);
									if (mysqli_num_rows($result) > 0) {
										  while($row = mysqli_fetch_assoc($result)) {
											printf ("<option value = %s > %s %s </option>", $row["code_categ"],$row["code_categ"],$row["desc_categ"]);
											}
										}
									mysqli_close($conn);
									echo "</select>";
									?>

								</div>
							</div>							

							<div class="col-sm-2">
								<div class="mb-3">
									<label><?php echo $n_rab_date ?></label>
									<input type="text" id="rab_date" name="rab_date" id="rab_date" class="form-control" value="<?php echo isset($_REQUEST['rab_date'])?$_REQUEST['rab_date']:''?>" placeholder="<?php echo $nenter." ".$n_rab_date; ?>">
								</div>
							</div>
							
							<div class="col-sm-2">
								<div class="mb-3">
									<label><?php echo $n_rab_qty ?></label>
									<input type="text" name="rab_qty" id="rab_qty" class="form-control" value="<?php echo isset($_REQUEST['rab_qty'])?$_REQUEST['rab_qty']:''?>" placeholder="<?php echo $nenter." ".$n_rab_qty; ?>">
								</div>
							</div>							


							<div class="col-sm-2">
								<div class="mb-3">
									<label><?php echo $n_rab_uc ?></label>
									<input type="text" name="rab_uc" id="rab_uc" class="form-control" value="<?php echo isset($_REQUEST['rab_uc'])?$_REQUEST['rab_uc']:''?>" placeholder="<?php echo $nenter." ".$n_rab_uc; ?>">
								</div>
							</div>							

							<div class="col-sm-2">
								<div class="mb-3">
									<label><?php echo $n_rab_number ?></label>
									<input type="text" name="rab_number" id="rab_number" class="form-control" value="<?php echo isset($_REQUEST['rab_number'])?$_REQUEST['rab_number']:''?>" placeholder="<?php echo $nenter." ".$n_rab_number; ?>">
								</div>
							</div>		

							<?php if ($expenses == 1) { ?>
							<div class="col-sm-1">
								<div class="mb-3">
									<label><?php echo $n_invoice ?></label>
									<input type="text" name="invoice" id="invoice" class="form-control" value="<?php echo isset($_REQUEST['invoice'])?$_REQUEST['invoice']:''?>" placeholder="<?php echo $nenter." ".$n_invoice; ?>">
								</div>
							</div>
							<?php } ?>

							<div class="col-sm-1">
								<div class="mb-3">
									<label><?php echo $n_comms ?></label>
									<input type="text" name="comms_html" id="comms_html" class="form-control" value="<?php echo isset($_REQUEST['comms_html'])?$_REQUEST['comms_html']:''?>" placeholder="<?php echo $nenter." ".$n_comms; ?>">
								</div>
							</div>							

							<input type="hidden" id="mid"  name="mid"  value="<?php echo $mid ?>"  >
							<input type="hidden" id="pid"  name="pid"  value="<?php echo $pid ?>"  >
							<input type="hidden" id="xuid" name="xuid" value="<?php echo $xuid ?>" >
							<input type="hidden" id="lang" name="lang" value="<?php echo $lang ?>" >

							<div class="col-sm-2">
								<div class="mb-3">
									<label>&nbsp;</label>
									<div>
										<button type="submit" name="submit" value="search" id="submit" class="btn btn-primary"><i class="fa fa-fw fa-search"></i><?php echo $nsearch ?></button>
										<a href="<?php echo $_SERVER['PHP_SELF']; ?>?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>" class="btn btn-danger"><i class="fa fa-fw fa-sync"></i> <?php echo $nclear ?></a>
									</div>
								</div>
							</div>
						</div>
					</form>
				</div> -->
				

				
			</div>
		</div>
		<hr>



		<div class="clearfix"></div>
     
		<div class="row marginTop">
			<div class="col-sm-12 paddingLeft pagerfwt">
				<?php if($pages->items_total > 0) { ?>
					<?php echo $pages->display_pages();?>
					<?php echo $pages->display_items_per_page();?>
					<?php echo $pages->display_jump_menu(); ?>
				<?php }?>
			</div>
			<div class="clearfix"></div>
		</div>
	 
		<div class="clearfix"></div>




		
		<div>
			<table class="table table-striped table-bordered">
				<thead>
					<tr class="bg-primary text-white">
						<th><?php echo $n_center ?>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=acode_center" />
						<i class="fas fa-sort-up" style="color:#ffffff;"></i>
						</a>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=dcode_center" />
						<i class="fas fa-sort-down" style="color:#ffffff;"></i>
						</a>						
						</th>
						<th><?php echo $n_categ ?>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=acode_categ" />
						<i class="fas fa-sort-up" style="color:#ffffff;"></i>
						</a>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=dcode_categ" />
						<i class="fas fa-sort-down" style="color:#ffffff;"></i>
						</a>						
						</th>				
						<th><?php echo $n_rab_date ?>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=arab_date" />
						<i class="fas fa-sort-up" style="color:#ffffff;"></i>
						</a>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=drab_date" />
						<i class="fas fa-sort-down" style="color:#ffffff;"></i>
						</a>						
						</th>	

						<?php if ($umqtyuc == 1) { ?>						
						<th><?php echo $n_rab_qty ?>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=arab_qty" />
						<i class="fas fa-sort-up" style="color:#ffffff;"></i>
						</a>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=drab_qty" />
						<i class="fas fa-sort-down" style="color:#ffffff;"></i>
						</a>						
						</th>	
						<?php } ?>
						
						<?php if ($expenses != 2 && $umqtyuc == 1) { ?>												
						<th class="text-center" ><?php echo $n_rab_uc ?></th>																		
						<?php } ?>
						
						<th><?php echo $n_rab_number ?>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=arab_number" />
						<i class="fas fa-sort-up" style="color:#ffffff;"></i>
						</a>
						<a href="nf_manager.php?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>&ordr=drab_number" />
						<i class="fas fa-sort-down" style="color:#ffffff;"></i>
						</a>						
						</th>	
							<?php if ($expenses == 1 && $umc_cnt > 0) { ?>						
						<th class="text-center" ><?php echo $numc ?></th>
							<?php }  ?>						
							<?php if ($expenses == 1 && $invoiceon == 1) { ?>						
						<th class="text-center" ><?php echo $n_invoice ?></th>
							<?php }  ?>
						<th class="text-center" ><?php echo $n_comms ?></th>						
						<th class="text-center" colspan=3 ><?php echo $naction ?></th>
					</tr>
				</thead>
				<tbody>
				
				<!-- START OF TABLE SEARCH -->
				<form method="get"  >
				<tr>
					<td>
					<?php
									echo "<select name='code_center' id='code_center' class='form-control chosen' > ";
									printf ("<option value = >Enter Center</option>");
									include('r_dbc.php');
											$sql = "select code_center,substr(desc_center,1,30) as desc_center
											from centers c
											where pid = '".$pid."' ".$user_cc."
											and isgroup != 'GRP1'
											order by 1";
									$result = mysqli_query($conn, $sql);
									if (mysqli_num_rows($result) > 0) {
										  while($row = mysqli_fetch_assoc($result)) {
											printf ("<option value = %s > %s %s </option>", $row["code_center"],$row["code_center"],$row["desc_center"]);
											}
										}
									mysqli_close($conn);
									echo "</select>";
									?>
					</td>
					<td>	
					<?php
									echo "<select name='code_categ' id='code_categ' class='form-control chosen' > ";
									printf ("<option value = >Enter Categ</option>");
									include('r_dbc.php');
											$sql = "select code_categ,substr(desc_categ,1,30) as desc_categ
											from categs c
											where pid = '".$pid."' ".$user_ct."
											and isgroup != 'GRP1'											
											order by 1";
									$result = mysqli_query($conn, $sql);
									if (mysqli_num_rows($result) > 0) {
										  while($row = mysqli_fetch_assoc($result)) {
											printf ("<option value = %s > %s %s </option>", $row["code_categ"],$row["code_categ"],$row["desc_categ"]);
											}
										}
									mysqli_close($conn);
									echo "</select>";
									?>
					</td>
					<td>
						<input type="text" id="rab_date" name="rab_date" id="rab_date" class="form-control" value="<?php echo isset($_REQUEST['rab_date'])?$_REQUEST['rab_date']:''?>" placeholder="<?php echo $nenter." ".$n_rab_date; ?>">
					</td>

					<?php if ($umqtyuc == 1) { ?>
					<td>
						<input type="text" name="rab_qty" id="rab_qty" class="form-control" value="<?php echo isset($_REQUEST['rab_qty'])?$_REQUEST['rab_qty']:''?>" placeholder="<?php echo $nenter." ".$n_rab_qty; ?>">
					</td>
					<?php } ?>	

					<?php if ($expenses != 2 && $umqtyuc == 1) { ?>	
					<td>
						<input type="text" name="rab_uc" id="rab_uc" class="form-control" value="<?php echo isset($_REQUEST['rab_uc'])?$_REQUEST['rab_uc']:''?>" placeholder="<?php echo $nenter." ".$n_rab_uc; ?>">
					</td>					
					<?php } ?>	
					<td>
						<input type="text" name="rab_number" id="rab_number" class="form-control" value="<?php echo isset($_REQUEST['rab_number'])?$_REQUEST['rab_number']:''?>" placeholder="<?php echo $nenter." ".$n_rab_number; ?>">
					</td>
							<?php if ($expenses == 1 && $umc_cnt > 0) { ?>	
					<td></td>
							<?php } ?>							
							<?php if ($expenses == 1 && $invoiceon == 1) { ?>	
					<td>
						<input type="text" name="invoice" id="invoice" class="form-control" value="<?php echo isset($_REQUEST['invoice'])?$_REQUEST['invoice']:''?>" placeholder="<?php echo $nenter." ".$n_invoice; ?>">
					</td>
							<?php } ?>
					<td>
						<input type="text" name="comms_html" id="comms_html" class="form-control" value="<?php echo isset($_REQUEST['comms_html'])?$_REQUEST['comms_html']:''?>" placeholder="<?php echo $nenter." ".$n_comms; ?>">	
					</td>
					<td colspan=2>
						<button type="submit" name="submit" value="search" id="submit" class="btn btn-primary"><i class="fa fa-fw fa-search"></i><?php echo $nsearch ?></button>
					</td>
					<td>
						<a href="<?php echo $_SERVER['PHP_SELF']; ?>?pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>&mid=<?php echo $mid ?>" class="btn btn-danger"><i class="fa fa-fw fa-sync"></i> <?php echo $nclear ?></a>
					</td>
				</tr>
				
							<input type="hidden" id="mid"  name="mid"  value="<?php echo $mid ?>"  >
							<input type="hidden" id="pid"  name="pid"  value="<?php echo $pid ?>"  >
							<input type="hidden" id="xuid" name="xuid" value="<?php echo $xuid ?>" >
							<input type="hidden" id="lang" name="lang" value="<?php echo $lang ?>" >
				
				</form>
				<!-- END OF TABLE SEARCH -->
				
				
				
					<?php 
					$s	=	'';
					foreach($userData as $val){
						$s++;
					?>
<?php 						

$code_center = $val['code_center'];

include('r_dbc.php');
 		$sql = "select desc_center,umc
		from centers
		where pid = '".$pid."'
		and code_center = '".$code_center."'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
      while($row = mysqli_fetch_assoc($result)) {
		$desc_center = $row["desc_center"];
		$umc_center = $row["umc"];
		}
	}
mysqli_close($conn);		
		
?>

<?php 						

$code_categ = $val['code_categ'];

include('r_dbc.php');
 		$sql = "select desc_categ
		from categs
		where pid = '".$pid."'
		and code_categ = '".$code_categ."'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
      while($row = mysqli_fetch_assoc($result)) {
		$desc_categ = $row["desc_categ"];
		}
	}
mysqli_close($conn);		
		
?>

<?php
// DATE TRANSFORMATION
$rab_datec = $val['rab_date'];
$rab_datec = substr($rab_datec,8,2)."-".substr($rab_datec,5,2)."-".substr($rab_datec,0,4);

$c_rab_qty		= number_format($val['rab_qty'], $totdcqty, $septh, $sepdc);											
$c_rab_uc		= number_format($val['rab_uc'], $totdc, $septh, $sepdc);											
$c_rab_umc		= number_format($val['rab_umc'], 0, $septh, $sepdc).$umc_center;											
$c_rab_number	= number_format($val['rab_number'], $totdc, $septh, $sepdc);											
$cid = $val['cid'];

?>


					<tr>
						<td><?php echo $val['code_center']." - ".$desc_center; ?></td>
						<td><?php echo $val['code_categ']." - ".$desc_categ; ?></td>
						<td class="text-center"><?php echo $rab_datec ?></td>	
						<?php if ($umqtyuc == 1) { ?>							
						<td class="text-end" ><?php echo $c_rab_qty ?></td>
						<?php } ?>
						<?php if ($expenses != 2 && $umqtyuc == 1) { ?>	
						<td class="text-end" ><?php echo $c_rab_uc ?></td>						
						<?php } ?>												
						<td class="text-end" ><?php echo $c_rab_number ?></td>
							<?php if ($expenses == 1 && $umc_cnt > 0) { ?>	
						<td class="text-right" ><?php echo $c_rab_umc ?></td>						
							<?php  } ?>
							<?php if ($expenses == 1 && $invoiceon == 1) { ?>	
						<td><?php echo $val['invoice'];?></td>						
							<?php  } ?>
						<td><?php echo substr($val['comms_html'],0,20).".."; ?></td>						

								<?php
								// TAGS TOOLTIP
								include('r_dbc.php');

								$tooltip_tags = "";
								$class_tooltip = "text-primary";
								
								$sql = "SELECT tag,id
										from ccmanager_tags
										where cid = '".$cid."'
										order by 1";

								$result = mysqli_query($conn, $sql);

								if (mysqli_num_rows($result) > 0) {
									// output data of each row
									  while($row = mysqli_fetch_assoc($result)) {
										$tag 	= $row["tag"];
										$tagid 	= $row["id"];
										$tooltip_tags = $tooltip_tags."\n".$tag;
										$class_tooltip = "text-primary";
									}
								} 
								else 
									{ 
										$tooltip_tags = $no_tags;
										$class_tooltip = "text-danger"; 
									}

								mysqli_close($conn);						
								?>
						<?php if ($gcrud == "CRUD" || $gcrud == "CRU") { ?>																								
						<td class="text-center" >
							<a href='nf_manager_tags.php?cid=<?php echo $cid ?>&lang=<?php echo $lang ?>' target=_blank data-toggle="tooltip" data-placement="top" title="<?php echo $tooltip_tags ?>" class="<?php echo $class_tooltip ?>" ><i class="fas fa-tags"></i><?php echo $ntags ?></a>
						</td>
						<?php } ?>

						<?php if ($gcrud == "CRUD" || $gcrud == "CRU") { ?>																														
						<td class="text-center" >
							<a href="nf_manager_edit.php?editId=<?php echo $val['cid']; ?>&pid=<?php echo $pid ?>&mid=<?php echo $mid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>" class="text-primary"><i class="fa fa-fw fa-edit"></i><?php echo $nedit ?></a>
						</td>
						<?php } ?>

						<?php if ($gcrud == "CRUD") { ?>																														
						<td class="text-center" >
							<a href="nf_manager_delete.php?delId=<?php echo $val['cid']; ?>&pid=<?php echo $pid ?>&mid=<?php echo $mid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>" class="text-danger" onClick="return confirm('<?php echo $areyousure ?>');"><i class="fa fa-fw fa-trash"></i> <?php echo $ndelete ?></a>
						</td>
						<?php } ?>						
						
						<?php if ($gcrud == "R") { ?>																														
						<td class="text-center" colspan=3 >
							<a href="nf_manager_view.php?editId=<?php echo $val['cid']; ?>&pid=<?php echo $pid ?>&mid=<?php echo $mid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>" class="text-primary"><i class="fa fa-fw fa-edit"></i><?php echo $nview ?></a>
						</td>
						<?php } ?>
				
						
					</tr>
					<?php } ?>
				</tbody>
			</table>
		</div> <!--/.col-sm-12
		-->
		
		<div class="clearfix"></div>
     
		<div class="row marginTop">
			<div class="col-sm-12 paddingLeft pagerfwt">
				<?php if($pages->items_total > 0) { ?>
					<?php echo $pages->display_pages();?>
					<?php echo $pages->display_items_per_page();?>
					<?php echo $pages->display_jump_menu(); ?>
				<?php }?>
			</div>
			<div class="clearfix"></div>
		</div>
	 
		<div class="clearfix"></div>		
		
	</div>
	
    <script src="./jquery-3.4.1.js"></script>
    <script src="popper.min.js" ></script>
    <script src="./bootstrap/js/bootstrap.min.js" ></script>
    
</body>
<?php include('nf_chosen02.php'); ?>
</html>
