<commit_before><?php 

include_once "dbconnect.php";
require_once "../backend/patientModel.php";
include_once "../backend/Hospitalmodel.php";
require_once "../backend/employeeModel.php";



class Attendance(){


	public function attendance_patient($atendimento){
        try{
           $sql = "INSERT INTO attendance (admission_cause, admission_date_itu, patient, hospital, itu, doctor_responsible, data_final)  
       }
       VALUES (:causa, :data, :patient_id, :hospital_id, :itu_id, :doctor, )";

       $ghIdHospital = $atendimeto->getIdPatient();
       $ghIdUTI = $atendimeto->getIdUTI();
       $ghIdDoctor = $atendimeto->getIdEmployee();
       $ghIdPatient = $atendimeto->getIdPatient();
       $ghCausa = $atendimeto->getCausa();
       $ghDataAdm = $atendimeto->getDataAdm();


       $conn = new DbConnector();
       $stmt = $conn->getConn()->prepare($sql);
       $stmt->bindParam(':data', $ghDataAdm);
       $stmt->bindParam(':causa', $ghCausa);
       $stmt->bindParam(':patient_id', $ghIdPatient);
       $stmt->bindParam(':doctor', $ghDoctor);
       $stmt->bindParam(':hospital_id', $ghIdHospital);
       $stmt->bindParam(':itu_id', $ghIdUTI);


       $result = $stmt->execute();
       return $result;
   }
   catch(PDOExeption $e){
    return $result;
}
}


public function searchId($search){
    $sql = "SELECT * FROM patient WHERE id = :id_patient";
    $conn = new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':id_patient', $search);
    $stmt->execute();
    $result = $stmt->fetch(PDO::FETCH_OBJ);
    return $result;
}


public function searchPatientAll(){
  $sql = "SELECT * FROM patient";
  $conn = new DbConnector();
  $stmt = $conn->getConn()->prepare($sql);
  $stmt->execute();
  $result = $stmt->fetchAll(PDO::FETCH_OBJ);
  return $result;
}

public function searchPatient($filter){

    $sql = "SELECT id,name,social_security,health_insurance,responsible1,responsible2,FROM `odt_soft`.`patient`
    WHERE name LIKE :name OR surname LIKE :surname  OR social_security = :cpf OR health_insurance = :health_insurance OR responsible1 = :responsible_Name1 OR responsible2 =:responsible_Name2 OR email LIKE :email
    ORDER by patient.name;";


    $filter2 ="%".$filter."%";
    $conn= new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':name', $filter2);
    $stmt->bindParam(':surname',$filter2);
    $stmt->bindParam(':cpf', $filter);
    $stmt->bindParam(':health_insurance', $filter);
    $stmt->bindParam(':responsible_Name1', $filter);
    $stmt->bindParam(':responsible_Name2', $filter);
    $stmt->bindParam(':patient_email', $filter2);
    $stmt->execute();
    $result = $stmt->fetchAll(PDO::FETCH_OBJ);
    return $result;



}
public function search_id($search){

    $sql = "SELECT * FROM hospital WHERE id = :id_hospital";
    $conn = new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':id_hospital', $search);
    return $result = $stmt -> fetch(PDO::OBJ);
}

public function searchHospital($filter){


    $sql = "SELECT id,name, name_admin_itu, number_itu FROM `odt_soft`.`hospital`
    WHERE name LIKE :name OR name_admin_itu LIKE :name_admin_itu OR number_itu = :number_itu
    ORDER by hospital.name;";


    $filter2 ="%".$filter."%";
    $conn= new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':name', $filter2);
    $stmt->bindParam(':name_admin_itu',$filter2);
    $stmt->bindParam(':number_itu', $filter);
    $stmt->execute();
    
    $result = $stmt->fetchAll(PDO::FETCH_OBJ);
    return $result;
}


}

public function searchEmployee($filter) {

    $sql = "SELECT id, name, surname, cro, email, registration, phone, phone2, address, admission_date, social_security, bank, number_of_account, agency, permition
    FROM `odt_soft`.`users`
    WHERE name LIKE :name OR surname LIKE :surname OR social_security = :cpf OR permition = :permition OR registration = :registration OR email like :email OR cro = :cro
    ORDER BY name";
    $filter2 = "%".$filter."%";
    $conn =  new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':name', $filter2);
    $stmt->bindParam(':surname', $filter2);
    $stmt->bindParam(':cpf', $filter);
    $stmt->bindParam(':permition', $filter);
    $stmt->bindParam(':registration', $filter);
    $stmt->bindParam(':email', $filter2);
    $stmt->bindParam(':cro', $filter);
    $stmt->execute();
    $result = $stmt->fetchAll(PDO::FETCH_OBJ);


    return $result;
}

public function searchEmployeeById($filter) {
    $sql = "SELECT *
    FROM `odt_soft`.`users`
    WHERE id = :id";
    $conn =  new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':id', $filter);
    $stmt->execute();
    $result = $stmt-> fetch(PDO::FETCH_OBJ);
    return $result;

}


}

<commit_msg>dbatendance<commit_after><?php 

include_once "dbconnect.php";
require_once "../backend/patientModel.php";
include_once "../backend/Hospitalmodel.php";
require_once "../backend/employeeModel.php";



class Attendance(){


	public function attendance_patient($atendimento){
        try{
           $sql = "INSERT INTO attendance (admission_cause, admission_date_itu, patient, hospital, itu, doctor_responsible, data_final)  
       }
       VALUES (:causa, :data,:data_final, :patient, :hospital, :itu, :doctor, )";

       $gaPatient = $atendimeto->getIdPatient();
       $gaHospital = $atendimeto->getHospital();
       $gaUti = $atendimeto->getIdUTI();
       $gaEmployee = $atendimeto->getIdEmployee();
       $gaAdmissionCause = $atendimeto->getCausa();
       $gaAdmissionDate = $atendimeto->getDataAdm();
       $gaFinalDate = $atendimeto->getDataFinal();
       $gaDoctorResponsible = $atendimeto->getDoctorResponsible();


       $conn = new DbConnector();
       $stmt = $conn->getConn()->prepare($sql);
       $stmt->bindParam(':data', $gaAdmissionCause;
       $stmt->bindParam(':data_final', $gaFinalDate;
       $stmt->bindParam(':causa', $gaAdmissionCause);
       $stmt->bindParam(':patient', $gaPatient);
       $stmt->bindParam(':doctor', $gaDoctorResponsible);
       $stmt->bindParam(':hospital', $gaHospital);
       $stmt->bindParam(':itu', $gaUTI);


       $result = $stmt->execute();
       return $result;
   }
   catch(PDOExeption $e){
    return $result;
}
}


public function searchId($search){
    $sql = "SELECT * FROM patient WHERE id = :id_patient";
    $conn = new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':id_patient', $search);
    $stmt->execute();
    $result = $stmt->fetch(PDO::FETCH_OBJ);
    return $result;
}


public function searchPatientAll(){
  $sql = "SELECT * FROM patient";
  $conn = new DbConnector();
  $stmt = $conn->getConn()->prepare($sql);
  $stmt->execute();
  $result = $stmt->fetchAll(PDO::FETCH_OBJ);
  return $result;
}

public function searchPatient($filter){

    $sql = "SELECT id,name,social_security,health_insurance,responsible1,responsible2,FROM `odt_soft`.`patient`
    WHERE name LIKE :name OR surname LIKE :surname  OR social_security = :cpf OR health_insurance = :health_insurance OR responsible1 = :responsible_Name1 OR responsible2 =:responsible_Name2 OR email LIKE :email
    ORDER by patient.name;";


    $filter2 ="%".$filter."%";
    $conn= new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':name', $filter2);
    $stmt->bindParam(':surname',$filter2);
    $stmt->bindParam(':cpf', $filter);
    $stmt->bindParam(':health_insurance', $filter);
    $stmt->bindParam(':responsible_Name1', $filter);
    $stmt->bindParam(':responsible_Name2', $filter);
    $stmt->bindParam(':patient_email', $filter2);
    $stmt->execute();
    $result = $stmt->fetchAll(PDO::FETCH_OBJ);
    return $result;



}
public function search_id($search){

    $sql = "SELECT * FROM hospital WHERE id = :id_hospital";
    $conn = new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':id_hospital', $search);
    return $result = $stmt -> fetch(PDO::OBJ);
}

public function searchHospital($filter){


    $sql = "SELECT id,name, name_admin_itu, number_itu FROM `odt_soft`.`hospital`
    WHERE name LIKE :name OR name_admin_itu LIKE :name_admin_itu OR number_itu = :number_itu
    ORDER by hospital.name;";


    $filter2 ="%".$filter."%";
    $conn= new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':name', $filter2);
    $stmt->bindParam(':name_admin_itu',$filter2);
    $stmt->bindParam(':number_itu', $filter);
    $stmt->execute();
    
    $result = $stmt->fetchAll(PDO::FETCH_OBJ);
    return $result;
}


}

public function searchEmployee($filter) {

    $sql = "SELECT id, name, surname, cro, email, registration, phone, phone2, address, admission_date, social_security, bank, number_of_account, agency, permition
    FROM `odt_soft`.`users`
    WHERE name LIKE :name OR surname LIKE :surname OR social_security = :cpf OR permition = :permition OR registration = :registration OR email like :email OR cro = :cro
    ORDER BY name";
    $filter2 = "%".$filter."%";
    $conn =  new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':name', $filter2);
    $stmt->bindParam(':surname', $filter2);
    $stmt->bindParam(':cpf', $filter);
    $stmt->bindParam(':permition', $filter);
    $stmt->bindParam(':registration', $filter);
    $stmt->bindParam(':email', $filter2);
    $stmt->bindParam(':cro', $filter);
    $stmt->execute();
    $result = $stmt->fetchAll(PDO::FETCH_OBJ);


    return $result;
}

public function searchEmployeeById($filter) {
    $sql = "SELECT *
    FROM `odt_soft`.`users`
    WHERE id = :id";
    $conn =  new DbConnector();
    $stmt = $conn->getConn()->prepare($sql);
    $stmt->bindParam(':id', $filter);
    $stmt->execute();
    $result = $stmt-> fetch(PDO::FETCH_OBJ);
    return $result;

}


}


{'fraction_non_alphanumeric': 0.17855346544613218, 'fraction_numerical': 0.004023740066391711, 'mean_word_length': 4.0441400304414, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 130, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6241757', 'n_tokens_mistral': 3438, 'n_tokens_neox': 3301, 'n_words': 662}