<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$admin = $_SESSION["admin_" . $dbname];

if (isset($_REQUEST['architect'])) {
    $architect = $_REQUEST['architect'];

    $query2 = "SELECT * FROM `accmast` WHERE accode ='$architect'";
    $result2 = mysqli_query($conn, $query2) or die(mysqli_error($conn));
    $r2 = mysqli_fetch_assoc($result2);
    
    

    $rows = array();
    $ctr = 0;
    $rows = array('success' => true,
        'commperc'   => "$r2[commperc]",
        'commsqft'   => "$r2[commsqft]",
        'add2'   => "$r2[add2]",
        'add3'   => "$r2[add3]",
        'mobile'   => "$r2[mobile]");

    header("Content-type: application\json");
    echo json_encode($rows);
}