<?php
include("../connect.php"); 
$response = array();
if(isset($_POST['new_password']) && isset($_POST['user_id']) && isset($_POST['type']))
{
	date_default_timezone_set('Asia/Calcutta');
	$scro = date("h:i:sa");
	$da  = date("Y-m-d");
	$cdateTime=date("Y-m-d H:i:s");
	$new_pass = $_POST['new_password']; 
	$type = $_POST['type']; 
	$user_id = $_POST['user_id']; 
	if($type=="Admin")
	{
		  $uq1=mysqli_query($con,"update tbl_distributor_users set password='$new_pass',update_datetime='$cdateTime' where distributor_id='$user_id'");
	}
	else
	{
		$uq1=mysqli_query($con,"UPDATE tbl_master_customer SET password='$new_pass',update_datetime='$cdateTime' where customer_id='$user_id'");	
	}
	$response['success']='1';
	$response['details']="Your password successfully changed.!!";
}
else
{
	$response['success']='0';
	$response['details']="Required field missing";
}	
echo json_encode($response);

?>