<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');

$zdb = $_SESSION["zdbyear_$dbname"];

mysqli_select_db($conn, $zdb);
if (isset($_POST["view"])) {
           
    $cond = "";
    if(!empty($_POST["itemdescname"])){
       $pname = trim($_POST["itemdescname"]);
       $cond = "AND `name` LIKE '%$pname%'";
    }
        
    $get = mysqli_query($conn, "SELECT * FROM `itemdesc` WHERE  `name`!='' $cond  ORDER by `name`")or die(mysqli_error($conn));
    $getno = mysqli_num_rows($get);
?>

<!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>

<style type="text/css">
<!--
@import url("table/table.css");
-->
</style>

                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                
            </head>
            <body>
               <?php
                require("includes/dbconnect.php");
                $comp = mysqli_query($conn, "SELECT * FROM `company`") or die(mysql_errno());
                $zcomp = mysqli_fetch_assoc($comp);
                echo "<font size='4px' color='#039'><b>$zcomp[compname]</font></b></font><br />";
                echo "<font size='2px' color='#039'><b> $zcomp[add1]. $zcomp[add2].  $zcomp[add3] </b></font><br /><br />";
                echo "<b><font color='#039'>Item Description List &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size='3px'>Date : ".date("M-d-Y") . "</b><br />";
                echo "<b>"."Total Records - $getno</b><br />";
                echo "<br />";
                        ?>  
                
                
                <table id="hor-minimalist-b" summary="Item Description Sheet" width="100%">

                    <thead>
                        <tr>
                            <th style="text-align:left;" scope="col" width="6"><b>Sr.</b></th>
                            <th style="text-align:left;" scope="col" width="120"><b>Name</b></th>
                        </tr>
                        <TR>
                            <td colspan="9"><hr/></td>
                        </TR>
                    </thead>
                    <tbody>
                        <?php
                        $ctr = 0;
                        while ($city = mysqli_fetch_assoc($get)) {
                            $ctr++;
                            echo "<tr> \n";
                            echo "<td style=\"text-align:left;\" width=\"6\"> \n <span> $ctr </span> \n </td> \n";
                            echo "<td style=\"text-align:left;\" width=\"120\"> \n <span><b> $city[name]</b> </span> \n </td> \n";
                        }
                        ?>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="9"><hr/></td>
                        </tr>
                    </tfoot>
                </table>
        </body>
</html>
   <?php 
}
   ?>
<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
