Beispiel #1
0
 function upload_file_save()
 {
     global $dd, $messa, $acao, $tipo;
     $page = page() . '?';
     $page .= 'dd0=' . $dd[0] . '&dd5=' . $dd[5] . '&dd2=' . $dd[2] . '&dd1=' . $dd[1] . '&dd90=' . $dd[90];
     $saved = 0;
     if (strlen($acao) > 0) {
         $tipo = $dd[2];
         $nome = lowercasesql($_FILES['arquivo']['name']);
         $temp = $_FILES['arquivo']['tmp_name'];
         $size = $_FILES['arquivo']['size'];
         $path = $this->upload_path;
         $extensoes = $this->upload_format;
         /* valida extensao */
         $ext = strtolower($nome);
         while (strpos(' ' . $ext, '.') > 0) {
             $ext = substr($ext, strpos($ext, '.') + 1, strlen($ext));
         }
         $ext = '.' . $ext;
         /* diretorio */
         $nome = substr($nome, 0, strlen($nome) - 4);
         $nome = lowercasesql(troca($nome, ' ', '_'));
         $nome .= $ext;
         $this->dir($path);
         if ($this->up_month_control == 1) {
             $path .= date("Y") . '/';
             $this->dir($path);
             $path .= date("m") . '/';
             $this->dir($path);
         }
         /* caso nao apresente erro */
         if (strlen($erro) == 0) {
             $compl = $dd[1] . '-' . substr(md5($nome . date("His")), 0, 5) . '-';
             $compl = troca($compl, '/', '-');
             $this->filename = $path . $compl . $nome;
             if (move_uploaded_file($temp, $path . $compl . $nome)) {
                 return 1;
             } else {
                 $sx = 'Erro de salvamento';
                 return 0;
             }
         } else {
             echo '<center>' . msg($erro) . '</center>';
         }
         return 0;
     }
 }
Beispiel #2
0
function menus($menu, $tipo)
{
    global $acao, $dd, $tab_max, $uploaddir, $include;
    ///////////////////////////////////////////////////// redirecionamento
    if (isset($dd[1]) and strlen($dd[1]) > 0) {
        $col = 0;
        for ($k = 0; $k <= count($menu); $k++) {
            if ($dd[1] == CharE($menu[$k][1])) {
                header("Location: " . $menu[$k][2]);
            }
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////// Tipo 1
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    if ($tipo == '1') {
        ?>
			<TABLE width="<?php 
        // This file is part of the ProEthos Software.
        //
        // Copyright 2013, PAHO. All rights reserved. You can redistribute it and/or modify
        // ProEthos under the terms of the ProEthos License as published by PAHO, which
        // 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
        echo $tab_max;
        ?>
" align="center" border="0">
			<TR><TD colspan="4">
				<FONT class="lt3">
				</FONT><FORM method="post" action="">
				</TD></TR>
			</TABLE>
			<TABLE width="<?php 
        // This file is part of the ProEthos Software.
        //
        // Copyright 2013, PAHO. All rights reserved. You can redistribute it and/or modify
        // ProEthos under the terms of the ProEthos License as published by PAHO, which
        // 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
        echo $tab_max;
        ?>
" align="center" border="0">
			<TR>
			<?php 
        // This file is part of the ProEthos Software.
        //
        // Copyright 2013, PAHO. All rights reserved. You can redistribute it and/or modify
        // ProEthos under the terms of the ProEthos License as published by PAHO, which
        // 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
        $xcol = 0;
        $seto = "X";
        for ($x = 0; $x <= count($menu); $x++) {
            if (isset($menu[$x][2])) {
                $xseto = $menu[$x][0];
                if (!($seto == $xseto)) {
                    echo '<TR><TD colspan="10">';
                    echo '<TABLE width="100%" cellpadding="0" cellspacing="0">';
                    echo '<TR><TD class="lt3" width="1%"><BR><NOBR><B><font color="#0000a0">' . $xseto . '&nbsp;</TD>';
                    echo '<TD><HR width="100%" size="2"></TD></TR>';
                    echo '</TABLE>';
                    echo '<TR class="lt3">';
                    $seto = $xseto;
                    $xcol = 0;
                }
                if ($xcol >= 3) {
                    echo '<TR><TD><img src="' . $img_dir . 'nada.gif" width="1" height="5" alt="" border="0"></TD><TR>';
                    $xcol = 0;
                }
                echo '<TD align="center">';
                echo '<input type="submit" name="dd1" value="' . CharE($menu[$x][1]) . '" ' . $estilo_admin . '>';
                echo '</TD>';
                $xcol = $xcol + 1;
            }
        }
        ?>
			</TABLE></FORM>		
			<?php 
        // This file is part of the ProEthos Software.
        //
        // Copyright 2013, PAHO. All rights reserved. You can redistribute it and/or modify
        // ProEthos under the terms of the ProEthos License as published by PAHO, which
        // 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
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////// Tipo 2
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    if ($tipo == '2') {
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////// Tipo 3
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    if ($tipo == '3') {
        $tps = 0;
        $seto = '';
        for ($x = 0; $x <= count($menu); $x++) {
            $xseto = $menu[$x][0];
            if (!($seto == $xseto)) {
                $tps++;
                $seto = $xseto;
            }
        }
        /////////////////////////////////
        $col = 0;
        $cola = 0;
        $mcol = intval($tps / 2);
        $cm1 = '';
        $cm2 = '';
        $seto = 'x';
        for ($x = 0; $x <= count($menu); $x++) {
            $xseto = $menu[$x][0];
            if (!($seto == $xseto)) {
                $cola++;
                if ($cola > $mcol) {
                    $col = 1;
                }
                $seto = lowercasesql($xseto);
                $seto = troca($seto, ' ', '_');
                $img_icone = 'img/icone_' . $seto . '.png';
                $updir = $_SERVER['SCRIPT_FILENAME'];
                $xx = strlen($updir);
                while ($xx > 0) {
                    if (substr($updir, $xx, 1) == '/') {
                        $updir = substr($updir, 0, $xx);
                        $xx = 0;
                    }
                    $xx--;
                }
                $image = trim($updir) . '/' . $img_icone;
                if (!file_exists($image)) {
                    $img_icone = $include . 'img/icone_noimage.png';
                }
                ////////////////////////////////////////////
                $sc = '<TR><TD colspan="10">';
                $sc .= '<TABLE width="100%" cellpadding="0" cellspacing="2" border="0"  class="menu_tit">';
                $sc .= '<TR><TD rowspan="2" width="48"><img src="' . $img_icone . '" width="48" height="48" alt=""></TD>';
                $sc .= '<TD width="80%"><BR><NOBR><B>' . $xseto . '&nbsp;</TD>';
                $sc .= '<TR><TD><HR width="100%" size="2"></TD></TR>';
                $sc .= '</TABLE>';
                $sc .= '<TR class="lt1"><TD><UL>';
                $seto = $xseto;
                $xcol = 0;
            } else {
                $sc = '';
            }
            if (isset($menu[$x][2])) {
                $link = '<A href="' . $menu[$x][2] . '" class="menu_item">';
                if (strlen(trim($menu[$x][2])) == 0) {
                    $link = '';
                }
                $pre = '';
                $pos = '';
                //////////////////////////////////////////////////////////////////////////// Título Em BOld
                if (substr($menu[$x][1], 0, 2) != '__' and strlen($link) == 0) {
                    $menu[$x][1] = '<B>' . $menu[$x][1] . '</B>';
                }
                if (substr($menu[$x][1], 0, 2) == '__') {
                    $menu[$x][1] = substr($menu[$x][1], 2, 100);
                    $pre = '<UL>';
                    $pos = '</UL>';
                }
                if ($col == 0) {
                    $cm1 .= $sc;
                    $cm1 .= $pre . '<LI class="menu_li">' . $link . $menu[$x][1] . '</A><BR>' . $pos;
                } else {
                    $cm2 .= $sc;
                    $cm2 .= $pre . '<LI class="menu_li">' . $link . $menu[$x][1] . '</A><BR>' . $pos;
                }
            }
        }
        $sm = '<TABLE width="' . $tab_max . '" border=0 align="center">';
        $sm .= '<TR valign="top">';
        $sm .= '<TD width="48%"><table width="100%">' . $cm1 . '</table></TD>';
        $sm .= '<TD width="4%"></TD>';
        $sm .= '<TD width="48%"><table width="100%">' . $cm2 . '</table></TD>';
        $sm .= '</TR>';
        $sm .= '</TABLE>';
        echo $sm;
    }
}