<?php
require_once 'config.php';
//$error=false;
$errors=array();
$cities=array();
$status=0;
$user_id=$_POST['user_id'];
$query='SELECT * FROM users where id='.$user_id;

$row = mysqli_query($con,$query);
     
    if (mysqli_num_rows($row) == 1) {
		//$r=mysqli_fetch_array($row)	;
			
		$r=mysqli_fetch_array($row);
			
			 $query1='SELECT id FROM orders where user_id='.$user_id;
			 $row1 = mysqli_query($con,$query1);
			 if(mysqli_num_rows($row1) == 0){
				 $status=1;
			 }else{
				 $status=2;
			 }
			 
			 if($r['is_insta']==1){
				 $status=3;
				 $errors['insta_no']=$r['insta_no'];
				 $errors['pin']=$r['pin'];
			 }
			
		$errors['status']=$status;
		
		$errors['success']='user status';
    } else {
        
		$errors['success']='There is no buser';
    }
	echo json_encode($errors);
?>