ok

Mini Shell

Direktori : /proc/thread-self/root/home2/selectio/www/subamangala/api/
Upload File :
Current File : //proc/thread-self/root/home2/selectio/www/subamangala/api/create_process.php

<?php
include "../config/config.php";
//include "upload/upload.php";
$broid='';


error_log("The Register Form Is Inserted");
if(isset($_GET['bname']) && $_GET['bname']!=""){


error_log("The Register Bname");

		//mysql_query ("set character_set_results='utf8'");
						//echo utf8_encode('<h3 style="color:#000;">'.$_GET['bname'].'</h3>');
						
	//mysql_query("SET NAMES utf8");
	//mysql_query ("set character_set_results='utf8'");
	$regtype =  trim($_GET['regtype']); 
	$gender =  trim($_GET['gender']); 
	$regnop =  trim($_GET['regnop']); 
	$brokertype='';$brokername='';
	if(!empty($_GET['brokertype'])){
	
	$brokertype =  $_GET['brokertype'];
	
	}
	if(!empty($_GET['brokername'])){
	
	$brokername = $_GET['brokername'];
	
	}
	 
	$binit =  trim($_GET['binit']); 
	$bname =  trim($_GET['bname']); 
	$dinit =  trim($_GET['dinit']);
	$dname =  trim($_GET['dname']); 
	//$edu_dep =  trim($_GET['edu_dep']); 
	$edu =  trim($_GET['edu']); 
	$edu_cat =  trim($_GET['edu_cat']); 
	$job =  trim($_GET['job']); 
	$job_cat =  trim($_GET['job_cat']); 
	$job_place =  trim($_GET['job_place']); 
	$job_company =  trim($_GET['job_company']); 
	$income =  trim($_GET['income']); 
	$cellno =  trim($_GET['cellno']); 
	$whatsapp_no =  trim($_GET['whatsapp_no']); 
	$email =  trim($_GET['email']); 
	$regdate =   $_GET['regdate1']."-".$_GET['regdate2']."-".$_GET['regdate3']; 
	
	$dob =  $_GET['dob1']."-".$_GET['dob2']."-".$_GET['dob3']; 
	$day =  trim($_GET['day']); 
	$time =  trim($_GET['time']); 
	$meridian =  trim($_GET['meridian']); 
	$tyear =  trim($_GET['tyear']); 
	$tdate =  trim($_GET['tdate']); 
	$month =  trim($_GET['month']); 
	$height =  trim($_GET['height']); 
	$height_cat =  trim($_GET['height_cat']); 
	$color =  trim($_GET['color']); 
	 
	$weight=0;
	if($_GET['weight']=='')
	{
		$weight=0;
		
		error_log("Weight Is Nulled");
	}
	else
	{
		$weight = $_GET['weight'];
		error_log("Weight Is Not Nulled");
	}
	$weight_cat =  trim($_GET['weight_cat']); 
	@$marriage =  trim($_GET['marriage']); 
	@$mar2status =  trim($_GET['mar2status']); 
	@$child =  trim($_GET['child']); 
	
	$physical_hand =  trim($_GET['physical_hand']); 
	$photo_ex =  trim($_GET['photo_ex']); 
	@$father_abs =  trim($_GET['father_abs']); 
	@$mother_abs =  trim($_GET['mother_abs']); 
	@$bro_abs =  trim($_GET['bro_abs']); 
	$business_opt =  trim($_GET['business_opt']);
	$foreign_opt =  trim($_GET['foreign_opt']); 
	$native_place =  trim($_GET['native_place']); 
	$birth_place =  trim($_GET['birth_place']); 
	$father_place =  trim($_GET['father_place']); 
	$mother_place =  trim($_GET['mother_place']); 
	$father_name =  trim($_GET['father_name']); 
	$father_dname =  trim($_GET['father_dname']); 
	$father_job =  trim($_GET['father_job']); 
	$mother_name =  trim($_GET['mother_name']); 
	$mother_dname =  trim($_GET['mother_dname']); 
	$mother_job =  trim($_GET['mother_job']); 
	$wealth_class =  trim($_GET['wealth_class']); 
	$family_idty =  trim($_GET['family_idty']); 
	$no_birth =  trim($_GET['no_birth']); 
	$no_bro =  trim($_GET['no_bro']); 
	$no_sis =  trim($_GET['no_sis']); 
	$no_sisy =  trim($_GET['no_sisy']); 
	$no_broy =  trim($_GET['no_broy']); 
	$no_bro_mar =  trim($_GET['no_bro_mar']); 
	$no_sis_mar =  trim($_GET['no_sis_mar']); 
	$no_sisy_mar =  trim($_GET['no_sisy_mar']); 
	$no_broy_mar =  trim($_GET['no_broy_mar']); 
	$with_birth =  trim($_GET['with_birth']); 
	$mar_nos =  trim($_GET['mar_nos']); 
	$wealth_det =  trim($_GET['wealth_det']); 
	$tidy =  trim($_GET['tidy']); 
	
	$caste =  trim($_GET['caste']);
	$casteid =  $_GET['casteid'];
	$subcaste =  trim($_GET['subcaste']);
	$subcasteid =  $_GET['subcasteid'];
	
	
	$ancestry =  trim($_GET['ancestry']); 
	$family_god =  trim($_GET['family_god']); 
	$fg_place =  trim($_GET['fg_place']); 
	
	$batcham =  trim($_GET['batcham']); 
	$thithi =  trim($_GET['thithi']); 
	$natchatram =  trim($_GET['natchatram']); 
	$padham =  trim($_GET['padham']); 
	
	$laknam =  trim($_GET['laknam']); 
	$rasi =  trim($_GET['rasi']); 
	$dhisa =  trim($_GET['dhisa']); 
	$dyears =  trim($_GET['dyears']); 
	
	$dmonth =  trim($_GET['dmonth']); 
	$ddays =  trim($_GET['ddays']); 
	$family_hint =  trim($_GET['family_hint']); 
	$astrotype =  trim($_GET['astrotype']); 
	$caste_restrict='';$astro_option='';
	if(!empty($_GET['caste_restrict'])){
	$caste_restrict =  trim($_GET['caste_restrict']); 
	}
	if(!empty($_GET['astro_option'])){
	$astro_option =  trim($_GET['astro_option']); 
	}
	
	
	
	$addr1 =  trim($_GET['address']); 
	
	$rasi1_laknam =  trim($_GET['rasi_laknam']); 
	$rasi1 =  trim($_GET['rasi1']); 
	$rasi2 =  trim($_GET['rasi2']); 
	$rasi3 =  trim($_GET['rasi3']); 
	$rasi4 =  trim($_GET['rasi4']); 
	
	$rasi5 =  trim($_GET['rasi5']); 
	$rasi6 =  trim($_GET['rasi6']); 
	$rasi7 =  trim($_GET['rasi7']); 
	$rasi8 =  trim($_GET['rasi8']); 
	
	$rasi9 =  trim($_GET['rasi9']); 
	$rasi10 =  trim($_GET['rasi10']); 
	$rasi11 =  trim($_GET['rasi11']); 
	$rasi12 =  trim($_GET['rasi12']); 
	
	
	$nav1_laknam =  trim($_GET['nav_laknam']); 
	$nav1 =  trim($_GET['nav1']); 
	$nav2 =  trim($_GET['nav2']); 
	$nav3 =  trim($_GET['nav3']); 
	$nav4 =  trim($_GET['nav4']); 
	
	$nav5 =  trim($_GET['nav5']); 
	$nav6 =  trim($_GET['nav6']); 
	$nav7 =  trim($_GET['nav7']); 
	$nav8 =  trim($_GET['nav8']); 
	
	$nav9 =  trim($_GET['nav9']); 
	$nav10 =  trim($_GET['nav10']); 
	$nav11 =  trim($_GET['nav11']); 
	$nav12 =  trim($_GET['nav12']); 
	$file_n=$_GET['filename'];
	$date = date('Y-m-d H:i:s');
	
	
	if(isset($_FILES['image']) && $_FILES["image"]["size"] > 0){
      $errors= array();
      $file_name = $_FILES['image']['name'];
      $file_size =$_FILES['image']['size'];
      $file_tmp =$_FILES['image']['tmp_name'];
      $file_type=$_FILES['image']['type'];
	  
      $file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
      
     $expensions= array("jpeg","jpg","png","gif");
      
      if(in_array($file_ext,$expensions)=== false){
         $errors[]="extension not allowed, please choose a JPEG or PNG oR GIF file.";
      }
      
      if($file_size > 2097152){
         $errors[]='File size must be less than or equal to 2 MB';
      }
      
      if(empty($errors)==true){
         move_uploaded_file($file_tmp,"img-upload/".$file_name);
         echo "Success";
      }else{
         print_r($errors);
      }
   }
   else
   {
	   $file_name = ""; 
	   
   }
   
	
	
	$rasi_kattam='';
	if($regtype!="N")
	{
		mysqli_set_charset($con,"utf8");
		$sql = "insert into rasi (laknam,rasi1,rasi2,rasi3,rasi4,rasi5,rasi6,rasi7,rasi8,rasi9,rasi10,rasi11,rasi12) values('$rasi1_laknam','$rasi1','$rasi2','$rasi3','$rasi4','$rasi5','$rasi6','$rasi7','$rasi8','$rasi9','$rasi10','$rasi11','$rasi12')"; //echo "Default character set is: ". $charset;
		mysqli_query($con,$sql);	
	$rasi_kattam = $con->insert_id;
	}
	$nav_kattam='';
	if($regtype!="N")
	{
	    
	    error_log("Register Type".$regtype);
		mysqli_set_charset($con,"utf8");
		$sql = "insert into nav (laknam,nav1,nav2,nav3,nav4,nav5,nav6,nav7,nav8,nav9,nav10,nav11,nav12) values('$nav1_laknam','$nav1','$nav2','$nav3','$nav4','$nav5','$nav6','$nav7','$nav8','$nav9','$nav10','$nav11','$nav12')"; //echo "Default character set is: ". $charset;
		mysqli_query($con,$sql);	
	    $nav_kattam = $con->insert_id;
	}
	
	$expectation =  trim($_GET['expectation']);
    $caste_wish   =  trim($_GET['caste_wish']);
    $rname   =  trim($_GET['rname']);
    $expect_rasi='';
    if(!empty($_GET['expect_rasi'])){
    $expect_rasi =  trim(implode(",",$_GET["expect_rasi"]));
	}
	
	
	$status =  1;
	$created_by=1;
	/*
	if($casteid=="")
	{
	   // echo $caste;
	   // mysqli_set_charset($con,"utf8");
		
		$query="insert into caste(name,status)values('$caste','')";
		mysqli_query($con,$query);
		$casteid = $con->insert_id;
	}
	
	if($subcasteid=="")
	{
		//mysqli_set_charset($con,"utf8");
		$sql = "insert into subcaste (casteid,name,status) values('$casteid','$subcaste','')"; //echo "Default character set is: ". $charset;
		mysqli_query($con,$sql) or die("Not Connected sub");	
		$subcasteid = $con->insert_id;
	}
	*/
	mysqli_set_charset($con,"utf8");
	//wealth class,family_idty to be added;
	
	error_log("The Inserted Query Is Start Here");
	$r=$rasi_kattam;
	$n=$nav_kattam;
	$sql = "insert into profiles(regtype,gender,regnop,broker_ids,brokercount,brokername,brokertype,binit,bname,dinit,dname,edu_dep,edu,edu_cat,
	job,job_cat,job_place,job_company,monthly_income,cellno,whatsapp_no,email,regdate,addr1,addr2,dob,day,time,meridian,month,tyear,tdate,height,
	height_cat,color,weight,weight_cat,marriage,child,marstatus2,physical_hand,photo_ex,father_abs,mother_abs,bro_abs,business_opt,foreign_opt,native_place,
	birth_place,father_place,mother_place,father_name,father_dname,father_job,mother_name,mother_dname,mother_job,wealth_class,family_idty,no_birth,photo,
	with_birth,no_bro,no_sis,no_sisy,no_broy,no_bro_mar,no_sis_mar,no_sisy_mar,no_broy_mar,mar_nos,wealth_det,tidy,caste,subcaste,ancestry,family_god,
	fg_place,batcham,thithi,natchatram,padham,laknam,rasi,dhisa,dyears,dmonth,ddays,family_hint,astrotype,caste_restrict,astro_option,rasi_kattam,nav_kattam,
	expectation,caste_wish,registeredby,expect_rasi,status,updated_on,created_by,password,loginstatus,fullphoto,pre_status,Total_Matches) 
    values('$regtype','$gender','$regnop','','','','','$binit','$bname','$dinit','$dname','','$edu','$edu_cat','$job','$job_cat','$job_place','$job_company','$income','$cellno',
	'$whatsapp_no','$email','$regdate','$addr1','','$dob','$day','$time','$meridian','$month','$tyear','$tdate','$height','$height_cat','$color','$weight','$weight_cat','$marriage',
	'$child ','$mar2status','$physical_hand','$photo_ex','$father_abs','$mother_abs','$bro_abs','$business_opt','$foreign_opt','$native_place','$birth_place','$father_place',
	'$mother_place','$father_name','$father_dname',	'$father_job','$mother_name','$mother_dname','$mother_job','$wealth_class','$family_idty','$no_birth','$file_name','$with_birth',
	'$no_bro','$no_sis','$no_sisy','$no_broy','$no_bro_mar','$no_sis_mar','$no_sisy_mar','$no_broy_mar','$mar_nos','$wealth_det','$tidy','$caste','$subcaste','$ancestry','$family_god',
	'$fg_place','$batcham','$thithi','$natchatram','$padham','$laknam','$rasi','$dhisa','$dyears','$dmonth','$ddays','$family_hint','$astrotype','$caste_restrict','$astro_option','$r',
	'$n','$expectation','$caste_wish','$rname','$expect_rasi','$status','$date','1','','Disable','','Not Set','0')"; //echo "Default character set is: ". $charset;
	//echo $sql;
	
	error_log("Inserted Query In Sql".$sql);
	$res=mysqli_query($con,$sql) or die("fali");	
	$last_id = $con->insert_id;
	$q="update profiles set password='$last_id' where id='$last_id'";
	mysqli_query($con,$q) or die("uerr");
	/*echo $last_id."<br>";
	echo count($_GET['brokername']);
	
	echo $_GET['is_phone'][1];*/
	$count = count($_GET['brokername']);
	
	if($res)
	{
		if($count>0)
	{
		/*if($count==1)
			{
				$brokername = $_GET['brokername'][$i];
				$brokertype = $_GET['brokertype'][$i];
				$is_phone = $_GET['is_phone'][$i];
				$profid = $_GET['profid'][$i];
			}
		else
		{*/
			for($i=0;$i<$count;$i++)
			{
				if($_GET['brokername'][$i]!="")
				{
				
					$brokername = preg_replace('!\s+!', ' ', $_GET['brokername'][$i]);
					$brokertype = $_GET['brokertype'][$i];
					$is_phone = $_GET['is_phone'][$i];
					if($is_phone==0)
					{
						$is_phone=0;
					}
					
					$profid = $_GET['profid'][$i];
					
					$cl = $i+1;
					$brokernamecl ="brokername".$cl;
					$brokertypecl = "brokertype".$cl;
					$is_phonecl = "is_phone".$cl;
					$profidcl = "profid".$cl;
					
					/*echo $_GET['brokername'][$i];*/
					
					/*$selq ="select * from brokers where brokername='$brokername'";
					$selr = mysqli_query($con,$selq);
					$rowcnt = mysqli_num_rows($selr);
					if($rowcnt>0)
					{
						$row = mysqli_fetch_assoc($selr);
						
						if($count==1)
						{
							$broid = $row['id'];
							
						}
						else if($count>1)
						{
							$broid .= $row['id'].",";
							
						}
				
						
					}
					else if($rowcnt==0)
					{*/
						mysqli_set_charset($con,"utf8");
						$sqlb = "insert into brokers (brokername,addr,phone_no,whatsapp_no,type,is_phone,profid,smprofid,status) values('$brokername','','','','$brokertype','$is_phone','$profid','$last_id','')"; //echo "Default character set is: ". $charset;
						//echo $sqlb;
						mysqli_query($con,$sqlb) or die("testing");	
						
						
						if($count==1)
						{
							$broid = $con->insert_id;
							
						}
						else if($count>1)
						{
							$broid .= $con->insert_id.",";
							
						}
					/*}
				*/
					
			}
				
		/*	}*/
		}
		
				mysqli_set_charset($con,"utf8");
				$broid = rtrim($broid,',');
				
				$sqlu = "update profiles set broker_ids='$broid',brokercount='$count' where id='$last_id'"; //echo "Default character set is: ". $charset;
				//echo $sqlu;
				mysqli_query($con,$sqlu) or die("uerr");	
				$url='http://fmsbilling.xyz/subamangala/login.php';
			echo '<script language="javascript">alert("Profile Create Successfully");location.href=\'' . $url . '\'</script>';
		
	}
	}
	else
	{
		echo '<script language="javascript">alert("Insert Not Successfully");location.href=\'' . $_SERVER['HTTP_REFERER'] . '\'</script>';
	}
	
	/*echo $sql;
	exit;*/
	
	$flag =1;
			
					
} 
?>

Zerion Mini Shell 1.0