コード例 #1
0
function getListaCustomers()
{
    $lg = mySx('logado', 0);
    if (!$lg) {
        return null;
    }
    $user = mySx('user');
    $where = $user['pnu_is_admin'] == 1 ? '' : "WHERE pug_user_id = {$user['id_panel_users']}";
    $busca = sqlQuery('main', "\r\n\t        SELECT DISTINCT C.*\r\n\t        FROM panel_user_groups A\r\n\t        JOIN panel_group_customers B ON A.pug_group_id = B.pgc_group_id\r\n\t        JOIN customers C ON B.pgc_customer_id = C.id_customers\r\n\t        {$where}\r\n\t    ");
    $lista = array();
    foreach ($busca['rows'] as $x) {
        $x['cus_name'] = $x['cus_name'];
        $lista[] = $x;
    }
    return $lista;
}
コード例 #2
0
function oQuery($params)
{
    $tp = myArray($params, 'tp', 'main');
    $st = myArray($params, 'st', '');
    $ps = myArray($params, 'ps', array());
    $pdo = myArray($params, 'pdo', null);
    $logIt = myArray($params, 'logIt', false);
    if (!is_array($ps)) {
        $ps = array($ps);
    }
    $code = $st . implode(',', $ps);
    $ret = mySx($code, null);
    if ($ret) {
        return $ret;
    }
    $ret = sqlQuery($tp, $st, $ps, $logIt, $pdo);
    setSx($code, formatSx($ret));
    return $ret;
}
コード例 #3
0
		SELECT Min(DATE(tkt_open_date)) data_inicio
		FROM trouble_tickets
		WHERE tkt_customer_id = ?
	', $customerID);
$datas = array();
$datas['min'] = date('Y-m-d', strtotime($x['data_inicio']));
$datas['max'] = date('Y-m-d');
// ======================================================
// MENU - CLIENTES
// ======================================================
$customers = mySx('customers');
if (count($customers) > 1) {
    $i++;
    $gs[$i] = new Sidebar_Group('OUTROS CLIENTES');
    foreach ($customers as $x) {
        if ($x['id_customers'] != mySx('customerID')) {
            $gs[$i]->addLink(new Sidebar_Link($x['cus_name'], 'fa-user', 'customer' . $x['id_customers'], "?ct={$x['id_customers']}"));
        }
    }
}
// ======================================================
// MENU - FILTROS
// ======================================================
$i++;
$gs[$i] = new Sidebar_Group("<img src='../images/logocivis.png'/> CIVIS: Solicitações");
$gs[$i]->addLink(new Sidebar_Select('sideCategoria', $categorias));
$gs[$i]->addLink(new Sidebar_Select('sideServico', $servicos));
$gs[$i]->addLink(new Sidebar_Select('sideStatus', $status));
$gs[$i]->addLink(new Sidebar_Select('sideData', $datas));
// ======================================================
// MENU - OUTROS
コード例 #4
0
<?php

session_start();
include "includeAll.php";
$ct = myGet('ct', 0);
if ($ct) {
    $lista = mySx('customers');
    foreach ($lista as $x) {
        if ($x['id_customers'] == $ct) {
            setSx('customerID', $ct);
        }
    }
}
$customerID = mySx('customerID');
if ($customerID) {
    $profiles = array();
    $profiles[1] = array('cat' => 1, 'serv' => 2, 'lat' => 7, 'lng' => 8);
    $profiles[2] = array('cat' => 13, 'serv' => 14, 'lat' => 19, 'lng' => 20);
    $profile = $profiles[$customerID];
    setSx('profile', $profile);
}
コード例 #5
0
<?php

include "../../configRoot.php";
include "../../includes/requestHeader.php";
checkLogged();
$aRet = array();
function getWhere($fieldid, $cat)
{
    return "\r\n\t\t\tA.id_trouble_tickets IN (\r\n\t\t\t\tSELECT ttd_ticket_id \r\n\t\t\t\tFROM trouble_ticket_data\r\n\t\t\t\tWHERE ttd_field_id = {$fieldid} AND ttd_string_value = '{$cat}'\r\n\t\t\t)";
}
// pegando o id do customer no session
$customerID = mySx('customerID');
$profile = mySx('profile');
$data = myGet('data');
$aFilters = array();
$aFilters[] = "DATE(A.tkt_open_date) <= '{$data}'";
$aFilters[] = "A.tkt_customer_id = {$customerID}";
$cat = myGet('cat', '');
if ($cat) {
    $aFilters[] = getWhere($profile['cat'], $cat);
}
$serv = myGet('serv', '');
if ($serv) {
    $aFilters[] = getWhere($profile['serv'], $serv);
}
$stat = myGet('stat', '');
if ($stat) {
    $aFilters[] = "A.tkt_status_name = '" . $stat . "'";
} else {
    $aFilters[] = "DATE(IFNULL(A.tkt_close_date,NOW())) >= '{$data}'";
}
コード例 #6
0
ファイル: top.php プロジェクト: tacira-tech/tacops-portal
$bold = array_shift($parts);
$rest = implode(' ', $parts);
$logoClient = "<img src='../images/logocliente{$customerID}.png' style='width:40px'>";
echo "<span style='margin-left:10px'><b>{$bold}</b> {$rest}</span>";
?>
	</a>
	<!-- Header Navbar: style can be found in header.less -->
	<nav class="navbar navbar-static-top" role="navigation">

		<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
        	<span class="sr-only">Toggle navigation</span>
        </a>

        <div class='navbar-menu' style='float:left'>
			<ul class="nav navbar-nav" style='font-size:20px; color:white'>
				<li class='hidden-xs' style='padding:10px'>Painel Operacional</li>
				<li class='visible-xs' style='padding:3px 15px'>Painel Operacional</li>
			</ul>
        </div>

		<!-- Navbar Right Menu -->
		<div class="navbar-custom-menu">
			<ul class="nav navbar-nav">
				<?php 
$user = mySx('user');
echo "\r\n\t\t\t\t<li class='user user-menu'>\r\n\t\t\t\t\t<a></a>\r\n\t\t\t\t</li>\r\n\t\t\t\t<li class='dropdown user user-menu'>\r\n\t\t\t\t\t<a href='../session/logout.php'>\r\n\t\t\t\t\t\t<span class='fa fa-user'></span>\r\n\t\t\t\t\t\t<span class='hidden-xs'>{$user['pnu_name']}</span> <span style='margin-left:10px'>(logout)</span>\r\n\t\t\t\t\t</a>\r\n\t\t\t\t</li>\r\n\t\t\t\t";
?>
			</ul>
		</div>
	</nav>
</header>
コード例 #7
0
ファイル: login.php プロジェクト: tacira-tech/tacops-portal
$login = myPost('login', '');
$password = myPost('password', '');
$ps = array($login, $password);
$busca = sqlQuery('main', '
		SELECT * 
		FROM panel_users
		WHERE pnu_username = ? AND pnu_password = ?
	', $ps);
$aRet = $busca['ret'];
if ($aRet['status'] == 1) {
    if ($busca['count'] == 1) {
        $user = $busca['rows'][0];
        setSx('uid', $user['id_panel_users']);
        setSx('user', $user);
        setSx('logado', 1);
        $lista = getListaCustomers();
        setSx('customers', $lista);
        if ($lista) {
            setSx('customerID', $lista[0]['id_customers']);
        }
    } else {
        setSx('uid', 0);
        setSx('user', null);
        setSx('logado', 0);
        setSx('customerID', 0);
        $aRet['status'] = 0;
        $aRet['error'] = $lb->get('session.wrong');
    }
}
$aRet['logado'] = mySx('logado', 0);
echo json_encode($aRet);
コード例 #8
0
function request_convertValues($converts)
{
    foreach ($converts as $cv) {
        $tipoVar = $cv[0];
        $nomeVar = $cv[1];
        $tipoConvert = isset($cv[2]) ? $cv[2] : '';
        $formatCheck = isset($cv[3]) ? $cv[3] : '';
        $formatTrue = isset($cv[4]) ? $cv[4] : '';
        if ($tipoVar == 'session') {
            $valor = mySx($nomeVar);
        }
        if ($tipoVar == 'post') {
            $valor = myPost($nomeVar);
        }
        if ($tipoConvert == 'date') {
            if (date($formatCheck, strtotime($valor)) == $valor) {
                $valor = date($formatTrue, strtotime($valor));
            } else {
                $valor = '';
            }
        }
        if ($tipoVar == 'session') {
            $_SESSION[$nomeVar] = $valor;
        }
        if ($tipoVar == 'post') {
            $_POST[$nomeVar] = $valor;
        }
    }
}