<?php 
$conn = mysql_connect('localhost', 'akhilagya', 'abhinay@2018AB') or die ("connection not found");
	mysql_select_db('laabh') or die ("connection not found");

$uname=$_REQUEST["uname"];
$type=$_REQUEST["type"];
if($type=='reg'){
$sqlitm="select * from system_login where emailid = '$uname'";
							//echo $sqlc;
							$citm=mysql_query($sqlitm);
							if(mysql_num_rows($citm)>0){
						$row_itm=mysql_fetch_array($citm);

			 $array[] = $row_itm['emailid'];
			 
			/* $array[] =  $rows['advertisement_type_id'];
			  $array[] =  $rows['duration_type_id'];
			   $array[] =  $rows['rate'];
			    $array[] =  $rows['area_type_id'];
				 $array[] =  $rows['land_type_id'];
*/
				
			//echo $rows['rate'];
			
		}
	}	
	
	
	if($type=='log'){
$sqlitm="select * from system_login where emailid = '$uname'";
							
							$citm=mysql_query($sqlitm);
							if(mysql_num_rows($citm)>0){
						$row_itm=mysql_fetch_assoc($citm);
$user_id = $row_itm['id'];
$sql_ck="select * from tbl_user_status_and_plan where user_id = '$user_id' order by id desc limit 1";
							
							$res_ck=mysql_query($sql_ck);
							
						$row_ck=mysql_fetch_assoc($res_ck);
						$date=date('Y-m-d');
						if($date > $row_ck['expiry_date']){
						$result=1;
						}
						else{
						$result=2;
						}
			 $array[] = $result;
			
			
		}
	}	
	
	
		 echo json_encode($array);
?>

                  
               
 