query($sql);
}catch (Exception $e)
{
echo $e->getMessage();
}
$exists=false;
if($res!=NULL && $res->rowCount()>0)
{
while ($row = $res->fetch(PDO::FETCH_ASSOC))
{
if($_SESSION['COMPANY_ID']==$row['company_id'])
{
$sql="update main.companies_users set last=false where last=true and user_id=".$_SESSION['USER_ID'];
$res = $db->query($sql);
$sql="update main.companies_users set last=true where company_id=".$_SESSION['COMPANY_ID']." and user_id=".$_SESSION['USER_ID'];
$res = $db->query($sql);
$exists=true;
break;
}
}
}
if(!$exists)
$_SESSION['COMPANY_ID']=null;
}
$userName = ''; //Фамилия Имя Отчество
$roleName = ''; //Роли доступа
$timezone='';
if(isset($_SESSION['USER_ID']) && $_SESSION['USER_ID']!='' && $_SESSION['USER_ID']!='null')
{
$sql="
select
Coalesce(u.name,'') as name, --concat(Coalesce(u.surname,''),' ',Coalesce(u.name,''),' ',Coalesce(u.patronymic,'')) as name,
t.role,
main.getcompanyid(u.id) company_id,
u.timezone
from
main._Users u
left join (select ug.user_id, array_to_string(array_agg(main._(".$_SESSION['USER_ID'].",g.name)), ', ') as role from main._Groups g, main._UsersGroups ug where ug.del=false and g.id=ug.group_id group by ug.user_id) t on u.id=t.user_id
where u.id=".$_SESSION['USER_ID'].";";
$res = NULL;
try
{
$res = $db->query($sql);
}catch (Exception $e)
{
echo $e->getMessage();
}
if($res!=NULL && $res->rowCount()>0)
{
while ($row = $res->fetch(PDO::FETCH_ASSOC))
{
$userName=$row['name'];
$roleName=trt($row['role']);
if($_SESSION['COMPANY_ID']==null)
$_SESSION['COMPANY_ID']=$row['company_id'];
$timezone=$row['timezone'];
}
}
}
//Типа версия скрипта (Задавать пути от корня сайта)
/*function getScript($path)
{
if (file_exists($_SERVER['DOCUMENT_ROOT'].$path))
{
return ''."\n";
}
return '';
}*/
?>
GEOVizor
echo getScript('/monitoring/setup.js'); ?>
echo getScript('/resources/metadata/dbms/tools.js'); ?>
echo getScript('/resources/metadata/dbms/editrecord.js'); ?>
echo getScript('/resources/metadata/dbms/showrecord.js'); ?>
echo getScript('/resources/metadata/dbms/tabs.js'); ?>
echo getScript('/resources/metadata/tree/tree.js'); ?>
echo getScript('/monitoring/jscripts/geofences.js'); ?>
echo getScript('/monitoring/jscripts/routes.js'); ?>
echo getScript('/monitoring/jscripts/detours.js'); ?>
echo getScript('/monitoring/jscripts/objects.js'); ?>
echo getScript('/monitoring/jscripts/trips.js'); ?>
echo getScript('/monitoring/jscripts/messages.js'); ?>
echo getScript('/monitoring/jscripts/events.js'); ?>
echo getScript('/monitoring/jscripts/user.js'); ?>
|
|
|
|
|
|
|
|
|
|
| Статус рейса |
|
|
|
|
| |
|
|
: 0
|
|