Guest User

Untitled

a guest
Jun 18th, 2018
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 KB | None | 0 0
  1. $this->layout = "client";
  2. $user = $this->Auth->user();
  3. if ($user['rol'] === "client") {
  4.  
  5. if ($this->request->is('post')) {
  6. $this->loadModel('Need');
  7. $this->Need->create();
  8. if ($this->Need->save($this->request->data)) {
  9. $this->Flash->success(__('Your post has been saved.'));
  10. //$this->redirect();
  11. //return $this->request->data;
  12. } else {
  13. $this->Flash->error(__('Unable to add your post.'));
  14. }
  15. }
  16. $this->set('user', $user);
  17. $this->loadModel('User');
  18. $informacionUsuarios = $this->User->find('first', array('conditions' => array('username' => $user['username'])));
  19. $this->set('informacionUsuarios', $informacionUsuarios['User']);
  20. $this->loadModel('Client');
  21. $informacionClientes = $this->Client->find('first', array('conditions' => array('email' => $user['username'])));
  22. $this->set('informacionClientes', $informacionClientes['Client']);
  23. $this->loadModel('Need');
  24. $informacionNecesidades = $this->Need->find('all', array('conditions' => array('client' => $informacionClientes["Client"]["company"])));
  25. $this->set('informacionNecesidades', $informacionNecesidades);
  26. $contadorNecesidades = $this->Need->find('count', array('conditions' => array('client' => $informacionClientes["Client"]["company"])));
  27. $this->set('contadorNecesidades', $contadorNecesidades);
  28. }
  29.  
  30. <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  31. <div class="modal-dialog modal-lg" role="document">
  32. <div class="modal-content">
  33. <div class="modal-header">
  34. <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
  35. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  36. <span aria-hidden="true">&times;</span>
  37. </button>
  38. </div>
  39. <div class="modal-body">
  40. <?php
  41. echo $this->Form->create('Need', array("class" => "form-signin"));
  42. echo $this->Form->input('client', array('label' => array('text' => " "),
  43. 'placeholder' => '¿Para que marca vamos a trabajar?',
  44. 'class' => 'validador txtClient lang prettyName', "type" => "hidden", 'key' => 'txtClient',
  45. "value" => $informacionClientes['company']));
  46. echo $this->Form->input('process', array('label' => array('text' => " "),
  47. 'placeholder' => '¿Para que marca vamos a trabajar?',
  48. 'class' => '', "type" => "hidden", 'key' => 'txtClient',
  49. "value" => "Empty"));
  50. echo $this->Form->input('date', array('label' => array('text' => " "),
  51. 'placeholder' => '¿Para que marca vamos a trabajar?',
  52. 'class' => '', "type" => "hidden", 'key' => 'txtClient',
  53. "value" => date("j") . "/" . date("n") . "/" . date("Y")));
  54. ?>
  55. <div class="form-group">
  56. <?php
  57. echo $this->Form->input('need', array('label' => array('text' => "Escríbenos acerca de tu necesidad",
  58. 'key' => 'lblNeed', 'class' => 'lang'), 'placeholder' => 'Agradecemos nos detalles muy bien la necesidad, '
  59. . 'es nuestro punto de partida para generar ideas quer fortalezcan la estrategia para resolverla.',
  60. 'rows' => '4', "minlength" => "900", "required" => "true", "maxlength" => "", 'class' => 'validador txtNeed lang prettyText validLength', 'key' => 'txtNeed', 'style' => 'resize: none;'));
  61. ?>
  62. <div class="invalid-feedback">
  63. </div>
  64. </div>
  65. <div class="form-group">
  66. <?php
  67. echo $this->Form->input('objective', array('label' => array('text' => "¿Cuál es el objetivo?",
  68. 'key' => 'lblObjective', 'class' => 'lang'), 'placeholder' => 'Que se quiere alcanzar con la'
  69. . 'solución de la necesidad, ¿Adquirir usuario? ¿Mejorar ventas? ¿Posicionar la marca? ... entre otros.'
  70. . ' Agradecemos nos detalles muy bien el objetivo.', 'rows' => '4', "minlength" => "300", "maxlength" => "",
  71. 'class' => 'validador txtObjective lang prettyText validLength', "required" => true, 'key' => 'txtObjective', 'style' => 'resize: none;'));
  72. ?>
  73. <div class="invalid-feedback">
  74. </div>
  75. </div>
  76. </div>
  77. <div class="modal-footer">
  78. <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  79. <?php echo $this->Form->end(__('Guardar')); ?>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
Add Comment
Please, Sign In to add comment