mail.test = APPLICATION_PATH "/../data/email/test"
+mailjet.username = a0efe78a914ae9b7b972618c6c3e1803
+mailjet.password = b4d51c4c1d0193f9b0963c2c374dd882
+
[testing : production]
dev = true
$data = $this->getCMSDatasOfPage($_POST['page']);
$form = new CCGM_Form_Rendezvous();
$form->setMedecins($data['medecins']);
+
if (!$form->isValid($_POST)) {
$this->_datas->refreshForm($form);
+ $this->_datas->addShow("#messageerreur");
+ $this->_datas->addScrollTo("#c", 0.35);
} else {
- $this->_datas->addAlert('ok!');
+
+ $mail = new CubeIT_Mail();
+ $mail->setFrom('rdv@ccgm.fr');
+ $mail->addTo($data['destinataire']);
+ $mail->addBcc('test@cubedesigners.com');
+ $mail->setSubject('Prise de rendez-vous - ' . $form->getValue('prenom') . ' ' . $form->getValue('nom') . ' (' . $form->getValue('naissance') . ')');
+ $body = '';
+ $fields = array('nom' => 'Nom', 'nom_usage' => 'Nom d\'usage', 'prenom' => 'Prénom', 'naissance' => 'Date de naissance', 'telephone' => 'Téléphone', 'email' => 'E-mail',
+ 'type' => 'Type de rendez-vous', 'medecin' => 'Médecin',
+ 'date' => 'Date et et plage horaire');
+ foreach ($fields as $f => $label) {
+ $val = $form->getValue($f);
+ if (!$val) {
+ continue;
+ }
+ $body.=$label . ' : ' . $val . "\n";
+ }
+ $mail->setBodyText($body);
+ $mail->send(new CubeIT_Mail_Transport_Mailjet());
+
+
+ $form = new CCGM_Form_Rendezvous();
+ $form->setMedecins($data['medecins']);
+ $form->setDefault('page', $_POST['page']);
+ $this->_datas->refreshForm($form);
+ $this->_datas->addHide("#messageerreur");
+ $this->_datas->addShow("#messageconfirmation");
+ $this->_datas->addScrollTo("#header", 0.35);
}
}
$this->addElement($type);
$medecin = new Zend_Form_Element_Select('medecin');
+ $medecin->addValidator($notempty);
+ $medecin->setRequired();
+ $medecin->setLabel('Médecin');
$this->addElement($medecin);
$motif = new Zend_Form_Element_Text('motif');
$date = new Zend_Form_Element_Text('date');
$date->setAttrib('placeholder', 'Merci de noter plusieurs créneaux possibles');
- $date->addValidator($datevalidator);
$this->addElement($date);
$info = new CubeIT_Form_Element_Html('info');
$this->headScript()
->addPolyfill('placeholder')
->addScriptAndStyle('rendezvous')
- ->addCheckbox();
+ ->addCheckbox()
+ ->addScrollTo();
?>
<section id="content">
<div id="c">
<?php
echo $this->markupDotclear($this->text);
echo '<div id="messageerreur">' . $this->erreur . '</div>';
+ echo '<div id="messageconfirmation"><div class="cont"><a href="#" class="close"></a>' . $this->markupDotclear($this->confirmation) . '</div></div>';
$form = new CCGM_Form_Rendezvous();
$form->getElement('page')->setValue($this->currentPage->getId());
$form->setMedecins($this->medecins);
?>
</div>
<?php echo $this->rightbar() ?>
-</section>
\ No newline at end of file
+</section>
\ No newline at end of file
--- /dev/null
+TO_LOAD_ONCE[TO_LOAD_ONCE.length] = 'load_rdv();';
+
+function load_rdv() {
+ $("#messageconfirmation").click(function() {
+ $(this).fadeOut();
+ });
+
+ resizeconf();
+ $(window).on('cubeitresize', resizeconf);
+}
+
+function resizeconf() {
+ $("#messageconfirmation .cont").css('left', 212+($(window).width() - 981) / 2);
+}
+
+
@import "constants.less";
+.twocolumns {
+ #content{
+ #c{
+ width:540px;
+ }
+ }
+}
+
+#messageconfirmation{
+ position:fixed;
+ top:0px;
+ left:0px;
+ width:100%;
+ height:100%;
+ z-index: 100;
+ background-color:rgba(255,255,255,0.7);
+ cursor:pointer;
+ display:none;
+
+ .cont{
+ text-align: center;
+ color:#fff;
+ background-color:#0ea6db;
+ padding:15px 30px;
+ border-radius: 5px;
+ position:absolute;
+ top:424px;
+ width:540px;
+ box-sizing: border-box;
+
+ .close{
+ position:absolute;
+ right:5px;
+ top:5px;
+ background-image:url("../images/closeconf.png");
+ width:13px;
+ height:13px;
+ display: block;
+ }
+ }
+
+
+}
+
+#messageerreur{
+ background-color: #f8a3a3;
+ color:#fff;
+ padding:14px;
+ border-radius: 5px;
+ display:none;
+ margin:-20px 0 0 0;
+}
+
#formRDV{
width:540px;
fieldset{
}
input,select{
-
.field;
}