Пример #1
0
 function save()
 {
     $array = file(ROOT . '/config.php');
     $content = '';
     foreach ($array as $k => $v) {
         if (strstr($v, '#system_style')) {
             $array[$k] = "define('SYS_STYLE', '" . params::get('system_style') . "'); #system_style\r\n";
         }
         if (strstr($v, '#system_lang')) {
             $array[$k] = "define('LANG_INDEX', '" . params::get('system_lang') . "'); #system_lang\r\n";
         }
         if (strstr($v, '#global_cache')) {
             if (params::get('global_cache')) {
                 $array[$k] = "define('GLOBAL_CACHE', true); #global_cache\r\n";
             } else {
                 $array[$k] = "define('GLOBAL_CACHE', false); #global_cache\r\n";
             }
         }
         if (strstr($v, '#global_time')) {
             $array[$k] = "define('GLOBAL_CACHE_TIME', " . params::get('global_cache_time') . "); #global_time\r\n";
         }
         $content .= $array[$k];
     }
     files::write(ROOT . '/config.php', $content);
     headers::self();
 }
Пример #2
0
 function save()
 {
     settings::set('feedback', 'feedback_email', params::get('feedback_email'));
     settings::set('feedback', 'feedback_subject', params::get('feedback_subject'));
     settings::save('feedback');
     headers::self();
 }
Пример #3
0
 function saveMail()
 {
     db::table('mails');
     db::where('mail_id', admin::get('id'));
     db::update(array('mail_name' => params::get('mail_name'), 'mail_subject' => params::get('mail_subject'), 'mail_content' => params::get('mail_content')));
     headers::self();
 }
Пример #4
0
 function _add()
 {
     $array = array('news_date' => 'NOW()', 'news_pub' => '1', 'news_title' => params::get('news_title'), 'news_content' => params::get('news_content'), 'news_desc' => params::get('news_desc'));
     db::table('news');
     db::smartInsert($array);
     headers::app('news');
 }
 public function __construct($html = false)
 {
     headers::not_found();
     # send 404
     if ($html === true) {
         $this->html();
     }
 }
Пример #6
0
 function replace()
 {
     $page_id = params::get('page_id');
     db::table('pages');
     db::limit(1);
     db::where('page_id', $page_id);
     $page_folder = db::get('page_folder');
     headers::url($page_folder);
     //self::loadPage();
 }
Пример #7
0
 function sendFeedback()
 {
     $mail_content = params::get('message');
     $email = params::get('email');
     if (!empty($mail_content) && !empty($email)) {
         mail::from($email);
         mail::html($mail_content);
         mail::subject(settings::get('feedback', 'feedback_subject'));
         mail::send(settings::get('feedback', 'feedback_email'));
         headers::url('/contacts/success/');
     }
 }
Пример #8
0
 function save()
 {
     settings::set('pages', 'global_page_keywords', params::get('global_page_keywords'));
     settings::set('pages', 'global_page_description', params::get('global_page_description'));
     settings::set('pages', 'global_page_keywords_check', params::isCheck('global_page_keywords_check'));
     settings::set('pages', 'global_page_description_check', params::isCheck('global_page_description_check'));
     settings::set('pages', 'redactor', params::isCheck('redactor'));
     settings::set('pages', 'jip', params::isCheck('jip'));
     settings::set('pages', 'global_page_title', params::get('global_page_title'));
     settings::save('pages');
     headers::self();
 }
Пример #9
0
 /**
  * Prepares a list of products and renders accordingly
  * 
  * If the request comes from an AJAX request containing pagination data, the resultant table will be 
  * paginated appropriately.  Otherwise, a default pagination state (no sorting, no filtering, page 1)
  * will be created.
  */
 public function actionIndex()
 {
     $statuses = statuses::model()->getAll();
     $vendors = vendors::model()->getAll();
     $tags = tags::model()->getAll();
     $showColumns = Auth::User()->getColumns();
     if (count($showColumns) == 0) {
         $showColumns = array(1, 2, 3);
     }
     $columnHeaders = headers::model()->getAll();
     $allHeaders = array();
     foreach ($columnHeaders as $header) {
         $allHeaders[$header->id] = $header;
     }
     $headers = array('show' => $showColumns, 'headers' => $allHeaders);
     $pagination = array('limit' => array(0, 10), 'filter' => 'All categories', 'sortAttribute' => null, 'sortDirection' => null);
     if (!empty($_GET['ajax'])) {
         //handle ajax requests
         //get the pagination data from the query string
         if (isset($_GET['headers'])) {
             $headers['show'] = explode(',', $_GET['headers']);
             Auth::User()->setColumns($_GET['headers']);
         }
         $sortHeader = headers::model()->getbyPK($_GET['sortAttribute']);
         $pagination['sortAttribute'] = $sortHeader->sortName;
         $pagination['sortDirection'] = $_GET['sortDirection'];
         $pagination['limit'] = array($_GET['paginationPageNumber'], $_GET['paginationPerPage']);
         $pagination['filter'] = $_GET['filter'];
         $conditions = null;
         $params = null;
         //if there is a filter in place, create the conditions and parameters needed
         if (!empty($pagination['filter']) && $pagination['filter'] != 'All categories') {
             $conditions = "category = :category";
             $category = categories::model()->getByAttribute('name', $pagination['filter']);
             $params = array('category' => $category->id);
         }
         $models = items::model(true)->getAll($conditions, $params, $pagination);
         $count = items::model()->getCount($conditions, $params);
         $pagination['count'] = $count;
         $pagination['sortAttribute'] = $_GET['sortAttribute'];
         $this->renderPartial('table', array('data' => $models, 'statuses' => $statuses, 'pagination' => $pagination, 'vendors' => $vendors, 'tags' => $tags, 'headers' => $headers));
     } else {
         //handle default requests
         $models = items::model(true)->getAll(null, null, $pagination);
         $count = items::model()->getCount(null);
         $pagination['count'] = $count;
         $this->render('index', array('models' => $models, 'statuses' => $statuses, 'vendors' => $vendors, 'tags' => $tags, 'pagination' => $pagination, 'headers' => $headers));
     }
 }
 /** send headers **/
 function send()
 {
     global $sendheaders, $sendnocacheheaders, $gzip;
     if ($sendheaders == 1) {
         @header("HTTP/1.0 200 OK");
         @header("HTTP/1.1 200 OK");
         @header("Content-type: text/html");
     }
     if ($sendnocacheheaders == 1) {
         @header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
         @header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
         @header("Cache-Control: no-cache, must-revalidate");
         @header("Pragma: no-cache");
     }
     if ($gzip == 1) {
         headers::compress();
     }
 }
Пример #11
0
 function upload()
 {
     $dir = IMAGES_ROOT . 'index/';
     @mkdir(IMAGES_ROOT);
     @mkdir($dir);
     if (!empty($_FILES['file']['name'])) {
         $img_id = md5(date('YmdHis'));
         $file = $dir . $img_id . '.jpg';
         $file_m = $dir . $img_id . '_m.jpg';
         copy($_FILES['file']['tmp_name'], $file);
         images::src($file);
         images::thumb($file_m);
         images::setWidth(150);
         images::resize();
         $array = array('img_id' => $img_id, 'img_set' => '0');
         db::table('images');
         db::smartInsert($array);
     }
     headers::self();
 }
Пример #12
0
 function start($engine = true)
 {
     self::$site = str_replace('www.', '', $_SERVER['HTTP_HOST']);
     self::$query_string = urldecode($_SERVER['QUERY_STRING']);
     self::$request_uri = str_replace('?' . self::$query_string, '', urldecode($_SERVER['REQUEST_URI']));
     if (!self::$request_uri) {
         self::$request_uri = '/';
     }
     /*
     	Sections
     */
     self::$sections = explode('/', string::clearBoth(self::$request_uri));
     if (!self::$sections) {
         self::$sections[0] = '';
     }
     self::loadEngine();
     // load sites.ini
     if (self::$engine == 'web') {
         // redirects
         $redirect = false;
         $ini = ini::parse(SYS_ROOT . 'conf/global/sites.ini', 'redirects');
         if ($ini) {
             $redirect = arrays::returnValue($ini, self::$site);
             if ($redirect) {
                 headers::site($redirect);
             }
         }
         // mirrors
         $ini = ini::get('mirrors');
         if ($ini) {
             $mirror = arrays::returnValue($ini, self::$site);
             if ($mirror) {
                 self::$site = $mirror;
             }
         }
     }
     self::setConst();
     if ($engine) {
         load::engine(ENGINE);
     }
 }
Пример #13
0
         it under the terms of the GNU General Public License as published by
         the Free Software Foundation; either version 2 of the License, or
         (at your option) any later version.

         OCOMON 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
         GNU General Public License for more details.

         You should have received a copy of the GNU General Public License
         along with Foobar; if not, write to the Free Software
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
$cab = new headers();
$cab->set_title(HTML_TITLE);
$auth = new auth();
$auth->testa_user($s_usuario, $s_nivel, $s_nivel_desc, 4);
$hoje = date("Y-m-d H:i:s");
$cor = TD_COLOR;
$cor1 = TD_COLOR;
$cor3 = BODY_COLOR;
$queryA = "SELECT\n\n\t\t\tmold.mold_marca as padrao,\n\t\t\tmold.mold_inv as etiqueta, mold.mold_sn as serial, mold.mold_nome as nome,\n \t\t\tmold.mold_nf as nota,\n\n \t\t\tmold.mold_coment as comentario, mold.mold_valor as valor, mold.mold_data_compra as\n\t\t\tdata_compra, mold.mold_ccusto as ccusto,\n\n\t\t\tinst.inst_nome as instituicao, inst.inst_cod as cod_inst,\n\n\t\t\tequip.tipo_nome as equipamento, equip.tipo_cod as equipamento_cod,\n\n\t\t\tt.tipo_imp_nome as impressora, t.tipo_imp_cod as impressora_cod,\n\n\t\t\tloc.local as local, loc.loc_id as local_cod,\n\n\n\n\t\t\tproc.mdit_fabricante as fabricante_proc, proc.mdit_desc as processador, proc.mdit_desc_capacidade as clock, proc.mdit_cod as cod_processador,\n\t\t\thd.mdit_fabricante as fabricante_hd, hd.mdit_desc as hd, hd.mdit_desc_capacidade as hd_capacidade,hd.mdit_cod as cod_hd,\n\t\t\tvid.mdit_fabricante as fabricante_video, vid.mdit_desc as video, vid.mdit_cod as cod_video,\n\t\t\tred.mdit_fabricante as rede_fabricante, red.mdit_desc as rede, red.mdit_cod as cod_rede,\n\t\t\tmodm.mdit_fabricante as fabricante_modem, modm.mdit_desc as modem, modm.mdit_cod as cod_modem,\n\t\t\tcd.mdit_fabricante as fabricante_cdrom, cd.mdit_desc as cdrom, cd.mdit_cod as cod_cdrom,\n\t\t\tgrav.mdit_fabricante as fabricante_gravador, grav.mdit_desc as gravador, grav.mdit_cod as cod_gravador,\n\t\t\tdvd.mdit_fabricante as fabricante_dvd, dvd.mdit_desc as dvd, dvd.mdit_cod as cod_dvd,\n\t\t\tmb.mdit_fabricante as fabricante_mb, mb.mdit_desc as mb, mb.mdit_cod as cod_mb,\n\t\t\tmemo.mdit_desc as memoria, memo.mdit_cod as cod_memoria,\n\t\t\tsom.mdit_fabricante as fabricante_som, som.mdit_desc as som, som.mdit_cod as cod_som,\n\n\n\t\t\tfab.fab_nome as fab_nome, fab.fab_cod as fab_cod,\n\n\t\t\tfo.forn_cod as fornecedor_cod, fo.forn_nome as fornecedor_nome,\n\n\t\t\tmodel.marc_cod as modelo_cod, model.marc_nome as modelo,\n\n\t\t\tpol.pole_cod as polegada_cod, pol.pole_nome as polegada_nome,\n\n\t\t\tres.resol_cod as resolucao_cod, res.resol_nome as resol_nome\n\n\n\t\tFROM ((((((((((((((((((moldes as mold\n\t\t\tleft join  tipo_imp as t on\tt.tipo_imp_cod = mold.mold_tipo_imp)\n\t\t\tleft join polegada as pol on mold.mold_polegada = pol.pole_cod)\n\t\t\tleft join resolucao as res on mold.mold_resolucao = res.resol_cod)\n\t\t\tleft join fabricantes as fab on fab.fab_cod = mold.mold_fab)\n\t\t\tleft join fornecedores as fo on fo.forn_cod = mold.mold_fornecedor)\n\n\t\t\tleft join modelos_itens as proc on proc.mdit_cod = mold.mold_proc)\n\t\t\tleft join modelos_itens as hd on hd.mdit_cod = mold.mold_modelohd)\n\t\t\tleft join modelos_itens as vid on vid.mdit_cod = mold.mold_video)\n\t\t\tleft join modelos_itens as red on red.mdit_cod = mold.mold_rede)\n\t\t\tleft join modelos_itens as modm on modm.mdit_cod = mold.mold_modem)\n\t\t\tleft join modelos_itens as cd on cd.mdit_cod = mold.mold_cdrom)\n\t\t\tleft join modelos_itens as grav on grav.mdit_cod = mold.mold_grav)\n\t\t\tleft join modelos_itens as dvd on dvd.mdit_cod = mold.mold_dvd)\n\t\t\tleft join modelos_itens as mb on mb.mdit_cod = mold.mold_mb)\n\t\t\tleft join modelos_itens as memo on memo.mdit_cod = mold.mold_memo)\n\t\t\tleft join modelos_itens as som on som.mdit_cod = mold.mold_som)\n\n\t\t\tleft join instituicao as inst on inst.inst_cod = mold.mold_inst)\n\t\t\tleft join localizacao as loc on loc.loc_id = mold.mold_local),\n\n\n\t\t\tmarcas_comp as model, tipo_equip as equip\n\t\tWHERE\n\n\t\t\t(mold.mold_tipo_equip = equip.tipo_cod) and\n\t\t\t(mold.mold_marca = model.marc_cod) order by fab_nome";
//(mold.mold_marca = $comp_marca) and
$resultadoA = mysql_query($queryA);
$linhasA = mysql_num_rows($resultadoA);
$row = mysql_fetch_array($resultadoA);
/*    if (mysql_num_rows($resultadoA)>0)
        {
                $linhasA = mysql_num_rows($resultadoA)-1;
Пример #14
0
 function observerMemory()
 {
     $cookie = cookie::get(self::$auth_cookie_name);
     if ($cookie) {
         $err = false;
         list($username, $userid, $hash) = explode(',', $cookie);
         $userid = intval($userid);
         db::table('admin_users');
         db::where('user_id', $userid);
         $row = db::assoc();
         $word = 'legenda';
         if (md5($row['user_login'] . $word) != $hash) {
             $err = true;
         }
         if (db::rows() == 0) {
             $err = true;
         }
         if ($err) {
             self::logout();
         } else {
             $_SESSION['ADMIN_AUTH'] = 1;
             $_SESSION['ADMIN_USER_ID'] = $userid;
             headers::self();
         }
     }
 }
Пример #15
0
         (at your option) any later version.

         OCOMON 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
         GNU General Public License for more details.

         You should have received a copy of the GNU General Public License
         along with Foobar; if not, write to the Free Software
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
session_start();
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
include 'includes/header.php';
$cab = new headers();
$cab->set_title($TRANS["html_title"]);
$auth = new auth();
$auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 4);
$hojeLog = date("d-m-Y H:i:s");
$fecha = "";
if (isset($_GET['popup'])) {
    $fecha = "window.close()";
} else {
    $fecha = "redirect('" . basename($_SERVER['PHP_SELF']) . "')";
}
print "<BR><B>" . TRANS('TTL_ADMIN_SW_STAND') . "</B><BR>";
print "<FORM method='POST' action='" . $_SERVER['PHP_SELF'] . "' onSubmit=\"return valida()\">";
if (!isset($_GET['cellStyle'])) {
    $cellStyle = "cellpadding='5' cellspacing='0'";
} else {
Пример #16
0
 function _save()
 {
     $block_id = params::get('block_id');
     db::table('blocks');
     db::where('block_id', $block_id);
     db::update(array('block_pub' => '1', 'block_code' => params::get('block_code'), 'block_title' => params::get('block_title'), 'block_name' => params::get('block_name')));
     $allPages = params::isCheck('allPages');
     $allPagesOut = params::isCheck('allPagesOut');
     $pages = params::get('pages');
     if ($allPages == 1) {
         conf::deleteAll('blocks', $block_id, 'in');
         conf::addPageIn('blocks', $block_id, 0);
         conf::deleteAll('blocks', $block_id, 'out');
         conf::addPageOut('blocks', $block_id, 0);
     } else {
         if ($allPagesOut == 1 && $pages) {
             conf::deleteAll('blocks', $block_id, 'in');
             conf::addPageIn('blocks', $block_id, 0);
             conf::deleteAll('blocks', $block_id, 'out');
             foreach ($pages as $v) {
                 conf::addPageOut('blocks', $block_id, $v);
             }
         } else {
             if ($pages) {
                 conf::deleteAll('blocks', $block_id, 'out');
                 conf::addPageOut('blocks', $block_id, 0);
                 conf::deleteAll('blocks', $block_id, 'in');
                 foreach ($pages as $v) {
                     conf::addPageIn('blocks', $block_id, $v);
                 }
             } else {
                 conf::deleteAll('blocks', $block_id, 'in');
                 conf::addPageIn('blocks', $block_id, 0);
                 conf::deleteAll('blocks', $block_id, 'out');
                 conf::addPageOut('blocks', $block_id, 0);
             }
         }
     }
     if (events::detect('add')) {
         headers::app('blocks');
     } else {
         if (params::isCheck('go_structure')) {
             headers::app('blocks');
         } else {
             headers::self();
         }
     }
 }
Пример #17
0
 function installApp()
 {
     if ($_FILES['app']['name']) {
         if ($_FILES['app']['type'] != 'application/zip') {
             s::set('ERRORS', '<ul><li>Неверный формат архива приложения.</li></ul>');
         } else {
             $arr = explode('.', $_FILES['app']['name']);
             if (count($arr) < 5) {
                 s::set('ERRORS', '<ul><li>Неверный формат архива приложения.</li></ul>');
             } else {
                 define('INSTALL_APP', $arr[0]);
                 define('INSTALL_APP_VERSION', $arr[1] . '.' . $arr[2] . '.' . $arr[3]);
                 files::fullRemoveDir(SYS_ROOT . 'var/tmp/apps/');
                 $path = SYS_ROOT . 'var/tmp/apps/';
                 zipfile::read($_FILES['app']['tmp_name']);
                 zipfile::extract($path);
                 $install_file = $path . 'install.php';
                 if (!file_exists($install_file)) {
                     s::set('ERRORS', '<ul><li>Не найден инсталляционый файл приложения.</li></ul>');
                 } else {
                     include $install_file;
                     // copy lang files
                     $tmp_lang_dir = SYS_ROOT . 'var/tmp/apps/langs/';
                     $lang_dir = SYS_ROOT . 'langs/admin/';
                     if (file_exists($lang_dir)) {
                         $array = files::getFiles($tmp_lang_dir);
                         foreach ($array as $v) {
                             if (!file_exists($lang_dir . $v)) {
                                 copy($tmp_lang_dir . $v, $lang_dir . $v);
                             } else {
                                 $lang = ini::parse($tmp_lang_dir . $v);
                                 ini::parse($lang_dir . $v);
                                 ini::add($lang);
                                 ini::write();
                             }
                         }
                     }
                     // copy app files
                     $dir = SYS_ROOT . 'var/tmp/apps/' . INSTALL_APP . '/';
                     $new_dir = SYS_ROOT . 'apps/' . INSTALL_APP . '/';
                     files::copyDir($dir, $new_dir);
                     // clear tmp
                     files::fullRemoveDir(SYS_ROOT . 'var/tmp/apps/');
                     headers::app('manage');
                 }
             }
         }
     }
 }
$domain = $set['domain'];
if ($_SESSION['userid']) {
    if ($guest) {
        $gutxt = " AND guest=1";
    }
    $is = $db->query("SELECT * FROM users WHERE userid='{$userid}'{$gutxt}");
    $useex = $db->num_rows($is);
    if ($useex > 0) {
        $ir = $db->fetch_row($is);
        $namenospaces = str_replace(" ", "_", $ir['username']);
        $_SESSION['username'] = $namenospaces;
    } else {
        if (!$userid) {
            die('error');
        } else {
            if ($guest == 1) {
                header('Location: login.php');
            } else {
                $name = $user->fbc_name;
                $db->query("INSERT INTO users (userid, username, money) VALUES('{$userid}', '{$name}', 1000)");
                $is = $db->query("SELECT * FROM users WHERE userid='{$userid}'");
                $ir = $db->fetch_row($is);
            }
        }
    }
}
$h = new headers();
$h->startheaders();
$fm = "\$" . number_format($ir['money']);
$lv = date('F j, Y, g:i a', $ir['laston']);
$h->userdata($ir, $lv, $fm);
Пример #19
0
         (at your option) any later version.

         OCOMON 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
         GNU General Public License for more details.

         You should have received a copy of the GNU General Public License
         along with Foobar; if not, write to the Free Software
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
session_start();
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
$_SESSION['s_page_invmon'] = $_SERVER['PHP_SELF'];
$cab = new headers();
$cab->set_title(TRANS("html_title"));
$auth = new auth();
$auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 4);
print "<BODY bgcolor=" . BODY_COLOR . ">";
$hoje = date("d-m-Y H:i:s");
// 	$cor  = TD_COLOR;
// 	$cor1 = TD_COLOR;
// 	$cor3 = BODY_COLOR;
$dados = array();
//Array que ir�guardar os valores para montar o gr�ico
$legenda = array();
$queryB = $QRY["total_equip"] . " where comp_inst not in (" . INST_TERCEIRA . ")";
$resultadoB = mysql_query($queryB);
$row = mysql_fetch_array($resultadoB);
//$total = mysql_result($resultadoB,0);
Пример #20
0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
session_start();
require "global_func.php";
if ($_SESSION['loggedin'] == 0) {
    header("Location: login.php");
    exit;
}
$userid = $_SESSION['userid'];
require "header.php";
$h = new headers();
$h->startheaders();
include "mysql.php";
global $c;
$is = mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$userid}", $c) or die(mysql_error());
$ir = mysql_fetch_array($is);
check_level();
$fm = money_formatter($ir['money']);
$cm = money_formatter($ir['crystals'], '');
$lv = date('F j, Y, g:i a', $ir['laston']);
$h->userdata($ir, $lv, $fm, $cm);
$h->menuarea();
$_GET['ID'] = abs((int) $_GET['ID']);
if (!$_GET['ID']) {
    die("Incorrect usage of file.");
}
Пример #21
0
         the Free Software Foundation; either version 2 of the License, or
         (at your option) any later version.

         OCOMON 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
         GNU General Public License for more details.

         You should have received a copy of the GNU General Public License
         along with Foobar; if not, write to the Free Software
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
session_start();
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
$cab = new headers();
$cab->set_title(TRANS('TTL_OCOMON'));
$hoje = date("d-m-Y H:i:s");
$hojeDia = date("y-m-d");
$hoje_termo = date("d/m/Y H:i:s");
$logo = LOGO_PATH . '/logo_lasalle.gif';
$auth = new auth();
$auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 4);
if ($_SESSION['s_nivel'] == 1) {
    $administrador = true;
} else {
    $administrador = false;
}
if (!isset($_REQUEST['header'])) {
    $header = TRANS('TXT_REPORT_PERSON');
} else {
Пример #22
0
 function restoreVersion($app, $tmpl_file, $version_id)
 {
     db::table('templates_versions');
     db::where('version_id', $version_id);
     $row = db::assoc();
     $rows = db::rows();
     $code = stripslashes($row['version_code']);
     $file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $app . '/' . $tmpl_file;
     header("Content-Type: text/plain; charset=UTF-8");
     files::write($file, $code);
     if ($rows != 0) {
         self::deleteVersion($version_id);
     }
     router::delQs('restore');
     headers::selfQs();
 }
Пример #23
0
         (at your option) any later version.

         OCOMON 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
         GNU General Public License for more details.

         You should have received a copy of the GNU General Public License
         along with Foobar; if not, write to the Free Software
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
session_start();
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
include 'includes/header.php';
$cab = new headers();
$cab->set_title(TRANS('TTL_INVMON'));
$auth = new auth();
if (isset($_GET['popup'])) {
    $auth->testa_user_hidden($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 2);
} else {
    $auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 2);
}
$hojeLog = date("d-m-Y H:i:s");
if (isset($_POST['submit'])) {
    $erro = false;
    if ($_POST['software'] == -1) {
        $aviso = TRANS('MSG_EMPTY_DATA');
        $erro = true;
    } else {
        $qry_1 = "select * from softwares where soft_cod = " . $_POST['software'] . "";
         OCOMON 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
         GNU General Public License for more details.

         You should have received a copy of the GNU General Public License
         along with Foobar; if not, write to the Free Software
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
session_start();
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
include 'includes/header.php';
$_SESSION['s_page_invmon'] = $_SERVER['PHP_SELF'];
$cab = new headers();
$cab->set_title(TRANS('TTL_INVMON'));
$auth = new auth();
$auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 2);
$hoje = date("Y-m-d H:i:s");
$cor = TD_COLOR;
$cor1 = TD_COLOR;
$cor3 = BODY_COLOR;
$queryB = "SELECT count(*) total from equipamentos";
$resultadoB = mysql_query($queryB);
$rowTotal = mysql_fetch_array($resultadoB);
$total = $rowTotal['total'];
$queryC = "SELECT count(extract(day from comp_data)) as QTD_DIA, extract(day from comp_data)as DIA, " . "extract(month from comp_data) as MES , extract(year from comp_data) as ANO, " . "concat(date_format(comp_data,'%d'),'/',date_format(comp_data,'%m'),'/',extract(year from comp_data))as tipo_data " . "FROM equipamentos group by ano,mes,dia order by ano desc ,mes desc,dia desc";
$resultadoC = mysql_query($queryC);
$linhasC = mysql_num_rows($resultadoC);
//Tabela de quantidade de equipamentos cadastrados por dia
         OCOMON 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
         GNU General Public License for more details.

         You should have received a copy of the GNU General Public License
         along with Foobar; if not, write to the Free Software
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
session_start();
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
include 'includes/header.php';
$_SESSION['s_page_invmon'] = $_SERVER['PHP_SELF'];
$cab = new headers();
$cab->set_title(TRANS("html_title"));
$auth = new auth();
$auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 2);
$hoje = date("Y-m-d H:i:s");
$cor = TD_COLOR;
$cor1 = TD_COLOR;
$cor3 = BODY_COLOR;
$queryB = "SELECT count(*) from equipamentos";
$resultadoB = mysql_query($queryB);
$total = mysql_result($resultadoB, 0);
// Select para retornar a quantidade e percentual de equipamentos cadastrados no sistema
$query = "SELECT count( l.loc_reitoria )  AS qtd, count(  *  )  / " . $total . " * 100 AS porcento,\n\t\t\t\tl.loc_reitoria AS cod_reitoria, l.loc_id AS tipo_local, t.tipo_nome AS equipamento,\n\t\t\t\tt.tipo_cod AS tipo, r.reit_nome AS reitoria FROM equipamentos AS c, tipo_equip AS t,\n\t\t\t\tlocalizacao AS l, reitorias AS r WHERE c.comp_tipo_equip = t.tipo_cod AND\n\t\t\t\tc.comp_local = l.loc_id AND l.loc_reitoria = r.reit_cod GROUP  BY l.loc_reitoria, equipamento\n\t\t\t\tORDER  BY reitoria, qtd DESC";
$resultado = mysql_query($query);
$linhas = mysql_num_rows($resultado);
print "<TABLE border='0' cellpadding='5' cellspacing='0' align='center' width='80%' bgcolor='" . $cor3 . "'>";
Пример #26
0
 function _save()
 {
     $menu_id = params::get('menu_id');
     db::table('menus');
     db::where('menu_id', $menu_id);
     db::update(array('menu_pub' => '1', 'menu_name' => params::get('menu_name'), 'menu_title' => params::get('menu_title'), 'menu_tmpl' => params::get('menu_tmpl'), 'menu_tmpl_link' => params::get('menu_tmpl_link'), 'menu_tmpl_act' => params::get('menu_tmpl_act'), 'menu_tmpl_inact' => params::get('menu_tmpl_inact')));
     $allPages = params::isCheck('allPages');
     $allPagesOut = params::isCheck('allPagesOut');
     $pages = params::get('pages');
     if ($allPages == 1) {
         conf::deleteAll('menus', $menu_id, 'in');
         conf::addPageIn('menus', $menu_id, 0);
         conf::deleteAll('menus', $menu_id, 'out');
         conf::addPageOut('menus', $menu_id, 0);
     } else {
         if ($allPagesOut == 1 && $pages) {
             conf::deleteAll('menus', $menu_id, 'in');
             conf::addPageIn('menus', $menu_id, 0);
             conf::deleteAll('menus', $menu_id, 'out');
             foreach ($pages as $v) {
                 conf::addPageOut('menus', $menu_id, $v);
             }
         } else {
             if ($pages) {
                 conf::deleteAll('menus', $menu_id, 'out');
                 conf::addPageOut('menus', $menu_id, 0);
                 conf::deleteAll('menus', $menu_id, 'in');
                 foreach ($pages as $v) {
                     conf::addPageIn('menus', $menu_id, $v);
                 }
             } else {
                 conf::deleteAll('menus', $menu_id, 'in');
                 conf::addPageIn('menus', $menu_id, 0);
                 conf::deleteAll('menus', $menu_id, 'out');
                 conf::addPageOut('menus', $menu_id, 0);
             }
         }
     }
     if (events::detect('add')) {
         headers::app('menus');
     } else {
         headers::self();
     }
 }
         but WITHOUT ANY WARRANTY; without even the implied warranty of
         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
         GNU General Public License for more details.

         You should have received a copy of the GNU General Public License
         along with Foobar; if not, write to the Free Software
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
session_start();
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
include 'includes/header.php';
$_SESSION['s_page_invmon'] = $_SERVER['PHP_SELF'];
$auth = new auth();
$auth->testa_user($_SESSION['s_usuario'], $_SESSION['s_nivel'], $_SESSION['s_nivel_desc'], 2);
$cab = new headers();
$cab->set_title(TRANS('html_title'));
$hoje = date("Y-m-d H:i:s");
$hojeLog = date("d-m-Y H:i:s");
$nulo = null;
print "<BR>";
print "<B>" . TRANS("head_inc_mold_equip") . ":";
print "<BR><a href='model_config.php'>Lista os modelos de configuração já cadastrados</a>";
print "<FORM name='form1' method='POST' action='" . $_SERVER['PHP_SELF'] . "'  ENCTYPE='multipart/form-data'  onSubmit='return valida()'>";
print "<TABLE border='0' colspace='3' width='100%'>";
print "<tr><td colspan='4'></td><b>" . TRANS('TXT_GENERAL_DATA') . ":</b></td></tr>";
print "<tr>";
print "<TD width='20%' align='left' bgcolor='" . TD_COLOR . "'><b>" . "<a title='Campo obrigatório - Defina o tipo de equipamento que está cadastrando'>" . TRANS('FIELD_TYPE_EQUIP') . ":</a></b>" . "</TD>";
print "<TD width='30%' align='left' bgcolor='" . BODY_COLOR . "'>";
print "<SELECT class='select' name='comp_tipo_equip' id='idTipo' size='1' " . "onChange=\"fillSelectFromArray(this.form.comp_marca, ((this.selectedIndex == -1) ? null : " . "team[this.selectedIndex-1]));\">";
print "<option value=-1 selected>" . TRANS('SEL_TYPE_EQUIP') . "</option>";
Пример #28
0
 function _addsection()
 {
     $array = array('section_name' => strip_tags(params::get('section_name')), 'section_year' => params::get('section_year'), 'section_view' => params::isCheck('section_view'));
     db::table('info_sections');
     db::smartInsert($array);
     $section_id = mysql_insert_id();
     headers::action('info', 'main', 'sections');
 }
         the Free Software Foundation; either version 2 of the License, or
         (at your option) any later version.
  
         OCOMON 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
         GNU General Public License for more details.
  
         You should have received a copy of the GNU General Public License
         along with Foobar; if not, write to the Free Software
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
include "../../includes/include_geral.inc.php";
include "../../includes/include_geral_II.inc.php";
include 'includes/header.php';
$cab = new headers();
$cab->set_title($TRANS["html_title"]);
$auth = new auth();
$auth->testa_user($s_usuario, $s_nivel, $s_nivel_desc, 4);
if ($s_nivel != 1) {
    echo "<META HTTP-EQUIV=REFRESH   CONTENT=\"0;\n                        URL=../index.php\">";
} else {
    $query = "SELECT c.comp_inv as etiqueta, c.comp_sn as serial, c.comp_nome as nome, \n \t\t\tc.comp_nf as nota, inst.inst_nome as instituicao, inst.inst_cod as cod_inst,\n \t\t\tc.comp_coment as comentario, c.comp_valor as valor, c.comp_data as data_cadastro, \n\t\t\tc.comp_data_compra as data_compra, c.comp_ccusto as ccusto, c.comp_situac as situacao, \n\t\t\tc.comp_local as tipo_local, loc.loc_reitoria as reitoria_cod, reit.reit_nome as reitoria,\n\t\t\tc.comp_mb as tipo_mb, c.comp_proc as tipo_proc,\n\t\t\tc.comp_tipo_equip as tipo, c.comp_memo as tipo_memo, c.comp_video as tipo_video,\n\t\t\tc.comp_modelohd as tipo_hd, c.comp_modem as tipo_modem, c.comp_cdrom as tipo_cdrom,\n\t\t\tc.comp_dvd as tipo_dvd, c.comp_grav as tipo_grav, c.comp_resolucao as tipo_resol,\n\t\t\tc.comp_polegada as tipo_pole, c.comp_tipo_imp as tipo_imp,\n\t\t\tequip.tipo_nome as equipamento, c.comp_rede as tipo_rede, c.comp_som as tipo_som,\n\t\t\tt.tipo_imp_nome as impressora, loc.local, \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tproc.mdit_fabricante as fabricante_proc, proc.mdit_desc as processador, proc.mdit_desc_capacidade as clock, proc.mdit_cod as cod_processador,\n\t\t\thd.mdit_fabricante as fabricante_hd, hd.mdit_desc as hd, hd.mdit_desc_capacidade as hd_capacidade,hd.mdit_cod as cod_hd,\n\t\t\tvid.mdit_fabricante as fabricante_video, vid.mdit_desc as video, vid.mdit_cod as cod_video,\n\t\t\tred.mdit_fabricante as rede_fabricante, red.mdit_desc as rede, red.mdit_cod as cod_rede,\n\t\t\tmod.mdit_fabricante as fabricante_modem, mod.mdit_desc as modem, mod.mdit_cod as cod_modem,\n\t\t\tcd.mdit_fabricante as fabricante_cdrom, cd.mdit_desc as cdrom, cd.mdit_cod as cod_cdrom,\n\t\t\tgrav.mdit_fabricante as fabricante_gravador, grav.mdit_desc as gravador, grav.mdit_cod as cod_gravador,\n\t\t\tdvd.mdit_fabricante as fabricante_dvd, dvd.mdit_desc as dvd, dvd.mdit_cod as cod_dvd,\n\t\t\tmb.mdit_fabricante as fabricante_mb, mb.mdit_desc as mb, mb.mdit_cod as cod_mb,\n\t\t\tmemo.mdit_desc as memoria, memo.mdit_cod as cod_memoria,\n\t\t\tsom.mdit_fabricante as fabricante_som, som.mdit_desc as som, som.mdit_cod as cod_som, \n\n\t\t\tfab.fab_nome as fab_nome, fab.fab_cod as fab_cod, fo.forn_cod as fornecedor_cod, \n\t\t\tfo.forn_nome as fornecedor_nome, model.marc_cod as modelo_cod, model.marc_nome as modelo,\n\t\t\tpol.pole_cod as polegada_cod, pol.pole_nome as polegada_nome, \n\t\t\tres.resol_cod as resolucao_cod, res.resol_nome as resol_nome,\n\t\t\tsit.situac_cod as situac_cod, sit.situac_nome as situac_nome,\n\t\t\tdate_add(c.comp_data_compra, interval tmp.tempo_meses month)as vencimento\n\t\t\n\t\tFROM ((((((((((((((((((equipamentos as c left join  tipo_imp as t on \n\t\t\tt.tipo_imp_cod = c.comp_tipo_imp) left join polegada as pol on c.comp_polegada\n\t\t\t = pol.pole_cod) left join resolucao as res on c.comp_resolucao = res.resol_cod)\n\t\t\tleft join fabricantes as fab on fab.fab_cod = c.comp_fab) \n\t\t\tleft join fornecedores as fo on fo.forn_cod = c.comp_fornecedor) \n\t\t\tleft join situacao as sit on sit.situac_cod = c.comp_situac)\n\t\t\tleft join tempo_garantia as tmp on tmp.tempo_cod =c.comp_garant_meses)\n\t\t\t\n\t\t\tleft join modelos_itens as proc on proc.mdit_cod = c.comp_proc)\n\t\t\tleft join modelos_itens as hd on hd.mdit_cod = c.comp_modelohd)\n\t\t\tleft join modelos_itens as vid on vid.mdit_cod = c.comp_video)\n\t\t\tleft join modelos_itens as red on red.mdit_cod = c.comp_rede)\n\t\t\tleft join modelos_itens as mod on mod.mdit_cod = c.comp_modem)\n\t\t\tleft join modelos_itens as cd on cd.mdit_cod = c.comp_cdrom)\n\t\t\tleft join modelos_itens as grav on grav.mdit_cod = c.comp_grav)\n\t\t\tleft join modelos_itens as dvd on dvd.mdit_cod = c.comp_dvd)\n\t\t\tleft join modelos_itens as mb on mb.mdit_cod = c.comp_mb)\n\t\t\tleft join modelos_itens as memo on memo.mdit_cod = c.comp_memo)\n\t\t\tleft join modelos_itens as som on som.mdit_cod = c.comp_som),\n\n\t\t\t\n\t\t\tlocalizacao as loc, instituicao as inst, marcas_comp as model, tipo_equip as equip,\n\t\t\treitorias as reit\n            WHERE\n \t\t\t((c.comp_local = loc.loc_id) and\n\t\t\t(c.comp_inst = inst.inst_cod) and (c.comp_marca = model.marc_cod) and \n\t\t\t(c.comp_tipo_equip = equip.tipo_cod) and (loc.loc_reitoria = reit.reit_cod) and\n\t\t\t(c.comp_inv = {$comp_inv}) and (inst.inst_cod = {$comp_inst}))\n\t\t\t\n\t\t\t";
    $resultado = mysql_query($query);
    $linhas = mysql_num_rows($resultado);
    $row = mysql_fetch_array($resultado);
    if (!empty($row['ccusto'])) {
        $CC = $row['ccusto'];
        $query2 = "select * from planejamento.CCUSTO where codigo= {$CC}";
        $resultado2 = mysql_query($query2);
        $resultado3 = mysql_result($resultado2, 0, 4);
Пример #30
0
 function _add()
 {
     self::_save();
     headers::app('templates');
 }