Exemplo n.º 1
0
         $out = array('success' => 'false', 'error' => $e->getMessage());
     }
     break;
 case 'incluir-anexo-resposta':
     try {
         Session::set('_upload', array('digital' => $_POST['hdnUploadDigital']));
         //var_dump($_FILES['inpFileUpload']);
         if ($_FILES['inpFileUpload']['type'] == '') {
             $arrNome = explode('.', $_FILES['inpFileUpload']['name']);
             //var_dump($arrNome); die;
             $_FILES['inpFileUpload']['type'] = array_pop($arrNome);
         }
         $arquivo = new UploaderPdfResposta($_FILES['inpFileUpload']);
         $arquivo->idPrazo = $_POST['hdnUploadPrazo'];
         $arquivo->upload();
         $out = DaoPrazoDemanda::incluirAnexoResposta($arquivo)->toArray();
     } catch (Exception $e) {
         $out = array('success' => 'error', 'error' => $e->getMessage());
     }
     break;
 case 'excluir-anexo-resposta':
     try {
         $idAnexo = $_POST['id_anexo'];
         $out = DaoPrazoDemanda::excluirAnexoResposta($idAnexo)->toArray();
     } catch (Exception $e) {
         $out = array('success' => 'false', 'error' => $e->getMessage());
     }
     break;
 case 'carregar-demanda':
     try {
         $digDemanda = $_POST['nu_proc_dig_ref'];