Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->layout = "client";
- $user = $this->Auth->user();
- if ($user['rol'] === "client") {
- if ($this->request->is('post')) {
- $this->loadModel('Need');
- $this->Need->create();
- if ($this->Need->save($this->request->data)) {
- $this->Flash->success(__('Your post has been saved.'));
- //$this->redirect();
- //return $this->request->data;
- } else {
- $this->Flash->error(__('Unable to add your post.'));
- }
- }
- $this->set('user', $user);
- $this->loadModel('User');
- $informacionUsuarios = $this->User->find('first', array('conditions' => array('username' => $user['username'])));
- $this->set('informacionUsuarios', $informacionUsuarios['User']);
- $this->loadModel('Client');
- $informacionClientes = $this->Client->find('first', array('conditions' => array('email' => $user['username'])));
- $this->set('informacionClientes', $informacionClientes['Client']);
- $this->loadModel('Need');
- $informacionNecesidades = $this->Need->find('all', array('conditions' => array('client' => $informacionClientes["Client"]["company"])));
- $this->set('informacionNecesidades', $informacionNecesidades);
- $contadorNecesidades = $this->Need->find('count', array('conditions' => array('client' => $informacionClientes["Client"]["company"])));
- $this->set('contadorNecesidades', $contadorNecesidades);
- }
- <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-lg" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- <?php
- echo $this->Form->create('Need', array("class" => "form-signin"));
- echo $this->Form->input('client', array('label' => array('text' => " "),
- 'placeholder' => '¿Para que marca vamos a trabajar?',
- 'class' => 'validador txtClient lang prettyName', "type" => "hidden", 'key' => 'txtClient',
- "value" => $informacionClientes['company']));
- echo $this->Form->input('process', array('label' => array('text' => " "),
- 'placeholder' => '¿Para que marca vamos a trabajar?',
- 'class' => '', "type" => "hidden", 'key' => 'txtClient',
- "value" => "Empty"));
- echo $this->Form->input('date', array('label' => array('text' => " "),
- 'placeholder' => '¿Para que marca vamos a trabajar?',
- 'class' => '', "type" => "hidden", 'key' => 'txtClient',
- "value" => date("j") . "/" . date("n") . "/" . date("Y")));
- ?>
- <div class="form-group">
- <?php
- echo $this->Form->input('need', array('label' => array('text' => "Escríbenos acerca de tu necesidad",
- 'key' => 'lblNeed', 'class' => 'lang'), 'placeholder' => 'Agradecemos nos detalles muy bien la necesidad, '
- . 'es nuestro punto de partida para generar ideas quer fortalezcan la estrategia para resolverla.',
- 'rows' => '4', "minlength" => "900", "required" => "true", "maxlength" => "", 'class' => 'validador txtNeed lang prettyText validLength', 'key' => 'txtNeed', 'style' => 'resize: none;'));
- ?>
- <div class="invalid-feedback">
- </div>
- </div>
- <div class="form-group">
- <?php
- echo $this->Form->input('objective', array('label' => array('text' => "¿Cuál es el objetivo?",
- 'key' => 'lblObjective', 'class' => 'lang'), 'placeholder' => 'Que se quiere alcanzar con la'
- . 'solución de la necesidad, ¿Adquirir usuario? ¿Mejorar ventas? ¿Posicionar la marca? ... entre otros.'
- . ' Agradecemos nos detalles muy bien el objetivo.', 'rows' => '4', "minlength" => "300", "maxlength" => "",
- 'class' => 'validador txtObjective lang prettyText validLength', "required" => true, 'key' => 'txtObjective', 'style' => 'resize: none;'));
- ?>
- <div class="invalid-feedback">
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
- <?php echo $this->Form->end(__('Guardar')); ?>
- </div>
- </div>
- </div>
- </div>
Add Comment
Please, Sign In to add comment