<?php session_start();
?>
<!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" />


        <title>Search Invoice</title>

        <script language="JavaScript" src="js/stkrepnew.js"></script>
        <!-- Bootstrap core CSS -->
        <link rel="stylesheet" href="css/bootstrap.min.css">


    </head>

    <body>
        <div class="container">

            <table border="0" class="table table-bordered">

                <tr>
                    <?php
                    if (isset($_GET["stname"])) {
                        $stname = $_GET["stname"];
                    } else {
                        $stname = "";
                    }
                    ?>
                    <td width="100" ><input type="text" size="20" name="refno" id="refno" value=""  class="form-control" tabindex="1" onkeyup="<?php echo "update_list('$stname')"; ?>" /></td>
                    <td width="250" ><input type="text" size="70" name="des" id="des" value=""  class="form-control" tabindex="1" onkeyup="<?php echo "update_list('$stname')"; ?>" /></td>
                    <td width="100" ><input type="text" size="20" name="partno" id="partno" value=""  class="form-control" onkeyup="<?php echo "update_list('$stname')"; ?>"/></td>
                    <td width="100" ><input type="text" size="20" name="brand" id="brand" value=""  class="form-control" onkeyup="<?php echo "update_list('$stname')"; ?>"/></td>
            </table>    
            <div id="filt_table">  <table class="table table-bordered">
                    <tr>
                        <th width="100">Stk No</th>
                        <th width="250">Description</th>
                        <th width="100">Part No</th> 
                        <th width="100">Brand</th>  
                    </tr>
                    <?php
                    include './connection_sql.php';



//                    
                    $sql = "SELECT * FROM s_mas  ORDER BY STK_NO asc limit 50";

                    foreach ($conn->query($sql) as $row) {
                        $cuscode = $row["STK_NO"];


                        echo "<tr>               
                              <td onclick=\"crnview('$cuscode', '$stname');\">" . $row['STK_NO'] . "</a></td>
                              <td onclick=\"crnview('$cuscode', '$stname');\">" . $row['PART_NO'].'&nbsp;'.$row['DESCRIPT'] . "</a></td>
                              <td onclick=\"crnview('$cuscode', '$stname');\">" . $row['PART_NO'] . "</a></td>
                                  <td onclick=\"crnview('$cuscode', '$stname');\">" . $row['BRAND_NAME'] . "</a></td> 
                            </tr>";
                    }
                    ?>
                </table>
            </div>
        </div>
    </body>
</html>
