<?php
include("../../db.php");
//header("Access-Control-Allow-Origin: * ");
header('Content-Type: application/json');

$session = $_GET["session"];

$cri = $db->getRows("select * from admin where session='$session'");

// 	$result_criteria = mysql_query($cri);
//   while ($rowp = mysql_fetch_assoc($result_criteria)) 	
foreach ($cri as $rowp) {
    $jsond[] = array("id" => $rowp['id'], "login_id" => $rowp['login_id'], "name" => $rowp['name'], "password" => $rowp['password'], "mobile" => $rowp['mobile'], "photo" => "media/photo/" . $rowp['photo']);

}

if ($jsond == null) {
    $jsond = array();
}


$json['status'] = 1;
$json['msg'] = "successful";
$json['data'] = $jsond;

if (is_array($json) && count($json) > 0) {
    echo json_encode($json);

} else {
    echo json_encode(array('status' => 0, 'msg' => 'data not found..!'));
}
