<?php
// array for JSON response
$response = array();
//check for required fields
if (isset($_POST['LoginMobileNo'])){

      $LoginMobileNo = $_POST['LoginMobileNo'];

      // include db connect class
      require_once __DIR__ . '/DBConnect.php';

      $UpdatedDate = date("Y-m-d H:i:s");

      $sql = "SELECT       Account3Name.AcNameID, Account3Name.ClientUserID, Account3Name.AcMobileNo, Account3Name.UserRights, Account3Name.AcName, Client.ClientID,Client.Email,Client.WebSite,Client.BusinessDescriptions,Client.CompanyName, Client.CompanyAddress,Client.CBEditCharges,Client.CBEntryCharges,Client.BillEditCharges,Client.BillEntryCharges,Client.CountryUserID, Client.CountryClientID,Project.ProjectID, Project.ProjectName
FROM            Account3Name INNER JOIN
                         Client ON Account3Name.ClientID = Client.ClientID INNER JOIN
                         Project ON Client.ProjectID = Project.ProjectID
WHERE        (Account3Name.AcMobileNo = '$LoginMobileNo') AND (Account3Name.UserRights <> N'NotAllowLogin')";
     $stmt = $conn->prepare($sql);
			$stmt->execute();
			$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
	if($result!=null &&  $result>0){
        $response["ShadiHall"] = array();
        foreach($result as $row) { 
            
		  $ShadiHall["AcNameID"] = $row["AcNameID"];
		  $ShadiHall["ClientUserID"] = $row["ClientUserID"];
          $ShadiHall["AcMobileNo"] = $row["AcMobileNo"];
          $ShadiHall["UserRights"] = $row["UserRights"];
          $ShadiHall["AcName"] = $row["AcName"];
          $ShadiHall["ClientID"] = $row["ClientID"];
          $ShadiHall["CompanyName"] = $row["CompanyName"];
          $ShadiHall["CompanyAddress"] = $row["CompanyAddress"];
          $ShadiHall["ProjectID"] = $row["ProjectID"];
          $ShadiHall["ProjectName"] = $row["ProjectName"];
          $ShadiHall["CBEditCharges"] = $row["CBEditCharges"];
          $ShadiHall["CBEntryCharges"] = $row["CBEntryCharges"];
          $ShadiHall["BillEditCharges"] = $row["BillEditCharges"];
          $ShadiHall["BillEntryCharges"] = $row["BillEntryCharges"];
          $ShadiHall["CountryUserID"] = $row["CountryUserID"];
          $ShadiHall["CountryClientID"] = $row["CountryClientID"];
          $ShadiHall["email"] = $row["Email"];
          $ShadiHall["website"] = $row["WebSite"];
          $ShadiHall["businessDesc"] = $row["BusinessDescriptions"];


          // push single product into final response array
    			array_push($response["ShadiHall"], $ShadiHall);
        }
        // success
    		$response["success"] = 1;
		  $response["message"] = "Success";
        // echoing JSON response
    		echo json_encode($response);
      }else{
		  $response["success"] = 0;
      $response["message"] = $LoginMobileNo." Not Register";
	// echoing JSON response
    		echo json_encode($response);
	  }
    }else {
      $response["success"] = 0;
      $response["message"] = "Please Send AcMobileNo";
	// echoing JSON response
    		echo json_encode($response);
    }
?>
