<?php session_start();?>
<?php include("../includes/connection.php"); ?>
<?php include("../includes/func.php");
include("ProductPopup_inc.php"); ?>
<html>
<head>
<script>
function openWin(argURL, argSize) {

	window.open(argURL, "x_win" + (new Date()).getTime(), "resizable=yes,scrollbars=yes," + argSize);

}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Administrative Panel : Merchant</title>
<link href="includes/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<form name="frmCatPopup" method="post">
<input type="hidden" name="product_id" value="<?php echo $_GET["product_id"]; ?>">
<table width="600" border="0" cellpadding="0" cellspacing="1" class="bgDarkGray">
   <tr>
        <td align="right" class="bgGray"><input name="btnSave" type="submit" id="btnSave" value="Save">
        </td>
    </tr>
    <tr>
        <td class="bgWhite"><table width="100%"  border="0">
            <tr align="center">
                <td colspan="2" class="note">&nbsp;<?php echo($errMsg); ?></td>
            </tr>
          
            <tr>
                <td width="38%" class="LabelBold">Name : </td>
                <td width="62%"><input type="text" size=45  name="product_name" value="<?php echo($rs["product_name"]); ?>"></td>
            </tr>
			 
			
			
            <tr>
                <td>&nbsp;</td>
                <td><input type="checkbox" name="product_status" value="1" <?php cbfx($rs["product_status"]); ?>>
                    <span class="LabelBold">Approved</span></td>
            </tr>
			
			<tr>
                <td width="38%" class="LabelBold">Category : </td>
                <td width="62%"><select name=product_category_id><?=categorycombo($rs["product_category_id"]);?></select></td>
            </tr>
			
			
			<tr>
                <td width="38%" class="LabelBold">Details : <br>
				<a href="#" onClick="openWin('edit.php?type=2&merchant_id=<?php echo($rs["merchant_id"]); ?>', 'width=650, height=430');"><small><font class=Blue>Use Editor
				</font></small></a></td>
                <td width="62%"><textarea name="product_description" rows=5 cols=37 ><?php echo($rs["product_description"]); ?></textarea></td>
            </tr>
			<tr>
                <td width="38%" class="LabelBold">No. Of Rings : <br><small>Enter No. of rings in this product.For Example Monitor has 2 rings.For Other products like ID card enter 0.</td>
                <td width="62%"><input type="text" size=45  name="ring_count" value="<?php echo($rs["ring_count"]); ?>"></td>
				
            </tr>

			
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>

<tr>
                <td width="100%" colspan=2 class="LabelBold"> 
<table width="600" border="0" cellpadding="0" cellspacing="1" class="bgGray"> 
	<tr>
		<td class="LabelBold">Product Images
		</td><td class="LabelBold">Image Name
		</td><td class="LabelBold">Ring Number*
		</td>
		</td><td class="LabelBold">Max characters
		</td>
		</td><td class="LabelBold">Outside Eng.
		</td>
		</td><td class="LabelBold">Inside Eng.
		</td>
	</tr>
	<?$i=0;
	if ($_GET["product_id"]!='') {
		while ($rsR = mysql_fetch_array($cmd)) {
			$i=$i+1;?>
		<tr>
			<td class="bgWhite"><img src="../product_images/<?=$rsR["ring_image"]?>">
			</td>
			<td class="bgWhite"><input type=text name=ring_image<?=$i;?> value="<?=$rsR["ring_image"]?>" size=14>
			</td>
			<td class="bgWhite"><input type=text name=ring_number<?=$i;?> value="<?=$rsR["ring_number"]?>" size=14><br>
			<a href="#" onClick="openWin('pricePopup.php?ring_number=<?=$rsR["ring_number"]?>', 'width=650, height=630');"><font class=Blue>Manage Price</font></a>
			<td class="bgWhite"><input type=text name=max_characters<?=$i;?> value="<?=$rsR["max_characters"]?>">
			<td class="bgWhite"><input type=text name=outside_engraving<?=$i;?> value="<?=$rsR["outside_engraving"]?>">
			<td class="bgWhite"><input type=text name=inside_engraving<?=$i;?> value="<?=$rsR["inside_engraving"]?>">
			</td>
		</tr>
	<?} }
	for($i = $i+1; $i < 7; $i++){
		?>
	<tr>
		<td class="bgWhite">Add New Image
		</td>
		<td class="bgWhite"><input type=text name=ring_image<?=$i;?> value="<?=$rsR["ring_image"]?>" size=14>
		</td>
		<td class="bgWhite"><input type=text name=ring_number<?=$i;?> value="<?=$rsR["ring_number"]?>" size=14>
		</td>
		<td class="bgWhite"><input type=text name=max_characters<?=$i;?> value="<?=$rsR["max_characters"]?>">
		</td>
		<td class="bgWhite"><input type=text name=outside_engraving<?=$i;?> value="<?=$rsR["ring_number"]?>">
		</td>
		<td class="bgWhite"><input type=text name=inside_engraving<?=$i;?> value="<?=$rsR["ring_number"]?>">
		</td>
		
	</tr>
	<?}?>

</table>
		*Leave Blank if Not applicable.	
				</td>
              
            </tr>

        </table></td>
    </tr>



    <tr>
        <td align="right" class="bgGray"><input name="btnSave" type="submit" id="btnSave" value="Save">
        </td>
    </tr>
</table>
</form>
</body>
</html>
