<?php

namespace App\modele;

use App\metier\Alumni;
use App\metier\Offre;

class MembreModele extends UtilisateurModele
{


    /**
     * @description modifier photo de profil
     */
    public function updateProfilPhoto() : bool
    {
        // TO DO
        return false;
    }

    /**
     * @description ajouter formation
     */
    public function addFormation() : bool
    {
        // TO DO
        return false;
    }


    /**
     * @description modifier formation
     */
    public function updateFormation() : bool
    {
        // TO DO
        return false;
    }

    /**
     * @description ajouter Experience
     */
    public function addExperience() : bool
    {
        // TO DO
        return false;
    }

    /**
     * @description modifier experience
     */
    public function updateExpereience() : bool
    {
        // TO DO
        return false;
    }

    /**
     * @description changer mot de passe
     * @param string $oldHash ancien hash
     * @param string $newHash nouveau hash
     */
    public function updatePasswd(string $oldHash,string $newHash) : bool
    {
        // TO DO
        return false;
    }



    public function publishOffer(string $img, string $logo)
    {
        $desc = $_POST["description"];
        $descposte = $_POST["descriptPoste"];
        $nom = $_POST["name"];
        $ville = $_POST["ville"];
        $entreprise = $_POST["entreprise"];
        $profilRecherche = $_POST["profilRecherche"];
        $mail = $_POST["mail"];
        $num = $_POST["num"];
        $site = $_POST["site"];
        $exp = $_POST["choixExp"];
        $typeContrat = $_POST["typeContrat"];
        $niveauEtudes = $_POST["education"];
        $date = new \DateTime();

        if(isset($_POST["fullRemote"]))
        {
            $remote = true;
        }
        else $remote = false;

        // à la place de NULL passer id utilisateur créateur offre
        $offre = new Offre($this->offreGw->getNewId(),
            new Alumni("test.mail@icloud.fr","password","admin","prenom","nom"),
            $nom,
            $desc,
            $img,
            $logo,
            $typeContrat,
            $ville,
            $entreprise,
            $descposte,
            $profilRecherche,
            $exp,
            $niveauEtudes,
            $mail,
            $num,
            $site,
            $remote,
            $date);

        $this->offreGw->addOffers($offre);

        return $offre;

    }


}