log($pays, 'pays'); $message = ''; require_once 'dbbootstrap.php'; require_once 'graydon/graydonws.php'; require_once 'graydon/graydon_log.php'; setDbConn('graydon'); $country = Doctrine_Query::create() ->from('Country') ->where('code = ?', $paysCode) ->fetchOne(); $pays = $country->graydon_country; if(isset($_REQUEST['submit'])){ $firephp->log('Soumission formulaire'); //Enregistrement du formulaire /* print '
'; print_r($_REQUEST['InfoUser']); print_r($_REQUEST['InfoEnq']); print ''; */ //Vérification des informations $formError = FALSE; $fields = array(); //Info utilisateur obligatoire : if($_REQUEST['InfoUser']['dIdentite']==''){ $fields[] ='Votre Identite'; $formError=TRUE;} if($_REQUEST['InfoUser']['Tel']==''){ $fields[] ='Votre Téléphone'; $formError=TRUE;} if($_REQUEST['InfoUser']['Email']==''){ $fields[] ='Votre Email'; $formError=TRUE;} //Info entreprise obligatoire : if(!isset($_REQUEST['pidentifier'])){ if($_REQUEST['InfoEnq']['Name']==''){ $fields[] ='Raison Sociale'; $formError=TRUE;} if($_REQUEST['InfoEnq']['Telephone']==''){ $fields[] ='Téléphone'; $formError=TRUE;} if($_REQUEST['InfoEnq']['Adresse']==''){ $fields[] ='Adresse'; $formError=TRUE;} } if($_REQUEST['InfoEnq']['Servicespeed']==''){ $fields[] ='Type d\'enquête'; $formError=TRUE;} if ($formError==TRUE){ $message = ''; $message.= 'Veuillez remplir les champs suivants : '; $message.= join(', ', $fields); $message.= ''; }else{ $commandeOk = setEnquete($pays); require_once 'phpmailer/class.phpmailer.php'; $mail = new PHPMailer(); $mail->From = "contact@scores-decisions.com"; $mail->FromName = "Serveur SD-13408"; $mail->Host = "mail.scores-decisions.com"; $mail->Mailer = "smtp"; $mail->Subject = "DEBUG - Commandes de rapport graydon"; $body = "Commandes\n"; $body .= "Utilisateur :\n"; $body .= print_r($REQUEST['InfoUser']); $body .= "\n"; $body .= "Enquêtes : \n"; $body .= print_r($REQUEST['InfoEnq']); $body .= "\n"; $mail->MsgHTML($body); $mail->AddAddress(EMAIL_SUPPORTDEV, "Support"); $mail->Send(); } } ?>