<?php
namespace App\Models;

use CodeIgniter\Model;

class myfitResetPass extends Model
{
    protected $db;
    public $con_name = 'mermsemr';

    public function __construct()
    {
        parent::__construct();
        $this->db = \Config\Database::connect($this->con_name);
    }

    /*
      Reset password will be in stages 

      STAGE 1 : Resquest _start password change - user get a code 
    */
    public function resetPass($in)
    {
        $change_state = $in['stage'];

        switch ($change_state) {
            case START_PASS_CHANGE:
                break;

            case CONFIRM_PASS_PIN:
                break;

            case CONFIRM_PASS_CHANGE:
                break;
        }

        $reminder_category = [];
        $sqlQ = 'SELECT * FROM members_resetpass';

        $query = $this->db->query($sqlQ);
        $data['resetpass_data'] = $query->getResultArray();
        return $inx = [
            'reminder_category' => $reminder_category,
            'reminders' => $data['resetpass_data'],
            'status' => 1,
            'raw_data' => $in,
        ];
    }
}
