<?php 
 include('nf_config.php');
 // include('menu_side.php');
?>
<!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 echo $nproject ?></title>
	
    <link rel="stylesheet" href="./bootstrap/css/bootstrap.css" >
    <link rel="stylesheet" href="./fontawesome/css/all.css" >

<?php include('menu_side_css.php'); ?>
<?php include('nf_chosen01.php'); ?>
	
</head>

<body>
	
<?php include('menu_side_body.php'); ?>

	
	<?php
	$condition	=	" and pid = '".$pid."'";
	//Main queries
    $pages->default_ipp  =   10; //total records show on per page
    $sql    = $db->getRecFrmQry("SELECT * FROM ccprojects WHERE 1 ".$condition."");
    $pages->items_total  =   count($sql);
    $pages->mid_range    =   9;
    $pages->paginate(); 
      
    $userData   =   $db->getRecFrmQry("SELECT * FROM ccprojects WHERE 1 ".$condition." ORDER BY 1".$pages->limit."");	
	
	
		
	?>
   	<div class="container-fluid">
		<h1><?php echo $nproject ?></h1>
		<div class="card">
		
			<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>
		<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 class="text-center"><?php echo $nproject." ".$ndesc ?></th>
						<th class="text-center"><?php echo $nsepth ?></th>
						<th class="text-center"><?php echo $nsepdc ?></th>						
						<th class="text-center"><?php echo $ntotdc ?></th>						
						<th class="text-center"><?php echo $ntotdcqty ?></th>												
						<th class="text-center"><?php echo $numqtyuc ?></th>						
						<th class="text-center"><?php echo $nstockrep ?></th>																		
						<th class="text-center"><?php echo $ninvoiceon ?></th>																								
						<th class="text-center"><?php echo $naction ?></th>
					</tr>
				</thead>
				<tbody>
					<?php 
					$s	=	'';
					foreach($userData as $val){
						$s++;
					?>

					<tr>
						<td><?php echo $val['desc_project']; ?></td>
						<th class="text-center"><?php echo $val['septh']; ?></td>						
						<th class="text-center"><?php echo $val['sepdc']; ?></td>						
						<th class="text-center"><?php echo $val['totdc']; ?></td>												
						<th class="text-center"><?php echo $val['totdcqty']; ?></td>																		
						<th class="text-center"><?php echo $val['umqtyuc']; ?></td>																		
						<th class="text-center"><?php echo $val['stockrep']; ?></td>																								
						<th class="text-center"><?php echo $val['invoiceon']; ?></td>																														
						<td align="center">
							<a href="nf_project_edit.php?editId=<?php echo $val['cid']; ?>&pid=<?php echo $pid ?>&xuid=<?php echo $xuid ?>&lang=<?php echo $lang ?>" class="text-primary"><i class="fa fa-fw fa-edit"></i><?php echo $nedit ?></a>
						</td>
					</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>
</html>
