Ejemplo n.º 1
0
 function check_this_year()
 {
     $year = date("Y");
     for ($bln = 1; $bln <= 12; $bln++) {
         $period = $year . "-" . strzero($bln, 2);
         if (!$this->exist($period)) {
             $last_date = date("Y-m-t", strtotime($year . "-" . strzero($bln, 2) . "-01"));
             //lastday
             $this->save(array("period" => $period, "year_id" => $year, "sequence" => $bln, "startdate" => $year . "-" . strzero($bln, 2) . "-01 00:00:00", "enddate" => $last_date . " 23:59:59", "closed" => 0, "month_name" => date("M", strtotime($last_date))));
         }
     }
 }
Ejemplo n.º 2
0
 function updatex()
 {
     global $base;
     $c = 'amt';
     $c1 = 'id_' . $c;
     $c2 = $c . '_codigo';
     $c3 = 3;
     $sql = "update " . $this->tabela . " set \n\t\t\t\t\t\t{$c2} = lpad({$c1},{$c3},0) \n\t\t\t\t\t\twhere {$c2}='' ";
     if ($base == 'pgsql') {
         $sql = "update " . $this->tabela . " set {$c2} = trim(to_char(id_" . $c . ",'" . strzero(0, $c3) . "')) where {$c2}='' ";
     }
     $rlt = db_query($sql);
 }
Ejemplo n.º 3
0
 function proses_kredit_save($data)
 {
     //param $data['old_loan_id'], $data['new_loan_id'], $data['loan_date']
     $this->load->model("leasing/invoice_header_model");
     $ok = false;
     $old = $data['old_loan_id'];
     $data['loan_date'] = date('Y-m-d H:i:s', strtotime($data['loan_date']));
     if ($data['new_loan_id'] == "") {
         $data['new_loan_id'] = "01630" . substr($old, -6);
     }
     $rs_loan['loan_id'] = $data['new_loan_id'];
     $rs_loan['loan_date'] = $data['loan_date'];
     $rs_loan['loan_date'] = $data['loan_date'];
     $rs_loan['status'] = 1;
     if ($query = $this->db->where("loan_id", $data['old_loan_id'])->update("ls_loan_master", $rs_loan)) {
         $this->db->query("update ls_loan_obj_items \n\t\t\t\tset loan_id='" . $data['new_loan_id'] . "' \n\t\t\t\twhere loan_id='" . $data['old_loan_id'] . "'");
         if ($query = $this->db->query("select * from ls_loan_master lm\n\t\t\t\twhere lm.loan_id='" . $data['new_loan_id'] . "'")) {
             if ($row_loan = $query->row()) {
                 $qspk = $this->db->query("select * from ls_app_master  \n\t\t\t\t\twhere app_id='" . $row_loan->app_id . "'");
                 $spk = $qspk->row();
                 $rs_invoice = null;
                 // hapus dulu data invoice yg ada
                 $this->db->where("loan_id", $data['new_loan_id'])->delete("ls_invoice_header");
                 $tgl_tagih = date('Y-m-d H:i:s', strtotime($data['loan_date']));
                 for ($tenor = 0; $tenor < $row_loan->max_month; $tenor++) {
                     $faktur = $row_loan->loan_id . "-" . strzero($tenor + 1, 2);
                     $rs_invoice['loan_id'] = $row_loan->loan_id;
                     $rs_invoice['app_id'] = $spk->app_id;
                     $rs_invoice['idx_month'] = strzero($tenor + 1, 2);
                     $rs_invoice['invoice_number'] = $faktur;
                     $rs_invoice['invoice_date'] = add_date($tgl_tagih, 0, $tenor + 1);
                     $rs_invoice['invoice_type'] = "I";
                     $rs_invoice['amount'] = $spk->inst_amount;
                     $rs_invoice['cust_deal_id'] = $row_loan->cust_id;
                     $rs_invoice['cust_deal_ship_id'] = $spk->counter_id;
                     $rs_invoice['gross_amount'] = $spk->inst_amount;
                     $rs_invoice['insr_amount'] = $spk->insr_amount;
                     $rs_invoice['pokok'] = $spk->inst_amount - $spk->rate_amount;
                     $rs_invoice['bunga'] = $spk->rate_amount;
                     $rs_invoice['disc_amount'] = 0;
                     $rs_invoice['paid'] = 0;
                     $rs_invoice['admin_amount'] = 0;
                     $ok = $this->invoice_header_model->save($rs_invoice);
                 }
                 $this->db->where("app_id", $spk->app_id)->update("ls_app_master", array("status" => "Finish", "contract_id" => $row_loan->loan_id));
             }
         } else {
             echo mysql_error();
         }
     }
     return $ok;
 }
Ejemplo n.º 4
0
    function comment_form()
    {
        global $dd, $ss;
        $us = strzero(round($ss->user_id), 7);
        $sx = '';
        $sxf = '';
        if (strlen($dd[1]) > 0) {
            if (strlen($dd[2]) == 0) {
                $sxf = '<script>' . chr(13);
                $sxf .= " alert('" . msg('need_comment_type') . "');";
                $sxf .= '</script>' . chr(13);
            } else {
                $this->comment = $dd[1];
                $this->avaliation = $dd[2];
                $this->user = $us;
                $this->comment_save();
                $dd[1] = '';
                $dd[2] = '';
                redirecina(page());
            }
        }
        $disp1 = 'display: none;';
        $disp2 = 'display: block;';
        if (strlen($dd[1]) > 0) {
            $disp2 = 'display: none;';
            $disp1 = 'display: block;';
        }
        $sx .= '<div id="posted" style="' . $disp1 . '">';
        $sx .= '<form method="post" action="' . page() . '">';
        //				$sx .= '<input type="hidden" name="dd0" value="'.$dd[0].'">'.chr(13);
        //				$sx .= '<input type="hidden" name="dd90" value="'.$dd[90].'">'.chr(13);
        $sx .= '<table width="98%">';
        $sx .= '<TR><TD>';
        $sx .= msg('comment_post') . '<BR>';
        $sx .= '<TR><TD><textarea name="dd1" cols="80" rows="5">';
        $sx .= $dd[1];
        $sx .= '</textarea>';
        $sx .= '<TR><TD>';
        /** Avaliation **/
        /* $sx .= msg('comment_type').':';
        			
        			$chk1 = ''; $chk2 = '';
        			if ($dd[2]=='1') { $chk1 = 'checked'; }
        			if ($dd[2]=='0') { $chk2 = 'checked'; }
        			
        			/** Radio **/
        /** com avalia��o		
        					$sx .= '<input type="radio" value="1" name="dd2" '.$chk1.'>';
        					$sx .= '<img src="img/icone_coment_ok.png">';
        	
        					$sx .= '<input type="radio" value="0" name="dd2" '.$chk2.'>';
        					$sx .= '<img src="img/icone_coment_nook.png">';
        					**/
        /** sem avalia��o **/
        $sx .= '<input type="hidden" value="1" name="dd2" >';
        /**  **/
        $sx .= '<BR><input type="submit" value="' . msg('comment_submit') . '">';
        $sx .= '</table>';
        $sx .= '</form>';
        $sx .= '</div>';
        /** **/
        $sx .= '<input id="mst" type="button" value="' . msg('comment_add', 1) . '" onclick="mostrar();"  style="' . $disp2 . '">';
        $sx .= chr(13) . '<script>
					      $("#mst").click(function () {
					      		$("#posted").fadeIn("slow"); 
						   		$("#mst").fadeOut("slow"); 
						  }); 
						';
        $sx .= chr(13) . '</script>';
        return $sx . $sxf;
    }
Ejemplo n.º 5
0
if (strlen($adm) == 0) {
    return 'admin.php';
}
/* Admin Common */
$ok = ($perfil->valid('#ADM') or $perfil->valid('#SCR') or $perfil->valid('#COO'));
if ($ok == 0) {
    redirecina('main.php');
}
require "_class/_class_submit_manuscrito_field.php";
global $acao, $dd, $cp, $tabela;
require $include . 'sisdoc_colunas.php';
require $include . '_class_form.php';
$form = new form();
require "form_css.php";
echo '<h1>' . msg('amendment_' . $adm) . '</h1>';
$dd[12] = strzero($adm, 5);
$cl = new fields();
$cp = $cl->cp();
$tabela = $cl->tabela;
$http_edit = 'admin_submit_ed.php';
$http_redirect = '';
/** Comandos de Edicao */
$tela = $form->editar($cp, $tabela);
/** Caso o registro seja validado */
if ($form->saved > 0) {
    echo 'Salvo';
    $cl->updatex();
    redirecina('admin_submit_000.php');
} else {
    echo $tela;
}
Ejemplo n.º 6
0
 function updatex()
 {
     global $base;
     $c = 'us';
     $c1 = 'id_' . $c;
     $c2 = $c . '_codigo';
     $c3 = 7;
     $sql = "update " . $this->tabela . " set {$c2} = lpad({$c1},{$c3},0) ,\n\t\t\t\t\t\tus_login =  lpad({$c1},{$c3},0) ,\n\t\t\t\t\t\tus_cracha =  lpad({$c1},{$c3},0) \n\t\t\t\t\t\twhere {$c2}='' or 1=1";
     if ($base == 'pgsql') {
         $sql = "update " . $this->tabela . " set {$c2} = trim(to_char(id_" . $c . ",'" . strzero(0, $c3) . "')) where {$c2}='' or  {$c2} isnull ";
     }
     $rlt = db_query($sql);
 }
Ejemplo n.º 7
0
require "_class/_class_cep_submit.php";
require "_class/_class_team.php";
require $include . 'sisdoc_data.php';
require $include . 'sisdoc_email.php';
require '_class/_class_ic.php';
$ic = new ic();
$proj = new submit();
$proj->doc_autor_principal = $ss->user_codigo;
require "_class/_class_ged.php";
require "_class/_class_cep.php";
$cep = new cep();
/****/
if (strlen($dd[91]) > 0) {
    $_SESSION['proj_page'] = $dd[91];
    redirecina('submit.php?time' . date("dmYhis"));
}
$pag_id = round($_SESSION['proj_id']);
$pag_page = round($_SESSION['proj_page']);
//if ($pag_id == 0) { $pag_page = 1; }
//if ($pag_page == 0) { $pag_page = 1; }
$pag_id = $_SESSION['proj_id'];
$dd[0] = $pag_id;
$protocolo = strzero($dd[0], 7);
echo '<H2>' . msg('submit_end_monitoreo_008') . '</h2>';
//echo msg('protocolo').' '.$protocolo;
echo '<BR><BR>';
echo '<div style="text-align: justify; width: 80%">';
echo msg('submit_end_monitoreo_008_text');
echo '</div>';
echo '</div>';
echo $hd->foot();
Ejemplo n.º 8
0
 function update12()
 {
     $new = 0;
     for ($r = 1; $r <= 10; $r++) {
         $cod = strzero($r, 3);
         $sql = "select * from cep_amendment_type \n\t\t\t\t\t\t\twhere amt_codigo = '{$cod}' ";
         $rlt = db_query($sql);
         if ($line = db_read($rlt)) {
         } else {
             $sql = "insert into cep_amendment_type \n\t\t\t\t\t\t\t\t\t(amt_codigo, amt_descrip, amt_form, amt_ord,amt_ativo)\n\t\t\t\t\t\t\t\t\t\tvalues\n\t\t\t\t\t\t\t\t\t('{$cod}','amendment_{$cod}','00{$cod}','{$r}',1);";
             $rlt = db_query($sql);
             $new++;
         }
     }
     if ($new > 0) {
         echo '<br>' . msg('update') . ' 012 ' . msg('successful') . ' ' . $new . ' updated';
     } else {
         echo '<br>' . msg('already update - 012');
     }
 }
Ejemplo n.º 9
0
 function protocolos_avaliacao($sta, $tipo = '')
 {
     global $ss;
     $us = strzero(round($ss->user_id), 7);
     if (strlen($tipo) > 0) {
         $wh = " and (cep_tipo = '{$tipo}' )";
     } else {
         $wh = '';
     }
     if ($sta == 'Z') {
         $sql = "select * from " . $this->tabela . " \n\t\t\t\t\t inner join cep_dictamen on pp_protocolo = cep_protocol \n\t\t\t\t\t where \n\t\t\t\t\t (cep_status = '@' or cep_status = 'A' or cep_status = 'B' or cep_status = 'C' or cep_status = 'D')\n\t\t\t\t\t and pp_avaliador = '{$us}' \n\t\t\t\t\t and (pp_status <> 'B' and pp_status <> 'X')\n\t\t\t\t\t {$wh}\n\t\t\t\t\t order by cep_reuniao ";
     } else {
         $sql = "select * from " . $this->tabela . " \n\t\t\t\t\t left join usuario on us_codigo = cep_pesquisador\n\t\t\t\t\t where cep_status = '{$sta}' \n\t\t\t\t\t {$wh}\n\t\t\t\t\t order by cep_reuniao \n\t\t\t\t\t ";
     }
     $rlt = db_query($sql);
     $dta = 19000101;
     $tot = 0;
     while ($line = db_read($rlt)) {
         $tot++;
         $data = $line['cep_reuniao'];
         if ($data != $dta) {
             $sx .= '<TR><TD colspan=4 align="center" class="lt2"><center>' . msg('meet_data') . ' ' . stodate($data);
             $dta = $data;
         }
         $sx .= $this->mostra($line);
     }
     $sa = '<table width=96% class="table_normal" border=0>';
     $sa .= '<TR><TH>' . msg('protocol');
     $sa .= '<TH>' . msg('project_title');
     $sa .= '<TH>' . msg('status');
     $sa .= $sx;
     $sa .= '<TR><TD colspan=5>' . msg('found') . ' ' . $tot . ' ' . msg('records');
     $sa .= '</table>';
     if ($tot == 0) {
         $sa = '';
     }
     return $sa;
 }
Ejemplo n.º 10
0
    function form_field($cp, $vlr)
    {
        global $dd, $ddi;
        /* Zera tela */
        $tela = '';
        $table = 1;
        if (!isset($dd)) {
            $dd = array();
            $ddi = 0;
        }
        $type = $cp[0];
        $label = $cp[2];
        $required = $cp[3];
        $placeholder = $label;
        $readonly = $cp[4];
        $tt = substr($type, 1, 1);
        /* exessoes */
        if (substr($type, 0, 4) == '$MES') {
            $tt = 'MES';
        }
        if (substr($type, 0, 3) == '$SW') {
            $tt = 'SW';
        }
        if (substr($type, 0, 3) == '$HV') {
            $tt = 'HV';
        }
        if (substr($type, 0, 5) == '$LINK') {
            $tt = 'LINK';
        }
        if (substr($type, 0, 3) == '$AA') {
            $tt = 'AA';
        }
        /* form */
        $max = 100;
        $size = 100;
        $dados = array();
        $dn = 'dd' . $ddi;
        if ($table == 1) {
            $td = '<td>';
            $tdl = '<td align="right">';
            $tdn = '</td>';
            $tr = '<tr valign="top">';
            $trn = '</tr>';
        } else {
            $td = '';
            $tdl = '';
            $tdn = '';
            $tr = '';
            $trn = '';
        }
        //$dados = array('name'=>'dd'.$ddi, 'id'=>'dd'.$ddi,'value='.$dd[$ddi],'maxlenght'=>$max,'size'=>$size,$class=>'');
        switch ($tt) {
            case '{':
                $tela .= $tr;
                $tela .= '<td colspan=2>';
                $tela .= '<fieldset class="border1"><legend class="lt3 bold">' . $label . '</legend>';
                $tela .= '<table width="100%" class="tabela00">';
                break;
            case '}':
                $tela .= '</table>';
                $tela .= '</fieldset>';
                $tela .= '</td></tr>';
                $tela .= '<table width="100%" id="row">';
                $tela .= '</td></tr>';
                break;
                /* Select Box */
            /* Select Box */
            case '[':
                $ntype = trim(substr($type, 2, strlen($type)));
                $n1 = substr($ntype, 0, strpos($ntype, '-'));
                $n2 = sonumero(substr($ntype, strpos($ntype, '-'), strlen($ntype)));
                $n3 = substr($ntype, strlen($ntype) - 1, 1);
                $options = array('' => '::select an option::');
                if ($n3 != 'D') {
                    /* Crescente */
                    for ($r = $n1; $r <= $n2; $r++) {
                        $options[$r] = $r;
                    }
                } else {
                    /* Descrecente */
                    for ($r = $n2; $r >= $n1; $r--) {
                        $options[$r] = $r;
                    }
                }
                /* recupera dados */
                $dados = array('name' => $dn, 'id' => $dn, 'size' => 1, 'class' => 'form_select');
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $tela .= '<TD>';
                $tela .= form_dropdown($dados, $options, $vlr);
                break;
                /* Select Box - Autocomplete*/
            /* Select Box - Autocomplete*/
            case 'AA':
                $ntype = trim(substr($type, 2, strlen($type)));
                $ntype = troca($ntype, ':', ';') . ';';
                $param = splitx(';', $ntype);
                /* TR da tabela */
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                /* **/
                $dados = array('name' => $dn . 'a', 'id' => $dn . 'a', 'value' => $vlr, 'maxlenght' => $max, 'size' => $size, 'placeholder' => $label, 'class' => 'form_string', 'autocomplete' => 'on');
                $tela .= $td . form_input($dados);
                $dados = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'maxlenght' => $max, 'size' => 10, 'placeholder' => $label, 'class' => 'form_string', 'autocomplete' => 'on');
                if ($readonly == false) {
                    $dados['readonly'] = 'readonly';
                }
                $tela .= form_input($dados);
                $tela .= $tdn . $trn;
                $tela .= '
				<script>
					$(function(){
						var $sfield = $("#' . $dn . 'a").autocomplete({
							source: function(request, response){
								var url = "' . base_url("index.php/instituicao/autocomplete?term=") . '" + $("#' . $dn . 'a").val();
								$.get(url, {}, 
									function(data)
									{
									response($.map(data, function(rlt) 
										{
											return { label: rlt.nome, value: rlt.id };
										}));
									}, "json");
								}, 
                        select: function( event, ui ) {
                            $( "#' . $dn . 'a" ).val( ui.item.label );
                            $( "#' . $dn . '" ).val( ui.item.value );
                            return false;
							} ,	minLength: 4, autofocus: true });
						});
				</script>
				';
                break;
                /* Button */
            /* Button */
            case 'B':
                $tela .= $tr . $tdl . $td;
                $dados = array('name' => 'acao', 'id' => 'acao', 'value' => $label, 'class' => 'form_submit');
                $tela .= form_submit($dados);
                $tela .= $tdn . $trn;
                break;
            case 'C':
                /* TR da tabela */
                $tela .= $tr;
                $dados = array('name' => $dn, 'id' => $dn, 'value' => '1', 'class' => 'onoffswitch-checkbox');
                if ($readonly == false) {
                    $dados['readonly'] = 'readonly';
                }
                $tela .= '<td align="right">' . form_checkbox($dados, 'accept', $vlr);
                /* label */
                if (strlen($label) > 0) {
                    $tela .= '<td>' . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $tela .= $tdn . $trn;
                break;
                /* Oculto */
            /* Oculto */
            case 'H':
                $dados = array($dn => $vlr);
                $tela .= form_hidden($dados);
                break;
            case 'HV':
                $vlr = $cp[2];
                $dados = array($dn => $vlr);
                $tela .= '<input type="hidden" name="' . $dn . '" id="' . $dn . '" value="' . $vlr . '">' . cr();
                break;
                /* Select Box - Mes */
            /* Select Box - Mes */
            case 'MES':
                $options = array('' => '::select an option::');
                /* recupera dados */
                for ($r = date("Y") + 4; $r > 1990; $r--) {
                    $vlra = $r;
                    $options[$vlra] = '===' . $r . '===';
                    //array_push($options,array('2019'));
                    $ar = array();
                    for ($y = 12; $y > 0; $y--) {
                        $vlrs = $r . strzero($y, 2) . '01';
                        $cpt = $r . '/' . msg('mes_' . strzero($y, 2));
                        $op = array($vlr => $cpt);
                        $ar[$vlrs] = $cpt;
                        //array_push($options,$op);
                    }
                    $options[$vlra] = $ar;
                }
                $dados = array('name' => $dn, 'id' => $dn, 'size' => 1, 'class' => 'form_select');
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                if (strlen($vlr) == 0) {
                    $vlr = date("Ym") . '01';
                } else {
                    $vlr = sonumero($vlr);
                }
                $tela .= '<TD>';
                $tela .= form_dropdown($dados, $options, $vlr);
                break;
                /* Select Box */
            /* Select Box */
            case 'O':
                $ntype = trim(substr($type, 2, strlen($type)));
                $ntype = troca($ntype, '&', ';') . ';';
                $param = splitx(';', $ntype);
                $options = array('' => '::select an option::');
                for ($r = 0; $r < count($param); $r++) {
                    if (count(trim($param[$r])) > 0) {
                        $nterm = splitx(':', $param[$r] . ':');
                        $key = $nterm[0];
                        $valor = $nterm[1];
                        $options[$key] = $valor;
                    }
                }
                /* recupera dados */
                $dados = array('name' => $dn, 'id' => $dn, 'size' => 1, 'class' => 'form_select');
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $tela .= '<TD>';
                $tela .= form_dropdown($dados, $options, $vlr);
                break;
                /* Select Box */
            /* Select Box */
            case 'Q':
                $ntype = trim(substr($type, 2, strlen($type)));
                $ntype = troca($ntype, ':', ';') . ';';
                $param = splitx(';', $ntype);
                $options = array('' => '::select an option::');
                /* recupera dados */
                $sql = "select * from (" . $param[2] . ") as tabela order by " . $param[1];
                $CI =& get_instance();
                $query = $CI->db->query($sql);
                foreach ($query->result_array() as $row) {
                    /* recupera ID */
                    $flds = trim($param[0]);
                    $vlrs = trim($param[1]);
                    $flds = $row[$flds];
                    $vlrs = $row[$vlrs];
                    $options[$flds] = $vlrs;
                }
                $dados = array('name' => $dn, 'id' => $dn, 'size' => 1, 'class' => 'form_select');
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $tela .= '<TD>';
                $tela .= form_dropdown($dados, $options, $vlr);
                break;
                /* String */
            /* String */
            case 'R':
                $ntype = trim(substr($type, 2, strlen($type)));
                $ntype = troca($ntype, '&', ';') . ';';
                $param = splitx(';', $ntype);
                $form = '<table width="100%" border=0>';
                for ($r = 0; $r < count($param); $r++) {
                    if (count(trim($param[$r])) > 0) {
                        $nterm = splitx(':', $param[$r] . ':');
                        $key = $nterm[0];
                        $valor = $nterm[1];
                        $options[$key] = $valor;
                        $checked = false;
                        if ($key == $vlr) {
                            $checked = true;
                        }
                        $dados = array('name' => $dn, 'id' => $dn, 'value' => $key, 'class' => 'form_select', 'checked' => $checked);
                        $form .= '<tr valign="top"><td>' . form_radio($dados) . '</td>';
                        $form .= '<td class="form_radio">' . $valor . '</td>';
                        $form .= '</tr>';
                    }
                }
                $form .= '</table>';
                /* recupera dados */
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $tela .= '<TD>';
                //$tela .= form_radio($dados, $options, $vlr);
                $tela .= $form;
                break;
                /* String */
            /* String */
            case 'D':
                /* TR da tabela */
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $dados = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'maxlenght' => 12, 'size' => 12, 'placeholder' => $label, 'class' => 'form_string date');
                if ($readonly == false) {
                    $dados['readonly'] = 'readonly';
                }
                $tela .= $td . form_input($dados) . ' (dd/mm/yyyy)';
                $tela .= $tdn . $trn;
                $tela .= '
				  <script>
				  $(function() {
				    $( "#' . $dn . '" ).datepicker();
				  });
				  </script>
				';
                break;
                /* String */
            /* String */
            case 'LINK':
                /* TR da tabela */
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $dados = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'maxlenght' => $max, 'size' => $size, 'placeholder' => $label, 'class' => 'form_string');
                if ($readonly == false) {
                    $dados['readonly'] = 'readonly';
                }
                $tela .= $td . form_input($dados);
                $tela .= $tdn . $trn;
                break;
            case 'M':
                /* TR da tabela */
                $tela .= $tr;
                /* label */
                $tela .= '<td colspan=2>' . '<span class="lt1">' . $label . '</span>';
                $tela .= $tdn . $trn;
                break;
                /* form_number */
            /* form_number */
            case 'N':
                /* TR da tabela */
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $dados = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'maxlenght' => 15, 'size' => 15, 'placeholder' => $label, 'class' => 'form_string money');
                if ($readonly == false) {
                    $dados['readonly'] = 'readonly';
                }
                $tela .= $td . form_input($dados);
                $tela .= $tdn . $trn;
                break;
                /* String */
            /* String */
            case 'S':
                /* TR da tabela */
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $size = sonumero($type);
                $dados = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'maxlenght' => $max, 'size' => $size, 'placeholder' => $label, 'class' => 'form_string');
                if ($readonly == false) {
                    $dados['readonly'] = 'readonly';
                }
                $tela .= $td . form_input($dados);
                $tela .= $tdn . $trn;
                break;
            case 'SW':
                /* TR da tabela */
                $tela .= $tr;
                $checked = False;
                /* label */
                $tela .= ' <td class="lt4" colspan=2>
						<table>
							<tr>
								<td>
								<div class="onoffswitch">
									';
                /* cehcked */
                if (trim($vlr) == '1') {
                    $checked = True;
                }
                /* Monta lista */
                $data = array('name' => $dn, 'checked' => $checked, 'class' => 'onoffswitch-checkbox', 'id' => $dn, 'value' => '1');
                $tela .= form_checkbox($data);
                $tela .= ' <label class="onoffswitch-label" for="' . $dn . '"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> </label>
								</div></td><td class="lt2"> ' . $label . ' </td>
							</tr>
						</table></td></tr>';
                break;
                /* Update */
            /* Update */
            case 'U':
                if (round($vlr) == 0) {
                    $vlr = date("Y-m-d");
                }
                $dados = array($dn => $vlr);
                $tela .= form_hidden($dados);
                break;
                /* Textarea */
            /* Textarea */
            case 'T':
                $ntype = trim(substr($type, 2, strlen($type)));
                $ntype = troca($ntype, ':', ';') . ';';
                $param = splitx(';', $ntype);
                /* TR da tabela */
                $tela .= $tr;
                /* label */
                if (strlen($label) > 0) {
                    $tela .= $tdl . $label . ' ';
                }
                if ($required == 1) {
                    $tela .= ' <font color="red">*</font> ';
                }
                $data = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'rows' => $param[1], 'cols' => $param[0], 'class' => 'form_textarea');
                $tela .= $td . form_textarea($data);
                $tela .= $tdn . $trn;
                break;
                /* Password */
            /* Password */
            case 'P':
                if (strlen($label) > 0) {
                    $tela .= $label . ' ';
                }
                $dados = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'maxlenght' => $max, 'size' => $size);
                $tela .= form_password($dados);
                break;
        }
        $ddi++;
        return $tela;
    }
Ejemplo n.º 11
0
$documents = new documents();
/* Sessao e pagina da Submissao */
$sx = '<H1>' . msg('documents_title_commite') . '</h1>';
$sx .= '<fieldset>';
$sx .= '<Table width="100%" class="tabela00" align="center" >';
$sx .= '<TR><TD>';
$sql = "select * from ged_documento_tipo \n\t\twhere (doct_publico = 1) ";
/* Restricted documents to members */
if ($perfil->valid('#MEM')) {
    $sql .= " or (doct_publico = 0) ";
}
/* Executa busca */
$rlt = db_query($sql);
$to = 0;
while ($line = db_read($rlt)) {
    $ged->protocol = strzero(round($line['doct_codigo']), 7);
    $sf = '<h2>' . utf8_encode(msg(trim($line['doct_nome']))) . '</h2>';
    $ged->table_class = "tabela01";
    $sf .= $ged->filelist_download();
    $to = $to + $ged->total_files;
}
$sx .= $sf;
$sx .= '</table>';
$sx .= '</fieldset>';
if ($to > 0) {
    echo $sx;
}
echo '<BR>';
echo '<H1>' . msg('documents_title') . '</h1>';
echo '<fieldset>';
require "documents_proethos.php";
Ejemplo n.º 12
0
    if ($dda < $dini) {
        $dini = $dda;
    }
    $dda = round("0" . $oline['cso_dt_fim']);
    if ($dda > $dfim) {
        $dfim = $dda;
    }
}
$meses = calcmeses($dini, $dfim);
if ($meses > 0) {
    $wt = intval(80 / $meses);
    $wi = 120;
    for ($kr = 0; $kr < count($crono); $kr++) {
        ////////// nomear datas
        $mm1 = strzero($crono[$kr][1], 6);
        $mm2 = strzero($crono[$kr][2], 6);
        $mn = nomemes_short(intval(substr($mm1, 0, 2))) . '/' . substr($mm1, 2, 4);
        $crono[$kr][3] = $mn;
        $mn = nomemes_short(intval(substr($mm2, 0, 2))) . '/' . substr($mm2, 2, 4);
        $crono[$kr][4] = $mn;
        if ($crono_cab == false) {
            $crono_cab = true;
            $pdf->MultiCell(0, 0, ' ', 1, 'L');
            $pdf->Ln($ln);
            $pdf->SetFont('Times', 'B', 12);
            $pdf->MultiCell(0, 8, msg('crono'), 0, 'L');
            $orca_cab = true;
            $pdf->Ln(6);
            /////////////////qqq cabecalho orcamento
            $y = $pdf->GetY();
            $pdf->SetLineWidth(0.3);
Ejemplo n.º 13
0
// restricts commercial use of the Software.
//
// ProEthos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
// PARTICULAR PURPOSE. See the ProEthos License for more details.
//
// You should have received a copy of the ProEthos License along with the ProEthos
// Software. If not, see
// https://raw.githubusercontent.com/bireme/proethos/master/LICENSE.txt
global $institution_name, $LANG, $messa;
$line = $dic->line;
require 'fphp-170/fpdf.php';
$versao_pdf = '0.0.38a';
$ln = 4;
$caae = trim($line['cep_caae']);
$nrp = strzero($dic->line['id_pr'], 5) . '/' . substr($dic->line['pr_data_emissao'], 0, 4);
$pdf = new FPDF();
$pdf->AliasNbPages();
$ln = 0;
$pdf->AddPage();
/* Logo Novo */
$img = 'document/proegthos_logo_1.jpg';
if (!file_exists($img)) {
    $img = 'img/logo_dictamen.jpg';
}
$pdf->Image($img, 20, 10);
$pdf->SetFont('Times', 'B', 16);
$pdf->MultiCell(0, 10, $institution_name, 0, 'R');
/* Research Project Evaluation Form */
$pdf->SetFont('Times', '', 14);
$pdf->MultiCell(0, 1, utf8_decode(msg('dictamen_title')), 0, 'R');
Ejemplo n.º 14
0
 function form_field($cp, $vlr)
 {
     global $dd, $ddi;
     /* Zera tela */
     $tela = '';
     $table = 1;
     if (!isset($dd)) {
         $dd = array();
         $ddi = 0;
     }
     $type = $cp[0];
     $label = $cp[2];
     $required = $cp[3];
     $placeholder = $label;
     $readonly = $cp[4];
     $tt = substr($type, 1, 1);
     /* exessoes */
     if (substr($type, 0, 4) == '$MES') {
         $tt = 'MES';
     }
     /* form */
     $max = 100;
     $size = 100;
     $dados = array();
     $dn = 'dd' . $ddi;
     if ($table == 1) {
         $td = '<td>';
         $tdl = '<td align="right">';
         $tdn = '</td>';
         $tr = '<tr valign="top">';
         $trn = '</tr>';
     } else {
         $td = '';
         $tdl = '';
         $tdn = '';
         $tr = '';
         $trn = '';
     }
     //$dados = array('name'=>'dd'.$ddi, 'id'=>'dd'.$ddi,'value='.$dd[$ddi],'maxlenght'=>$max,'size'=>$size,$class=>'');
     switch ($tt) {
         /* Button */
         case 'B':
             $tela .= $tr . $tdl . $td;
             $dados = array('name' => 'acao', 'id' => 'acao', 'value' => $label);
             $tela .= form_submit($dados);
             $tela .= $tdn . $trn;
             break;
             /* Oculto */
         /* Oculto */
         case 'H':
             $dados = array($dn => $vlr);
             $tela .= form_hidden($dados);
             break;
             /* Select Box - Mes */
         /* Select Box - Mes */
         case 'MES':
             $options = array('' => '::select an option::');
             /* recupera dados */
             for ($r = date("Y") + 4; $r > 1990; $r--) {
                 $vlra = $r;
                 $options[$vlra] = '===' . $r . '===';
                 //array_push($options,array('2019'));
                 $ar = array();
                 for ($y = 12; $y > 0; $y--) {
                     $vlrs = $r . strzero($y, 2) . '01';
                     $cpt = $r . '/' . msg('mes_' . strzero($y, 2));
                     $op = array($vlr => $cpt);
                     $ar[$vlrs] = $cpt;
                     //array_push($options,$op);
                 }
                 $options[$vlra] = $ar;
             }
             $dados = array('name' => $dn, 'id' => $dn, 'size' => 1, 'class' => 'form_select');
             $tela .= $tr;
             /* label */
             if (strlen($label) > 0) {
                 $tela .= $tdl . $label . ' ';
             }
             if ($required == 1) {
                 $tela .= ' <font color="red">*</font> ';
             }
             if (strlen($vlr) == 0) {
                 $vlr = date("Ym") . '01';
             }
             $tela .= '<TD>';
             $tela .= form_dropdown($dados, $options, $vlr);
             break;
             /* Select Box */
         /* Select Box */
         case 'Q':
             $ntype = trim(substr($type, 2, strlen($type)));
             $ntype = troca($ntype, ':', ';') . ';';
             $param = splitx(';', $ntype);
             $options = array('' => '::select an option::');
             /* recupera dados */
             $sql = "select * from (" . $param[2] . ") as tabela ";
             $CI =& get_instance();
             $query = $CI->db->query($sql);
             foreach ($query->result_array() as $row) {
                 /* recupera ID */
                 $flds = trim($param[0]);
                 $vlrs = trim($param[1]);
                 $flds = $row[$flds];
                 $vlrs = $row[$vlrs];
                 $options[$flds] = $vlrs;
             }
             $dados = array('name' => $dn, 'id' => $dn, 'size' => 1, 'class' => 'form_select');
             $tela .= $tr;
             /* label */
             if (strlen($label) > 0) {
                 $tela .= $tdl . $label . ' ';
             }
             if ($required == 1) {
                 $tela .= ' <font color="red">*</font> ';
             }
             $tela .= '<TD>';
             $tela .= form_dropdown($dados, $options, $vlr);
             break;
             /* String */
         /* String */
         case 'S':
             /* TR da tabela */
             $tela .= $tr;
             /* label */
             if (strlen($label) > 0) {
                 $tela .= $tdl . $label . ' ';
             }
             if ($required == 1) {
                 $tela .= ' <font color="red">*</font> ';
             }
             $dados = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'maxlenght' => $max, 'size' => $size, 'placeholder' => $label, 'class' => 'form_string');
             if ($readonly == false) {
                 $dados['readonly'] = 'readonly';
             }
             $tela .= $td . form_input($dados);
             $tela .= $tdn . $trn;
             break;
             /* Update */
         /* Update */
         case 'U':
             if (round($vlr) == 0) {
                 $vlr = date("Ymd");
             }
             $dados = array($dn => $vlr);
             $tela .= form_hidden($dados);
             break;
             /* Textarea */
         /* Textarea */
         case 'T':
             $ntype = trim(substr($type, 2, strlen($type)));
             $ntype = troca($ntype, ':', ';') . ';';
             $param = splitx(';', $ntype);
             /* TR da tabela */
             $tela .= $tr;
             /* label */
             if (strlen($label) > 0) {
                 $tela .= $tdl . $label . ' ';
             }
             if ($required == 1) {
                 $tela .= ' <font color="red">*</font> ';
             }
             $data = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'rows' => $param[1], 'cols' => $param[0], 'class' => 'form_textarea');
             $tela .= $td . form_textarea($data);
             $tela .= $tdn . $trn;
             break;
             /* Password */
         /* Password */
         case 'P':
             if (strlen($label) > 0) {
                 $tela .= $label . ' ';
             }
             $dados = array('name' => $dn, 'id' => $dn, 'value' => $vlr, 'maxlenght' => $max, 'size' => $size);
             $tela .= form_password($dados);
             break;
     }
     $ddi++;
     return $tela;
 }
Ejemplo n.º 15
0
}
/* Redireciona se 008 */
if ($adm == '008') {
    redirecina('admin_submit_blocked.php');
    exit;
}
require "_class/_class_submit_manuscrito_field.php";
/* Dados da Classe */
$clx = new fields();
$tabela = $clx->tabela;
echo '<h1>' . msg('amendment_' . $adm) . '</h1>';
/* Nao alterar - dados comuns */
$label = msg($tabela);
$http_edit = 'admin_submit_000_ed.php';
//$http_ver = 'pibic_bolsa_tipo_detalhe.php';
$editar = True;
$http_redirect = page();
$clx->row();
$busca = true;
$offset = 20;
//$pre_where = " e_mailing = '".$cl->mail_codigo."' ";
if ($order == 0) {
    $order = $cdf[1];
}
$order = ' sub_pag, sub_pos, sub_ordem ';
$pre_where = " sub_projeto_tipo = '" . strzero($adm, 5) . "' ";
echo '<TABLE width="' . $tab_max . '" align="center"><TR><TD>';
require $include . 'sisdoc_row.php';
echo '</table>';
echo '</div>';
echo $hd->foot();
Ejemplo n.º 16
0
    function dictamen_form()
    {
        global $dd, $acao, $cep, $messa, $LANG;
        $sx = '';
        /* recupera tipo do projeto */
        $tipo = $dd[41];
        $sql = "select * from parecer_modelo where pm_type = '{$tipo}' ";
        $rlt = db_query($sql);
        $fmt = array();
        array_push($fmt, array('', '---', '00000', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
        while ($line = db_read($rlt)) {
            array_push($fmt, array(trim($line['pm_name']), $line['pm_decision'], $line['pm_codigo'], $line['pm_0'], $line['pm_1'], $line['pm_2'], $line['pm_3'], $line['pm_4'], $line['pm_5'], $line['pm_6'], $line['pm_7'], $line['pm_8'], $line['pm_accompaniment']));
        }
        /* JavaScript */
        $cpa = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
        $ja .= 'function mostra_fields(a,b,c,d,e,f,g,h,i,j) { ' . chr(13);
        for ($rr = 0; $rr < count($cpa); $rr++) {
            $ja .= 'if (' . $cpa[$rr] . ' == 1) 
							{ $("#dic' . strzero($rr, 3) . '").fadeIn("slow"); } else 
							{ $("#dic' . strzero($rr, 3) . '").fadeOut("slow"); } ' . chr(13);
        }
        $ja .= ' } ' . chr(13);
        /* Mostra formularios */
        $pos = 0;
        /* monta formulario Select */
        $sa .= '<input type="hidden" id="dd1" name="dd1" value="' . $dd[1] . '">';
        $sa .= '<select id="dd27" name="dd27">';
        $jb = '';
        $jb2 = '';
        for ($r = 0; $r < count($fmt); $r++) {
            $chk = '';
            if ($dd[27] == $fmt[$r][1]) {
                $chk = 'selected';
            }
            $sa .= '<option value="' . $fmt[$r][1] . '" ' . $chk . '>';
            $sa .= msg($fmt[$r][0]);
            $sa .= '</option>';
            /* monta comando java show */
            $jb1 = 'if (ask == "' . $fmt[$r][1] . '") { mostra_fields(';
            for ($ra = 0; $ra < 9; $ra++) {
                $jb1 .= $fmt[$r][$ra + 3] . ',';
            }
            $jb1 .= $fmt[$r][12] . '); } ' . chr(13);
            if ($chk == 'selected') {
                $jb2 .= 'var x = mostra_fields(';
                for ($ra = 0; $ra < 9; $ra++) {
                    $jb2 .= $fmt[$r][$ra + 3] . ',';
                }
                $jb2 .= $fmt[$r][12] . '); ' . chr(13);
            }
            $jb .= $jb1;
        }
        $sa .= '</select>';
        $sx .= $sa;
        $sx .= '<table class="table_proj2" width="100%">';
        for ($r = 0; $r < 9; $r++) {
            $stl = '';
            if ($fmt[$pos][$r + 3] == 0) {
                $stl = 'style="display: none;"';
            }
            $sx .= chr(13);
            $sx .= '<TR><TD colspan=2 class="lt0"><div id="dic' . strzero($r, 3) . '" ' . $stl . '>';
            $sx .= msg('dic_pm_' . $r) . '<BR>';
            $sx .= '<textarea rows=6 cols=80 style="width: 96%;" name="dd' . ($r + 20) . '" id="dd' . ($r + 20) . '">';
            $sx .= $dd[$r + 20];
            $sx .= '</textarea>';
            $sx .= '</div>';
        }
        /* Acompanhamento */
        $sx .= chr(13);
        $acop = array(array('', ''), array(180, msg('semiannual')), array(365, msg('annual')), array(-1, msg('end_of_the_investigation')), array(0, msg('not_applied')));
        $hd = 'style="display: none;"';
        /*
         * Acompanhamento
         **/
        $sx .= '<TR><TD colspan=2 class="lt0"><div id="dic009" 	' . $hd . '>';
        $sx .= msg('accompaniment') . ' ';
        $sx .= chr(13);
        $sx .= '<select id="dd29" name="dd29">';
        for ($r = 0; $r < count($acop); $r++) {
            $chk = '';
            $sx .= chr(13);
            if ($dd[29] == $acop[$r][0]) {
                $chk = 'selected';
            }
            $sx .= '<option value="' . $acop[$r][0] . '" ' . $chk . '>';
            $sx .= msg($acop[$r][1]);
            $sx .= '</option>';
        }
        $sx .= chr(13) . '</select>';
        /* Botao */
        $sx .= chr(13);
        $sx .= '<TR><TD colspan=2 class="lt0"><div id="dicfim" style="' . $hid . '">';
        $bto = msg('save_dictamen');
        $sx .= '<BR>';
        $sx .= '<input type="checkbox" value="1" id="dd31">';
        $sx .= ' ' . msg('final_version');
        $sx .= '<BR>';
        $sx .= '<input type="button" value="' . $bto . '" id="save_dictamen" class="form_submit">';
        $sx .= chr(13) . '</table>';
        $sx .= chr(13) . chr(13);
        $sx .= '<script>' . chr(13);
        $sx .= $jb2;
        $ss .= ' var ask=2; ' . chr(13);
        $sx .= $ja;
        $sx .= chr(13);
        $sx .= '$("#dd27").change(function () { ' . chr(13);
        $sx .= 'var ask = $("#dd27").val(); ' . chr(13);
        $sx .= $jb;
        $sx .= '});' . chr(13);
        $sx .= '</script>' . chr(13);
        $sx .= '
			<script>
				$("#save_dictamen").click(function() 
				{	
					var v1 = $(\'#dd1\').val();
 					var v20 = $(\'#dd20\').val();
					var v21 = $(\'#dd21\').val();
					var v22 = $(\'#dd22\').val();
					var v23 = $(\'#dd23\').val();
					var v24 = $(\'#dd24\').val();
					var v25 = $(\'#dd25\').val();
					var v26 = $(\'#dd26\').val();
					
					var v27 = $(\'#dd27\').val();
					var v28 = $(\'#dd28\').val();
					var v29 = $(\'#dd29\').val();
					
					var v30 = $(\'#dictamen\').val();
					var v31 = $(\'#dd31\').is(":checked");
					if (v31==true)
						{ v31 = 1; }
						else
						{ v31 = 0; }
					var ok = 1;
					/*
					if (v20.length == 0) { ok = 0; alert(\'Descriction is necessary\'); }
					if (v21.length == 0) { ok = 0; alert(\'Quant. is necessary\'); }
					if (v22.length == 0) { ok = 0; alert(\'Unit value is necessary\'); }
					*/					
					ok = 1;
					
					if (ok == 1)
					{
			 			$.ajax({
			 					url: "dictamen_ajax.php",
			 					type: "POST",
			 					data: { dd1: v1,
			 							dd20: v20, dd21: v21, dd22: v22,
			 							dd23: v23, dd24: v24, dd25: v25,
			 							dd26: v26, dd30: v30, dd31: v31,
			 							dd27: v27, dd28: v28, dd29: v29,
			 							dd30: v30,
			 							dd31: v31,
			 							dd1: v1, acao: "gravar"
									  }
			 		 	}) 
						.fail(function() { alert("error"); })
			 			.success(function(data) { $("#dictame").html(data); });
					}  
				}); 			
			</script>
			';
        return $sx;
    }
Ejemplo n.º 17
0
Archivo: Csfs.php Proyecto: GCPUCPR/CsF
    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;
    }
Ejemplo n.º 18
0
 function keyid_form()
 {
     global $secu;
     $size = 10;
     $key = troca(microtime() + rand(), '.', '');
     $key = substr($key, strlen($key) - $size, $size);
     $this->key_form = $key;
     $this->key_form_check = strzero(3 * $key, $size);
     return $key;
 }
Ejemplo n.º 19
0
//
// You should have received a copy of the ProEthos License along with the ProEthos
// Software. If not, see
// https://raw.githubusercontent.com/bireme/proethos/master/LICENSE.txt
$prj_nr = $protocolo;
if (strlen($prj_nr) == 0) {
    $sql = "select * from cep_submit_documento where doc_id = '" . $prj_nr . "' ";
    $rlt = db_query($sql);
    if (!($line = db_read($rlt))) {
        $novo = true;
    }
}
/* SAVE */
$sql = "delete from cep_submit_documento_valor ";
$sql .= " where spc_pagina = '" . strzero($pag, 3) . "' ";
$sql .= " and spc_projeto = '" . $protocolo . "' ";
$sql .= " and spc_autor = '" . $proj->doc_autor_principal . "' ";
$rlt = db_query($sql);
$xsql = '';
for ($k = 0; $k < count($cops); $k++) {
    $xsql = "insert into cep_submit_documento_valor ";
    $xsql .= "(spc_codigo,spc_projeto,spc_content,";
    $xsql .= "spc_pagina,spc_autor,spc_ativo) ";
    $xsql .= " values ";
    $xsql .= "('" . $cops[$k][0] . "','" . $protocolo . "','" . $cops[$k][1] . "',";
    $xsql .= "'" . strzero($pag, 3) . "','" . $proj->doc_autor_principal . "','1') ";
    $rlt = db_query($xsql);
}
$sql = "update cep_submit_documento set doc_status = '@', doc_dt_atualizado = " . date("Ymd") . "\n\t\t\t\twhere doc_protocolo = '{$protocolo}' ";
$rlt = db_query($sql);
$sql .= '';
Ejemplo n.º 20
0
        $op = msg("top_submit_menu_" . $r);
    }
    $name = "item" . $r;
    $class_name = "topmenu_off";
    if ($ini == $r) {
        $class_name = 'topmenu_on';
    }
    echo '<TD align="center" class="' . $class_name . '" height=30>';
    if ($protocolo != '0000000') {
        echo '<A HREF="submit.php?dd91=' . $r . '">';
    }
    echo '<center><font class="' . $class_name . '">';
    echo $op;
    echo '</A></center>';
    echo '<TD class="' . $class_name . '" width="20">';
    echo '<img src="img/topmenu_sp.png">';
}
echo '</table>';
$edit_mode = $edit_mode_old;
/* Omite título se não for projeto */
if ($doc_tipo == 'PROJE') {
    echo '<H1>' . msg("submit_process") . '</h1>';
}
/* Le dados do protocolo */
$proj->le($protocolo);
/* Classe que mostra os dados do protocolo */
echo $proj->protocolo_mostrar();
$proto_cep = strzero($_SESSION['proto_cep'], 7);
// print "<pre>";
// var_dump($proj);
$clinic = round($proj->doc_clinic);
Ejemplo n.º 21
0
 function report_001c($ano = '')
 {
     if (strlen($ano) == 0) {
         $ano = date("Y");
     }
     $sql = "select cep_data, count(*) as total  from (\n\t\t\t\t\t\tselect round(pr_data/100) as cep_data\n\t\t\t\t\t\tfrom cep_parecer \n\t\t\t\t\t\twhere pr_status = 'F'\n\t\t\t\t\t\tand pr_data > 20000101\n\t\t\t\t\t\tand round(pr_data/10000) = {$ano}\n\t\t\t\t\t\t) as tabela\n\t\t\t\t\t\tgroup by cep_data\n\t\t\t\t\t\torder by cep_data\n\t\t\t\t";
     $rlt = db_query($sql);
     $max = 10;
     /* Calcula o maximo */
     while ($line = db_read($rlt)) {
         if ($line['total'] > $max) {
             $max = $line['total'];
         }
     }
     $rlt = db_query($sql);
     $sx = '<table width="100%" class="table_proj">';
     $sx .= '<TR><TH width="8%">' . msg('year');
     for ($r = 1; $r <= 12; $r++) {
         $sx .= '<TH width="8%">';
         $sx .= msg('month_' . strzero($r, 2));
     }
     $xano = -1;
     $xmes = 0;
     $sa = '';
     $sb = '';
     while ($line = db_read($rlt)) {
         $ano = round($line['cep_data'] / 100);
         $mes = round(substr($line['cep_data'], 4, 2));
         if ($ano != $xano) {
             $sx .= $sb;
             $sx .= $sa;
             $sa = '';
             $sb = '';
             $sa = '<TR><TD align="center">' . $ano;
             $xano = $ano;
             $xmes = 1;
             $sb = '<TR><TD>&nbsp;';
         }
         for ($r = $xmes; $r < $mes; $r++) {
             $sa .= '<TD align="center">-';
             $sb .= '<TD align="center">-';
         }
         $xmes = $mes + 1;
         $sa .= '<TD align="center">';
         $sb .= '<TD align="center" valign="bottom" height="80">';
         $sa .= $line['total'];
         $hg = round(30 * $line['total'] / $max);
         $sb .= '<img src="img/gr_point_blue.png" width="30" height="' . $hg . '">';
     }
     $sx .= $sb . $sa;
     $sx .= '</table>';
     echo $sx;
 }
Ejemplo n.º 22
0
 function calcmeses($df1, $df2)
 {
     $dxm = substr($df1, 4, 2);
     $dxa = substr($df1, 0, 4);
     $dym = substr($df2, 4, 2);
     $dya = substr($df2, 0, 4);
     while ($dxa * 100 + $dxm <= $dya * 100 + $dym) {
         //		echo '<BR>'.($dxa*100+$dxm).'=='.($dafim*100+$dmfim).', '.$meses;
         $dxm = intval($dxm) + 1;
         if ($dxm > 12) {
             $dxa++;
             $dxm = 1;
         }
         $dxm = strzero($dxm, 2);
         $meses = $meses + 1;
     }
     return $meses;
 }
Ejemplo n.º 23
0
 */
require 'cab.php';
/* Admin Common */
$ok = ($perfil->valid('#ADM') or $perfil->valid('#SCR') or $perfil->valid('#COO'));
if ($ok == 0) {
    redirecina('main.php');
}
$ln = new message();
global $acao, $dd, $cp, $tabela;
require $include . 'sisdoc_colunas.php';
require $include . 'sisdoc_data.php';
require $include . 'sisdoc_debug.php';
require "_ged_documents.php";
/* Excluir Arquivo */
if ($dd[21] == 'DEL') {
    $chk = checkpost($dd[20] . $secu);
    if ($dd[22] == $chk) {
        $ged->id_doc = $dd[20];
        $ged->file_delete();
    }
}
$ged->protocol = strzero($dd[0], 7);
$type = strzero($dd[0], 5);
$protocol = $ged->protocol;
//file_delete
echo '<h2>' . msg('documents_title') . '</h2>';
echo $ged->file_list();
echo $ged->upload_botton_with_type($protocol, '_ged_documents.php', $type, '');
echo '</div>';
/** Caso o registro seja validado */
echo $hd->foot();
Ejemplo n.º 24
0
 function resume_adhoc()
 {
     global $tab_max, $message, $ss, $perfil;
     $tp = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
     $us = strzero(round($ss->user_id), 7);
     $sql = "select count(*) as total from cep_dictamen \n\t\t\t\t\tinner join cep_protocolos on pp_protocolo = cep_protocol\n\t\t\t\t\twhere \n\t\t\t\t\t (cep_status = '@' or cep_status = 'A' or cep_status = 'B' or cep_status = 'C' or cep_status = 'D')\n\t\t\t\t\t and pp_avaliador = '{$us}' \n\t\t\t\t\t and (pp_status <> 'B' and pp_status <> 'X') \n\t\t\t\t\t";
     $rlt = db_query($sql);
     while ($line = db_read($rlt)) {
         $tp[9] = $line['total'];
     }
     $sx .= '<font class="lt4">' . msg('resume_adhoc') . '</font>';
     $sx .= '<Table width="100%" class="table_resume" align="center" >';
     $sx .= '<TR><TD>';
     $sx .= '<fieldset><legend>' . msg('research') . '</legend>';
     $sx .= '<Table width="120" class="table_resume" border=1 >';
     /* Protocolo em Submissao */
     $size = 15;
     $sx .= '<TR  class="table_resume_th" align="center"> ';
     if ($tp[9] > 0) {
         $sx .= '<TD width="' . $size . '%" align="center"  class="table_resume_td_sel"><B>' . msg('pesq_relate');
     }
     if ($tp[9] > 0) {
         $link[9] = '<A HREF="protocols.php?dd1=Z" class="table_resume_td">';
     }
     $sx .= '<TR  class="table_resume_td">';
     if ($perfil->valid("#ADC")) {
         $sx .= '<TD align="center">' . $link[9] . round($tp[9]) . '</A>';
     }
     $sx .= '</table>';
     $sx .= '</fieldset>';
     $sx .= '</table>';
     if ($tp[9] == 0) {
         $sx = '';
     }
     return $sx;
 }
Ejemplo n.º 25
0
function upload_form()
{
    global $_FILES, $dir_atual, $dir_dest, $fechar, $quota_mb, $path_info;
    $num_uploads = 5;
    html_header();
    echo "<body marginwidth=\"0\" marginheight=\"0\">";
    if (count($_FILES) == 0) {
        echo "\r\n        <table height=\"100%\" border=0 cellspacing=0 cellpadding=2 align=center>\r\n        <form name=\"upload_form\" action=\"" . $path_info["basename"] . "\" method=\"post\" ENCTYPE=\"multipart/form-data\">\r\n        <input type=hidden name=dir_dest value=\"{$dir_atual}\">\r\n        <input type=hidden name=action value=10>\r\n        <tr><th colspan=2>" . et('Upload') . "</th></tr>\r\n        <tr><td align=right><b>" . et('Destination') . ":<td><b><nobr>{$dir_atual}</nobr>";
        for ($x = 0; $x < $num_uploads; $x++) {
            echo "<tr><td width=1 align=right><b>" . et('File') . ":<td><nobr><input type=\"file\" name=\"file{$x}\"></nobr>";
            $test_js .= "(document.upload_form.file{$x}.value.length>0)||";
        }
        echo "\r\n        <input type=button value=\"" . et('Send') . "\" onclick=\"test_upload_form()\"></nobr>\r\n        <tr><td> <td><input type=checkbox name=fechar value=\"1\"> <a href=\"JavaScript:troca();\">" . et('AutoClose') . "</a>\r\n        <tr><td colspan=2> </td></tr>\r\n        </form>\r\n        </table>\r\n        <script language=\"Javascript\" type=\"text/javascript\">\r\n        <!--\r\n            function troca(){\r\n                if(document.upload_form.fechar.checked){document.upload_form.fechar.checked=false;}else{document.upload_form.fechar.checked=true;}\r\n            }\r\n            foi = false;\r\n            function test_upload_form(){\r\n                if(" . substr($test_js, 0, strlen($test_js) - 2) . "){\r\n                    if (foi) alert('" . et('SendingForm') . "...');\r\n                    else {\r\n                        foi = true;\r\n                        document.upload_form.submit();\r\n                    }\r\n                } else alert('" . et('NoFileSel') . ".');\r\n            }\r\n            window.moveTo((window.screen.width-400)/2,((window.screen.height-200)/2)-20);\r\n        //-->\r\n        </script>";
    } else {
        $out = "<tr><th colspan=2>" . et('UploadEnd') . "</th></tr>\r\n                <tr><th colspan=2><nobr>" . et('Destination') . ": {$dir_dest}</nobr>";
        for ($x = 0; $x < $num_uploads; $x++) {
            $temp_file = $_FILES["file" . $x]["tmp_name"];
            $filename = $_FILES["file" . $x]["name"];
            if (strlen($filename)) {
                $resul = save_upload($temp_file, $filename, $dir_dest);
            } else {
                $resul = 7;
            }
            switch ($resul) {
                case 1:
                    $out .= "<tr><td><b>" . strzero($x + 1, 3) . ".<font color=green><b> " . et('FileSent') . ":</font><td>" . $filename . "</td></tr>\n";
                    break;
                case 2:
                    $out .= "<tr><td colspan=2><font color=red><b>" . et('IOError') . "</font></td></tr>\n";
                    $x = $upload_num;
                    break;
                case 3:
                    $out .= "<tr><td colspan=2><font color=red><b>" . et('SpaceLimReached') . " ({$quota_mb} Mb)</font></td></tr>\n";
                    $x = $upload_num;
                    break;
                case 4:
                    $out .= "<tr><td><b>" . strzero($x + 1, 3) . ".<font color=red><b> " . et('InvExt') . ":</font><td>" . $filename . "</td></tr>\n";
                    break;
                case 5:
                    $out .= "<tr><td><b>" . strzero($x + 1, 3) . ".<font color=red><b> " . et('FileNoOverw') . "</font><td>" . $filename . "</td></tr>\n";
                    break;
                case 6:
                    $out .= "<tr><td><b>" . strzero($x + 1, 3) . ".<font color=green><b> " . et('FileOverw') . ":</font><td>" . $filename . "</td></tr>\n";
                    break;
                case 7:
                    $out .= "<tr><td colspan=2><b>" . strzero($x + 1, 3) . ".<font color=red><b> " . et('FileIgnored') . "</font></td></tr>\n";
            }
        }
        if ($fechar) {
            echo "\r\n            <script language=\"Javascript\" type=\"text/javascript\">\r\n            <!--\r\n                window.close();\r\n            //-->\r\n            </script>\r\n            ";
        } else {
            echo "\r\n            <table height=\"100%\" border=0 cellspacing=0 cellpadding=2 align=center>\r\n            {$out}\r\n            <tr><td colspan=2> </td></tr>\r\n            </table>\r\n            <script language=\"Javascript\" type=\"text/javascript\">\r\n            <!--\r\n                window.focus();\r\n            //-->\r\n            </script>\r\n            ";
        }
    }
    echo "</body>\n</html>";
}
Ejemplo n.º 26
0
 function autonumber($varname, $step = 0, $default = '')
 {
     $varvalue = $this->getvar($varname);
     if ($varvalue == "") {
         $varvalue = $default;
         if ($varvalue == '') {
             return $varvalue;
         }
         $this->insert($varname, $varvalue, 'Numbering');
     }
     $arRomawi = array("", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII");
     $aa = explode("~", $varvalue);
     $sFlagAdaCounter = false;
     $nCtrPos = 0;
     $nCtrLen = 0;
     $sVal = "";
     $sLF = "";
     $sMD = "";
     $sRG = "";
     $nextkode = "";
     $autoKey = -1;
     foreach ($aa as $a) {
         $code = substr($a, 0, 1);
         $nilai = substr($a, 1, strlen($a));
         $pj = strlen($nilai);
         $nextkode .= $code;
         //echo "<br>code: ".$code." nilai: ".$nilai." nextkode: ".$nextkode;
         switch ($code) {
             case "!":
                 $sVal .= $nilai;
                 //echo "<br>val ! ".$sVal;
                 break;
             case "@":
                 $sVal .= $nilai;
                 //echo "<br>val @ ".$sVal;
                 break;
             case "#":
                 $sFlagDDMMYY = $nilai;
                 if ($nilai == "MM") {
                     $sNew = date("m");
                 } elseif ($nilai == "YY") {
                     $sNew = date("y");
                 } elseif ($nilai == "DD") {
                     $sNew = date("d");
                 } else {
                     $sFlagDDMMYY = "";
                     $sNew = $arRomawi[strval(date("m"))];
                 }
                 $sVal .= $sNew;
                 break;
             case "\$":
                 $nCurCounter = strval($nilai);
                 $nCtrPos = strlen($sVal);
                 $nCtrLen = $pj;
                 $sVal .= strzero(strval($nilai), $pj);
                 $nilai = strzero(strval($nilai) + $step, $pj);
                 //echo 'nilai='.$nilai;
                 $sFlagAdaCounter = True;
                 //echo "<br>val $ ".$nilai ;
                 break;
             case "?":
                 //reset
                 if (($sFlagAdaCounter and strlen($sFlagDDMMYY)) > 0) {
                     $nOldMM = strval(substr($a, 4));
                     $nl = substr($nilai, 2, strlen($nilai));
                     if ($nl == "MM") {
                         if (strval(date("m")) != strval($nOldMM)) {
                             $sLF = substr($sVal, $nCtrPos);
                             $sMd = strzero(1, $nCtrLen);
                             $sRG = substr($sVal, $nCtrPos + $nCtrLen + 1, strlen($sVal));
                             $sVal = $sLF . $sMd . $sRG;
                         }
                     } elseif ($nl == "DD") {
                         if (strval(date("d")) != strval($nOldMM)) {
                             $sLF = substr($sVal, $nCtrPos);
                             $sMd = strzero(1, $nCtrLen);
                             $sRG = substr($sVal, $nCtrPos + $nCtrLen + 1, strlen($sVal));
                             $sVal = $sLF . $sMd . $sRG;
                         }
                     } elseif ($nl == "YY") {
                         if (strval(date("Y")) - 2000 != strval($nOldMM)) {
                             $sLF = substr($sVal, $nCtrPos);
                             $sMd = strzero(1, $nCtrLen);
                             $sRG = substr($sVal, $nCtrPos + $nCtrLen + 1, strlen($sVal));
                             $sVal = $sLF . $sMd . $sRG;
                         }
                     }
                 }
                 break;
         }
         //end switch
         $nextkode .= $nilai . "~";
     }
     /// for each
     if ($step != 0) {
         if (substr($nextkode, -1, 1) == "~") {
             $nextkode = substr($nextkode, 0, strlen($nextkode) - 1);
         }
         //echo "<br>NextKode: ".$nextkode;
         $this->save($varname, $nextkode);
     }
     return $sVal;
 }
Ejemplo n.º 27
0
 * @version v.0.13.46
 * @package Proethos
 * @subpackage Protocol
 */
/* Add Styles */
$style_add = array('proethos_form.css');
require "cab.php";
require $include . 'sisdoc_data.php';
require '_class/_class_cep.php';
$cep = new cep();
require '_class/_class_cep_submit.php';
$submit = new submit();
require '_class/_class_cep_email.php';
$comm = new comunication();
/* recupara ID do projeto */
$ID = strzero($dd[0], 7);
$submit->le($ID);
$doc_tipo = $submit->doc_tipo;
/* Action */
$acao = $dd[5];
if ($acao == 'TO_SUBMIT') {
    $submit->protocolo_to_submit();
    redirecina('submit.php?dd0=' . $dd[0] . '&dd90=' . checkpost($dd[0]));
}
if ($acao == 'TO_AMED') {
    $submit->protocolo_to_submit();
    redirecina('submit_amendment.php?dd0=' . $dd[0] . '&dd90=' . checkpost($dd[0]));
}
echo '<h1>Protocolo: ' . $submit->status_show($submit->doc_status) . '</h1>';
echo $submit->protocolo_mostrar();
$status = trim($submit->doc_status);
Ejemplo n.º 28
0
// You should have received a copy of the ProEthos License along with the ProEthos
// Software. If not, see
// https://raw.githubusercontent.com/bireme/proethos/master/LICENSE.txt
require "db.php";
require $include . 'sisdoc_colunas.php';
require $include . 'sisdoc_email.php';
require "_class/_class_message.php";
$file = 'messages/msg_' . $LANG . '.php';
if (file_exists($file)) {
    require $file;
} else {
    echo 'message not found ' . $file;
}
$LANG = $lg->language_read();
$edit_mode = round($_SESSION['editmode']);
$pag_id = strzero(round($_SESSION['proj_id']), 7);
require "_class/_class_team.php";
$tm = new team();
$tm->protocol = $pag_id;
if ($dd[10] == 'con') {
    $id = $dd[12];
    $tm->team_contact($id, $tm->protocol);
}
if ($dd[10] == 'del') {
    $id = $dd[12];
    $tm->team_delete_member($id, $tm->protocol);
}
if ($dd[10] == 'add') {
    $email = $dd[12];
    if (checaemail($email)) {
        $author = $tm->author_exist($email);
Ejemplo n.º 29
0
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 . '&nbsp;';
            }
            $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;
}
Ejemplo n.º 30
0
/************************************************************** DATAS */
$op_data_1 = '';
$op_data_2 = '';
for ($r = 2015; $r < date("Y") + 4; $r++) {
	for ($m = 1; $m <= 12; $m++) {
		$select = '';
		$mes = $r . strzero($m, 2) . '01';
		if ($dd24 == $mes) { $select = ' selected ';
		}
		$op_data_1 .= '<option value="' . $mes . '" ' . $select . '>' . strzero($m, 2) . '/'.$r.'</option>' . cr();

		$select = '';
		if ($dd25 == $mes) { $select = ' selected ';
		}
		$op_data_2 .= '<option value="' . $mes . '" ' . $select . '>' . strzero($m, 2) . '/'.$r.'</option>' . cr();
	}
}
?>
<!---- cabeclaho ----->
<h1>Página 1/3 - Dados da proposta</h1>
<form method="post">
	<table width="80%">
		<!---- Parte 1 ----->
		<tr>
			<td class="lt4 bold">1) Título do projeto do professor</td>
		</tr>
		<tr>
			<td>			<textarea name='dd1' rows=5 cols=80 style="width: 98%"><?php 
echo $dd1;
?>