<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="calendar.css">
<link type="text/css" rel="stylesheet" href="maincss/form.css"/>
<link type="text/css" rel="stylesheet" href="maincss/industrial_dark.css" />

<title>Search Item</title>
<link rel="stylesheet" href="css/table.css" type="text/css"/>	
<script language="JavaScript" src="js/quotation.js"></script>
<style type="text/css">

	/* START CSS NEEDED ONLY IN DEMO */
	html{
		height:100%;
	}
	
	
	#mainContainer{
		width:700px;
		margin:0 auto;
		text-align:left;
		height:100%;
		background-color:#FFF;
		border-left:3px double #000;
		border-right:3px double #000;
	}
	#formContent{
		padding:5px;
	}
	/* END CSS ONLY NEEDED IN DEMO */
	
	
	/* Big box with list of options */
	#ajax_listOfOptions{
		position:absolute;	/* Never change this one */
		width:175px;	/* Width of box */
		height:250px;	/* Height of box */
		overflow:auto;	/* Scrolling features */
		border:1px solid #317082;	/* Dark green border */
		background-color:#FFF;	/* White background color */
		text-align:left;
		font-size:0.9em;
		z-index:100;
	}
	#ajax_listOfOptions div{	/* General rule for both .optionDiv and .optionDivSelected */
		margin:1px;		
		padding:1px;
		cursor:pointer;
		font-size:0.9em;
	}
	#ajax_listOfOptions .optionDiv{	/* Div for each item in list */
		
	}
	#ajax_listOfOptions .optionDivSelected{ /* Selected item in the list */
		background-color:#317082;
		color:#FFF;
	}
	#ajax_listOfOptions_iframe{
		background-color:#F00;
		position:absolute;
		z-index:5;
	}
	
	form{
		display:inline;
	}

	#article {font: 12pt Verdana, geneva, arial, sans-serif;  background: white; color: black; padding: 10pt 15pt 0 5pt}
    </style>
	

</head>

<body>

 <table width="735" border="0" class=\"form-matrix-table\">
  <tr>
  	<td colspan="3"><input type="checkbox" name="checkbox" id="checkbox" onclick="re_qtn_stk_search();" />
    Stock Item Only</td>
  </tr>
  <tr>
  
    <td width="153"  background="images/headingbg.gif" ><input type="text" size="10" name="itemno" id="itemno" value="" class="txtbox"  onkeyup="qtn_item_search();"/></td>
      <td width="309"  background="images/headingbg.gif" ><input type="text" size="44" name="item_name" id="item_name" value="" class="txtbox" onkeyup="qtn_item_search();"/></td>
    <td width="259"  background="images/headingbg.gif" ><input type="text" size="18" name="model" id="model" value="" class="txtbox" onkeyup="qtn_item_search();"/></td>
     
                             
   </tr>
  </table>   
 	 <div class="CSSTableGenerator" > 
                <div id="filt_table">  <table width="735" border="0" class=\"form-matrix-table\">
                <?php    session_start();
    if ($_SESSION['company'] == "") { 
        exit("Please Login");
    }
    if ($_SESSION['CURRENT_USER'] == "") { 
        exit("Please Login");
    }
    		if (isset($_GET["stname"])) {
                        if ($_GET["stname"] == "un_delivered") {
                            $_SESSION["brand"] = null;
                        }
                    }
    			?>
                           
   <input type="hidden" value="" id="cur" />
   <tr>
                              <td width="90"  background="images/headingbg.gif" ><font color="#FFFFFF"><b>Item Code</b></font></td>
                              <td width="224"  background="images/headingbg.gif"><font color="#FFFFFF"><b>Item Description</b></font></td>
                              <td width="50"  background="images/headingbg.gif"><font color="#FFFFFF"><b>Brand</b></font></td>
                              <td width="50"  background="images/headingbg.gif"><font color="#FFFFFF"><b>Qty In Hand</b></font></td>
                              <td width="50"  background="images/headingbg.gif"><font color="#FFFFFF"><b>Min Selling</b></font></td>
                              <td width="50"  background="images/headingbg.gif"><font color="#FFFFFF"><b>List Price</b></font></td>
                              
   </tr>
       			<?php
                            require_once("connectioni.php");


                            if (!isset($_GET["stname"])) {
                                $_SESSION["stname"] ="";
                                $mstname ="";
                                
                            }   else {
                                $_SESSION["stname"] =$_GET["stname"];
                                $mstname = $_GET["stname"];
                            }


                                echo "Brand:" . $_SESSION["brand"];
 
                                // if (isset($_SESSION["brand"]) == true) {
                                //     $sql = "SELECT * from s_mas where BRAND_NAME='" . $_SESSION["brand"] . "' order by STK_NO  ";
                                // } else {
                                    $sql = "SELECT * from s_mas order by STK_NO LIMIT 100";
                                // }

                                $result = mysqli_query($GLOBALS['dbinv'], $sql);

                                while ($row = mysqli_fetch_array($result)) {

                                    echo "<tr>               
                              <td onclick=\"itno_quot('" . $row['STK_NO'] . "');\">" . $row['STK_NO'] . "</td>
                              <td onclick=\"itno_quot('" . $row['STK_NO'] . "');\">" . $row['DESCRIPT'] . "</td>
							  <td onclick=\"itno_quot('" . $row['STK_NO'] . "');\">" . $row['BRAND_NAME'] . "</td>
							  <td onclick=\"itno_quot('" . $row['STK_NO'] . "');\">" . $row['QTYINHAND'] . "</td> 
							  <td onclick=\"itno_quot('" . $row['STK_NO'] . "');\">" . $row['MIN_SELLING'] . "</td> 
							  <td onclick=\"itno_quot('" . $row['STK_NO'] . "');\">" . $row['SELLING'] . "</td>";
                                    echo "</tr>";
                                }
                                $department = $_SESSION["department"];
 
                            ?>
                    </table>
                </div>
            </div>    

</body>
</html>
