コード例 #1
0
ファイル: contact.php プロジェクト: rakotobe/Rakotobe
    $zSql .= " WHERE id_ent = " . $id_ent ;
    
    $toUsers = CBdd::select_row($zSql);
	
	//print_r($toUsers['cp_adr']);
	
	
	// RDV
	if(!empty($_POST['nom_rdv'])) 		$nom_rdv 		= CFunctions::clean($_POST['nom_rdv']);
	if(isset($_POST['type_rdv'])) 		$type_rdv		= $_POST['type_rdv'];
	if(!empty($_POST['etat_rdv'])) 		$etat_rdv 		= $_POST['etat_rdv'];
	if(!empty($_POST['date_rdv'])) 		$date_rdv		= $_POST['date_rdv'];
	if(!empty($_POST['heure_rdv'])) 	$heure_rdv		= $_POST['heure_rdv'];
	

	if(!CTableUser::login_dispo($login, " AND id != $id")) {
		//erreur de type login non dispo
		$msginfo = "Login non disponible";
		$a = 5;
		break;
	}
	if(CTableUserContact::is_admin($_SESSION['idmbr'])) {
		$tuse = new CTableUserContact(array('id_ent'=>$id, 'login_ent'=>$login, 'password_ent'=>$passe, 'resp_ent'=>CFunctions::addslashes($responsable), 'commune_adr'=>CFunctions::addslashes($adresse),  'rue_adr'=>CFunctions::addslashes($adresse), 'pays_ent'=>$pays, 'mail_ent'=>CFunctions::addslashes($email), 'tel_ent'=>CFunctions::addslashes($telephone), 'nom_ent'=>CFunctions::addslashes($societe), 'web_ent'=>CFunctions::addslashes($web), 'etat_contact'=>$etat_contact, 'date_contact'=>$date_contact, 'descr_ent'=>CFunctions::addslashes($description), 'etat_ent'=>$etat, 'type'=>$type, 'idopportunite'=>$idopportunite));
	} else {
		$tuse = new CTableUserContact(array('id_ent'=>$id, 'login_ent'=>$login, 'password_ent'=>$passe, 'resp_ent'=>CFunctions::addslashes($responsable), 'commune_adr'=>CFunctions::addslashes($adresse),  'rue_adr'=>CFunctions::addslashes($adresse), 'pays_ent'=>$pays, 'mail_ent'=>CFunctions::addslashes($email), 'tel_ent'=>CFunctions::addslashes($telephone), 'nom_ent'=>CFunctions::addslashes($societe), 'web_ent'=>CFunctions::addslashes($web), 'etat_contact'=>$etat_contact, 'date_contact'=>$date_contact, 'descr_ent'=>CFunctions::addslashes($description), 'idopportunite'=>$idopportunite));
	}
	$tuse->update();
	
	CTablContact::delete_rdv_of_user($id);
	if($date_rdv) {
		$trdv = new CTablContact(array('iduser'=>$id, 'nom'=>CFunctions::addslashes($nom_rdv), 'date'=>$date_rdv, 'heure'=>$heure_rdv,  'type'=>$type_rdv, 'etat'=>$etat_rdv, 'nom_ent'=>$societe, 'resp_ent'=>$responsable, 'commentaire'=>$commentaire));
コード例 #2
0
ファイル: user.php プロジェクト: rakotobe/Rakotobe
	//-- tester si l'adresse email saisie est d? enregistr?pour un autre contact
	if (trim($email) != "") {
		$zQuery = ("SELECT id FROM user WHERE email = '" . $email. "'");
		if ($tzUser = mysql_fetch_array (mysql_query ($zQuery))) {
			$error_type = 3;
			$error_signe['email'] = "*";
			$msginfo = "L'adresse email saisi appartient d? ?n autre contact enregistr?n base.'";
		}
	}
	
	if ($error_type > 0) {
		//erreur de type champ non valide
		$a = 4;
		break;
	}
	if(!CTableUser::login_dispo($login)) {
		//erreur de type login non dispo
		$msginfo = "Login non disponible";
		$a = 4;
		break;
	}
	$tuse = new CTableUser(array('login' => $login, 'passe' => $passe, 'etat' => $etat, 'type' => $type, 'civilite' => $civilite, 'nom'=>CFunctions::addslashes($nom), 'prenom'=>CFunctions::addslashes($prenom), 'adresse'=>CFunctions::addslashes($adresse), 'cp'=>CFunctions::addslashes($cp), 'ville'=>CFunctions::addslashes($ville), 'pays' => $pays, 'email'=>CFunctions::addslashes($email), 'telephone'=>CFunctions::addslashes($telephone), 'mobile'=>CFunctions::addslashes($mobile), 'societe'=>CFunctions::addslashes($societe), 'web'=>CFunctions::addslashes($web), 'etat_contact' => $etat_contact, 'idopportunite' => $idopportunite, 'date_contact' => $date_contact, 'commentaire'=>CFunctions::addslashes($commentaire)));

	$tuse->insert();
	
	// Récupération du dernier enregistrement
	$iduser = CTableCommuneD::recupLastId('user');
	
	// Commune
	$idcom = CTableCommune::recupnomCom('commune', 'id_com', 'nom_com', $ville);
	if ($idcom) {