public function clientesolicitudAction()
 {
     $producto_id = $this->request->getPost('producto_id');
     $model = new Solicitudesproductos();
     $resul = $model->clientessolicitudes($producto_id);
     $html = '';
     if (count($resul) > 0) {
         $html = '<table class="table table-vcenter table-striped">
         <thead>
             <tr>
                 <th>Cliente</th>
                 <th>Cant. Solicitada</th>
                 <th>Fecha Solicitud</th>
             </tr>
         </thead>
         <tbody>';
         foreach ($resul as $v) {
             $html .= '<tr>
                 <td>' . $v->razon_social . '</td>
                 <td>' . $v->cantidad . '</td>
                 <td>' . date("d-m-Y", strtotime($v->fecha_recepcion_solicitud)) . '</td>
             </tr>';
         }
         $html .= '</tbody>
     </table>
     <hr>';
     }
     $this->view->disable();
     echo $html;
 }
 public function saverespuestaAction()
 {
     if ($this->request->isPost()) {
         $fecha_envio_resp = date("Y-m-d", strtotime($this->request->getPost('fecha_envio_resp')));
         $fecha_recepcion_resp = date("Y-m-d", strtotime($this->request->getPost('fecha_recepcion_resp')));
         $resul = Solicitudes::findFirstById($_POST['id']);
         $resul->respuesta = $this->request->getPost('respuesta');
         $resul->fecha_envio_resp = $fecha_envio_resp;
         $resul->fecha_recepcion_resp = $fecha_recepcion_resp;
         $resul->descripcion_resp = $this->request->getPost('descripcion_resp');
         $resul->estado = $this->request->getPost('estado');
         if ($resul->save()) {
             if ($this->request->getPost('estado') == '3') {
                 $model = new Solicitudesproductos();
                 $resul = $model->updateCantSolicitud($_POST['id']);
             }
             $msm = 'Exito: Se guardo correctamente';
         } else {
             $msm = 'Error: No se guardo el registro';
         }
     }
     $this->view->disable();
     echo $msm;
 }