Merge branch 'develop' of gitlab.antadis.fr:dev-antadis/bebeboutik into develop

This commit is contained in:
Thibault GUILLAUME 2016-03-01 16:34:17 +01:00
commit d9ec061ada
6 changed files with 288 additions and 150 deletions

View File

@ -4,12 +4,22 @@ class Process
{ {
private $data; private $data;
private $mail_dir; private $mail_dir;
private $to; private $to_provider = [];
private $to_press = [];
public function __construct() public function __construct()
{ {
$this->mail_dir = dirname(__FILE__); $this->mail_dir = dirname(__FILE__);
$this->to = 'simonet@antadis.com';
$_to = Db::getInstance()->ExecuteS('SELECT `email`, `type` FROM `'._DB_PREFIX_.'contactform_email`');
foreach ($_to as $k => $email) {
if ($email['type'] == Contactform::TYPE_PROVIDER) {
$to_provider[] = $email['email'];
}
if ($email['type'] == Contactform::TYPE_PRESS) {
$to_press[] = $email['email'];
}
}
} }
public function addProvider($post) public function addProvider($post)
@ -18,45 +28,50 @@ class Process
$errors = []; $errors = [];
$isCorrect = $this->validate(Contactform::TYPE_PROVIDER); $isCorrect = $this->validate(Contactform::TYPE_PROVIDER);
if (!$isCorrect) { if (!$isCorrect) {
$errors[] = 'Tous les champs ne sont pas remplis'; $errors[] = Tools::displayError('Tous les champs ne sont pas remplis');
} else { } else {
$query = Db::getInstance()->autoExecute(_DB_PREFIX_.'contactform', [ if (!Validate::isEmail($this->data['email1'])) {
'brand' => pSQL($this->data['brand']), $errors[] = Tools::displayError('Certains champs ne sont pas valide');
'compagny' => pSQL($this->data['compagny']),
'lastname' => pSQL($this->data['lastname']),
'firstname' => pSQL($this->data['firstname']),
'function' => pSQL($this->data['function']),
'email1' => pSQL($this->data['email1']),
'email2' => pSQL($this->data['email2']),
'phone1' => pSQL($this->data['phone1']),
'phone2' => pSQL($this->data['phone2']),
'purpose' => pSQL($this->data['purpose']),
'content' => pSQL($this->data['content']),
'type' => Contactform::TYPE_PROVIDER
], 'INSERT');
if (!$query) {
$errors[] = "Une erreur s'est produite. Votre message n'a pas été envoyé";
} else { } else {
Mail::Send( $query = Db::getInstance()->autoExecute(_DB_PREFIX_.'contactform', [
intval($cookie->id_lang), 'brand' => pSQL($this->data['brand']),
'provider', 'compagny' => pSQL($this->data['compagny']),
'sujet', 'lastname' => pSQL($this->data['lastname']),
$this->data, 'firstname' => pSQL($this->data['firstname']),
$this->to, 'function' => pSQL($this->data['function']),
NULL, 'email1' => pSQL($this->data['email1']),
NULL, 'email2' => pSQL($this->data['email2']),
NULL, 'phone1' => pSQL($this->data['phone1']),
NULL, 'phone2' => pSQL($this->data['phone2']),
NULL, 'purpose' => pSQL($this->data['purpose']),
$this->mail_dir 'content' => pSQL($this->data['content']),
); 'type' => Contactform::TYPE_PROVIDER
], 'INSERT');
if (!$query) {
$errors[] = Tools::displayError('Une erreur s\'est produite. Votre message n\'a pas été envoyé');
} else {
Mail::Send(
intval($cookie->id_lang),
'provider',
'Contact fournisseur',
$this->data,
$this->to_provider,
NULL,
NULL,
NULL,
NULL,
NULL,
$this->mail_dir
);
}
} }
} }
if (!empty($errors)) { if (!empty($errors)) {
return $errors; return $errors;
} }
$this->emptyForm();
return true; return true;
} }
@ -66,43 +81,48 @@ class Process
$errors = []; $errors = [];
$isCorrect = $this->validate(Contactform::TYPE_PRESS); $isCorrect = $this->validate(Contactform::TYPE_PRESS);
if (!$isCorrect) { if (!$isCorrect) {
$errors[] = 'Tous les champs ne sont pas remplis'; $errors[] = Tools::displayError('Tous les champs ne sont pas remplis');
} else { } else {
$query = Db::getInstance()->autoExecute(_DB_PREFIX_.'contactform', [ if (!Validate::isEmail($this->data['email1'])) {
'compagny' => pSQL($this->data['compagny']), $errors[] = Tools::displayError('Certains champs ne sont pas valide');
'lastname' => pSQL($this->data['lastname']),
'firstname' => pSQL($this->data['firstname']),
'function' => pSQL($this->data['function']),
'email1' => pSQL($this->data['email1']),
'email2' => pSQL($this->data['email2']),
'phone1' => pSQL($this->data['phone1']),
'phone2' => pSQL($this->data['phone2']),
'content' => pSQL($this->data['content']),
'type' => Contactform::TYPE_PRESS
], 'INSERT');
if (!$query) {
$errors[] = "Une erreur s'est produite. Votre message n'a pas été envoyé";
} else { } else {
Mail::Send( $query = Db::getInstance()->autoExecute(_DB_PREFIX_.'contactform', [
intval($cookie->id_lang), 'compagny' => pSQL($this->data['compagny']),
'press', 'lastname' => pSQL($this->data['lastname']),
'sujet', 'firstname' => pSQL($this->data['firstname']),
$this->data, 'function' => pSQL($this->data['function']),
$this->to, 'email1' => pSQL($this->data['email1']),
NULL, 'email2' => pSQL($this->data['email2']),
NULL, 'phone1' => pSQL($this->data['phone1']),
NULL, 'phone2' => pSQL($this->data['phone2']),
NULL, 'content' => pSQL($this->data['content']),
NULL, 'type' => Contactform::TYPE_PRESS
$this->mail_dir ], 'INSERT');
);
if (!$query) {
$errors[] = Tools::displayError('Une erreur s\'est produite. Votre message n\'a pas été envoyé');
} else {
Mail::Send(
intval($cookie->id_lang),
'press',
'Contact presse',
$this->data,
$this->to_press,
NULL,
NULL,
NULL,
NULL,
NULL,
$this->mail_dir
);
}
} }
} }
if (!empty($errors)) { if (!empty($errors)) {
return $errors; return $errors;
} }
$this->emptyForm();
return true; return true;
} }
@ -136,4 +156,18 @@ class Process
break; break;
} }
} }
private function emptyForm() {
$_POST['brand'] = '';
$_POST['compagny'] = '';
$_POST['function'] = '';
$_POST['lastname'] = '';
$_POST['firstname'] = '';
$_POST['email1'] = '';
$_POST['email2'] = '';
$_POST['phone1'] = '';
$_POST['phone2'] = '';
$_POST['purpose'] = '';
$_POST['content'] = '';
}
} }

View File

@ -18,8 +18,8 @@ class Contactform extends Module {
parent::__construct(); parent::__construct();
$this->displayName = $this->l('Contact form for press and providers'); $this->displayName = $this->l('Formulaire de contact pour les fournisseurs et la presse');
$this->description = $this->l('Integrate contact form.'); $this->description = $this->l('Intégration de formulaire de contact');
$this->assets_module_dir = dirname(__FILE__); $this->assets_module_dir = dirname(__FILE__);
} }
@ -44,20 +44,19 @@ class Contactform extends Module {
PRIMARY KEY (`id_contactform`) PRIMARY KEY (`id_contactform`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8; ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;
') ')
// && Db::getInstance()->Execute(' && Db::getInstance()->Execute('
// CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'contactform_email` ( CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'contactform_email` (
// `id_contactform_email` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_contactform_email` INT UNSIGNED NOT NULL AUTO_INCREMENT,
// `email` VARCHAR(255) NULL, `email` VARCHAR(255) NULL,
// PRIMARY KEY (`id_contactform_email`) `type` INT(11) NOT NULL,
// ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8; PRIMARY KEY (`id_contactform_email`)
// ') ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;
; ');
} }
public function uninstallDB() { public function uninstallDB() {
return Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'contactform`;') return Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'contactform`;')
//&& Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'contactform_email`;') && Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'contactform_email`;');
;
} }
public function install() { public function install() {
@ -74,39 +73,144 @@ class Contactform extends Module {
return TRUE; return TRUE;
} }
// public function getContent() { public function getContent() {
//
// $content = " $content = "<style>
// {{ error }} h2 {
// <form method='post'> font-size: 1.4em;
// <textarea name='emails'></textarea> margin: 0 0 .83em 0;
// <input type='submit' value='Modifier'> color: #268CCD;
// <form> }
// "; form.module {
// padding: 20px;
// if ($_POST) { background: #F4E6C9;
// if (empty($_POST['emails'])) { display: inline-block;
// $content = str_replace('{{ error }}', "Aucune adresse email n'a été renseignée", $content); }
// return $content; form.module label, form.module input, form.module textarea {
// } display: block;
// $emails = explode("\n", $_POST['emails']); margin: 10px 0;
// foreach ($emails as $k => $email) { }
// $email[$k] = trim($email); form.module label {
// } float: none;
// $emails = array_unique($emails); width: auto;
// foreach ($emails as $k => $email) { padding: 0.2em 0.5em 0 0;
// if (!$this->emailExistInDb($email)) { text-align: left;
// $content = str_replace('{{ error }}', "Existe pas", $content); font-weight: bold;
// } }
// } form.module input[type=submit] {
// } border: none;
// color: black;
// $content = str_replace('{{ error }}', "", $content); font-weight: bold;
// return $content; background: #D6C195;
// } padding: 10px 20px;
// cursor: pointer;
// private function emailExistInDb($email) { }
// return (Db::getInstance()->executeS("SELECT COUNT(*) as count FROM `"._DB_PREFIX_."contactform_email` WHERE email = \"".pSQL($email)."\" ")[0]['count'] != 0); .form-inline {
// } display: inline-block;
margin: 20px;
}
</style>
<div class='form-inline'>
<h2>Formulaire de contact pour les fournisseurs</h2>
<form method='post' class='module'>
<p class='bold'>{{ error_provider }}</p>
<label for='email'>Emails destinataire (Une adresse email par ligne):</label>
<textarea name='emails' id='email' cols='50' rows='10'>{{ emails_provider }}</textarea>
<input type='submit' value='Modifier' name='update_mail'>
<input type='hidden' name='type' value='".Contactform::TYPE_PROVIDER."'>
</form>
</div>
<div class='form-inline'>
<h2>Formulaire de contact pour la presse</h2>
<form method='post' class='module'>
<p class='bold'>{{ error_press }}</p>
<label for='email'>Emails destinataire (Une adresse email par ligne):</label>
<textarea name='emails' id='email' cols='50' rows='10'>{{ emails_press }}</textarea>
<input type='submit' value='Modifier' name='update_mail'>
<input type='hidden' name='type' value='".Contactform::TYPE_PRESS."'>
</form>
</div>";
if (Tools::isSubmit('update_mail')) {
if (empty($_POST['emails'])) {
if ($_POST['type'] == Contactform::TYPE_PROVIDER) {
$content = str_replace('{{ error_provider }}', $this->l("Aucune adresse email n'a été renseignée"), $content);
$content = str_replace('{{ error_press }}', "", $content);
} else {
$content = str_replace('{{ error_press }}', $this->l("Aucune adresse email n'a été renseignée"), $content);
$content = str_replace('{{ error_provider }}', "", $content);
}
$contentEmails = Db::getInstance()->ExecuteS('SELECT `email`, `type` FROM `'._DB_PREFIX_.'contactform_email`');
$contentEmailProvider = '';
$contentEmailPress = '';
foreach ($contentEmails as $k => $row) {
if ($row['type'] == Contactform::TYPE_PROVIDER) {
$contentEmailProvider .= $row['email']."\n";
}
if ($row['type'] == Contactform::TYPE_PRESS) {
$contentEmailPress .= $row['email']."\n";
}
}
$content = str_replace('{{ emails_provider }}', $contentEmailProvider, $content);
$content = str_replace('{{ emails_press }}', $contentEmailPress, $content);
return $content;
}
$emails = explode("\n", trim($_POST['emails']));
foreach ($emails as $k => $email) {
$email = trim($email);
if (Validate::isEmail($email)) {
$emails[$k] = $email;
} else {
array_splice($emails, $k);
}
}
$emails = array_unique($emails);
Db::getInstance()->executeS('DELETE FROM `'._DB_PREFIX_.'contactform_email` WHERE `type` = '.pSQL($_POST['type']));
foreach ($emails as $k => $email) {
Db::getInstance()->autoExecute(_DB_PREFIX_.'contactform_email', [
'email' => pSQL($email),
'type' => pSQL($_POST['type'])
], 'INSERT');
}
if ($_POST['type'] == Contactform::TYPE_PROVIDER) {
$content = str_replace('{{ error_provider }}', $this->l("Modification effectuée"), $content);
$content = str_replace('{{ error_press }}', "", $content);
} else {
$content = str_replace('{{ error_press }}', $this->l("Modification effectuée"), $content);
$content = str_replace('{{ error_provider }}',"", $content);
}
} else {
$content = str_replace('{{ error_provider }}', "", $content);
$content = str_replace('{{ error_press }}', "", $content);
}
$contentEmails = Db::getInstance()->ExecuteS('SELECT `email`, `type` FROM `'._DB_PREFIX_.'contactform_email`');
$contentEmailProvider = '';
$contentEmailPress = '';
foreach ($contentEmails as $k => $row) {
if ($row['type'] == Contactform::TYPE_PROVIDER) {
$contentEmailProvider .= $row['email']."\n";
}
if ($row['type'] == Contactform::TYPE_PRESS) {
$contentEmailPress .= $row['email']."\n";
}
}
$content = str_replace('{{ emails_provider }}', $contentEmailProvider, $content);
$content = str_replace('{{ emails_press }}', $contentEmailPress, $content);
return $content;
}
} }

View File

@ -8,7 +8,7 @@ include_once(dirname(__FILE__).'/Process.php');
include(dirname(__FILE__).'/../../header.php'); include(dirname(__FILE__).'/../../header.php');
$result = null; $result = null;
if (!empty($_POST['type'])) { if (Tools::isSubmit('press_form')) {
$Process = new Process(); $Process = new Process();
$result = $Process->addPress($_POST); $result = $Process->addPress($_POST);
} }

View File

@ -14,7 +14,7 @@
<p class="bold text" style="color: red">{$error}</p> <p class="bold text" style="color: red">{$error}</p>
{/foreach} {/foreach}
{else} {else}
<p class="bold text">{l s='Votre message à été envoye' mod='contactform'}</p> <p class="bold text">{l s='Votre message a été envoyé' mod='contactform'}</p>
{/if} {/if}
{/if} {/if}
@ -22,60 +22,60 @@
<div> <div>
<p class="text module-contactform-input-group" style="display: inline-block"> <p class="text module-contactform-input-group" style="display: inline-block">
<label for="compagny">{l s='Entreprise' mod='contactform'}*</label> <label for="compagny">{l s='Entreprise' mod='contactform'}<sup>*</sup> </label>
<input type="text" name="compagny" id="compagny"> <input type="text" name="compagny" id="compagny" value="{if Tools::getValue('compagny')} {Tools::getValue('compagny')} {/if}">
</p> </p>
<p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px"> <p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px">
<label for="function">{l s='Fonction' mod='contactform'}*</label> <label for="function">{l s='Fonction' mod='contactform'}<sup>*</sup></label>
<input type="text" name="function" id="function"> <input type="text" name="function" id="function" value="{if Tools::getValue('function')} {Tools::getValue('function')} {/if}">
</p> </p>
</div> </div>
<div> <div>
<p class="text module-contactform-input-group" style="display: inline-block"> <p class="text module-contactform-input-group" style="display: inline-block">
<label for="lastname">{l s='Nom' mod='contactform'}*</label> <label for="lastname">{l s='Nom' mod='contactform'}<sup>*</sup></label>
<input type="text" name="lastname" id="lastname"> <input type="text" name="lastname" id="lastname" value="{if Tools::getValue('lastname')} {Tools::getValue('lastname')} {/if}">
</p> </p>
<p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px"> <p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px">
<label for="firstname">{l s='Prénom' mod='contactform'}*</label> <label for="firstname">{l s='Prénom' mod='contactform'}<sup>*</sup></label>
<input type="text" name="firstname" id="firstname"> <input type="text" name="firstname" id="firstname" value="{if Tools::getValue('firtname')} {Tools::getValue('firstname')} {/if}">
</p> </p>
</div> </div>
<div> <div>
<p class="text module-contactform-input-group" style="display: inline-block"> <p class="text module-contactform-input-group" style="display: inline-block">
<label for="email1">{l s='Email' mod='contactform'}*</label> <label for="email1">{l s='Email' mod='contactform'}<sup>*</sup></label>
<input type="text" name="email1" id="email1"> <input type="text" name="email1" id="email1" value="{if Tools::getValue('email1')} {Tools::getValue('email1')} {/if}">
</p> </p>
<p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px"> <p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px">
<label for="email2">{l s='Email secondaire' mod='contactform'}</label> <label for="email2">{l s='Email secondaire' mod='contactform'}</label>
<input type="text" name="email2" id="email2"> <input type="text" name="email2" id="email2" value="{if Tools::getValue('email2')} {Tools::getValue('email2')} {/if}">
</p> </p>
</div> </div>
<div> <div>
<p class="text module-contactform-input-group" style="display: inline-block"> <p class="text module-contactform-input-group" style="display: inline-block">
<label for="phone1">{l s='Téléphone' mod='contactform'}*</label> <label for="phone1">{l s='Téléphone' mod='contactform'}<sup>*</sup></label>
<input type="text" name="phone1" id="phone1"> <input type="text" name="phone1" id="phone1" {if Tools::getValue('phone1')} {Tools::getValue('phone1')} {/if}>
</p> </p>
<p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px"> <p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px">
<label for="phone2">{l s='Téléphone secondaire' mod='contactform'}</label> <label for="phone2">{l s='Téléphone secondaire' mod='contactform'}</label>
<input type="text" name="phone2" id="phone2"> <input type="text" name="phone2" id="phone2" {if Tools::getValue('phone2')} {Tools::getValue('phone2')} {/if}>
</p> </p>
</div> </div>
<p class="text module-contactform-input-group"> <p class="text module-contactform-input-group">
<label for="content">{l s='Message' mod='contactform'}*</label> <label for="content">{l s='Message' mod='contactform'}<sup>*</sup></label>
<textarea name="content" id="content" cols="65" rows="10"></textarea> <textarea name="content" id="content" cols="65" rows="10">{if Tools::getValue('content')} {Tools::getValue('content')} {/if}</textarea>
</p> </p>
<input type="hidden" name="type" value="{Contactform::TYPE_PRESS}"> <input type="hidden" name="type" value="{Contactform::TYPE_PRESS}">
<button type="submit" id="SubmitLogin" class="module-contactform-button">{l s='Envoyer' mod='contactform'}</button> <button type="submit" id="SubmitLogin" class="module-contactform-button" name="press_form">{l s='Envoyer' mod='contactform'}</button>
</form> </form>
</div> </div>

View File

@ -8,7 +8,7 @@ include_once(dirname(__FILE__).'/Process.php');
include(dirname(__FILE__).'/../../header.php'); include(dirname(__FILE__).'/../../header.php');
$result = null; $result = null;
if (!empty($_POST['type'])) { if (Tools::isSubmit('provider_form')) {
$Process = new Process(); $Process = new Process();
$result = $Process->addProvider($_POST); $result = $Process->addProvider($_POST);
} }

View File

@ -13,7 +13,7 @@
<p class="bold text" style="color: red">{$error}</p> <p class="bold text" style="color: red">{$error}</p>
{/foreach} {/foreach}
{else} {else}
<p class="bold text">{l s='Votre message à été envoye' mod='contactform'}</p> <p class="bold text">{l s='Votre message a été envoyé' mod='contactform'}</p>
{/if} {/if}
{/if} {/if}
@ -21,70 +21,70 @@
<div> <div>
<p class="text module-contactform-input-group" style="display: inline-block"> <p class="text module-contactform-input-group" style="display: inline-block">
<label for="brand">{l s='Marque' mod='contactform'}*</label> <label for="brand">{l s='Marque' mod='contactform'}<sup>*</sup> </label>
<input type="text" name="brand" id="brand"> <input type="text" name="brand" id="brand" value="{if Tools::getValue('brand')} {Tools::getValue('brand')} {/if}">
</p> </p>
<p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px"> <p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px">
<label for="compagny">{l s='Entreprise' mod='contactform'}*</label> <label for="compagny">{l s='Entreprise' mod='contactform'}<sup>*</sup></label>
<input type="text" name="compagny" id="compagny"> <input type="text" name="compagny" id="compagny" value="{if Tools::getValue('compagny')} {Tools::getValue('compagny')} {/if}">
</p> </p>
</div> </div>
<p class="text module-contactform-input-group"> <p class="text module-contactform-input-group">
<label for="function">{l s='Fonction' mod='contactform'}*</label> <label for="function">{l s='Fonction' mod='contactform'}<sup>*</sup></label>
<input type="text" name="function" id="function"> <input type="text" name="function" id="function" value="{if Tools::getValue('function')} {Tools::getValue('function')} {/if}">
</p> </p>
<div> <div>
<p class="text module-contactform-input-group" style="display: inline-block"> <p class="text module-contactform-input-group" style="display: inline-block">
<label for="lastname">{l s='Nom' mod='contactform'}*</label> <label for="lastname">{l s='Nom' mod='contactform'}<sup>*</sup></label>
<input type="text" name="lastname" id="lastname"> <input type="text" name="lastname" id="lastname" value="{if Tools::getValue('lastname')} {Tools::getValue('lastname')} {/if}">
</p> </p>
<p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px"> <p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px">
<label for="firstname">{l s='Prénom' mod='contactform'}*</label> <label for="firstname">{l s='Prénom' mod='contactform'}<sup>*</sup></label>
<input type="text" name="firstname" id="firstname"> <input type="text" name="firstname" id="firstname" value="{if Tools::getValue('firstname')} {Tools::getValue('firstname')} {/if}">
</p> </p>
</div> </div>
<div> <div>
<p class="text module-contactform-input-group" style="display: inline-block"> <p class="text module-contactform-input-group" style="display: inline-block">
<label for="email1">{l s='Email' mod='contactform'}*</label> <label for="email1">{l s='Email' mod='contactform'}<sup>*</sup></label>
<input type="text" name="email1" id="email1"> <input type="text" name="email1" id="email1" value="{if Tools::getValue('email1')} {Tools::getValue('email1')} {/if}">
</p> </p>
<p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px"> <p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px">
<label for="email2">{l s='Email secondaire' mod='contactform'}</label> <label for="email2">{l s='Email secondaire' mod='contactform'}</label>
<input type="text" name="email2" id="email2"> <input type="text" name="email2" id="email2" value="{if Tools::getValue('email2')} {Tools::getValue('email2')} {/if}">
</p> </p>
</div> </div>
<div> <div>
<p class="text module-contactform-input-group" style="display: inline-block"> <p class="text module-contactform-input-group" style="display: inline-block">
<label for="phone1">{l s='Téléphone' mod='contactform'}*</label> <label for="phone1">{l s='Téléphone' mod='contactform'}<sup>*</sup></label>
<input type="text" name="phone1" id="phone1"> <input type="text" name="phone1" id="phone1" value="{if Tools::getValue('phone1')} {Tools::getValue('phone1')} {/if}">
</p> </p>
<p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px"> <p class="text module-contactform-input-group" style="display: inline-block; margin-left: 30px">
<label for="phone2">{l s='Téléphone secondaire' mod='contactform'}</label> <label for="phone2">{l s='Téléphone secondaire' mod='contactform'}</label>
<input type="text" name="phone2" id="phone2"> <input type="text" name="phone2" id="phone2" value="{if Tools::getValue('phone2')} {Tools::getValue('phone1')} {/if}">
</p> </p>
</div> </div>
<p class="text module-contactform-input-group"> <p class="text module-contactform-input-group">
<label for="purpose">{l s='Proposition' mod='contactform'}*</label> <label for="purpose">{l s='Proposition' mod='contactform'}<sup>*</sup></label>
<input type="text" name="purpose" id="purpose"> <input type="text" name="purpose" id="purpose" value="{if Tools::getValue('purpose')} {Tools::getValue('purpose')} {/if}">
</p> </p>
<p class="text module-contactform-input-group"> <p class="text module-contactform-input-group">
<label for="content">{l s='Message' mod='contactform'}*</label> <label for="content">{l s='Message' mod='contactform'}<sup>*</sup></label>
<textarea name="content" id="content" cols="65" rows="10"></textarea> <textarea name="content" id="content" cols="65" rows="10">{if Tools::getValue('content')} {Tools::getValue('content')} {/if}</textarea>
</p> </p>
<input type="hidden" name="type" value="{Contactform::TYPE_PROVIDER}"> <input type="hidden" name="type" value="{Contactform::TYPE_PROVIDER}">
<button type="submit" id="SubmitLogin" class="btn_box login_box module-contactform-button">{l s='Envoyer' mod='contactform'}</button> <button type="submit" id="SubmitLogin" class="btn_box login_box module-contactform-button" name="provider_form">{l s='Envoyer' mod='contactform'}</button>
</form> </form>
</div> </div>
</div> </div>