<?include("includes/connection.php")?>
<?include("includes/func.php")?>
<html>
<head>
<link href="images/class.css" rel="stylesheet" type="text/css">
<title>Design Your Ring </title>
</head>
<body>
<noscript>
<center><br><br><font class=heading><font color=red size=2><b>You cannot use many Features of this website because JavaScript is turned off in your Web browser. To use ATI website order process, turn JavaScript on through your Preferences or Internet Options in your Web browser.</b></font></font></center> <br><br>
</noscript>
<?if ($_SESSION["username"]=='') {
	$_SESSION["errmsg"]='';
	redirect("register_user.php?product=".gdbfx("product"));
}

$step=2;
include("stepstop.php")?>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
				  <form name=step1 action="chooseoptions2.php" method=GET onSubmit="return validate(this);">
				  <input type=hidden name=product value="<?=gdbfx("product");?>">
<?
$sql="select R.*,P.product_category_id from ring_master R,product_master P where R.product_id=P.product_id and R.ring_status=1 and R.product_id='".gdbfx("product")."'";

$cmd = mysql_query($sql);
echo "<table><tr><td colspan=\"2\" background=\"images/pagebg.jpg\" style=\"background-repeat:no-repeat; PADDING:10px\"><table width=\"76%\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\">";?>
 <tr align="center" class="heading"> 
                        <td class="toplinks" align=left colspan=2><font  size=2><strong>Step 1 :Choose Ring </font></strong></td>
                      </tr>

<?echo "<tr>";
while ($rs = mysql_fetch_array($cmd)) {
	$category_id=$rs["product_category_id"];
	if ($i==3) echo "</tr><tr>";
	$i=$i+1;
	if ($rs["ring_image"]!='') {
		echo "<td width=\"24%\" background=\"product_images/".$rs["ring_image"]."\" style=\"background-repeat:no-repeat;background-position: center \" align=left><img src=\"images/imgframe.gif\" width=\"137\"  border=\"0\"></a>";
		
		echo "</td>";
		$ringnumber=$rs["ring_number"];
		if ($i==1)
			$checked="checked";	
		else
			$checked="";


	}
	echo "<td><font class='heading'><input type=radio name=ring_number value='".$rs["ring_number"]."' ".$checked.">".$rs["ring_number"]."</font></td>";
}


echo "</tr></table></td></tr></table>";
?>
<input type=hidden name=category_id value="<?=$category_id;?>">
<?
$i=0;
$sql="select * from metal_master where metal_status=1 and metal_id<>8";
$cmd = mysql_query($sql);
echo "<table><tr><td colspan=\"2\" background=\"images/pagebg.jpg\" style=\"background-repeat:no-repeat; PADDING:10px\"><table width=\"76%\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\">";?>
 <tr align="center" class="heading"> 
                        <td class="toplinks" align=left colspan=2><font  size=2><strong>Step 2 :Choose Metal </font></strong></td>
                      </tr>

<?echo "<tr>";
while ($rs = mysql_fetch_array($cmd)) {
	if ($i==4 || $i==7) echo "</tr><tr>";
	$i=$i+1;
		if ($i==4)
			$checked="checked";	
		else
			$checked="";

		//$disabled="";
		//if (getcostsimple($ringnumber,$rs["metal_name"])=='') $disabled="Disabled";
		
		echo "<td width=\"24%\" background=\"metal_images/".$rs["metal_image"]."\" style=\"background-repeat:no-repeat\" align=left valign=top><img src=\"images/imgframe.gif\" width=\"137\"  border=\"0\"></a><br>";
		echo "<font class='heading'><input type=radio name=metal_name value='".$rs["metal_name"]."' ".$checked.">".$rs["metal_name"]."</font>";
		 
		echo "</td>";

	

}
echo "</tr></table></td></tr></table><table><tr><td>";?>
<tr align="center" class="heading"> 
                        <td class="toplinks" align=left ><font  size=2>Metal Finish : </font></td>

<td class="toplinks" align=left colspan=1><font class='heading'><input type=radio name=metal_finish value='Black Antique' checked>Black Antique</font><font class='heading'><input type=radio name=metal_finish value='Natural' >Natural</font></td>
                      </tr>
<tr align="center" class="heading"> 
                        <td class="toplinks" align=left colspan=1><font  size=2>Palm Side : </font></td>

<td class="toplinks" align=left colspan=1><font class='heading'><input type=radio name=Palm_Side value='Smooth' checked>Smooth</font><font class='heading'><input type=radio name=Palm_Side value='Textured' >Textured</font></td>
                      </tr>
<tr align="center" class="heading"> 
                        <td class="toplinks" align=left colspan=2><font  size=2>Replace Zicon with real Diamonds (If applicable) : </font></td>

<td class="toplinks" align=left colspan=1><font class='heading'><input type=checkbox name='Replace_Zicon' value='yes' checked></font></td>
                      </tr>
<?if ($category_id!=3) {?>
<tr align="center" class="heading"> 
                        <td class="toplinks" align=left colspan=2><font  size=2>Please enter the
name of school/university to <br>appear on ring bezel around the stone : </font></td>

<td class="toplinks" align=left colspan=1><input type=text name=schoolname maxlength=40 size=30></td>
                      </tr>
<?}?>
<tr align="center" class="heading"> 
                        <td class="toplinks" align=left colspan=2><font  size=2>Finger size : </font></td>

<td class="toplinks" align=left colspan=1>
<select name="finger_size">
<?for ($fs=2;$fs<=15; $fs=($fs+0.25)) {?>
<option value="<?=number_format($fs,2);?>"><?=number_format($fs,2);?></option>
<?}?>
</select>

</td>
                      </tr>

<?echo "</table>";
?>
<table align=center><tr align="center" class="heading"> <td class="toplinks"  align=center>
<input type=submit name=submit1 class=button value="Move to Next Step">
</td>
                      </tr></table>
<table align=center><tr align="center" class="text"><td class="text"  align=center>Images Shown above are for demonstration Purpose Only.Your Final Product will vary acoording to different option you choose on this page & Other sections.
</td>
                      </tr></table>
					  </form>
</body>
<script>

function validate(frm) {
		<?if ($category_id!=3) {?>
		if (step1.schoolname.value == "") {
				alert("Please enter the name of school/university to appear on ring bezel around the stone");
				step1.schoolname.focus();
				return (false);
		}
		<?}?>
}
</script>
</html>