<?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>
<script language="javascript" type="text/javascript">
	function validate(frm) {
		

		if (step3.left_side_text.value == "") {
			alert("Please enter Left Side Text.");
			step3.left_side_text.focus();
			return (false);
		}
		if (step3.right_side_text.value == "") {
			alert("Please enter Right Side Text.");
			step3.right_side_text.focus();
			return (false);
		}
		if (step3.left_side_image.value != "" && step3.right_side_image.value != "") {
			if (step3.left_side_image.value == step3.right_side_image.value) {
				alert("Left Side Shank Image Should not be similar to Right side");
				step3.left_side_image.focus();
				return (false);
			}
		}
		
		if (step3.image.value != "") {
			if (step3.custom_left_side[0].checked==false && step3.custom_left_side[1].checked==false) {
				alert("You Have choosen a custom Image but did not choose the side to use it.");
				step3.custom_left_side[0].focus();
				return (false);
			}
		}
		
		//if (step3.inside_engraving.value == "") {
			//alert("Please enter Inside Engraving.");
			//step3.inside_engraving.focus();
			//return (false);
		//}
		//return (true);
	}
</script>
<?$step=4;
include("stepstop.php")?>
 <form name=step3 action="preview_order.php" method=GET onSubmit="return validate(this);">

				  <input type=hidden name=product value="<?=gdbfx("product");?>">
				  <input type=hidden name=ring_number value="<?=gdbfx("ring_number");?>">
				  <input type=hidden name=metal_name value="<?=gdbfx("metal_name");?>">
				  <input type=hidden name=metal_finish value="<?=gdbfx("metal_finish");?>">
				   <input type=hidden name=Palm_Side value="<?=gdbfx("Palm_Side");?>">
				    <input type=hidden name=Replace_Zicon value="<?=gdbfx("Replace_Zicon");?>">

				<input type=hidden name=stone_number value="<?=gdbfx("stone_number");?>">
				<input type=hidden name=stone_cut_number value="<?=gdbfx("stone_cut_number");?>">
				<input type=hidden name=stone_letter value="<?=gdbfx("stone_letter");?>">
				<input type=hidden name=letter1 value="<?=gdbfx("letter1");?>">
				<input type=hidden name=letter2 value="<?=gdbfx("letter2");?>">
				<input type=hidden name=letter3 value="<?=gdbfx("letter3");?>">
				<input type=hidden name=schoolname value="<?=gdbfx("schoolname");?>">
				<input type=hidden name=finger_size value="<?=gdbfx("finger_size");?>">
				
<?$charallowed=getringoptions(gdbfx("ring_number"));
$insidecharallowed=getengraving(gdbfx("ring_number"));
$insidecharallowed=split(",",$insidecharallowed);
$insideengraving=$insidecharallowed[1];
$outsideengraving=$insidecharallowed[0];

?>

<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr align="center" class="heading"> 
	<td class="toplinks" align=left colspan=2><font  size=2><strong>Step 4 : Ring Side Options </font></strong></td>
  </tr>
</table>


<table width="100%" border="0" cellspacing="1" cellpadding="2">
<?if($charallowed!=0) {?>
<tr align="center" class="heading"> 
	<td class="toplinks" align=left colspan=2><font  size=2><strong>Writing</strong></font></td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="2" background="images/yellowbg4.gif"><tr>
<tr>
<td bgcolor="#FFFFFF" class="toplinks">Left Side <small>(<?=$charallowed;?> char. Max.)</small><input type=text name=left_side_text value="" size=18 maxlength="<?=$charallowed;?>">

		</td>
<td bgcolor="#FFFFFF" class="toplinks">Right Side <small>(<?=$charallowed;?> char. Max.)</small><input type=text name=right_side_text value="" size=18 maxlength="<?=$charallowed;?>">

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

<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr align="center" class="heading"> 
	<td class="toplinks" align=left colspan=2><font  size=2><strong>Images</strong> (Write image number )</font></td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="1" cellpadding="2" background="images/yellowbg4.gif"><tr>
<tr>
<td bgcolor="#FFFFFF" class="toplinks">Left Side <input type=text name=left_side_image value="" size=18 >

		</td>
<td bgcolor="#FFFFFF" class="toplinks">Right Side <input type=text name=right_side_image value="" size=18 >
<a href="#" onClick="javascript:openWin('emblemspopup.php', 'width=580, height=810')" class=toplinks ><font class=text><b><u>Available shanks</u></b></font></a>
		</td>	
</tr></table>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<?echo "<tr>";
echo "<td align=left colspan=\"2\" class=toplinks>Or Click Upload Button to upload a Image of your Choice:<input type=text name=image>&nbsp;&nbsp;&nbsp;&nbsp;";?>
<input name="profile_photo_upload" type="button" value="Click To Upload a Custom Image" onClick="openWin('uploadphoto.php', 'width=560, height=230');" class=button><br><font class=label>&nbsp;[.JPG,.GIF,.PNG]<br>
Use Custom image in Left Side <input type=radio name=custom_left_side value=1> Or Right Side <input type=radio name=custom_left_side value=2></font> <br>

				
					  <img id=photo2 src="images/trans.gif">
	
<?echo "</td></tr></table>";?>

<?}
else
{?>
<table width="100%" border="0" cellspacing="1" cellpadding="2" background="images/yellowbg4.gif"><tr>
<tr>
<td bgcolor="#FFFFFF" class="toplinks">NA <input type=hidden name=left_side_text value="0" size=20 >

		</td>
<td bgcolor="#FFFFFF" class="toplinks"> NA<input type=hidden name=right_side_text value="0" size=20 >

		</td>	
</tr></table>
<?}?>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr align="center" class="heading"> 
	<td class="toplinks" align=left colspan=2><font  size=2><strong><br><br>Step 5 : Engraving </font></strong></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="2" background="images/yellowbg4.gif"><tr>
<tr>

<td bgcolor="#FFFFFF" class="toplinks"><?if ($insideengraving!=0) {?>
Inside Engraving <small>(<?=$insideengraving;?> char. Max.)</small><input type=text name=inside_engraving value="" size=17 maxlength="<?=$insideengraving;?>">
<?}?>
<?if ($outsideengraving!=0) {?><br>
Outside Engraving <small>(<?=$outsideengraving;?> char. Max.)</small><input type=text name=outside_engraving value="" size=20 maxlength="<?=$outsideengraving;?>">
<?}?>
		</td>
<td bgcolor="#FFFFFF" class="toplinks">Choose Font <input type=radio name=choose_font value="BLOCK" checked>BLOCK <input type=radio name=choose_font value="BLOCK" selected>Script

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


<table width="100%" border="0" cellspacing="1" cellpadding="2">
<?echo "<tr>";
echo "<td align=center  class=toplinks><br><a href=\"javascript:history.go(-1);\"><input type=button name=startagain value=\"Back\" class=button onclick=\"javascript:history.go(-1);\"></a></td><td align=center  class=toplinks><br><input type=submit name=submit2 value=\"Next Step (Review your Order)\" class=button></form></td></tr></table>";?>

<table width="100%" border="0" cellspacing="1" cellpadding="2" ><tr>
<tr>

<td bgcolor="#FFFFFF" class="toplinks"><a href="chooseoptions.php?product=<?=gdbfx("product");?>"><u>Start Again</u></a>

		</td>	
</tr></table>
<script>
function openWin(argURL, argSize) {

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

}
</script>
</body>
</html>