MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/sb_web/b2432/valphp.dailyroll.org/
File Upload :
Current < : /hermes/sb_web/b2432/valphp.dailyroll.org/ws_account.php

<?php

/**
 * @author Ravi Tamada
 * @link http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ Complete tutorial
 */

require_once 'class_user.php';
$db = new USER();
$eventlog = EVENTLOG;
	function event_log($text){
	if(EVENTLOG == Y){
		$text=$uid."\t".$text;
		$file = "logs"."/".APP_NAME.date("Y-m-d").".log";
//$file = "logs/dailyroll".date("Y-m-d").".log";
		error_log(date("[Y-m-d H:i:s]")."\t[INFO][".basename(__FILE__)."]\t".$text."\r\n", 3, $file);
	}		
	}

// json response array
$response = array("error" => FALSE);

if (isset($_POST['user_id'])) {
	event_log("begining of login");
	
	$user_id = $_POST['user_id'];
	event_log($user_id);
	
	//echo $user_id = '5c2dcee2e21538.17188314';
	$id=$db->getUseridByUniq($user_id);
   $sql="SELECT * FROM  groups  WHERE  `account_status`='active' and   `added_user_id`='$id'group by account_id ";
	$stmt = $db->runQuery($sql);
	$stmt->execute();
	//echo$sql;
	event_log($sql);
	
	//$response =  array();
	//$x = 1;
	while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
		//print_r($user);
		$accountname=$db->get_account($row['account_id']);
		$data=[
		'account_id'=> $row['account_id'],
		 'accountname' =>$accountname
		 ];
		 $responsearray[] = $data;
		//print_$response);
		
		}						
		echo json_encode($responsearray);
		event_log(json_encode($responsearray));
    //$password = 'abc123';
  } else {
    // required post params is missing
    $response["error"] = TRUE;
    $response["error_msg"] = "Required parameters email or password is missing!";
	echo json_encode($response);
	event_log(json_encode($response));
        
}
?>