<?php


namespace App\Models;

use \App\Maps\Model;

/**
*
*/
class Admins extends Model
{

    public static function read(string $username, string $password)
    {

    	global $db;

        $query = "SELECT * FROM admins WHERE admin_username = :username AND admin_password = :password ;";
        $parameters = [
            'username' => $username,
            'password' => $password
        ];

        return $db->run($query, $parameters);
    }
    
    public static function updatePassword($id, $password)
    {
        global $db;

        $query = "UPDATE admins SET admin_password = :password WHERE admin_id = :id ;";
        $parameters = [
            'password' => $password,
            'id' => $id
        ];

        return $db->count($query, $parameters);
    }

}
