<?php
class Empleado {
    private $conn;
    private $table = "templeado";

    public $nroDocumento;
    public $clave;

    public function __construct($db) {
        $this->conn = $db;
    }

    public function login() {
        $query = "SELECT codempleado, apellidopaterno, apellidomaterno, nombres,  nroDocumento 
                 FROM " . $this->table . " 
                 WHERE nroDocumento = :nroDocumento AND clave = :clave";

        $stmt = $this->conn->prepare($query);
        
        $stmt->bindParam(":nroDocumento", $this->nroDocumento);
        $stmt->bindParam(":clave", $this->clave);

        $stmt->execute();
        return $stmt;
    }
}
