You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
4.9KB

  1. <?php
  2. use yii\helpers\Html;
  3. use yii\bootstrap\ActiveForm;
  4. /* @var $this yii\web\View */
  5. /* @var $form yii\bootstrap\ActiveForm */
  6. /* @var $model \frontend\models\SignupForm */
  7. $this->title = 'Inscription';
  8. $this->params['breadcrumbs'][] = $this->title;
  9. ?>
  10. <div class="site-signup">
  11. <h1 class="title-systeme-commande"><span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;<?= Html::encode($this->title) ?></h1>
  12. <div class="row">
  13. <div class="col-lg-5">
  14. <?php if(YII_ENV == 'demo'): ?>
  15. <div class="alert alert-warning">
  16. Les inscriptions sont désactivées sur l'espace de démonstration. Utilisez
  17. les identifiants indiqués sur la page de <?= Html::a('connexion', Yii::$app->urlManager->createUrl(['site/login'])); ?> pour vous identifier.
  18. </div>
  19. <?php else: ?>
  20. <?php $form = ActiveForm::begin(['id' => 'form-signup','enableClientValidation'=> false]); ?>
  21. <?= $form->field($model, 'email') ?>
  22. <?= $form->field($model, 'password')->passwordInput() ?>
  23. <?= $form->field($model, 'nom') ?>
  24. <?= $form->field($model, 'prenom') ?>
  25. <?= $form->field($model, 'telephone') ?>
  26. <?php //$form->field($model, 'is_boulanger')->checkbox() ?>
  27. <div id="client-boulanger" class="btn-group" data-toggle="buttons">
  28. <label class="btn btn-default <?php if($model->option_client_boulanger == 'client' || !$model->option_client_boulanger): ?>active<?php endif; ?>">
  29. <input type="radio" name="SignupForm[option_client_boulanger]" value="client" id="option-client" autocomplete="off" <?php if($model->option_client_boulanger == 'client' || !$model->option_client_boulanger): ?>checked<?php endif; ?>> Je suis client
  30. </label>
  31. <label class="btn btn-default <?php if($model->option_client_boulanger == 'boulanger'): ?>active<?php endif; ?>">
  32. <input type="radio" name="SignupForm[option_client_boulanger]" value="boulanger" id="option-boulanger" autocomplete="off" <?php if($model->option_client_boulanger == 'boulanger'): ?>checked<?php endif; ?>> Je suis boulanger
  33. </label>
  34. </div>
  35. <div id="champs-boulanger">
  36. <?= $form->field($model, 'nom_magasin') ?>
  37. <?= $form->field($model, 'siret') ?>
  38. <?= $form->field($model, 'code_postal') ?>
  39. <?= $form->field($model, 'ville') ?>
  40. <?= $form->field($model, 'cgv')->checkbox()->label('J\'accepte les <a class="btn btn-xs btn-default" data-toggle="modal" data-target="#modal-cgv" href="javascript:void(0);">conditions générales de service</a> et les <a class="btn btn-xs btn-default" data-toggle="modal" data-target="#modal-tarifs" href="javascript:void(0);">conditions tarifaires</a>.') ?>
  41. </div>
  42. <div id="champs-client">
  43. <?= $form->field($model, 'id_etablissement')->dropDownList($data_etablissements_dispos, ['prompt' => '--','encode' => false,'options' => $options_etablissements_dispos]) ?>
  44. <div id="bloc-code-acces">
  45. <?= $form->field($model, 'code',[
  46. 'inputTemplate' => '<div class="input-group"><span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>{input}</div>',
  47. ])
  48. ->label('Code')
  49. ->hint('Renseignez-vous auprès de votre boulangerie pour qu\'elle vous fournisse le code d\'accès') ; ?>
  50. </div>
  51. </div>
  52. <div class="form-group" id="boutons-inscrire">
  53. <?= Html::submitButton("S'inscrire", ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>
  54. </div>
  55. <?php ActiveForm::end(); ?>
  56. <?php endif; ?>
  57. </div>
  58. </div>
  59. </div>
  60. <!-- CGV -->
  61. <div class="modal fade" id="modal-cgv" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  62. <div class="modal-dialog modal-lg" role="document">
  63. <div class="modal-content">
  64. <div class="modal-header">
  65. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  66. <h4 class="modal-title" id="myModalLabel">Conditions générales de service</h4>
  67. </div>
  68. <div class="modal-body">
  69. <?= $this->render('_cgv_content.php'); ?>
  70. </div>
  71. <div class="modal-footer">
  72. <button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <!-- Tarifs -->
  78. <?= $this->render('../site/_tarifs_boulanger'); ?>