<? ob_start();

session_start();

require_once("../dbconnect.php");

if($_GET['categiry_id']!=""){

  $view="Select * from tblcategories1 where categiry_id=".$_GET['categiry_id']; 

 $exeview=mysql_query($view);

 $viewrow=mysql_fetch_array($exeview);

 $category=$viewrow['categiryname']; 

 }

if($_GET['subcat']!=""){ 

 $view1="Select * from tblsubcategories1 where subcot_id=".$_GET['subcat']; 

 $exeview1=mysql_query($view1);

 $viewrow1=mysql_fetch_array($exeview1);

 $subsubcategory=$viewrow1['subcot_name'];

 }

 $res=mysql_fetch_array(mysql_query("select * from products1 where pdid=".$_GET['prodid']));

?>

<!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=iso-8859-1" />

<title>Welcome to Sir Box and Plastics</title>

<style type="text/css">

<!--

body {

	margin-left: 0px;

	margin-top: 0px;

	margin-right: 0px;

	margin-bottom: 0px;

}

-->

</style>

<link href="stylesheet.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="valid.js"></script>

<script type="text/javascript" src="controls.js"></script>

<script type="text/javascript" src="controls1.js"></script>

<script type="text/javascript" src="sizes.js"></script>

</head>

<body>

<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

        <tr>

          <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

              <tr>

                <td><? require_once("header.php"); ?></td>

              </tr>

              <tr>

                <td>&nbsp;</td>

              </tr>

              <tr>

                <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

                    <tr>

                      <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

                          <tr>

                            <td height="30" class="cate_pro"> Product in Category: "<? echo $category?> <? echo $subcategory ?> - <? echo $subsubcategory ?>"</td>

                            <td>&nbsp;</td>

                            <td class="index_text" align="right">&nbsp;</td>

                            <td width="20">&nbsp;</td>

                          </tr>

                        </table></td>

                    </tr>

                    <tr>

                      <td>&nbsp;</td>

                    </tr>

                    <tr>

                      <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">

                          <tr>

                            <td width="100%" valign="top" style="padding-right:1px;"><form  name="form" method="post" action="productinsert1.php?action=edit" enctype="multipart/form-data" onsubmit="return validation(this.file);">

                                <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F2F1EE">

                                  <tr>

                                    <td height="40" colspan="6" align="center" bgcolor="#D7D6CC" class="cate_pro">Edit Product</td>

                                  </tr>

                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td align="left">&nbsp;</td>

                                    <td colspan="3">&nbsp;</td>

                                  </tr>

								   <tr>

                                    <td width="10%" height="30" align="left">&nbsp;</td>

                                    <td width="6%">&nbsp;</td>

                                    <td width="16%"><label><strong>Item Number:</strong></label></td>

                                    <td  colspan="3"><input type="text" name="itemno" size="30" value="<?php echo $res['itemno'];?>" /></td>

                                  </tr>

                                  <tr>

                                    <td width="10%" height="30" align="left">&nbsp;</td>

                                    <td width="6%">&nbsp;</td>

                                    <td width="16%"><label><strong>Product Name:</strong></label></td>

                                    <td  colspan="3"><input type="text" name="pdname" size="30" value="<?php echo $res['pdname']; ?>" /></td>

                                  </tr>
                                  
                                  <tr>

                                    <td width="10%" height="30" align="left">&nbsp;</td>

                                    <td width="6%">&nbsp;</td>

                                    <td width="16%"><label><strong>Size:</strong></label></td>

                                    <td  colspan="3"><input type="text" name="size" size="30" value="<?php echo $res['size'];?>" /></td>

                                  </tr>

                           

                                  <tr>

                                    <td height="30" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td><strong>Description:</strong></td>

                                    <td  colspan="3"><textarea name="description" id="description" rows="10" cols="25"  /><?php echo $res['description'];?></textarea></td>

                                  </tr>

								 

                                  <tr>

                                    <td height="30" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    

                                    <!--<td  colspan="4" align="center"><p id="parah2" align="left"><span style="padding-left:160px;">Click below to add more.....</span></p>

                                      <a href="javascript:addInput1()" class="menu7"  style="margin-right:100px;"><img src="images/addmore.gif" border="0" /></a></td>-->

                                  </tr>

								     <tr>

                                    <td height="30" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td><strong>Weight:</strong></td>

                                    <td  colspan="3"><input type="text" name="weight" id="weight" value="<?php echo $res['weight'];?>"  /></td>

                                  </tr>
									
								  <tr>

                                    <td height="30" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td><strong>Price:</strong></td>

                                    <td  colspan="3"><input type="text" name="price" id="size" value="<?php echo $res['price'];?>"  /></td>

                                  </tr>

								 

                                  <tr>

                                    <td height="30" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                   

                                    <!--<td  colspan="4" align="center"><p id="parahsize" align="left"><span style="padding-left:160px;">Click below to add more.....</span></p>

                                      <a href="javascript:addInputsize()" class="menu7"  style="margin-right:100px;"><img src="images/addmore.gif" border="0" /></a></td>-->

                                  </tr>
                               <tr>
							   <td height="34">&nbsp;</td>
							   <td>&nbsp;</td>
							   <td><strong>Qty/Case:</strong></td>
							   <td><input type="text" name="case" value="<?php echo $res['qtycase'];?>" /></td>
							   </tr>
                                  <tr>

                                    <td width="10%" height="30" align="left">&nbsp;</td>

                                    <td width="6%">&nbsp;</td>

                                    <td width="16%"><label><strong>Qty:</strong></label></td>

                                    <td  colspan="3"><input type="text" name="qty[]" value="<?php echo $res['qty'];?>" /></td>

                                  </tr>
								
                                  <tr>

                                    <td width="10%" height="30" align="left">&nbsp;</td>

                                    <td width="6%">&nbsp;</td>

                                    <!--<td width="16%"><label><strong>Product Image:</strong></label></td>

                                    <td  colspan="3"><input type="file" name="prodimg1" id="prodimg1" size="30" /></td>-->
									<td><strong>Image:</strong></td>

                                    <td  colspan="3"><input type="file" name="file" id="file" />
									<?php 
										
										if($res["image"]!=""){
											$image_url = "http://".$_SERVER['SERVER_NAME']."/zeaplocks/th-".$res["image"];
											//if(file_exists($image_url)){
												echo "<img src='".$image_url."' height='100' width='100'>";
											//}
												
										}	
									?>
									</td>
                                  </tr>

                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td align="left"><strong>Price:</strong></td>

                                    <td colspan="3">$ <input type='text'  id='price'  name='price' size='5' onkeyup='return validatephone(this);' /></td>

                                  </tr>

                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td align="left"><strong></strong></td>

                                    <td colspan="3"></td>

                                  </tr>
                                  
                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td align="left">&nbsp;</td>

                                    <td colspan="3"></td>

                                  </tr>
                                  
                                   <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td align="left">&nbsp;</td>

                                    <td colspan="3"></td>

                                  </tr>

                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td align="left"><strong></strong></td>

                                    <td colspan="3"></td>

                                  </tr>

								  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td><strong></strong></td>

                                    <td colspan="3">
						  
                          
						</td>

                                  </tr>

								<tr>

                                    <td height="30" align="left">&nbsp;</td>

                                    

                                    <td  colspan="5" align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>

                                      </td>

                                  </tr>

								   

                                  <tr>

                                    <td height="30" align="left">&nbsp;</td>

                                    

                                    <!--<td  colspan="5" align="center" style="padding-left:202px;"><p id="parah1"  align="left"><span style="padding-left:160px;">Click below to add more.....</span></p>

                                      <a href="javascript:addInput();"><img src="images/addmore.gif" border="0" /></a></td>-->

                                  </tr>

                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td colspan="3">&nbsp;</td>

                                  </tr>

                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td colspan="2"><input type="hidden" name="firstcnt" id="firstcnt" value="1"  />

                                      <input type="hidden" name="secondcnt" id="secondcnt" value="1"  />

                                      <input type="hidden" name="catid" value="<?=$_GET['catid'] ?>">

                                      <input type="hidden" name="subcat" value="<?=$_GET['subcat']?>">
                                      <input type="hidden" name="pdid" value="<?=$_GET['prodid']?>">
									  <?php /*?><input type="hidden" name="subsubcat" value="<?=$_GET['subsubcat']?>"><?php */?>                                      <a href="<? echo $_SESSION['url'];?>"><img src="images/button_back.gif" border="o"/></a> &nbsp;&nbsp;

                                      <input type="image" src="images/button_insert.gif" name="inserpr" />

                                      &nbsp;&nbsp; <a href="<? echo $_SESSION['url'];?>"><img src="images/button_cancel.gif" border="o"/></a> &nbsp;&nbsp;</td>

                                    <td width="38%">&nbsp;</td>

                                  </tr>

                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td colspan="3">&nbsp;</td>

                                  </tr>

                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td colspan="3">&nbsp;</td>

                                  </tr>

                                  <tr>

                                    <td height="25" align="left">&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td>&nbsp;</td>

                                    <td colspan="3">&nbsp;</td>

                                  </tr>

                                </table>

                              </form></td>

                            <td width="0%" valign="top"><!---->

                              <!----></td>

                          </tr>

                        </table></td>

                    </tr>

                    <tr>

                      <td>&nbsp;</td>

                    </tr>

                  </table></td>

              </tr>

              <tr>

                <td>&nbsp;</td>

              </tr>

              <tr>

                <td><? require_once("footer.php"); ?></td>

              </tr>

              <tr>

                <td height="200">&nbsp;</td>

              </tr>

            </table></td>

        </tr>

      </table></td>

  </tr>

</table>

</body>

</html>

