<?php
namespace App\Controllers;
// use App\Models\VinDescriptionModel;
use Config\Services;
//use Firebase\JWT\JWT;

class Edituser extends BaseController{
    private $dbx;

    public function index(){
    	$error = 1 ;
        $this->dbx   = \Config\Database::connect();
        $uid = $this->request->getVar('uid');
		$data = [
			'firstname' 		=> $this->request->getVar('firstname'),
			'phone' 			=> $this->request->getVar('phone'),
			'password' 			=> $this->request->getVar('password')
		];

		$users = $this->dbx->table('fans');
		$r = $users->where('uid', $uid)->update($data);
	    $E = $this->dbx->error(); $error = $E['code'];
		
		$W = [];
		$W['status'] = $error;
		return json_encode($W, JSON_HEX_APOS | JSON_HEX_QUOT);
    }
}