Primer commit del sistema avantika sin cambios
This commit is contained in:
58
modules/envios.php
Executable file
58
modules/envios.php
Executable file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
$empresa->AuthUser();
|
||||
|
||||
if(!$usuario->AllowPage($page, $_SESSION['loginKey'])){
|
||||
header('Location: '.WEB_ROOT);
|
||||
exit;
|
||||
}
|
||||
|
||||
$envio->setPage(intval($_GET['p']));
|
||||
$envio->setTipo('CT');
|
||||
if($Usr['type'] == 'gerente'){
|
||||
$envio->setSucursalId($_SESSION['idSuc']);
|
||||
$resEnvios = $envio->EnumBySuc();
|
||||
|
||||
$sucursal->setSucursalId($_SESSION['idSuc']);
|
||||
$nomSuc = utf8_decode(urldecode($sucursal->GetNameById()));
|
||||
|
||||
}else{
|
||||
$resEnvios = $envio->Enumerate();
|
||||
}
|
||||
|
||||
$envios = array();
|
||||
foreach($resEnvios['items'] as $res){
|
||||
|
||||
$sucursal->setSucursalId($res['sucursalId']);
|
||||
$res['sucursal'] = utf8_decode(urldecode($sucursal->GetNameById()));
|
||||
|
||||
$envio->setEnvioId($res['envioId']);
|
||||
$res['noCajas'] = $envio->GetTotalCajas();
|
||||
|
||||
$fecha = date('d-m-Y',strtotime($res['fecha']));
|
||||
$hora = date('H:i:s',strtotime($res['fecha']));
|
||||
$fecha = $util->FormatDateDMMMY($fecha);
|
||||
$res['fecha'] = $fecha.' '.$hora;
|
||||
|
||||
$total = $envio->GetValorTotal();
|
||||
$res['total'] = number_format($total,2);
|
||||
|
||||
$res['prendas'] = $envio->GetTotalPrendas();
|
||||
|
||||
$envios[] = $res;
|
||||
}
|
||||
$resEnvios['items'] = $envios;
|
||||
|
||||
$msg = $_SESSION['msgEnv'];
|
||||
$_SESSION['msgEnv'] = '';
|
||||
|
||||
$resSuc = $sucursal->GetSucursalesByEmpresaId();
|
||||
$resSuc2 = $util->DecodeUrlResult($resSuc);
|
||||
$sucursales = $util->DecodeResult($resSuc2);
|
||||
|
||||
$smarty->assign('msg', $msg);
|
||||
$smarty->assign('nomSuc', $nomSuc);
|
||||
$smarty->assign('envios', $resEnvios);
|
||||
$smarty->assign('sucursales', $sucursales);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user