×

Notice

The forum is in read only mode.

Add function to saveResume

14 years 6 months ago - 14 years 6 months ago #1253 by Tartuffe
Replied by Tartuffe on topic Add function to saveResume
Hello,
Thanks for your help, I progress but this query doesn\'t work !
//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());

Tks
14 years 6 months ago #1254 by Tartuffe
Replied by Tartuffe on topic Add function to saveResume
When I test my query in phpmyadmin it\'s OK !! I really don\'t understand where is the problem.

Please help me, i\'m going to be crazy !!!
Thanks
14 years 6 months ago #1256 by Ahmad
Replied by Ahmad on topic Add function to saveResume
Please use this
$minicv = $db->loadObject();

Please write your valuable review JS Jobs and JS Support Ticket at JED.
14 years 6 months ago - 14 years 6 months ago #1258 by Tartuffe
Replied by Tartuffe on topic Add function to saveResume
Hi,
I did it, it\'s my insert whitch isn\'t executed.
Here\'s my code :
//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();

Thanks for your help
Matine44
14 years 5 months ago #1268 by Tartuffe
Replied by Tartuffe on topic Add function to saveResume
Hi and thanks for your help !
So, I do not have error but nothing added in my database.
here\'s my code :
	//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
between
		if (!$row->bind($resumedata))
		{
			$this->setError($this->_db->getErrorMsg());
			return false;
		}
and
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;
	}

in function \"function storeResume()\"

Could you tell me why, I don\'t understand.
I really need to do that because I would like to permit users (not registered) to view a small resume that I generated with component Fabrik.

Please, could you help me to find problems ?
Thanks
Matine44
14 years 5 months ago - 14 years 5 months ago #1269 by Tartuffe
Replied by Tartuffe on topic Add function to saveResume
Hi !
I found my mistake ! Insert query should be write like that :

$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());


So, now I have a new question. When I update resume, new table (jos_js_job_minicv) didn\'t update. How can I do this, where should I insert my query ?

Thanks for your help...
Time to create page: 0.061 seconds

Please publish modules in offcanvas position.