File: /home/austral3d/fourdplan.com/pruebas/php/dashboard.php
<?php
//INICIO VARIABLE SESION0
session_start();
if ($_SESSION == NULL ){
session_destroy();
echo'<script>
alert("Acceso denegado.")
self.location="../index.php"
</script>';
}
//coneccion servidor y base de datos
require('conexion.php');
$proy = $_GET['proy'];
$asse = $_GET['asse'];
if(empty($_GET['lenguaje'])){
$lenguaje = false;
}else{
$lenguaje = $_GET['lenguaje'];
}
//consula para obtener id de usuario segun el nombre de la sesion iniciada
$con_id_usu = mysql_query("select empresa_id from Usuario where nombre= '".$_SESSION['nombre']."'");
$emid = mysql_fetch_array($con_id_usu);
$consul = mysql_query("Select * from Proyecto where empresa_id = '".$emid['empresa_id']."'");
$consula = mysql_query("Select * from Proyecto where empresa_id = '".$emid['empresa_id']."'");
$array = mysql_fetch_array($consul);
$consulta_assemnly_nombre= mysql_query("select nombre from Assembly where id = '".$asse."'");
$arrayassembly2 = mysql_fetch_array($consulta_assemnly_nombre);
$consulta_proy = mysql_query("Select * from Proyecto where id = '".$proy."'");
//--------Consulta grafico torta-----------------------------------------------------------------------------
$consulta_numero_instancias = mysql_query("select sum(E.peso)as peso from Instancia I JOIN Elemento E ON I.elemento_id = E.id Join Descripcion D ON E.descripcion_id = D.id where D.assembly_id = '".$asse."'");
$arraytotal = mysql_fetch_array($consulta_numero_instancias);
$vatiable = $arraytotal[0];
if(!empty($vatiable)){
$r1 = $vatiable;
}else {
$r1 = 0;
}
//Consulta Pintura---------------------------------------------------
$consulta_numero_instancias_pintura = mysql_query("select sum(E.peso)as peso from Instancia I JOIN Elemento E ON I.elemento_id = E.id Join Descripcion D ON E.descripcion_id = D.id where D.assembly_id = '".$asse."' and fecha_pintura != 0000-00-00");
$arraytotalpintura = mysql_fetch_array($consulta_numero_instancias_pintura);
$vatiablepintura = $arraytotalpintura[0];
if(!empty($vatiablepintura)){
$r2pintura =$vatiablepintura;
}else {
$r2pintura = 0;
}
if($r1 != 0){
$resultadopintura = ($r2pintura * 100) / $r1 ;
$resultado2pintura = 100 - $resultadopintura ;
}else {
$resultadopintura = 0;
$resultado2pintura = 100;
}
//Consulta soldadura-------------------------------------------------
$consulta_numero_instancias_soldadura = mysql_query("select sum(E.peso)as peso from Instancia I JOIN Elemento E ON I.elemento_id = E.id Join Descripcion D ON E.descripcion_id = D.id where D.assembly_id = '".$asse."' and fecha_soldadura != 0000-00-00");
$arraytotalsoldadura = mysql_fetch_array($consulta_numero_instancias_soldadura);
$vatiablesoldadura = $arraytotalsoldadura[0];
if(!empty($vatiablesoldadura)){
$r2soldadura =$vatiablesoldadura;
}else {
$r2soldadura = 0;
}
if($r1 != 0){
$resultadosoldadura = ($r2soldadura * 100) / $r1 ;
$resultado2soldadura = 100 - $resultadosoldadura ;
}else {
$resultadosoldadura = 0;
$resultado2soldadura = 100;
}
//Consulta plnajificacion-----------------------------------------
$consulta_numero_instancias_planificacion = mysql_query("select sum(E.peso)as peso from Instancia I JOIN Elemento E ON I.elemento_id = E.id Join Descripcion D ON E.descripcion_id = D.id where D.assembly_id = '".$asse."' and fecha_planificacion != 0000-00-00");
$arraytotalplanificacion = mysql_fetch_array($consulta_numero_instancias_planificacion);
$vatiableplanificacion = $arraytotalplanificacion[0];
if(!empty($vatiableplanificacion)){
$r2planificacion =$vatiableplanificacion;
}else {
$r2planificacion = 0;
}
if($r1 != 0){
$resultadoplanificacion = ($r2planificacion * 100) / $r1 ;
$resultado2planificacion = 100 - $resultadoplanificacion ;
}else {
$resultadoplanificacion = 0;
$resultado2planificacion = 100;
}
//Consulta liberacion------------------------------------------------
$consulta_numero_instancias_liberacion= mysql_query("select sum(E.peso)as peso from Instancia I JOIN Elemento E ON I.elemento_id = E.id Join Descripcion D ON E.descripcion_id = D.id where D.assembly_id = '".$asse."' and fecha_liberacion != 0000-00-00");
$arraytotalliberacion = mysql_fetch_array($consulta_numero_instancias_liberacion);
$vatiableliberacion = $arraytotalliberacion[0];
if(!empty($vatiableliberacion)){
$r2liberacion =$vatiableliberacion;
}else {
$r2liberacion = 0;
}
if($r1 != 0){
$resultadoliberacion = ($r2liberacion* 100) / $r1 ;
$resultado2liberacion = 100 - $resultadoliberacion;
}else {
$resultadoliberacion = 0;
$resultado2liberacion= 100;
}
//Consulta pre. material-----------------------------------------
$consulta_numero_instancias_prematerial = mysql_query("select sum(E.peso)as peso from Instancia I JOIN Elemento E ON I.elemento_id = E.id Join Descripcion D ON E.descripcion_id = D.id where D.assembly_id = '".$asse."' and fecha_preparacion_material != 0000-00-00");
$arraytotalprematerial = mysql_fetch_array($consulta_numero_instancias_prematerial);
$vatiableprematerial = $arraytotalprematerial[0];
if(!empty($vatiableprematerial)){
$r2prematerial =$vatiableprematerial;
}else {
$r2prematerial = 0;
}
if($r1 != 0){
$resultadoprematerial = ($r2prematerial* 100) / $r1 ;
$resultado2prematerial = 100 - $resultadoprematerial;
}else {
$resultadoprematerial = 0;
$resultado2prematerial= 100;
}
//Consulta armado-------------------------------------------------
$consulta_numero_instancias_armado = mysql_query("select sum(E.peso)as peso from Instancia I JOIN Elemento E ON I.elemento_id = E.id Join Descripcion D ON E.descripcion_id = D.id where D.assembly_id = '".$asse."' and fecha_armado != 0000-00-00");
$arraytotalarmado = mysql_fetch_array($consulta_numero_instancias_armado);
$vatiablearmado = $arraytotalarmado[0];
if(!empty($vatiablearmado)){
$r2armado =$vatiablearmado;
}else {
$r2armado = 0;
}
if($r1 != 0){
$resultadoarmado = ($r2armado* 100) / $r1 ;
$resultado2armado = 100 - $resultadoarmado;
}else {
$resultadoarmado = 0;
$resultado2armado= 100;
}
//Consulta granallado----------------------------
$consulta_numero_instancias_granallado= mysql_query("select sum(E.peso)as peso from Instancia I JOIN Elemento E ON I.elemento_id = E.id Join Descripcion D ON E.descripcion_id = D.id where D.assembly_id = '".$asse."' and fecha_granallado != 0000-00-00");
$arraytotalgranallado = mysql_fetch_array($consulta_numero_instancias_granallado);
$vatiablegranallado = $arraytotalgranallado[0];
if(!empty($vatiablegranallado)){
$r2granallado =$vatiablegranallado;
}else {
$r2granallado = 0;
}
if($r1 != 0){
$resultadogranallado = ($r2granallado* 100) / $r1 ;
$resultado2granallado = 100 - $resultadogranallado;
}else {
$resultadogranallado = 0;
$resultado2granallado= 100;
}
//Consulta despacho-----------------------------------------------
$consulta_numero_instancias_despacho= mysql_query("select sum(E.peso)as peso from Instancia I JOIN Elemento E ON I.elemento_id = E.id Join Descripcion D ON E.descripcion_id = D.id where D.assembly_id = '".$asse."' and fecha_despacho != 0000-00-00");
$arraytotaldespacho = mysql_fetch_array($consulta_numero_instancias_despacho);
$vatiabledespacho = $arraytotaldespacho[0];
if(!empty($vatiabledespacho)){
$r2despacho =$vatiabledespacho;
}else {
$r2despacho = 0;
}
if($r1 != 0){
$resultadodespacho = ($r2despacho* 100) / $r1 ;
$resultado2despacho = 100 - $resultadodespacho;
}else {
$resultadodespacho = 0;
$resultado2despacho= 100;
}
//resultados dash
$resultsoldadura = $r1-$r2soldadura;
if($resultsoldadura < 1000){
$soldaduraresultado = round($resultsoldadura/1000,1);
}else{
$soldaduraresultado = round(number_format($resultsoldadura,0,",","."),1);
}
$resultpintura = $r1-$r2pintura;
if($resultpintura < 1000){
$pinturaresultado = round($resultpintura/1000,1);
}else{
$pinturaresultado = round(number_format($resultpintura,0,",","."),1);
}
$resultliberacion = $r1-$r2liberacion;
if($resultliberacion < 1000){
$liberacionresultado = round($resultliberacion/1000,1);
}else{
$liberacionresultado = round(number_format($resultliberacion,0,",","."),1);
}
$resultdespacho = $r1-$r2despacho;
if($resultdespacho < 1000){
$despachoresultado = round($resultdespacho/1000,1);
}else{
$despachoresultado = round(number_format($resultdespacho,0,",","."),1);
}
//fechas curva S
?>
<!DOCTYPE html>
<html>
<head>
<title>Fourdplan</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/sti.css" rel="stylesheet">
<link rel="icon" href="../img/fdp.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('#soldadura').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: '<?php if($lenguaje){echo "AVANCE<br>Soldadura<br>Total: ";}else{echo "PROGRESS<br>Welding<br>Total: ";}?><?php echo round(number_format($r1,0,",","."),1);?> Ton',
align: 'center',
verticalAlign: 'middle',
y: 50
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -10,
style: {
fontWeight: 'bold',
color: 'white',
textShadow: '0px 1px 2px black'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%']
}
},
series: [{
type: 'pie',
name: '<?php if($lenguaje){echo "Porcentaje";}else{echo "Percentage";}?>',
innerSize: '45%',
data: [
['<?php if($lenguaje){echo "TONELADAS: ";}else{echo "TONS: ";}?> <?php echo round(number_format($r2soldadura,0,",","."),1);?><br><?php echo round($resultadosoldadura,1);?> %' , <?php echo $resultadosoldadura;?>],
['<?php if($lenguaje){echo "SIN AVANCE: ";}else{echo "NO PROGRESS: ";}?><?php echo $soldaduraresultado?> TON <br><?php echo round($resultado2soldadura,1);?> %',<?php echo $resultado2soldadura;?>],
]
}]
});
});
$(function () {
$('#pintura').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: '<?php if($lenguaje){echo "AVANCE<br>Pintura<br>Total: ";}else{echo "PROGRESS<br>Painting<br>Total: ";}?> <?php echo round(number_format($r1,0,",","."),1);?> Ton',
align: 'center',
verticalAlign: 'middle',
y: 50
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -10,
style: {
fontWeight: 'bold',
color: 'white',
textShadow: '0px 1px 2px black'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%']
}
},
series: [{
type: 'pie',
name: '<?php if($lenguaje){echo "Porcentaje";}else{echo "Percentage";}?>',
innerSize: '45%',
data: [
['<?php if($lenguaje){echo "TONELADAS: ";}else{echo "TONS: ";}?><?php echo round(number_format($r2pintura,0,",","."),1);?><br><?php echo round($resultadopintura,1);?> %' , <?php echo $resultadopintura;?>],
['<?php if($lenguaje){echo "SIN AVANCE: ";}else{echo "NO PROGRESS: ";}?><?php echo $pinturaresultado;?> TON <br><?php echo round($resultado2pintura,1);?> %',<?php echo $resultado2pintura;?>],
]
}]
});
});
$(function () {
$('#liberacion').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: '<?php if($lenguaje){echo "AVANCE<br>Liberacion<br>Total: ";}else{echo "PROGRESS<br>Release<br>Total: ";}?><?php echo round(number_format($r1,0,",","."),1);?> Ton',
align: 'center',
verticalAlign: 'middle',
y: 50
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -10,
style: {
fontWeight: 'bold',
color: 'white',
textShadow: '0px 1px 2px black'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%']
}
},
series: [{
type: 'pie',
name: '<?php if($lenguaje){echo "Porcentaje";}else{echo "Percentage";}?>',
innerSize: '45%',
data: [
['<?php if($lenguaje){echo "TONELADAS: ";}else{echo "TONS: ";}?> <?php echo round(number_format($r2liberacion,0,",","."),1);?><br><?php echo round($resultadopintura,1);?> %' , <?php echo $resultadopintura;?>],
['<?php if($lenguaje){echo "SIN AVANCE: ";}else{echo "NO PROGRESS: ";}?> <?php echo $liberacionresultado;?> TON <br><?php echo round($resultado2pintura,1);?> %',<?php echo $resultado2pintura;?>],
]
}]
});
});
$(function () {
$('#despacho').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: '<?php if($lenguaje){echo "AVANCE<br>Despacho<br>Total: ";}else{echo "PROGRESS<br>Dispaching<br>Total: ";}?><?php echo round(number_format($r1,0,",","."),1);?> Ton',
align: 'center',
verticalAlign: 'middle',
y: 50
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -10,
style: {
fontWeight: 'bold',
color: 'white',
textShadow: '0px 1px 2px black'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%']
}
},
series: [{
type: 'pie',
name: '<?php if($lenguaje){echo "Porcentaje";}else{echo "Percentage";}?>',
innerSize: '45%',
data: [
['<?php if($lenguaje){echo "TONELADAS: ";}else{echo "TONS: ";}?> <?php echo round(number_format($r2despacho,0,",","."),1);?><br><?php echo round($resultadodespacho,1);?> %' , <?php echo $resultadodespacho;?>],
['<?php if($lenguaje){echo "SIN AVANCE: ";}else{echo "NO PROGRESS: ";}?><?php echo $despachoresultado;?> TON <br><?php echo round($resultado2despacho,1);?> %',<?php echo $resultado2despacho;?>],
]
}]
});
});
$(function () {
$('#curvasoldadura').highcharts({
chart: {
type: 'line'
},
title: {
text: 'Curva S Programado Soldadura'
},
xAxis: {
categories: ['Soldadura', '01-07', '08-07', '15-07', '22-07', '29-07', '05-08', '12-08', '19-08', '26-08', '02-09', '09-09', '16-09', '23-09', '30-09', '07-10', '14-10']
,title: {
text: 'Año 2016'
}
},
yAxis: {
title: {
text: 'Toneladas'
}
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
series: [{
name: 'Real',
data: [0, 0, 0, 0, 8.3, 16.5, 39.6, 78.1, 93.5, 114.7, 120.4, 125.0, 129.6, 129.6, 150.7, 171.9, 193.0]
}]
});
});
$(function () {
$('#curvapintura').highcharts({
chart: {
type: 'line'
},
title: {
text: 'Curva S Programado Pintura'
},
xAxis: {
categories: ['Pintura', '01-07', '08-07', '15-07', '22-07', '29-07', '05-08', '12-08', '19-08', '26-08', '02-09', '09-09', '16-09', '23-09', '30-09', '07-10', '14-10']
,title: {
text: 'Año 2016'
}
},
yAxis: {
title: {
text: 'Toneladas'
}
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
series: [{
name: 'Real',
data: [0, 0, 0, 0, 8.3, 16.5, 39.6, 78.1, 93.5, 114.7, 120.4, 125.0, 129.6, 129.6, 150.7, 171.9, 193.0]
}]
});
});
</script>
</head>
<body>
<div class="content">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" ><img src="../img/logo90x19.png" class="img"/></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a <?php if($lenguaje){echo 'href="../index.php?lenguaje=true"';}else{echo 'href="../index.php"';}?>><span class="glyphicon glyphicon-home" aria-hidden="true"></span> <?php if($lenguaje){echo "Inicio";}else{echo "Home";}?><span class="sr-only">(current)</span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php if($lenguaje){echo "Proyecto";}else{echo "Project";}?><span class="caret"></span></a>
<ul class="dropdown-menu scrollable-menu">
<?php
if($lenguaje){
?>
<li><a href="proyecto.php?lenguaje=true">Proyecto</a></li>
<li role="separator" class="divider"></li>
<?php
}else{
?>
<li><a href="proyecto.php">Project</a></li>
<li role="separator" class="divider"></li>
<?php
}
while($proyecto1 = mysql_fetch_array($consulta_proy)){?>
<li><a href="assembly.php?proy=<?php echo $proyecto1[0];?>"><?php echo preg_replace('/_+/',' ',$proyecto1[1]);?></a></li>
<?php } ?>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Assembly<span class="caret"></span></a>
<ul class="dropdown-menu scrollable-menu">
<?php
if($lenguaje){
?>
<li><a href="assembly.php?proy=<?php echo $proy;?>&lenguaje=true">Assembly</a></li>
<li role="separator" class="divider"></li>
<?php
}else{
?>
<li><a href="assembly.php?proy=<?php echo $proy;?>">Assembly</a></li>
<li role="separator" class="divider"></li>
<?php
}
$consulta_assembly = mysql_query("select * from Assembly where proyecto_id ='".$proy."'");
while($arrayassembly = mysql_fetch_array($consulta_assembly)){
?>
<li><a href="dashboard.php?asse=<?php echo $arrayassembly[0];?>&proy=<?php echo $proy;?>"><?PHP echo preg_replace('/_+/',' ',$arrayassembly[1]);?></a></li>
<?php
}
?>
</ul>
</li>
</ul>
<!--Derecha barra-->
<ul class="nav navbar-nav navbar-right">
<?php require("barrasuperior.php");?>
<li role="presentation"><a><span class="glyphicon glyphicon-user" aria-hidden="true"></span> <?php if($_SESSION){echo $_SESSION['nombre'];}?></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-list" aria-hidden="true"></span><span class="caret"></span></a>
<ul class="dropdown-menu">
<?php
if($lenguaje){
?>
<li><a href="cerrar_session.php">Cerrar sesion</a></li>
<li><a href="dashboard.php?&asse=<?php echo $asse;?>&proy=<?php echo $proy;?>">Ingles</a></li>
<?php
}else{
?>
<li><a href="cerrar_session.php">Log Out</a></li>
<li><a href="dashboard.php?&asse=<?php echo $asse;?>&proy=<?php echo $proy;?>&lenguaje=true">Spanish</a></li>
<?php
}
?>
</ul>
</li>
</ul>
</div><!-- /.container-fluid -->
</div>
</nav>
<br><br><br>
<div class="container-fluid">
<div class="container">
<center><h3><b>Assembly: <?php echo preg_replace('/_+/',' ',$arrayassembly2['nombre']);?></b></h3>
<h4><b><?php if($lenguaje){echo "Estado de avance - ";}else{echo "State of progress - ";}?><?php echo strftime("%A, %d de %B de %Y");?></b></h4></center>
</div>
<div class="col-xs-10 col-ms-10 col-md-offset-1" style="background-color: #c7c7c7; border-radius: 5px 5px 5px 5px;">
<br>
<center>
<table class="table table" >
<?php if($lenguaje){?>
<tr bgcolor="#363636">
<th><font color="#fff">Edificio</font></th>
<th><font color="#fff">Toneladas</font></th>
<th><font color="#fff">Planificacion</font></th>
<th><font color="#fff">Pre. material</font></th>
<th><font color="#fff">Armado</font></th>
<th><font color="#fff">Soldadura</font></th>
<th><font color="#fff">Granallado</font></th>
<th><font color="#fff">Pintura</font></th>
<th><font color="#fff">Liberacion</font></th>
<th><font color="#fff">Despacho</font></th>
<th><font color="#fff">Avance</font></th>
</tr>
<?php
}else{
?>
<tr bgcolor="#363636">
<th><font color="#fff">Buildings</font></th>
<th><font color="#fff">Tons</font></th>
<th><font color="#fff">Planning</font></th>
<th><font color="#fff">Material Pre.</font></th>
<th><font color="#fff">Assembly</font></th>
<th><font color="#fff">Welding</font></th>
<th><font color="#fff">Shotpeened</font></th>
<th><font color="#fff">Painting</font></th>
<th><font color="#fff">Release</font></th>
<th><font color="#fff">Dispatching</font></th>
<th><font color="#fff">Progress</font></th>
</tr>
<?PHP }
$decimales =2;?>
<tr bgcolor="#e6e6e6">
<th><?php echo preg_replace('/_+/',' ',$arrayassembly2['nombre']);?></th>
<td><?php if($r1 < 1000){echo round($r1/1000,$decimales);}else{echo round(number_format($r1,0,",","."),$decimales);}?></td>
<td><?php if($r2planificacion < 1000){echo round($r2planificacion/1000,$decimales);}else{echo round(number_format($r2planificacion,0,",","."),$decimales);}?></td>
<td><?php if($r2prematerial < 1000){echo round($r2prematerial/1000,$decimales);}else{echo round(number_format($r2prematerial,0,",","."),$decimales);}?></td>
<td><?php if($r2armado < 1000){echo round($r2armado/1000,$decimales);}else{echo round(number_format($r2armado,0,",","."),$decimales);}?></td>
<td><?php if($r2soldadura < 1000){echo round($r2soldadura/1000,$decimales);}else{echo round(number_format($r2soldadura,0,",","."),$decimales);}?></td>
<td><?php if($r2granallado < 1000){echo round($r2granallado/1000,$decimales);}else{echo round(number_format($r2granallado,0,",","."),$decimales);}?></td>
<td><?php if($r2pintura < 1000){echo round($r2pintura/1000,$decimales);}else{echo round(number_format($r2pintura,0,",","."),$decimales);}?></td>
<td><?php if($r2liberacion < 1000){echo round($r2liberacion/1000,$decimales);}else{echo round(number_format($r2liberacion,0,",","."),$decimales);}?></td>
<td><?php if($r2despacho < 1000){echo round($r2despacho/1000,$decimales);}else{echo round(number_format($r2despacho,0,",","."),$decimales);}?></td>
<?php $avance = $r2planificacion+$r2prematerial+$r2armado+$r2soldadura+$r2granallado+$r2pintura+$r2liberacion+$r2despacho;?>
<td><?php
if($r1!= 0){
$ravance = ($avance/8)/$r1*100;
echo round($ravance,$decimales)." %";
}else{
echo "0 %";
}
?></td>
</tr>
</table>
</center>
</div>
<div class="container-fluid">
<div class="col-md-offset-2">
<div style="width: 500px; height: 230px;" id="soldadura" class="col-xs-6 col-sm-2"></div>
<div style="width: 500px; height: 230px;" id="pintura" class="col-xs-6 col-sm-2"></div>
<div style="width: 500px; height: 230px;" id="liberacion" class="col-xs-6 col-sm-2"></div>
<div style="width: 500px; height: 230px;" id="despacho" class="col-xs-6 col-sm-2"></div>
</div>
</div>
</div>
<br><br><br>
</div>
<?php require("pie.php");?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/highcharts.js"></script>
<script src="../js/modules/exporting.js"></script>
</body>
</html>