public function actionEvaluate($id)
 {
     $model = $this->findModel($id);
     $solucion = new SolucionReclamoSugerencia();
     if (Yii::$app->request->isAjax && $solucion->load($_POST)) {
         Yii::$app->response->format = 'json';
         return \yii\widgets\ActiveForm::validate($model);
     }
     if ($solucion->load(Yii::$app->request->post())) {
         $solucion->ESR_ID = 1;
         $solucion->REC_NUMERO = $model->REC_NUMERO;
         $solucion->SRS_FECHA_ENVIO = date('Y-m-d');
         //Aprobar o rechazar el Reclamo o Sugerencia
         $historial = new HistorialEstados();
         if ($solucion->SRS_VISTO_BUENO == 'Autorizado') {
             $model->ERS_ID = 2;
             $motivo = $model->REC_MOTIVO;
             $model->REC_MOTIVO = $motivo;
             $model->save();
             $solucion->save();
             //insertar en el historial la aprobacion
             $historial->REC_NUMERO = $model->REC_NUMERO;
             $historial->ERS_ID = $model->ERS_ID;
             $historial->USU_RUT = $solucion->USU_RUT;
             $historial->HES_FECHA_HORA = date('Y-m-d H:i:s');
             $historial->HES_COMENTARIO = "El usuario " . $historial->USU_RUT . " ha Aprobado el Reclamo Nº " . $historial->REC_NUMERO . " el día " . $historial->HES_FECHA_HORA;
             $historial->save();
         } else {
             $model->ERS_ID = 3;
             $motivo = $model->REC_MOTIVO;
             $model->REC_MOTIVO = $motivo;
             $model->save();
             $solucion->save();
             //insertar en e historial el rechazo
             $historial->REC_NUMERO = $model->REC_NUMERO;
             $historial->ERS_ID = $model->ERS_ID;
             $historial->USU_RUT = $solucion->USU_RUT;
             $historial->HES_FECHA_HORA = date('Y-m-d H:i:s');
             $historial->HES_COMENTARIO = "El usuario " . $historial->USU_RUT . " ha Rechazado el Reclamo Nº " . $historial->REC_NUMERO . " el día " . $historial->HES_FECHA_HORA;
             $historial->save();
         }
         //  $solucion->save();
         return $this->redirect(['/solucion-reclamo-sugerencia/view', 'id' => $solucion->SRS_ID]);
     } else {
         if ($model->ERS_ID != 1) {
             //soucion parche
             return $this->redirect(['/solucion-reclamo-sugerencia/index']);
         } else {
             return $this->render('evaluate', ['model' => $model, 'solucion' => $solucion]);
         }
     }
 }