- Posts: 27
- Thank you received: 1
//insertion des donnees dans la table jos_js_job_minicv
$ajout_minicv = \"INSERT INTO \".$db->nameQuote(\'#__js_job_minicv\').\" (time_date, profil_candidat, disponibilite_candidat, date_disponibilite_candidat, secteur_candidat, type_contrat_candidat, niveau_etudes_candidat, dernier_employeur_candidat, dernier_poste_candidat, date_fin_contrat_candidat, raison_fin_contrat_candidat, experience_candidat, mobilite_candidat, id_candidat) VALUES (\'$time_date\', \'$profil_candidat\', \'$disponibilite_candidat\', \'$date_disponibilite_candidat\', \'$activite_candidat\', \'$contrat_candidat\', \'$niveau_etudes_candidat\', \'$dernier_employeur_candidat\', \'$dernier_poste_candidat\', \'$date_fin_contrat_candidat\', \'$raison_fin_contrat_candidat\', \'$total_experience_candidat\', \'$mobilite_candidat\', \'$id_candidat\')\";
$db->setQuery ( $ajout_minicv ) or die(\'Erreur SQL jos_js_job_minicv!<br>\'.mysql_error());
//insertion des donnees dans la table jos_js_job_minicv
$ajout_minicv = \"INSERT INTO \".$db->nameQuote(\'#__js_job_minicv\').\" (time_date, profil_candidat, disponibilite_candidat, date_disponibilite_candidat, secteur_candidat, type_contrat_candidat, niveau_etudes_candidat, dernier_employeur_candidat, dernier_poste_candidat, date_fin_contrat_candidat, raison_fin_contrat_candidat, experience_candidat, mobilite_candidat, id_candidat) VALUES (\'$time_date\', \'$profil_candidat\', \'$disponibilite_candidat\', \'$date_disponibilite_candidat\', \'$activite_candidat\', \'$contrat_candidat\', \'$niveau_etudes_candidat\', \'$dernier_employeur_candidat\', \'$dernier_poste_candidat\', \'$date_fin_contrat_candidat\', \'$raison_fin_contrat_candidat\', \'$total_experience_candidat\', \'$mobilite_candidat\', \'$id_candidat\')\";
$db->setQuery ($ajout_minicv) or die(\'Erreur SQL jos_js_job_minicv!<br>\'.mysql_error());
$db->query();
//Ajout pour enregistrement du cv dans jos_js_job_minicv
$db =&$this->getDBO();
$uid = &JRequest::getString(\'uid\',\'none\');
$resumequery = \"SELECT * FROM \".$db->nameQuote(\'#__js_job_resume\').\" WHERE uid = \".$uid.\"\";
$db->setQuery( $resumequery );
$minicv = $db->loadObject() or die(\'Erreur SQL minicv <br>\'.mysql_error());
if ( isset($minicv) ){
$id_candidat = $minicv->uid;
$profil_candidat = $minicv->application_title;
$disponibilite_candidat = $minicv->iamavailable;
$date_disponibilite_candidat = $minicv->date_start;
$secteur_candidat = $minicv->job_category;
$type_contrat_candidat = $minicv->jobtype;
$dernier_employeur_candidat = $minicv->employer;
$dernier_poste_candidat = $minicv->employer_position;
$date_fin_contrat_candidat = $minicv->employer_to_date;
$raison_fin_contrat_candidat = $minicv->employer_leave_reason;
$etudes_candidat = $minicv->heighestfinisheducation;
$experience_candidat = $minicv->total_experience;
$mobilite_candidat = $minicv->license_country;
$time_date = $minicv->create_date;
}
//recuperation du secteur activite
$activite = \"SELECT cat_title FROM jos_js_job_categories WHERE id=$secteur_candidat\";
$db->setQuery ( $activite );
$activite_candidat = $db->loadResult() or die(\'Erreur SQL recup secteur activite<br>\'.mysql_error());
//recuperation du type contrat
$contrat = \"SELECT title FROM \".$db->nameQuote(\'#__js_job_jobtypes\') .\" WHERE id=$type_contrat_candidat\";
$db->setQuery ( $contrat );
$contrat_candidat = $db->loadResult() or die(\'Erreur SQL type contrat!<br>\'.mysql_error());
//recuperation du niveau etudes
$etudes = \"SELECT title FROM \".$db->nameQuote(\'#__js_job_heighesteducation\') .\" WHERE id=$etudes_candidat\";
$db->setQuery ( $etudes );
$niveau_etudes_candidat = $db->loadResult() or die(\'Erreur SQL niveau etudes!<br>\'.mysql_error());
//recuperation de experience totale
$experience = \"SELECT title FROM \".$db->nameQuote(\'#__js_job_experience\') .\" WHERE id=$experience_candidat\";
$db->setQuery ( $experience );
$total_experience_candidat = $db->loadResult() or die(\'Erreur SQL total experience!<br>\'.mysql_error());
//insertion des donnees dans la table jos_js_job_minicv
$db->setQuery(\"INSERT INTO jos_js_job_minicv (time_date,profil_candidat,disponibilite_candidat,date_disponibilite_candidat,secteur_candidat,type_contrat_candidat,niveau_etudes_candidat,experience_candidat,mobilite_candidat,id_candidat) VALUES (\'\".$time_date.\"\',\'\".$profil_candidat.\"\',\'\".$disponibilite_candidat.\"\',\'\".$date_disponibilite_candidat.\"\',\'\".$activite_candidat.\"\',\'\".$contrat_candidat.\"\',\'\".$niveau_etudes_candidat.\"\',\'\".$total_experience_candidat.\"\',\'\".$mobilite_candidat.\"\',\'\".$id_candidat.\"\')\");
$db->query() or die(\'Erreur SQL jos_js_job_minicv!<br>\'.$query.\'<br>\'.mysql_error());
//Fin ajout
if (!$row->bind($resumedata))
{
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->check())
{
$this->setError($this->_db->getErrorMsg());
return 2;
}
if (!$row->store())
{
$this->setError($this->_db->getErrorMsg());
return false;
}
$returnvalue = $this->uploadResume($row->id);
$returnvalue = $this->uploadPhoto($row->id);
return true;
}
$db->setQuery(\"INSERT INTO \".$db->nameQuote(\'#__js_job_minicv\').\" (time_date,profil_candidat,disponibilite_candidat,date_disponibilite_candidat,secteur_candidat,type_contrat_candidat,niveau_etudes_candidat,experience_candidat,mobilite_candidat,id_candidat) VALUES (\'\".$time_date.\"\',\'\".$profil_candidat.\"\',\'\".$disponibilite_candidat.\"\',\'\".$date_disponibilite_candidat.\"\',\'\".$activite_candidat.\"\',\'\".$contrat_candidat.\"\',\'\".$niveau_etudes_candidat.\"\',\'\".$total_experience_candidat.\"\',\'\".$mobilite_candidat.\"\',\'\".$id_candidat.\"\')\");
$db->query() or die(\'Erreur SQL jos_js_job_minicv!<br>\'.$query.\'<br>\'.mysql_error());