function format_fld($zq1, $zq2) { global $hd, $LANG; $zqr = ''; if (strlen($zq2) > 0) { if (substr($zq2, 0, 1) == '(') { $zqr = substr($zq2, strpos($zq2, $zq1 . ':') + 2, 100); // echo '['.strpos($zq2,$zq1.':').']'; if (strpos($zqr, '&') > 0) { $zqr = substr($zqr, 0, strpos($zqr, '&')); } $zqr = $zq1 . '-' . $zqr; } ////////////////////// $ if ($zq2 == 'M') { $zqr = msg($zq1); } if ($zq2 == '$') { $zqr = Number_format($zq1 / 100, 2); } ////////////////////// $R if ($zq2 == '$R' or $zq2 == '2') { $zqr = Number_format($zq1, 2); if ($LANG == 'en_US') { $zqr = $zqr; } if ($LANG == 'pt_BR' or $zq2 == '2') { $zqr = troca(troca(troca($zqr, '.', '#'), ',', '.'), '#', '.'); } } ////////////////////// C if (substr($zq2, 0, 1) == 'C') { $zqr = '<CENTER>'; $zqr = $zqr . $zq1; } ////////////////////// # if (substr($zq2, 0, 1) == '#') { $zqr = '<CENTER>'; $zqr = $zqr . $zq1; } ////////////////////// @ if ($zq2 == 'SHORT') { $zqr = $zqr . SubStr($zq1, 0, 1) . LowerCase(SubStr($zq1, 1, strpos($zq1, ' '))); } if ($zq2 == '@') { $zqr = UpperCase(SubStr($zq1, 0, 1)); if (substr($zq1, 1, 1) == ' ') { $zqr = $zqr . ' '; } $zqr = $zqr . LowerCase(SubStr($zq1, 1, 200)); } ////////////////////// Bold if ($zq2 == 'B') { $zqr = $zqr . '<B>' . $zq1 . '</B>'; } ////////////////////// CB if ($zq2 == 'CB') { $varf = $vars[$varf]; $vvvt = ''; $vvvt = $vars['chk' . $zq1]; if ($vvvt == "1") { $vvvt = "checked"; } $zqr = $zqr . '<input type="checkbox" name="chk' . $zq1 . '" ' . $vvvt . ' value="1">'; } ////////////////////// CEP if ($zq2 == 'CEP') { $xxcep = sonumero($zq1); if (strlen($xxcep) == 8) { $xxcep = substr($xxcep, 0, 2) . '.' . substr($xxcep, 2, 3) . '-' . substr($xxcep, 5, 3); } $zqr = $zqr . $xxcep; } ////////////////////// D if ($zq2 == 'D') { $zqr = '<CENTER>'; $dta = trim($zq1); if ($dta == '19000101') { $zqr = $zqr . '-'; } else { $zqr = $zqr . stodbr($zq1); } } ////////////////////// DR if ($zq2 == 'DR') { $zqr = '<CENTER>'; $dta = trim($zq1); if ($dta == '19000101') { $zqr = $zqr . '-'; } else { $zqr = $zqr . substr(stodbr($zq1), 0, 5); } } ////////////////////// H if (substr($zq2, 0, 1) == 'H' and $zq2 != 'H1' and $zq2 != 'H2') { $zqr = ''; if ($hd != trim($zq1)) { $zq1v = $zq1; if (substr($zq2, 1, 1) == 'D') { $zq1v = stodbr($zq1); } // $zqr .= '<TR><TD colspan="15" height="1" bgcolor="#c0c0c0"></TD></TR>'; $zqr .= '<TR><TD bgcolor="#FFFFFF" colspan="15" class="lt2" align="left"><HR size="1"><B>' . $zq1v . '</TD></TR>'; $hd = trim($zq1); $zqr = $zqr . '<TR><TD></TD>'; } } if ($zq2 == 'H1') { $zqr = $zqr . '<h1>' . $zq1 . '</h1>'; } if ($zq2 == 'H2') { $zqr = $zqr . '<h2>' . $zq1 . '</h2>'; } ////////////////////// Italic if ($zq2 == 'I') { $zqr = $zqr . '<I>' . $zq1 . '</I>'; } if (${$zq2} == 'NL') { $zqr = $zqr . '<TR ' . $xcol . '><TD><TD>' . $linkv . $zq1; } if ($zq2 == 'SHORT') { $zqr = $zqr . LowerCase(SubStr($zq1, 1, strpos($zq1, ' '))); } ////////////////////// SN if ($zq2 == 'SN') { $zqr = '<CENTER>'; $dta = trim($zq1); if ($dta == '1' or $dta == true or $dta == 'S') { $zqr = $zqr . 'SIM'; } else { $zqr = $zqr . 'NAO'; } } ////////////////////// C if (substr($zq2, 0, 2) == 'OB') { $zqr = '<CENTER>'; if ($zq1 == '1') { $zqr .= msg('yes'); } else { $zqr .= msg('no'); } } if ($zq2 == 'Z') { $zqr = '<CENTER>'; $zqr = $zqr . strzero($zq1, '0' . substr($zq2, 1, 2)); } } else { $zqr = $zq1; } return $zqr; }
function report_002() { global $cep; $sql = "select * from cep_protocolos \n\t\t\t\t\t\twhere cep_tipo = 'PRO'\n\t\t\t\t\t\tand cep_status = 'P'\n\t\t\t\t\t\t\n\t\t\t\t\t\torder by cep_monitoring\t\t\t\t\n\t\t\t\t"; $rlt = db_query($sql); $id = 0; $sx = '<table width="100%" class="table_proj">'; $sx .= '<TR><TH>' . msg('caae'); $sx .= '<TH>' . msg('protocol_title'); $sx .= '<TH><nobr>' . msg('monitoring'); $sx .= '<TH>' . msg('status'); while ($line = db_read($rlt)) { $bgcor = ''; if ($line['cep_monitoring'] < date("Ymd")) { $bgcor = 'style="background-color:#FF8080; " '; } $id++; $link = '<A HREF="protocolo_detalhe_investigator.php?dd0=' . $line['id_cep'] . '&dd90=' . checkpost($line['id_cep']) . '">'; $sx .= chr(13); $sx .= '<TR valign="top">'; $sx .= '<TD>' . $link; $sx .= $line['cep_caae']; $sx .= '<TD>' . $link; $sx .= $line['cep_titulo']; $sx .= '<TD ' . $bgcor . '>' . $link; $sx .= stodbr($line['cep_monitoring']); $sx .= '<TD>' . $link; $sx .= $cep->mostra_status($line['cep_status']); } $sx .= '</table>'; return $sx; }
require_once '_ged_config.php'; $ged->protocolo = $dd[0]; $sql = "select * from " . $ged->tabela; $sql .= " left join " . $ged->tabela . "_tipo on doc_tipo = doct_codigo "; $sql .= " where doc_dd0 = '" . $ged->protocol . "' and doc_ativo=1 "; $xrlt = db_query($sql); $tot = 0; $pdf->SetFont('Arial', 'B', 9); $pdf->Cell(6, 5, utf8_decode(msg('iten')), 1, 0, 'C'); $pdf->Cell(40, 5, utf8_decode(msg('type')), 1, 0, 'C'); $pdf->Cell(88, 5, utf8_decode(msg('file_filename')), 1, 0, 'L'); $pdf->Cell(18, 5, utf8_decode(msg('file_size')), 1, 0, 'L'); $pdf->Cell(38, 5, utf8_decode(msg('file_data')), 1, 0, 'L'); $id++; $pdf->SetFont('Arial', '', 9); while ($xline = db_read($xrlt)) { $capt = trim($xline['doct_nome']); if (substr($capt, 0, 1) == '#') { $capt = msg(substr($capt, 1, strlen($capt))); } //$link = 'ged_download.php?dd0='.$xline('id_doc').'&dd90='.checkpost($xline['id_doc'].$secu); $pdf->Ln(); $pdf->Cell(6, 5, $id, 1, 0, 'C'); $pdf->Cell(40, 5, $capt, 1, 0, 'L'); $pdf->Cell(88, 5, $xline['doc_filename'], 1, 0, 'L'); $pdf->Cell(18, 5, $ged->size_mask($xline['doc_size']), 1, 0, 'L'); $pdf->Cell(38, 5, stodbr($xline['doc_data']) . ' ' . $xline['doc_hora'], 1, 0, 'L'); $tot++; } $pdf->Ln(6); $pdf->Ln(6);
function mostra_todas_csf($aluno_id) { $sql = "select * from csf_view where id_us = " . round($aluno_id); $rlt = $this->db->query($sql); $rlt = $rlt->result_array($rlt); $sx = '<table width="100%" align="left" class="border1 tabela01" border=0>'; $sx .= '<tr> <th width="5%" align=left> protocolo</th> <th width="10%" align=left> situação</th> <th width="20%" align=left> edital</th> <th width="24%" align=left> universidade</th> <th width="10%" align=left> país</th> <th width="10%" align=left> parceiro</th> <th width="5%" align=center> saída</th> <th width="5%" align=center> retorno</th> <th width="1%" >-</th> </tr> '; $tot = 0; for ($r = 0; $r < count($rlt); $r++) { $tot++; $line = $rlt[$r]; $link = base_url('index.php/csf/ver/' . $line['id_csf'] . '/' . checkpost_link($line['id_csf'])); $link = '<A HREF="' . $link . '" class="lt4 link">'; $sx .= '<tr valign="top">'; $sx .= '<td class="borderb1" align="center">'; $sx .= $link . 'CF' . strzero($line['id_csf'], 5) . '</A>'; $sx .= '</td>'; $sx .= '<td class="borderb1">'; $sx .= $line['cs_descricao']; $sx .= '</td>'; $sx .= '<td class="lt1 borderb1">'; $sx .= $line['ed_titulo']; $sx .= '</td>'; $sx .= '<td class="borderb1">'; $sx .= $line['gpip_nome']; $sx .= '</td>'; $sx .= '<td class="borderb1">'; $sx .= $line['nome']; $sx .= '</td>'; $sx .= '<td class="borderb1">'; $sx .= $line['cp_descricao']; $sx .= '</td>'; $sx .= '<td class="borderb1" align="center">'; $dt1 = $line['csf_saida']; $prev = ''; if ($dt1 == '0000-00-00') { $dt1 = $line['csf_saida_previsao']; $prev = '<a ref="#" title="previsão de saída">*</A>'; } $sx .= stodbr($dt1); $sx .= '<span color="blue">' . $prev . '</span>'; $sx .= '</td>'; $sx .= '<td class="borderb1" align="center">'; $dt1 = $line['csf_retorno']; $prev = ''; if ($dt1 == '0000-00-00') { $dt1 = $line['csf_retorno_previsao']; $prev = '<a ref="#" title="previsão de retorno">*</A>'; } $sx .= stodbr($dt1); $sx .= '<span color="blue">' . $prev . '</span>'; $sx .= '</td>'; $sx .= '<td class="borderb1">'; $img = '<img src="' . base_url('img/icon/icone_editar.png') . '" border=0 height="24" onclick="mostra(\'csf' . $r . '\',' . $line['id_csf'] . ');" class="link">'; $sx .= $img; $sx .= '</td>'; $sx .= '<tr><td colspan=10>'; $sx .= '<div id="csf' . $r . '" style="display:none; width: 100%;">aguarde ...</div>'; $sx .= '</td></tr>'; } $sx .= '<tr><td colspan=10 class="lt0">* Previsão</td></tr>'; $sx .= '</table>'; $sx .= ' <script> function mostra($id,$reg) { $idr = "#"+$id; $($idr).fadeIn(); var $url = "' . base_url('index.php/csf/ajax/') . '/"+$reg+"/"+$id; $.ajax({ url: $url, type: "post", success: function(data){ $($idr).html(data); }, error:function(data){ $($idr).html(data); } }); } </script> '; return $sx; }
function dados() { global $date, $LANG, $tab_max; $oms = new oms(); $line = $this->line; $gr = trim($line['cep_grupo']); $versao = $line['cep_versao']; $codigo = $line['cep_codigo']; $clinic_st = round($line['cep_clinic']); $protocol_cep = trim($line['cep_protocol']); $oms = new oms(); if ($clinic_st == 1) { $clinic = msg('clinic_study'); } else { $clinic = ''; } $status = 'cep_status_' . trim($line['cep_status']); $protocol_id = $this->protocolo; /* Estatus */ $sp = ''; $sp .= '<table width="100%" border=0 cellpadding=0 cellspacing=0 class="table_normal">'; $sp .= '<TR><TD>' . msg('protocol') . ' <B>' . $clinic . '</B><TD align="right">' . msg('status') . ': ' . msg($status); $sp .= '</table></B>'; /* CAAE */ $sp .= '<table width="100%" border=0 class="lt0">'; $sp .= '<TR><Td colspan=4 >' . msg('caae'); $sp .= ' <Td colspan=4 >' . msg('project_type'); $sp .= '<TR><Td colspan=4 class="table_proj" ><B>'; $sp .= trim($line['cep_caae']); $sp .= ' <Td colspan=3 class="table_proj">'; $sp .= msg('amendment__' . trim($line['cep_tipo'])); $sp .= ' <Td colspan=1 class="table_proj" align="right">'; if ($clinic_st == 1) { $sp .= $oms->icone($protocol_id); } $sp .= '</table>'; /* Title */ $sp .= '<table width="100%" border=0 class="lt0">'; $sp .= '<TR><Td colspan=7 class="lt0">' . msg('project_title'); $sp .= '<TR><Td colspan=7 class="table_proj"><B>'; $sp .= trim($line['cep_titulo']); $sp .= '</table>'; /* Investigador */ $sp .= '<table width="100%" border=0 class="lt0">'; $sp .= '<TR><Td colspan=6>' . msg('project_investigador'); $sp .= '<Td align="right" width="10%">' . msg('protocol'); $sp .= '<TR><Td colspan=6 class="table_proj">'; $tipo = $this->line['cep_tipo']; if ($tipo == 'PRO') { $sp .= '<img src="img/icone_plus.png" align="right" height="16" id="new_author" alt="include_investigator">'; //$sp .= '<TR><TD colspan=2>'; $sp .= chr(13) . '<script type="text/javascript">'; $sp .= chr(13) . '$("#new_author").click(function() { $("#new_author").hide(); $("#team").show(); var $tela = $.ajax({ url: "team_ajax_cep.php", type: "POST", data: { dd11: "' . $protocol_id . '", dd10: "team" ,dd12: "' . $protocol_id . '" } }) .fail(function() { alert("error"); }) .success(function(data) { $("#team").html(data); }); });'; $sp .= chr(13) . '</script>'; } $sp .= $this->investigadores($line); /* Protocolo de submissão */ $sp .= ' ' . chr(13); $sp .= '<Td align="rigth" class="table_proj" > <div style="width:100%; text-align: right;">' . $protocol_id . '</div>'; $sp .= '</table>'; /* Inser new investigator */ $sp .= '<table width="100%" border=0 class="lt0">'; $sp .= '<TR><TD colspan=7>'; $sp .= '<div id="team" style="display: none; ">'; $sp .= '</div>'; /* INstitution */ $sp .= '<TR><Td colspan=1 width="50%" class="lt0">' . msg('institution'); $sp .= '<Td align="left" colspan=1 width="25%" class="lt0" width="10%">' . msg('country'); $sp .= '<Td align="left" colspan=1 width="25%" class="lt0" width="10%">' . msg('result'); /* dados da instituicao */ $sp .= '<TR><Td colspan=1 class="table_proj">'; $sp .= trim($line['us_instituition']); $sp .= ' ' . chr(13); $sp .= '<Td class="table_proj">'; $sp .= trim($line['pais_nome']) . ' '; $sp .= '<Td class="table_proj">'; $sp .= msg(trim($line['cep_pr_protocol'])) . ' '; $sp .= ' ' . chr(13); if (strlen($clinic) > 0) { /* XML OMS */ //$sp .= '<Td colspan=1 class="lt2"><NOBR>'; //$sp .= $oms -> icone($this -> line['id_cep']); //$sp .= ' ' . chr(13); } $sp .= '</table>'; $sp .= '<table width="100%" border=0 class="lt0">'; $sp .= '<TR>'; $sp .= '<TD width="10%">' . msg('date_accept'); $sp .= '<TD width="10%">' . msg('date_update'); $sp .= '<TD width="10%">' . msg('meet_data'); $sp .= '<TD width="10%">' . msg('dictamen_date'); $sp .= '<TD width="10%">' . msg('aware_date'); $sp .= '<TD width="10%">' . msg('date_reclutamiento'); $sp .= '<TD width="10%">' . msg('date_amendment'); $sp .= '<TD>' . msg('monitoring'); $sp .= '<TR class="lt2" valign="top">'; $sp .= '<Td class="table_proj lt2" align="left" >'; $sp .= ' ' . stodbr($line['cep_data']); $sp .= '<Td class="table_proj lt2" align="left">'; $sp .= ' ' . stodbr($line['cep_atualizado']); $sp .= '<Td class="table_proj lt2" align="left">'; $sp .= ' ' . stodbr($line['cep_reuniao']); $sp .= '<Td class="table_proj lt2" align="left">'; $sp .= ' ' . stodbr($line['cep_dt_parecer']); $sp .= '<Td class="table_proj lt2" align="left">'; $sp .= ' ' . stodbr($line['cep_dt_ciencia']); $sp .= '<Td class="table_proj lt2" align="left">'; /* dados sobre recutramento */ $dtr = $line['cep_recrutamento']; if ($dtr < 20000000) { $sp .= ' ' . msg('no_start'); } else { $sp .= ' ' . stodbr($line['cep_recrutamento']); $sp .= '<BR><font class="lt1">'; $sp .= msg($line['cep_recrutamento_status']); $sp .= '</font>'; } $sp .= '<Td class="table_proj lt2" align="left">'; $sp .= ' ' . stodbr($line['cep_dt_liberacao']); $sp .= '<Td class="table_proj lt2" align="right"><center>'; $sp .= ' ' . $this->monitoring($line['cep_monitoring']); $sp .= '</table>'; $sp .= '</table>'; return $sp; }
function protocolos_mostrar($rst) { global $colunas; $sx = ''; $sx .= '<table class="tabela00 lt1" width="100%">'; $sx .= '<TR class="lt1"> <TH width="10%">' . msg('caae'); $sx .= '<TH>' . msg('protocol_title'); $sx .= '<TH width="15%"><nobr>' . msg('main_type'); $sx .= '<TH width="7%"><nobr>' . msg('last_update'); $sx .= '<TH width="7%">' . msg('status'); $xsta = "X"; $id = 0; for ($r = 0; $r < count($rst); $r++) { $id++; $line = $rst[$r]; $sta = trim($line['doc_status']); $asta = ''; if (strlen($sta == '')) { $sta = '@'; } $cor = ''; $page_link = ''; switch ($sta) { case '@': $page_link = 'protocol_submit.php'; $asta = '<font color="green">' . msg('status_@'); $img = '<img src="img/icone_edit.png" height="20" title="view">'; break; case 'Z': $page_link = 'protocol_submit.php'; $asta = '<font color="red">' . msg('problem') . '</font>'; break; case 'A': $page_link = ''; $img = '<img src="img/icone_view.png" height="20" title="view">'; break; case '$': $page_link = 'protocol_submit.php'; $page_link = 'protocol_submit_detalhe.php'; $asta = msg('status_$'); $cor = '<font color="red">'; $asta = '<font color="red">' . msg('problem') . '</font>'; break; case 'X': $asta = msg('status_X'); break; case 'H': $asta = msg('status_H'); break; } /* Dados do projeto */ $id = $line['id_doc']; $link = '<a href="' . $page_link . '?dd0=' . $id . '&dd90=' . checkpost($id) . '" class="link lt1">'; $tit = trim($line['doc_1_titulo']); if (strlen($tit) == 0) { $tit = msg('not_definid'); } $sxx = '<TR valign="top ">'; $sxx .= '<TD class="lt1">' . $line['doc_protocolo']; $sxx .= '<TD>'; $sxx .= $link . $cor; $sxx .= $tit; $sxx .= '<TD><nobr>'; $sxx .= '<font class="lt1">'; $sxx .= msg('amendment_' . $line['doc_type']); $sxx .= '<TD>'; $sxx .= '<font class="lt0">'; $sxx .= stodbr($line['doc_dt_atualizado']); $sxx .= '<TD><nobr>' . $link . $cor; $sxx .= $asta; $sxx .= '<TD width="10">' . $link . $img; if ($sta == 'Y' or $sta == 'Z') { /* Protocol ja finalizado */ $sx .= $sxx; } else { $sx .= $sxx; } } $sx .= '</table>'; if (count($rst) == 0) { $sx = ''; } return $sx; }
function mostra_pareceres_emitidos() { global $dd; $cep = new cep(); $caae = $this->protocol; $sql = "select * from cep_protocolos \n\t\t\t\t\tinner join cep_parecer on cep_protocol = pr_protocol \n\t\t\t\t\twhere cep_protocol = '{$caae}' \n\t\t\t\t\tand pr_status = 'A'\n\t\t\t\t\t"; $rlt = db_query($sql); $sx .= '<table class="tabela00 lt1" width="100%" border=0>'; $sx .= '<TR> <TH>' . msg('file_tipo') . ' <TH>ID <TH>' . msg('date') . ' <TH>' . msg('status') . ' <TH>' . msg('status') . ' <TH>' . msg('accompaniment') . ' <TH>' . msg('action') . ' '; while ($line = db_read($rlt)) { $id = $line['id_pr']; $rela = round($line['pr_accompaniment']); $accompaniment = $cep->monitoring($rela); $link = '<A HREF="#" onclick="newxy2(\'dictamen_pdf.php?dd1=' . $id . '&dd90=' . checkpost($id) . '\',800,600);">Print</A>'; $sx .= '<TR align="center">'; $sx .= '<TD class="border1">'; $sx .= msg('dictamen'); $sx .= '<TD class="border1">'; $sx .= strzero($line['id_pr'], 7); $sx .= '<TD class="border1">'; $sx .= stodbr($line['pr_data']); $sx .= '<TD class="border1">'; $sx .= $line['pr_status']; $sx .= '<TD class="border1">'; $decision = msg('pm_' . trim($line['pr_situacao'])); $sx .= mst($decision); $sx .= '<TD class="border1">'; $sx .= $accompaniment; $sx .= '<TD class="border1">'; $sx .= $link; } $sx .= '</table>'; return $sx; }
function mostra($data = 0, $page = 6) { global $institution_name, $institution_site; $data = round($data); $sql = "select * from cep_protocolos\n\t\t\t\t\tleft join usuario on cep_pesquisador = us_codigo\n\t\t\t\t\twhere cep_reuniao = {$data}\n\t\t\t\t\torder by cep_caae , cep_data\n\t\t\t\t"; $rlt = db_query($sql); $link = '<A href="javascript:newxy2(\'meeting_schediled_popup.php?dd1=' . $data . '&dd2=' . $page . '\',800,600);">'; $sh = '<table bgcolor="white" class="tabela00" cellpadding=0 cellspacing=0 width="100%" border=0>'; $sh .= '<TR valign="top"> <TD colspan=1 rowspan=2 width="10%">'; $sh .= '<img src="img/logo_dictamen.jpg">'; $sh .= '<TD colspan=2><center><B>' . $institution_name . '</B>'; $sh .= '<BR>' . $institution_site; $sh .= '</center>'; $sh .= '<div id="icone_pr">' . $link . '<img src="img/icone_print.png" width="48" border=0></A></div>'; $sh .= '<TR><TD>'; $sh .= '<div class="lt0" style="text-align: right">page</div>'; $sh .= '</table>'; /* Dados da pauta */ $sh .= '<table class="table_proj tabela00" width="100%" border=0>'; $sh .= '<TR><TD colspan=4><h2><center>' . msg("scheduled_meeting") . ' - ' . stodbr($data) . '</center></h2>'; $sh .= '<TR> <TH width="10%">' . msg('protocol'); $sh .= '<TH width="80%" colspan=2>' . msg('project_title'); $sh .= '<TH width="10%">' . msg('results'); $sx = ''; $tot = 99; $totr = 0; $pag = 1; while ($line = db_read($rlt)) { if ($tot + 1 > $page) { $tot = 0; if ($pag > 1) { $sx .= '</table>'; $sx .= '<p style="page-break-before: always;"></p>'; } $sx .= troca($sh, 'page', 'p. ' . $pag); $pag++; } $tot++; $totr++; $sx .= '<TR valign="top" class="tabela01">'; /* NR caae */ $sx .= '<TD rowspan=2> <font class="lt1"><B>' . $line['cep_caae'] . '</B>' . '</font>'; $sx .= '<BR>' . msg('version') . ' ' . $line['cep_versao']; $sx .= '<BR><center><font class="lt0">' . stodbr($line['cep_data']) . '</font></center>'; /* Project title */ $sx .= '<TD colspan=2><B>' . $line['cep_titulo'] . '</B>'; /* Decision */ $sx .= '<TD rowspan=2 width="60"><center>' . msg('decision'); $sx .= '<table border=1 width=80%> <TR><TD height="30"> </table>'; $sx .= '<TR>'; $sx .= '<TD colspan=2>' . msg('investigador') . ': <B>' . $line['us_nome']; $sx .= '</B> - ' . $line['us_instituition']; $sx .= '<BR> '; } $sx .= '<TR><TD colspan=3>' . msg('found') . ' ' . $totr . ' ' . msg('register'); $sx .= '</table>'; $sx .= show_logo(); return $sx; }
function editar($cp, $tabela, $post = '') { global $dd, $acao, $path, $http; /* AJAX */ if ($this->ajax == 1) { if (strlen($this->frame) == 0) { echo 'FRAME NAME NOT FOUND'; exit; } /* Mostra campos para o ajax */ $vars = ''; $data = ''; $ks = ''; for ($r = 0; $r < count($cp) + 2; $r++) { /* Novo */ $op = substr($cp[$r][0], 0, 2); if ($op != '$O' and $op != '$Q') { $vars .= 'var ddv' . $r . ' = $("#dd' . $r . '").val();' . chr(13) . chr(10); } else { $vars .= 'var ddv' . $r . ' = $(\'#dd' . $r . ' option:selected\').val();' . chr(13) . chr(10); } if (strlen($data) > 0) { $data .= ', '; } $data .= 'dd' . $r . ': ddv' . $r . ' '; } $data .= ', dd91: \'' . $this->frame . '\', dd89: \'' . $this->frame . '\', acao: \'gravar\' '; /* Inicia construcao do formulario */ $sx = ''; $page = $http . '_ajax/ajax_form.php'; $sx .= ' <script> var dd91 = \'' . $this->frame . '\'; function enviar_formulario(id) { ' . $vars . ' /* alert("POST "+id + "' . $data . ' - ' . $this->frame . '"); */ var tela01 = $.ajax({ type: "POST", url: \'' . $page . '\', data: { ' . $data . '} }) .done(function(data) { $("#' . $this->frame . '_main").html(data); }) .fail(function() { alert("error"); }); } </script> '; } $this->total_cps = count($cp); /* Local de salvamento dos dados */ if (strpos($tabela, ':') > 0) { /* Salva em arquivos */ $file = 1; } else { /* Salvar em tabela de base de dados */ $file = 0; } /* Campos */ $bto = 0; for ($r = 0; $r < count($cp); $r++) { if (substr($cp[$r][0], 0, 2) == '$B') { $bto = 1; } } if ($bto == 0) { array_push($cp, array('$B8', '', msg('save'), false, false)); } $this->keyid(); array_push($cp, array('$TOKEN', '', '', True, False)); /** * Recupera informacoes da tabela do banco de dados */ $recupera = 0; if (strlen($tabela) > 0 and $file == 0 and strlen($acao) == 0 and strlen($dd[0]) > 0 and strlen($cp[0][1]) > 0) { $sql = "select * from " . $tabela . " where " . $cp[0][1] . " = '" . $dd[0] . "'"; $rrr = db_query($sql); if ($line = db_read($rrr)) { $this->line = $line; } $recupera = 1; } /** * Recupera informacoes do arquivo */ if (empty($filename)) { $filename = ''; } if (strlen($filename) > 0 and $file == 1 and strlen($acao) == 0) { echo '#1#'; exit; require $filename; $recupera = 1; } /** * Processa */ $this->js_submit = '<script>'; if (strlen($post) == 0) { $post = page(); } $this->saved = 1; $this->rq = ''; //echo '<BR>'.date("Y-m-d H:i:s"); if (empty($sx)) { $sx = ''; } if (empty($sh)) { $sh = ''; } $sx .= '<form id="' . $this->form_name . '" method="post" action="' . $post . '">' . chr(13); $sh .= '<table class="' . $this->class_form_standard . '" width="100%" border=0 >' . chr(13); for ($r = 0; $r < count($cp); $r++) { if ($recupera == 1) { $fld = trim($cp[$r][1]); $vlr = trim($this->line[$fld]); if (strlen($vlr) > 0) { $dd[$r] = trim($this->line[$fld]); } if (substr($cp[$r][0], 0, 2) == '$D') { $dd[$r] = stodbr($this->line[$fld]); } } $this->name = 'dd' . $r; if (!is_array($dd)) { $dd = array(); } $this->value = trim($dd[$r]); $sx .= $this->process($cp[$r]); if ($cp[$r][0] == '$CAPTCHA' and strlen($acao) > 0) { $captcha = $_SESSION['form_captcha']; if ($captcha != trim($dd[$r])) { $this->value = ''; echo 'erro'; } else { echo 'ok'; } } if ($cp[$r][0] == '$TOKEN' and strlen($acao) > 0) { $keyc = md5($this->key); if ($keyc != $this->value) { $sx .= '<TR><TD colspan=2><font color="red">Try CSRF (ingected)</font><BR>'; $this->saved = 0; } } if ($cp[$r][0] == '$TOKEN' and strlen($acao) > 0) { $array = $_POST; if (is_array($array)) { $fld = array_keys($_POST); } else { $fld = array(); } $fldk_value = '1'; $fldk_vlr = '2'; $sz = round(count($fld)); $fldk = ''; if ($sz > 0) { for ($ry = 0; $ry < count($fld); $ry++) { $flda = $fld[$ry]; if (!is_array($flda)) { if (substr($fld[$ry], 0, 2) == 'tk') { $fldk = $fld[$ry]; } } } //echo '<BR>FIM2-'.$sz.'-'.date("Y-m-d H:i:s"); if (strlen($fldk) > 0) { $fldk_value = substr($fldk, 2, strlen($fldk)); $fldk_vlr = round($_POST[$fldk] / 3); } else { $fldk_value = '1'; $fldk_vlr = '2'; } } if ($fldk_value != $fldk_vlr and $this->ajax == 0) { $sx .= '<TR><TD colspan=2><font color="red">Try CSRF ingected (2)</font><BR>'; $this->saved = 0; } } if ($this->required == '1' and strlen($this->value) == 0) { if ($this->required_message_post == 1) { $this->rq .= msg('field') . ' ' . $this->caption . ' ' . msg('is_requered') . '(dd' . $r . ')<BR>'; } $this->saved = 0; } } $sx .= '<input type="hidden" name="dd99" id="dd99" value="' . $dd[99] . '">' . chr(13); $sx .= chr(13) . '</table>'; $sx .= '</form>'; $this->js_submit .= chr(13) . '</script>'; $sx .= $this->js; $sx .= $this->js_submit; if (strlen($this->rq) > 0 and strlen($acao) > 0) { $sa = '<TR><TD colspan=2 bgcolor="#FFC0C0">'; $sa .= '<img src="' . $http . 'img/icone_alert.png" height="50" align="left">'; $sa .= '<font class="lt1">'; $sa .= $this->rq; $sa .= '</font>'; $sa .= $sx; $sx = $sa; } if ($this->saved > 0 and strlen($acao) > 0) { if (strlen($tabela) > 0) { if ($file == 0) { $this->save_post($cp, $tabela); } else { $this->save_file_post($cp, $tabela); } } //$sx = 'SAVED TABLE '.$tabela.' id = '.$dd[0]; } else { $this->saved = 0; } return $sh . $sx; }
require 'fphp-170/fpdf.php'; $versao_pdf = '0.0.36a'; $ln = 4; require "_class/_class_register_unit.php"; $reg = new register_unit(); //$register = dados_lista $protocol = $dd[0]; //Instanciation of inherited class $sql = "select * from cep_submit_documento "; $sql .= "where doc_protocolo = '" . $dd[0] . "' "; $rlt = db_query($sql); if ($line = db_read($rlt)) { $prj_tp = trim($line['doc_tipo']); $titulo = utf8_decode(trim($line['doc_1_titulo'])); $titp = utf8_decode(trim($line['doc_1_titulo_public'])); $data_submit = stodbr($line['doc_dt_atualizado']); $subt = ''; } require "_ged_config.php"; $ged->protocol = $dd[0]; $sql = "select * from cep_submit_manuscrito_field "; $sql .= " left join cep_submit_documento_valor on sub_codigo = spc_codigo "; $sql .= " where spc_projeto = '" . $dd[0] . "'"; $sql .= " and sub_ativo = 1 "; $sql .= " order by sub_pag, sub_pos, sub_ordem "; $rlt = db_query($sql); /* Extensão da Classe */ class PDF extends FPDF { // Page footer function Footer()
function display() { global $ss, $perfil, $dd; $id = $ss->user_codigo; /* Exluir e valida administrador */ $admin = 0; if ($perfil->valid('#ADM') or $perfil->valid('#MAS')) { $admin = 1; if ($dd[5] == 'DEL') { $idx = strzero($dd[0], 7); $sql = "update " . $this->tabela_perfil . " \n\t\t\t\t\t\t\t\t\tset up_ativo = 0 \n\t\t\t\t\t\t\t\t\twhere id_up = " . round($dd[6]); $rrr = db_query($sql); $this->set($id); } } //$id = $ $sql = "select * from " . $this->tabela_perfil; $sql .= " inner join " . $this->tabela . " on up_perfil = usp_codigo "; $sql .= " where up_usuario = '" . trim($id) . "' "; $sql .= " and up_ativo = 1"; $rlt = db_query($sql); $sx .= '<table width="100%" class="lt1">'; $sx .= '<TR><TH>' . msg('description'); $sx .= '<TH>' . msg('indication'); while ($line = db_read($rlt)) { $sx .= '<TR><TD>' . $line['usp_descricao']; $sx .= '<TD width="10%" align="center">' . stodbr($line['up_data']); if ($admin == 1) { $link = '<A HREF="' . page() . '?dd0=' . $dd[0] . '&dd1=' . $dd[1] . '&dd90=' . $dd[90] . '&dd5=DEL&dd6=' . $line['id_up'] . '">'; $sx .= '<TD width="5%" align="center">' . $link; $sx .= '<img src="images/icone_remove.png" border=0 >'; $sx .= '</A>'; } } $sx .= '</table>'; return $sx; }
* @package Class * @subpackage UC0001 - Sumissao de protocolo de pesquisa */ echo '<H1>' . msg('amendment_' . $doc_tipo) . '</h1>'; require 'submit_00_field.php'; if (strlen($acao) > 0) { require 'submit_save.php'; } echo $s; require "_class/_class_cep.php"; $cep = new cep(); // data CEP $cep_recrutamento = $cep->get_cep_recrutamento($proto_cep); $cp = $cep->cp_monitoreo(); /* Chave ID do register_shutdown_function(function)*/ $dd[0] = $proto_cep; $form = new form(); require "form_css.php"; $tela = $form->editar($cp, 'cep_protocolos'); if ($form->saved > 0) { $cep->protocolo = strzero($proto_cep, 6); $log = $cep->cep_historic_append("CHG", msg("recruiting_" . $dd[2]) . ', ' . msg("date_reclutamiento") . ":" . stodbr($dd[1])); redirecina('submit_end_monitoreo_008.php'); } else { echo $tela; } echo '</table>'; if ($ok > 0 and strlen($acao) > 0) { $_SESSION['proj_page'] = $pag + 1; redirecina('submit.php?time' . date("dmYhis")); }