<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Company || Control Panel</title>
<link href="CSS/Cpanel.css" rel="stylesheet" type="text/css">

</head>
<body>
	<!--the upper div / the header of the page and the Home button -->
    <div id="upper-div">
    <a href="index.php"><h1>Home</h1></a>
    </div>
    <!--the contant section and the general operations-->
    <div id="main">
        <div style="text-align: left; margin-left: 40px;">
            <form method="get">
                <label>Search  </label> <input style="height: 31px;" type="search" name="search" size="30" maxlength="50"/> <input type="submit" name="searchB"/>
            </form>
        </div>
        
            <?php

$con = mysql_connect('localhost','root','');
mysql_query('SET NAMES "utf8"');
if (!$con)
  {
  die('Could not connect: ' . mysql_error($con));
  }
mysql_select_db("wsltak");
$sql="SELECT * FROM company_cpanel";

$result = mysql_query($sql);
      echo"  <table id=\"records\">
            <tr>
                <th>Item ID</th>
                <th>Item Name</th>
                <th>Item Price</th>
                <th>Expired Date</th>
                <th>Name</th>
                <th>CID</th>
                <!--<th>REG_offers</th>
                <th>spe_offers</th>-->
           
            </tr>
        ";
      while($row =  mysql_fetch_array($result))
  {
  echo "<tr style=\"background-color:white; border:1px solid white;\">";
  echo "<td>" . $row['item_ID'] . "</td>";
  echo "<td>" . $row['item_name'] . "</td>";
  echo "<td>" . $row['price_item'] . "</td>";
  echo "<td>" . $row['expired_date'] . "</td>";
  echo "<td>" . $row['name'] . "</td>";
  echo "<td>" . $row['CID'] . "</td>";
  
 
  echo "</tr>";
  }
echo "</table>";

mysql_close($con);
      
      ?>
        <hr>
        <fieldset id="inform">
            <form method="post">
    <table>
        <tr>
            <td><img src="<?php?>" alt="<?php?>"/></td>
            <td><input type="file" name="OFF"/></td>
            <td style="padding-left:15px;">Type of the offer</td>
                    <td style="padding-left:15px;">
                        <select name="offers_type">
                            <option value="null"></option>
                            <option value="spe_offer">Special Offer</option>
                            <option value="reg_offer">Regular Offer</option>
                        </select>
                    </td>
        </tr>
        <tr>
            <td style="padding-left:15px;">Item ID</td>
            <td style="padding-left:15px;" ><input name="item_ID"  type="text" size="30" maxlength="50"></td>
            <td style="padding-left:15px;">Item Name</td>
            <td style="padding-left:15px;" ><input name="item_name"  type="text" size="30" maxlength="50"></td>
            <td style="padding-left:15px;">Price</td>
            <td style="padding-left:15px;"><input name="price_item" type="text" size="30" maxlength="7"/></td>
            <td style="padding-left:15px;">Expired</td>
            <td style="padding-left:15px;"><input type="date"  name="expired"/></td>
        </tr>
    </table>
   
            </form>
        </fieldset>
        <table id="buttons">
            <tr>
                <td><input type="submit" name="insert" value="Insert"></td>
                <td><input type="submit" name="update" value="Update"></td>
                <td><input type="submit" name="delete" value="Delete"></td>
            </tr>
        </table>
        <?php
        $con = mysql_connect('localhost','root','');
mysql_query('SET NAMES "utf8"');
if (!$con)
  {
  die('Could not connect: ' . mysql_error($con));
  }
mysql_select_db("wsltak");
$sql="Insert into company_cpanel(item_id,expired_date,item_name,price_item)"
        . "value ()";

$result = mysql_query($sql);
        ?>
        
    <!--the end of main section-->
    </div>
</body>
</html>