<?php session_start();
require_once __DIR__."/allfunctions.php";


	$con = mysqli_connect(get_dbserver(),get_dbuser(),get_dbpassword(),get_dbname());



	if(isset($_SESSION["proditemarrayinventory"]))
	{
	    $itemarrayprod = $_SESSION["proditemarrayinventory"];
		$itemarrayquantity = $_SESSION["proditemqty"];
	}
	else
	{
	 $itemarrayprod = array();
	 $itemarrayquantity = array();
	}


$num=$_GET["num"];

//echo $num;
//unset($itemarrayjoborder[$num]);
//unset($itemarrayquantity[$num]);
//$itemarray[$num]= "";
//$_SESSION["joborderitemarrayinventory"]=$itemarrayjoborder;
unset($_SESSION["proditemarrayinventory"][$num]);
unset($_SESSION["proditemqty"][$num]);
//$_SESSION["joborderitemarrayinventory"]=$itemarrayjoborder;
//$_SESSION["joborderitemqty"]=$itemarrayquantity;
$itemarrayprod = $_SESSION["proditemarrayinventory"];
$itemarrayquantity = $_SESSION["proditemqty"];
?>

															<table class="table table-bordered jomaterialtable" id="datatable" width="100%" cellspacing="0">
																		<thead>
																			<th>ID</th>
																			<th>Product Name</th>
																			<th>Quantity</th>
																			<th></th>
																		</thead>
																	<tbody>
																	<?php
																	foreach ($itemarrayprod as $key=>$value)
																	{
																		$MaterialListDetails = MaterialListDetails($itemarrayprod[$key]);


																		if($MaterialListDetails["id"]!="")
																		{
																	?>


																					<tr>
																	<td><?php echo $itemarrayprod[$key]; ?> </td>
																	<td><?php echo strtoupper($MaterialListDetails["name"]); ?> </td>
																	<td><?php echo $itemarrayquantity[$key]; ?> </td>
																	<td> <a href="#"  class="btn btn-sm btn-primary shadow-sm" onclick="deleteMaterialprod(<?php echo $key; ?>); return false"><i class="far fa-trash-alt"></i></a></td>
																			</tr>


																	<?php     }
																	}?>


																	</tbody>



																</table>
