<?php include("include/system_connect.php");







$action=$_REQUEST['action'];?>





<script language="javascript">







function formcheck()



{



        



		if(document.myform.member_id.value=="")



			{



				alert("Please Enter Username!");



				document.myform.member_id.focus()



				return false;



			}



			if(document.myform.intro_id.value=="")



			{



				alert("Please Enter Introducer Id!");



				document.myform.intro_id.focus()



				return false;



			}

			



			

				

			



			if(document.myform.name.value=="")



			{



				alert("Please Enter  Name!");



				document.myform.name.focus()



				return false;



			}

			

			 if(document.myform.pwd.value=="")



			{







				alert("Please Enter Password!");







				document.myform.pwd.focus()







				return false;



			}

			

			if(document.myform.tpwd.value=="")



			{







				alert("Please Enter T-Password!");







				document.myform.tpwd.focus()







				return false;



			}







			

			if(document.myform.email.value=="")



			{



				alert("Please Enter Email ID!");



				document.myform.email.focus()



				return false;



			}

			

			if(document.myform.mob.value=="")



			{



				alert("Please Enter Mobile No!");



				document.myform.mob.focus()



				return false;



			}



		

			





		

			





		if(document.myform.date.value=="")



			{



				alert("Please Enter Joining Date!");



				document.myform.date.focus()



				return false;



			}



			



			

			



		



			



		return true;



		



		}

</script>



<script language="javascript">







function duplicate_domain_check(member_id)







{ 







xmlHttp=GetXmlHttpObject()







if (xmlHttp==null)







 {







 alert ("Browser does not support HTTP Request")







 return







 }















 	







		var url="record.php";







		url=url+"?member_id="+member_id







		url=url+"&sid="+Math.random()







		xmlHttp.onreadystatechange=stateChanged_answer 







		xmlHttp.open("GET",url,true)







		xmlHttp.send(null)







		







}















function stateChanged_answer() 







{ 







  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")







  { 







  







	document.getElementById("msg").innerHTML='<font size=1>'+xmlHttp.responseText+'</font>';







  }







  else







  {







       document.getElementById("msg").innerHTML="<img src='images/loadingAnimation.gif' border=0  height=5 width=20 >";







  }







}















function duplicate_domain_check2(intro_id)







{ 







xmlHttp=GetXmlHttpObject()







if (xmlHttp==null)







 {







 alert ("Browser does not support HTTP Request")







 return







 }















 	







		var url="record.php";







		url=url+"?intro_id="+intro_id







		url=url+"&sid="+Math.random()







		xmlHttp.onreadystatechange=stateChanged_answer2 







		xmlHttp.open("GET",url,true)







		xmlHttp.send(null)







		







}















function stateChanged_answer2() 







{ 







  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")







  { 







  







	document.getElementById("msg2").innerHTML='<font size=1>'+xmlHttp.responseText+'</font>';







  }







  else







  {







       document.getElementById("msg2").innerHTML="<img src='images/loadingAnimation.gif' border=0  height=5 width=20 >";







  }







}

















function duplicate_domain_check3(parent_id)







{ 







xmlHttp=GetXmlHttpObject()







if (xmlHttp==null)







 {







 alert ("Browser does not support HTTP Request")







 return







 }















 	







		var url="record.php";







		url=url+"?parent_id="+parent_id







		url=url+"&sid="+Math.random()







		xmlHttp.onreadystatechange=stateChanged_answer3 







		xmlHttp.open("GET",url,true)







		xmlHttp.send(null)







		







}















function stateChanged_answer3() 







{ 







  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")







  { 







  







	document.getElementById("msg3").innerHTML='<font size=1>'+xmlHttp.responseText+'</font>';







  }







  else







  {







       document.getElementById("msg3").innerHTML="<img src='images/loadingAnimation.gif' border=0  height=5 width=20 >";







  }







}















function setPin()







{















var str=document.getElementById('pin').value;















	







	var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?abcdefghijklmnopqrstuvwxyz";















  	for (var i = 0; i < str.length; i++) 







	{







  		if (iChars.indexOf(str.charAt(i)) != -1) 







		{







		  	//alert ("Special characters are not allowed. \nPlease remove them and try again");







			str=str.substring(0,str.length-1);







			document.getElementById('pin').value=str.toLowerCase();







		  	return false;







		}







	}







	







	







		var tstring = "";







		str = '' + str;







		splitstring = str.split(" ");







		for(i = 0; i < splitstring.length; i++)







		{







			tstring += splitstring[i];







		}







		document.getElementById('pin').value=tstring;







		document.getElementById('pin').value=tstring.toLowerCase();







		







		















}















function setMob()







{















var str=document.getElementById('mob').value;















	







	var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?abcdefghijklmnopqrstuvwxyz";















  	for (var i = 0; i < str.length; i++) 







	{







  		if (iChars.indexOf(str.charAt(i)) != -1) 







		{







		  	//alert ("Special characters are not allowed. \nPlease remove them and try again");







			str=str.substring(0,str.length-1);







			document.getElementById('mob').value=str.toLowerCase();







		  	return false;







		}







	}







	







	







		var tstring = "";







		str = '' + str;







		splitstring = str.split(" ");







		for(i = 0; i < splitstring.length; i++)







		{







			tstring += splitstring[i];







		}







		document.getElementById('mob').value=tstring;







		document.getElementById('mob').value=tstring.toLowerCase();







		







		















}































function GetXmlHttpObject()







{







var xmlHttp=null;







try







 {







 // Firefox, Opera 8.0+, Safari







 xmlHttp=new XMLHttpRequest();







 }







catch (e)







 {







 //Internet Explorer







 try







  {







  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");







  }







 catch (e)







  {







  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");







  }







 }







return xmlHttp;







}







function test()







{







alert('as');







}







</script>





<!DOCTYPE html>



<html lang="en">



<head>



    <meta charset="utf-8">



    <meta http-equiv="X-UA-Compatible" content="IE=edge">



    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">



    <title>LIXO - Register</title>



    <link rel="icon" type="image/x-icon" href="assets/img/favicon.png"/>



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



    <script src="assets/js/loader.js"></script>



    <!-- BEGIN GLOBAL MANDATORY STYLES -->



    <link href="https://fonts.googleapis.com/css?family=Quicksand:400,500,600,700&display=swap" rel="stylesheet">



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



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



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



    <link href="assets/css/authentication/form-2.css" rel="stylesheet" type="text/css" />



    <!-- END GLOBAL MANDATORY STYLES -->



    <link rel="stylesheet" type="text/css" href="assets/css/forms/theme-checkbox-radio.css">



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



</head>



<body class="form">



    







    <div class="form-container outer">



        <div class="form-form">



            <div class="form-form-wrap">



                <div class="form-container">



                    <div class="form-content">







                        <h1 class="">Register</h1>



                        <p class="signup-link register">Already have an account? <a href="index.php">Log in</a></p>



						<p class="signup-link register"><?php















						  if($_SESSION['msg_box2']!="")















						  {?><? echo $_SESSION['msg_box2'];?><?	} 















						 unset($_SESSION['msg_box2']);























						?></p>



						<? if($action==""){ ?>



                        <form class="text-left" action="new_register.php?action=process" method="post" enctype="multipart/form-data"  name="myform" onSubmit="return formcheck();">



                            <div class="form">







                                <div id="username-field" class="field-wrapper input">



                                    <!--<label for="username">Username</label>-->



                                    



                                   <input type="text" class="form-control"  placeholder="Username*" name="member_id" value="" onblur=duplicate_domain_check(this.value)>



                                </div>

								<div class="input-group mb-4">

                                                  

                                                <span class=red id=msg></span>

                                                </div>

												



								<div class="input-group mb-4">



                                                  <div class="input-group-prepend">



                                                    <span class="input-group-text" id="basic-addon5">Introducer ID*</span>



                                                  </div>



                                                <input type="text" class="form-control" placeholder="Enter Introducer" name="intro_id" value="" onblur=duplicate_domain_check2(this.value) />



                                                </div>



												<div class="input-group mb-4">



                                                  <div class="input-group-prepend">



                                                   <span class=red id=msg2></span>



                                                  </div>



                                                



                                                </div>

												



												<div class="input-group mb-4">



                                                  <div class="input-group-prepend">



                                                    <span class="input-group-text" id="basic-addon5">Name*</span>



                                                  </div>



                                                <input type="text" class="form-control" placeholder="Name"  name="name" value="<? echo $_SESSION['name'];?>">



                                                </div>

												

												<div class="input-group mb-4">

                                                  <div class="input-group-prepend">

                                                    <span class="input-group-text" id="basic-addon5">Password*</span>

                                                  </div>

                                                      <input type="text" class="form-control" placeholder="Password"  name="pwd" value="">

                                                </div>

												<div class="input-group mb-4">

                                                  <div class="input-group-prepend">

                                                    <span class="input-group-text" id="basic-addon5">T-Password*</span>

                                                  </div>

                                                      <input type="text" class="form-control" placeholder="T-Password"  name="tpwd" value="">

                                                </div>







                                <div id="email-field" class="field-wrapper input">



                                    <!--<label for="email">EMAIL*</label>-->



                                    <!--<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-at-sign register"><circle cx="12" cy="12" r="4"></circle><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"></path></svg>-->



                                    <input id="email" name="email" type="text" class="form-control" placeholder="Email*" value="<? echo $_SESSION['email'];?>">



                                </div>







                                <div class="input-group mb-4">



                                                  <div class="input-group-prepend">



                                                    <span class="input-group-text" id="basic-addon5">Mobile No*</span>



                                                  </div>



                                              <input type="text" class="form-control" placeholder="Mobile No" name="mob" value="<? echo $_SESSION['mob'];?>">



                                                </div>
																							 <?

 $query_con=$mysqli->prepare("select con_name from country_list order by id");



$query_con->execute();

$query_con->bind_result($con_name);





?>
												
												<div class="input-group mb-4">



                                                  <div class="input-group-prepend">



                                                    <span class="input-group-text" id="basic-addon5">Country</span>



                                                  </div>



                                             <select class="form-control" name="country">

													<option value="">Please Select Country </option>



                                              <?  while($query_con->fetch()){?>



												 <option  value="<? echo $con_name;?>"><? echo $con_name;?></option>

												 <? } ?>

												 



									

												</select>


                                                </div>



												



												



												<div class="input-group mb-4">



                                                  <div class="input-group-prepend">



                                                    <span class="input-group-text" id="basic-addon5">Address</span>



                                                  </div>



                                              <textarea class="form-control" name="address" rows="2"  placeholder="Address"><? echo $_SESSION['address'];?></textarea>



                                                </div>



												<div class="input-group mb-4">



                                                  <div class="input-group-prepend">



                                                    <span class="input-group-text" id="basic-addon5">City</span>



                                                  </div>



                                              <input type="text" class="form-control" placeholder="Enter City" name="city" value="<? echo $_SESSION['city'];?>">



                                                </div>



												<div class="input-group mb-4">



                                                  <div class="input-group-prepend">



                                                    <span class="input-group-text" id="basic-addon5">ZIP Code</span>



                                                  </div>



                                               <input type="text" class="form-control"  placeholder="ZIP code" name="pin" value="<? if($pin!="NULL"){ echo $pin;}?>">



                                                </div>

												<div class="input-group mb-4">

                                                  <div class="input-group-prepend">

                                                    <span class="input-group-text" id="basic-addon5">DOB</span>

                                                  </div>

                                                  

                                                  <input type="date" id="start" name="trip-start" min="1900-01-01" max="<? echo date("Y-m-d");?>">
                                                </div>

												

												



												<input type="hidden" name="date" placeholder="" value="<? echo date("d-m-Y");?>" />







                                







                                <div class="d-sm-flex justify-content-between">



                                    <div class="field-wrapper">



                                        <button type="submit" class="btn btn-primary" value="">Create Account</button>



                                    </div>



                                </div>







                               







                                







                            </div>



                        </form>



						<? }?>



						<? if($action=="voucher"){ 



						$member_id=$_REQUEST['member_id'];



						?>



						<div class="form">



						<p>



											<b><font size="+1">Thankyou For Registering with<br />



										   www.lixo.io <br/>



											 Your Registration has been Received<br /><br />



											If You would like to view your Registration Details,<br />You can check your Email/Mobile <br />or you can login to see your details



											</font></b><br /><br />



											



											<!--<a style="padding: 10px;margin: 20px 10px;background: #0ba360;border-radius: 10px;" 



									href="#" onClick="window.open('join_voucher.php?member_id=<? //print base64_encode($member_id);?>', '','width=950,height=650,scrollbars=yes,resizable=no,toolbar=yes,directories=no,location=no,menubar=no,status=no,left=50,top=0'); return true;" />



									<font size="+1">Joining Slip</font>



								</a>-->



											</p>



						</div>



						<? } ?>







                    </div>                    



                </div>



            </div>



        </div>



    </div>






    



    <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->



    <script src="assets/js/libs/jquery-3.1.1.min.js"></script>



    <script src="bootstrap/js/popper.min.js"></script>



    <script src="bootstrap/js/bootstrap.min.js"></script>



    



    <!-- END GLOBAL MANDATORY SCRIPTS -->



    <script src="assets/js/authentication/form-2.js"></script>







</body>



</html>





<?php



	

if($action=="process")



{



















 $member_id=$_REQUEST['member_id'];



//$member_id=strtoupper($member_id);







 $intro_id=$_REQUEST['intro_id'];







 $_SESSION['intro_id']=$intro_id;







		$name=$_REQUEST['name'];



$_SESSION['name']=$name;



$position=$_REQUEST['position'];







 $serial=$_REQUEST['serial'];







 $number=$_REQUEST['number'];







$address=$_REQUEST['address'];







if($address==""){$address="NULL";}















if($address!=""){$_SESSION['address']=$address;}







$pin=$_REQUEST['pin'];



if($pin==""){$pin="NULL";}



if($pin!=""){$_SESSION['pin']=$pin;}



$country=$_REQUEST['country'];



if($country==""){$country="NULL";}



$email=$_REQUEST['email'];



if($email==""){$email="NULL";}



if($email!=""){$_SESSION['email']=$email;}



$city=$_REQUEST['city'];



if($city==""){$city="NULL";}



if($city!=""){$_SESSION['city']=$city;}



$dist_type=$_REQUEST['dist_type'];



$joining_date=$_REQUEST['date'];



$pack_id=$_REQUEST['pack_id'];



$retail_type=$_REQUEST['retail_type'];



if($retail_type==""){$retail_type="NULL";}



$admin_id=$_SESSION['admin_id'];



$jn_date=explode("-",$joining_date);



$dtt=$jn_date[2]."-".$jn_date[1]."-".$jn_date[0];



$dt_val=$jn_date[2].$jn_date[1].$jn_date[0];



$jn_month=$jn_date[2].$jn_date[1];



$jn_time=date("h:m:s A");







	$pan=$_REQUEST['pan'];		







if($pan==""){$pan="APPLIED";}



$pan=strtoupper($pan);



$aadhar_no=$_REQUEST['aadhar_no'];



if($aadhar_no==""){$aadhar_no="APPLIED";}



if($aadhar_no!=""){$_SESSION['aadhar_no']=$aadhar_no;}



 $nominee=$_REQUEST['nominee'];







if($nominee==""){$nominee="NULL";}



if($nominee!=""){$_SESSION['nominee']=$nominee;}



$rel=$_REQUEST['rel'];







if($rel==""){$rel="NULL";}



if($rel!=""){$_SESSION['rel']=$rel;}



	$payee_name=$_REQUEST['payee_name'];



if($payee_name==""){$payee_name="NULL";}



$bank_name=$_REQUEST['bank_name'];



if($bank_name==""){$bank_name="NULL";}



$bk_address=$_REQUEST['b_address'];



if($bk_address==""){$bk_address="NULL";}



$acc=$_REQUEST['acc'];



if($acc==""){$acc="NULL";}



$ifcs=$_REQUEST['ifcs'];



if($ifcs==""){$ifcs="NULL";}



$acc_type=$_REQUEST['acc_type'];



if($acc_type==""){$acc_type="NULL";}



$mob=$_REQUEST['mob'];



if($mob==""){$mob="NULL";}	





$pack_id=0;











			  $query = $mysqli->prepare('SELECT * FROM member where member_id=?');











								$query->bind_param("s", $member_id);











						$query->execute();







						$query->store_result();







						$no=$query->num_rows;







			  if($no!=0)







			  {















			  $_SESSION['msg_box2']="Member ID Already Exist.Try Again.";









header("location:new_register.php?tab_id=tab1&default=new_register");









			  }







			  else











			  {



			  $own_member_id=$_SESSION['member_id'];



			 







													







			  $query2 = $mysqli->prepare('SELECT * FROM member where member_id=?');







								$query2->bind_param("s", $intro_id);







						$query2->execute();











						$query2->store_result();







						$no2=$query2->num_rows;



						



						$qury=$mysqli->prepare("select direct_join,id  from member where member_id=?");







								 $qury->bind_param("s", $intro_id);







								 $qury->execute();







								  $qury->bind_result($direct_join,$id);







								  while($qury->fetch())











									{































									$prt_id=$id;































									$drt_jnn=$direct_join;































									}



									



			   if($no2==0)































				  {































				  $_SESSION['msg_box2']="No Such Introducer Id Is Available.Try Again.";







header("location:new_register.php?tab_id=tab1&default=new_register");















				  }







				  else















				  {



				  






				  

 $queryymob = $mysqli->prepare('SELECT * FROM user where email=?');

                        $queryymob->bind_param("s", $email);

						$queryymob->execute();

						$queryymob->store_result();

						$no_moben=$queryymob->num_rows;

						



	  







				 



$idd33=$prt_id;  



				  















$sts="y";



					$query3=$mysqli->prepare("select direct_join, intro_no  from member where member_id=?");







								 $query3->bind_param("s", $intro_id);







								 $query3->execute();







								  $query3->bind_result($direct_join,$intro_no);







								  while($query3->fetch())















									{































									$direct_join=$direct_join;































									$intro_no=$intro_no;































									}



















				































		            































					$sp_intro_no=$intro_no;































					$sp_intro_no=$sp_intro_no+$direct_point;































					if($sp_intro_no>2){$spill="yes";}else{$spill="no";}































					// $intro_name=$intro_title." ".$intro_frname." ".$intro_midname." ".$intro_lstname;































					































						































						 $tot_query = $mysqli->prepare('SELECT * FROM member where member_id=?');



						$tot_query->execute();



						$tot_query->store_result();



						$total_unit=$tot_query->num_rows;







						$total_unit=total_unit+1; 








$dob=$_REQUEST['trip-start'];

if($dob==""){$dob="NULL";}




	



$pwd=$_REQUEST['pwd'];



$tpwd=$_REQUEST['tpwd'];	



$active="n";

$dist_type="M";

$pack_id=0;			

$login_otp= mt_rand (1001, 9999);

$insert=$mysqli->prepare("insert into member (member_id, intro_id, parent_id, name, total_unit, join_month, date_val, joining_date, address, country, dist_type, password, t_password,pack_id,active,login_otp,mob) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");









//echo $member_id."@".$intro_id."@".$prt_id."@".$name."@".$total_unit."@".$jn_month."@".$dt_val."@".$joining_date."@".$address."@".$country."@".$dist_type."@".$pwd,$tpwd."@".$pack_id."@".$active."@".$login_otp."@".$mob;





	$insert->bind_param("sssssssssssssssss", $member_id, $intro_id, $prt_id, $name, $total_unit, $jn_month, $dt_val, $joining_date, $address, $country, $dist_type, $pwd,$tpwd, $pack_id,$active,$tpwd,$mob);







$insert->execute();







$insert2=$mysqli->prepare("insert into user (member_id, username, password, first_name, address, pin, joining_date, joining_time, email, city,dob) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");



	$insert2->bind_param("sssssssssss", $member_id, $member_id, $pwd, $name, $address, $pin, $joining_date, $jn_time, $email, $city,$dob);











$insert2->execute();



















//----------------------------------------Package    Update-----------------//



$member_id=$_REQUEST['member_id'];



$pack_id=$_REQUEST['pack_id'];







										













$name=$name;



$member_id=$_REQUEST['member_id'];



  



 $mob=$_REQUEST['mob'];



 /*$msgtext="Hello%20".$name."%20Welcome%20to%20Tradebitpay%20Group.%20Your%20ID%20".$member_id."%20and%20password%20".$pwd."%20and%20LOGIN%20PIN%20".$login_otp;





  $mob=$_REQUEST['mob'];

  $url ="http://sms.kiyasoftechsolution.in/api/sendhttp.php?authkey=231776A7aeXzbzB7l35b72e489&mobiles=$mob&message=$msgtext&sender=TRDBIT&route=4";

					$ch = curl_init($url);

					curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

					$curl_scraped_page = curl_exec($ch);

					curl_close($ch);

					 $curl_scraped_page;







*/







$to = $email;

$subject = 'Login Details';

$from = 'support@lixo.io';

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";



$headers .= 'From: '.$from."\r\n".

'Reply-To: '.$from."\r\n" .

'X-Mailer: PHP/' . phpversion();



$message = 'Dear ';







$message .=$name;



$message .= '<br><br>';



$message = 'Welcome To www.lixo.io ';



$message .= '<br>';



$message = 'Your Registration was Successfull with us ';



$message .= '<br><br>';



$message = 'Please note your Login information ';



$message .= '<br><br>';



$message .='YOUR USER ID : ';







$message .=$member_id;



$message .= '<br>';



$message .='PASSWORD IS : ';







$message .=$pwd;



$message .= '<br>';



$message .='AND YOUR T-PASSWORD IS : ';







$message .=$tpwd;

$message .= '<br><br>';

$message .='Regards,';

$message .= '<br><br>';

$message .= 'www.lixo.io';

$message .= '<br><br>';

$message .='Please do not reply to this email. Emails sent to this address will not be answered.';



if(mail($to, $subject, $message, $headers)){

 echo 'Your mail has been sent successfully.';







} else{



 echo 'Unable to send email. Please try again.';



}



















 unset($_SESSION['intro_id']);















unset($_SESSION['name']);











unset($_SESSION['address']);















unset($_SESSION['email']);















unset($_SESSION['pin']);







unset($_SESSION['mob']);



unset($_SESSION['city']);



unset($_SESSION['pan']);



unset($_SESSION['aadhar_no']);



unset($_SESSION['nominee']);



unset($_SESSION['rel']);



























unset($_SESSION['date']);	



























$member_id=$_REQUEST['member_id'];











 $_SESSION['msg_box2']="New Distributor Added Successfully.";	











header("location:new_register.php?member_id=$member_id&action=voucher");

















//header("location:register.php?tab_id=tab1&default=register");



































}





}



}



?>  