Info(); $name = "R_Envios_Traspasos"; extract($_POST); $sucursalId = $_POST['sucursalId2']; $status = $_POST['status2']; $fechaEnvio = $_POST['fechaEnvio2']; $ordenCompra = $_POST['ordenCompra2']; $envio->setSucursalId($sucursalId); $envio->setNoPedido($ordenCompra); $envio->setStatus($status); if($fechaEnvio) $envio->setFecha(date('Y-m-d',strtotime($fechaEnvio))); if($Usr['type'] == 'gerente') $envio->setSucursalId($_SESSION['idSuc']); $resEnvios = $envio->Search(); $envios = array(); foreach($resEnvios as $res){ $sucursal->setSucursalId($res['sucursalId']); $res['sucursal'] = utf8_decode(urldecode($sucursal->GetNameById())); $fecha = date('d-m-Y',strtotime($res['fecha'])); $res['fecha'] = $util->FormatDateDMMMY($fecha); $envio->setEnvioId($res['envioId']); $res['enviaron'] = $envio->GetTotalPrendas(); $res['recibieron'] = $envio->GetTotalRec(); $res['diferencia'] = $res['enviaron'] - $res['recibieron']; $envios[] = $res; } $x = "
COMERCIALIZADORA NOVOMODA S.A. DE C.V.


"; $x .= ""; foreach($envios as $res){ $x .= " "; }//foreach $x .= "
No. Fecha Envío Sucursal Enviaron Recibieron Diferencia Status
".$res['envioId']." ".$res['fecha']." ".$res['sucursal']." ".$res['enviaron']." ".$res['recibieron']." ".$res['diferencia']." ".$res['status']."
"; header("Content-Type: application/vnd.ms-excel; charset=utf-8"); header("Content-type: application/x-msexcel; charset=utf-8"); header("Content-Disposition: attachment; filename=".$name.".xls"); header("Pragma: no-cache"); header("Expires: 0"); echo $x; ?>