<?
session_start();
ob_start();
	if($_SESSION['lang']=='')
{
	$_SESSION['lang'] = "en";
}	
	include 'languages/lang_logedin_'.$_SESSION['lang'].'.php';
	include 'languages/lang_common_'.$_SESSION['lang'].'.php';
   include("include/db.inc.php");
   include("include/bit_functions.inc.php");
   include("include/mail.php");
   $db1=new db;
   $db1->open();
  mysql_query("SET NAMES 'utf8'");  $currency_symbol_new=symbol_currency();
   $headermsg=_CRT_ACC_;    
if(isset($_POST['register']))
{ 
     extract($_POST); 	 
     $sql_chk="select * from user where email='$email' or uname='$uname'";
     $res_chk=mysql_query($sql_chk);
	if(mysql_num_rows($res_chk)>0)
	 {
  ?>
			<script type=text/javascript language=javascript>
            alert("Sorry , this email/user already exist.");
            window.location.href="<?=_BASEURL_?>/register/index.html";
            </script>
<?
	 } 
	 
else if(strtolower($_POST['security_code'])==$_SESSION['freecap_word_hash'])
		 { 
		 
		  $bday = $year."-".$month."-".$day;
		  $ccode=substr(md5($email),0,10);
		  $ip = getIP();
  		  $sql="insert into user (id,gender,first_name,last_name,uname,bday,country,password,email,ccode,ip,stat_date)
		  values('','$gender','$fname','$lname','$uname','$bday','$country','$password','$email','$ccode','$ip',now())";
 		 $res=mysql_query($sql) or die(mysql_error().$sql);
		 $i_id=mysql_insert_id();		
		
			if($refer!='')
			{
			  mysql_query("update invite_friend set confirm_register='1' where email='$email' and refer_code='$refer'");		 		
			}
		
		// mysql_query("insert into friends set user_id='1', fr_id='$i_id', status='1'");
		$reg = "yes";
		}
	else 
	{
		$reg = "no";
		$msg="<font color=\"red\">Invalid captcha code.</font><br />";
	}		
  if($reg =="yes")
   {  
   			register_mail($fname,$email,$ccode,$i_id); 		   
			
			header("location:"._BASEURL_."/loginconfirm/".$i_id."/");
			exit();
          
   }
 
  }   
 
?>
<!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>
<base href="<?=_BASEURL_?>/" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="<?=_TITLE1_?> offers bargain auctions of new brand products. Save up to 70% for every product almost. Bid and Win high quality products.<?=_TITLE1_?> offers amazing bargains." />
<meta name="Description" content="<?=_TITLE1_?> is USA's first Real time Auction site where one can bid for products at very cheap price. Products like Wii, Nintendo, Scooter, Mini, iPod, iTouch, Mac BookAir, Mac Book, aston martin trip and ferrari and much more." />
<meta name="Keywords" content="Penny Auction, Auction, Bid, Mega Cheap prices, Sale,  for Penny Auction, Cheap Deals, Great Bargains, Win Consoles, Cameras, TV, LCD, Plasma TV, Scooters, and even Cars for mega cheap prices, <?=_TITLE1_?>, Brand new , discount of" />
<meta name="rating" content="General"/>
<meta name="copyright" content="Copyright (c) 2008 by <?=_TITLE1_?>.com" />
<meta name="classification" content="auction, bidding, unique bid, ecommerce platform, real time shopping"/>
<meta name="coverage" content="Worldwide"/>
<meta name="title" content="<?=_TITLE1_?> | An online real time Ecommerce Auction Platform"/>
<meta name="page-topic" content="products, services, technology, business, Internet, Web, friends, photos, networks, connections, events, groups, relations"/>
<meta name="audience" content="all, experts, advanced, professionals, business, youth, children, ladies, females, males"/>
<meta name="reply-to" content="support@<?=_TITLE1_?>.com"/>
<meta name="author" content="Info-Tech Ltd. | We simplify web 2.0"/>
<title><?=_TITLE_?> Register Now!</title>
<link href="<?=_BASEURLCSSNEW_?>/register.css" rel="stylesheet" type="text/css" />
<link href="<?=_BASEURLCSSNEW_?>/index.css" rel="stylesheet" type="text/css" />
<link href="<?=_BASEURLCSSNEW_?>/index_sec.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 6]><style type="text/css" media="screen">/* <![CDATA[ */ @import url(<?=_BASEURLCSSNEW_?>/ie6.css?0:102290); /* ]]> */</style><![endif]-->
<!--[if gte IE 7]><style type="text/css" media="screen">/* <![CDATA[ */ @import url(<?=_BASEURLCSSNEW_?>/ie7.css?0:99961); /* ]]> */</style><![endif]-->
<script src="include/validation.js"></script>
<script language="javascript">
function validate()
{
	
	var fname=trim(document.form1.fname.value);
	if(is_empty(fname))
	{
		alert("<?=_PLZ_FIRST_NAME_?>");
		document.form1.fname.focus();
		return false;
	}
	var lname=trim(document.form1.lname.value);
	if(is_empty(lname))
	{
		alert("<?=_PLX_UR_LNAME_?>");
		document.form1.lname.focus();
		return false;
	}
	
	/*if(document.getElementById('male').checked !="true" || document.getElementById('female').checked !="true")
	{
		alert("Select Gender");
		return false;
	}
	*/
	
	<? $minyear=date('o')-16;?>
	
	var day=trim(document.form1.day.value);
	var month=trim(document.form1.month.value);
    var year=trim(document.form1.year.value);
   
    if(day==0 || month==0 || year==0 )
	{
		alert("Please enter your date of birth!");
		document.form1.day.focus();
		return false;
	}
	if(year > <?=$minyear?>)
	{
		alert("You must be more than 16 year old!");
		document.form1.year.focus();
		return false;
	}
	
	
	
	
	
	
	var uname=trim(document.form1.uname.value);
	if(is_empty(uname))
	{
		alert("<?=_PLZ_URS_UNAME_?>");
		document.form1.uname.focus();
		return false;
	}
	
	var password=trim(document.form1.password.value);
	if(is_empty(password))
	{
		alert("<?=_PLZ_ENR_PASS_?>");
		document.form1.password.focus();
		return false;
	}
	
	var email=document.form1.email;
	if (trim(email.value) == 0) {
		alert("<?=_PLS_UYR_EMAIL_?>");
		email.focus();
		return false;
	} else if (email.value.indexOf("@") < 0) {
		alert("<?=_INCORRE_EMAIL_ADDRE_?>");
		email.focus();
		return false;
	} else if (email.value.indexOf(".") < 0) {
		alert("<?=_PLZ_RE_ENTR_?>");
		email.focus();
		return false;
	} else if (trim(email.value).indexOf(" ") >= 0) {
		alert("Incorrect email address. Please re-enter.");
		email.focus();
		return false;
	}
	var tos=document.form1.tos;
	if (!tos.checked) {
		alert("Please check the agree to our terms of conditions.");
		tos.focus();
		return false;
	}
	
	var security_code=trim(document.form1.security_code.value);
	if(is_empty(security_code))
	{
		alert("Please enter captcha code");
		document.form1.security_code.focus();
		return false;
	}

return true;
}
</script>

</head>
<body>
<div id="container">
  <? include("header.php");?>
  <div class="lm90px">
  
  
  <div id="accountleft2">
  <div class="buygreen1" >
   <div class="buygreen2"><img src="<?=_BASEURLMEDIA_?>/greenfair_register.gif" alt="Registration Panel" />
	</div><div class="buygreen3">
  </div>
  </div>

  <div class="allm100px">
  <div class="allm10px">
     <form name="form1" action="" method="post" id="form1" onSubmit="return validate();">
     <input type="hidden" name="refer" value="<?=$_REQUEST['refer']?>" />
     <?=$msg?>
<table width="750" cellspacing="0"  cellpadding="0" align="center"  >
              <tr>
                <td valign="top">
                    
                   

<table width="500" align="center">

<tr>
<td valign="top" width="48%">  
   


  <strong>
  Your <?=_FIRT_NAME_?>
  </strong>
<div class="bm10px"><input name="fname" type="text" class="inputtext"/></div>
<strong>
Your <?=_LNAME_?>
</strong>
<div class="bm10px"><input name="lname" type="text" class="inputtext"  /></div>
<strong>Gender:</strong>
<div class="bm10px"><input type="radio" name="gender" id="male" value="male" checked="checked"/><?=_MALEE_?>&nbsp;&nbsp;&nbsp;<input type="radio" name="gender" id="female" value="female"  /><?=_FEMLSSS_?></div>
<strong>Your <?=_DOBB_?></strong>
<div class="bm10px"><select name="day" class="whiteselect"  style="width:100px; border-color:#E2E3E2"  >
        <option value="">--Day--</option>
        <?
			for ( $day = 1; $day <= 31; $day += 1) {
			echo "<option value='$day'>$day</option>";
				}
					?>
</select>
      <select name="month" class="whiteselect"    style="width:150px; border-color:#E2E3E2" >
        <option value="">--<?=_MM1_?>--</option>
        <option value="1"><?=_JAN1_?></option>
        <option value="2"><?=_FB1_?></option>
        <option value="3"><?=_M_RCH1_?></option>
        <option value="4"><?=_APR1_?></option>
        <option value="5"><?=_M_A_Y1_?></option>
        <option value="6"><?=_J_U_N1_?></option>
        <option value="7"><?=_JU_LY1_?></option>
        <option value="8"><?=_AUG_UST1_?></option>
        <option value="9"><?=_SEP_T1_?></option>
        <option value="10"><?=_OC_T1_?></option>
        <option value="11"><?=_NOV1_?></option>
        <option value="12"><?=_DEC1_?></option>
      </select>
      <select name="year" class="whiteselect"   style="width:100px; border-color:#E2E3E2">
        <option value="">--Year--</option>
        <?
			for ( $year = date('Y') - 100; $year <= date('Y')-18; $year += 1) {
				echo "<option value='$year'>$year</option>";
				}
				?>
      </select> </div>
<strong>
Your Desired <?=_UNAME_?>
</strong>
<div class="bm10px"><input name="uname" type="text" class="inputtext"  /></div>
<strong>
<?=_PASS_?>
</strong>
<div class="bm10px"><input name="password" type="password" class="inputtext" /></div>
<strong>
Your Email Address:
</strong>
<div class="bm10px"><input name="email" type="text" class="inputtext"  /></div>

<div class="bm10px"><input name="tos" type="checkbox" id="tos" value="checkbox">By clicking Checkbox, you are indicating that you have read and agree<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to the <a href="terms.php" style="font-size:11px; color:#ff9900">Terms of Use</a> and <a href="privacy.php" style="font-size:11px; color:#ff9900">Privacy Policy</a>.</div>

<div class="lm40px">
            <div id="captchaimage"><div class="lm40px bm10px"><img src="captcha.php" alt="Captcha image" /></div>

              <input  id="security_code" name="security_code" type="text" class="inputtext1" />
            </div>
          </div>
<div class="bm10px lm40px tm10px allp10px"><input type="submit" name="register" value=" " class="inputsubmitbig"  />
<!--<a href="#" class="close">-->
<input type="button" class="inputsubmitbigc"  value=" "  onclick="cls()" /></div>         
          
</td>

</tr>


</table>

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



</form>
</div>
</div>

  <div class="tft1">
        <div class="tft2"></div>
        <div class="tft3"></div>
      </div>


</div></div>
<? include("footer.php");?>
</div>
</body>
</html>
