<?php
require "racs.php";
require "vtshows.php";
include('style.php');
error_reporting(0);
session_start();
if(!isset($_SESSION['titles']) || !isset($_SESSION['positions'])|| !isset($_SESSION['usernames'])){
header("location:index.php");}
?>

<!DOCTYPE html>
<html>
<head>
<script src="jquery.min.js"></script>				

<ul>
  <li><a href="#">Phase-01</a></li>
  <li><a href="#">Phase-2</a></li>
  <li><a href="#">Phase-3</a></li>
  <li><a href="#">Phase-4</a></li>
  <li><a href="stkadd.php">Inventry</a></li>
  <ul style="float:right;list-style-type:none;">
  <li><aa href="#">Welcome :<?php echo $_SESSION['titles']; ?></aa></li>
  <li><a class="active" href="#">Dashboard</a></li>
  <li><a href="/prd/index.php">Logout</a></li>
  </ul>
</ul>


<header>
<h1>DTPL-Warehouse Item List</h1>
</header>


</head>


<nav>
<h>Quick Links</h><br>
<a href="stkadd.php">Addnew</a>
<a href="#">Up-date</a>
<a href="#">Detailes</a>
<a href="repsum.php">Summary</a>
</nav>


<input type="text" id="txtSearch" name="txtSearch" placeholder="Type for details" style='width:200px'maxlength="100" />
<img id="imgSearch" src="/images/cancel.gif" alt="Cancel Search" title="Cancel Search" style="width:150px;width:14px;height:14px;" />

<?php
$con=mysqli_connect("localhost","primarysales","S5L7lF01EQZvQrGK","primarysales_diana");

$result=mysqli_query($con,"select * from whitems order by id" );
{
echo "<table id='tblSearch'>
<tr>
<th>Item-Code</th>
<th>Descriptions</th>
<th>Uoms</th>
<th>Update</th>


</tr>";

while($row = mysqli_fetch_array($result)) {
echo"<tr>";
echo "<td style='width:100px'>" . $row['id'] . "</td>";
echo "<td style='width:350px'>"  . $row['item_names'] . "</td>";
echo "<td style='width:100px'>" . $row['uoms'] . "</td>";
echo "<td><a href=\"newtra.php?id=$row[id]\">Add</a> | <a href=\"##\" onClick=\"return confirm('You Have no Permisson to delete?')\">Edit</a></td>";

echo "</tr>";
}
}
echo "</table>";
mysqli_close($con);
?>
			
<script language="javascript" type="text/javascript">
jQuery.expr[":"].containsNoCase = function(el, i, m) {
var search = m[3];
if (!search) return false;
return eval("/" + search + "/i").test($(el).text());
};

jQuery(document).ready(function() {
// used for the first example in the blog post
jQuery('li:contains(\'DotNetNuke\')').css('color', '#0000ff').css('font-weight', 'bold');
    
// hide the cancel search image
jQuery('#imgSearch').hide();
  
// reset the search when the cancel image is clicked
jQuery('#imgSearch').click(function() {
resetSearch();
});
  
// cancel the search if the user presses the ESC key
jQuery('#txtSearch').keyup(function(event) {
if (event.keyCode == 27) {
resetSearch();
}
});
    
// execute the search
jQuery('#txtSearch').keyup(function() {
// only search when there are 3 or more characters in the textbox
if (jQuery('#txtSearch').val().length > 2) {
// hide all rows
jQuery('#tblSearch tr').hide();
// show the header row
jQuery('#tblSearch tr:first').show();
// show the matching rows (using the containsNoCase from Rick Strahl)
jQuery('#tblSearch tr td:containsNoCase(\'' + jQuery('#txtSearch').val() + '\')').parent().show();
// show the cancel search image
jQuery('#imgSearch').show();
}
else if (jQuery('#txtSearch').val().length == 0) {
// if the user removed all of the text, reset the search
resetSearch();
}
    
// if there were no matching rows, tell the user
if (jQuery('#tblSearch tr:visible').length == 1) {
// remove the norecords row if it already exists
jQuery('.norecords').remove();
// add the norecords row
jQuery('#tblSearch').append('<tr class="norecords"><td colspan="5" class="Normal">No records were found</td></tr>');
}
});
});
   
function resetSearch() {
// clear the textbox
jQuery('#txtSearch').val('');
// show all table rows
jQuery('#tblSearch tr').show();
// remove any no records rows
jQuery('.norecords').remove();
// remove the cancel search image
jQuery('#imgSearch').hide();
// make sure we re-focus on the textbox for usability
jQuery('#txtSearch').focus();
}
      
</script>
</body>
</html>

