<?php $__env->startSection('content'); ?>

<div class="content animate-panel">

	<div class="row">
		<div class="col-lg-12 text-center m-t-md">
			<h2>
				Sistema de Inventario Virtual
			</h2>

			<p>
				Herramienta de gestión de <strong>Ford Colombia</strong> para su red comercial de repuestos originales.
			</p>
		</div>
	</div>
	
	<div class="row">
		
		<div class="col-lg-8 hidden">
			<div class="hpanel">
				<div class="panel-heading">
					Comportamiento de Inventario { Nro. Referencias x N tiempo }
				</div>
				<div class="panel-body">
					<div class="flot-chart">
						<div class="flot-chart-content" id="flot-line-chart"></div>
					</div>
				</div>
			</div>
		</div>
		
		<div class="col-lg-4 hidden">
			<div class="hpanel">
				<div class="panel-heading">&nbsp;</div>
				<div class="panel-body">

					<div class="panel-body text-center h-200">
						<h2 class="m-b-xs text-success">Dinero Transado</h2>
						<i class="pe-7s-cash fa-4x"></i>
						<h1>$ 0,00</h1>

						<div class="m-t-xs">
							<div class="row">
								<div class="col-xs-5 animated-panel zoomIn" style="animation-delay: 0.8s; -webkit-animation-delay: 0.8s;">
									<small class="stat-label">Hoy</small>
									<h4>$ 0,00 </h4>
								</div>
								<div class="col-xs-7 animated-panel zoomIn" style="animation-delay: 0.8s; -webkit-animation-delay: 0.8s;">
									<small class="stat-label">Semana Pasada</small>
									<h4>$ 0,00 <i class="fa fa-level-up text-success"></i></h4>
								</div>
							</div>
						</div>
						<br>
						<button class="btn btn-danger btn-sm">Ver detalle</button>
					</div>
				</div>
			</div>
		</div>
	</div>

	<?php foreach($concesionarios as $concesionario): ?>
	<?php foreach($concesionario->bodegas as $bodega): ?>
	<?php foreach($bodega->inventarios as $inventario): ?>
	<div class="row">
		
		<?php $resumen = \App\Models\InventarioDealer::getResumenInventario($inventario->id); ?>
		
		<h3><?php echo e($concesionario->nombre); ?></h3>
		<h4>Bodega: <?php echo e($bodega->nombre); ?></h4>
		<h4>Inventario: <?php echo e($inventario->nombre); ?></h4>

		<div class="col-md-3 animated-panel zoomIn" style="animation-delay: 0.4s; -webkit-animation-delay: 0.4s;">
			<div class="hpanel hblue">
				<div class="panel-body">
					<div class="stats-title pull-left">
						<h4>TOTAL REFERENCIAS EN INVENTARIO</h4>
					</div>
					<div class="m-t-xl">
						<div class="stats-icon pull-right">
							<i class="pe-7s-shuffle fa-3x"></i>
						</div>
						<h1 class="text-success"><?php echo e($resumen->referencias); ?></h1>
						<small>
							Cantidad de piezas cargadas en este inventario.
						</small>
					</div>
					<br>
					<a href="/dealer/inventario/ver/<?php echo e($inventario->id); ?>" class="btn btn-success btn-sm">Ver detalle</a>
				</div>
			</div>
		</div>


		<div class="col-md-3 animated-panel zoomIn" style="animation-delay: 0.5s; -webkit-animation-delay: 0.5s;">
			<div class="hpanel hyellow">
				<div class="panel-body">
					<div class="stats-title pull-left">
						<h4>TOTAL PIEZAS EN INVENTARIO</h4>
					</div>
					<div class="m-t-xl">
						<div class="stats-icon pull-right">
							<i class="fa fa-puzzle-piece fa-3x"></i>
						</div>
						<h1 class="text-warning"><?php echo e($resumen->piezas); ?></h1>
						<small>Cantidad de piezas cargadas en este inventario.</small>
					</div>
					<br>
					<a href="/dealer/inventario/ver/<?php echo e($inventario->id); ?>" class="btn btn-warning btn-sm">Ver detalle</a>
				</div>
			</div>
		</div>


		<div class="col-md-3 animated-panel zoomIn" style="animation-delay: 0.4s; -webkit-animation-delay: 0.4s;">
			<div class="hpanel hred">
				<div class="panel-body">
					<div class="stats-title pull-left">
						<h4>CANASTA B&Aacute;SICA</h4>
					</div>
					<div class="m-t-xl">
						<div class="stats-icon pull-right">
							<i class="fa fa-warning fa-3x"></i>
						</div>
						<h1 class="text-danger"><?php echo e(number_format($resumen->canasta, 1, '.', '')); ?>%</h1>
						<small>&Iacute;ndice (%) de productos en la canasta b&aacute;sica.</small>
					</div>
					<br>
					<a href="/dealer/inventario/ver/<?php echo e($inventario->id); ?>" class="btn btn-danger btn-sm">Ver detalle</a>
				</div>
			</div>
		</div>

	</div>
	<?php endforeach; ?>
	<?php endforeach; ?>
	<?php endforeach; ?>

</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>

<script>

	$(function () {

		/**
		 * Flot charts data and options
		 */
		var data1 = [[0, 55], [1, 48], [2, 40], [3, 36], [4, 40], [5, 60], [6, 50], [7, 51]];
		var data2 = [[0, 56], [1, 49], [2, 41], [3, 38], [4, 46], [5, 67], [6, 57], [7, 59]];

		var chartUsersOptions = {
			series: {
				splines: {
					show: true,
					tension: 0.4,
					lineWidth: 1,
					fill: 0.4
				},
			},
			grid: {
				tickColor: "#f0f0f0",
				borderWidth: 1,
				borderColor: 'f0f0f0',
				color: '#6a6c6f'
			},
			colors: ["#003478", "#91A4B1"],
		};

		$.plot($("#flot-line-chart"), [data1, data2], chartUsersOptions);

		/**
		 * Flot charts 2 data and options
		 */
		var chartIncomeData = [
			{
				label: "line",
				data: [[1, 10], [2, 26], [3, 16], [4, 36], [5, 32], [6, 51]]
			}
		];

		var chartIncomeOptions = {
			series: {
				lines: {
					show: true,
					lineWidth: 0,
					fill: true,
					fillColor: "#003478"

				}
			},
			colors: ["#003478"],
			grid: {
				show: false
			},
			legend: {
				show: false
			}
		};

		$.plot($("#flot-income-chart"), chartIncomeData, chartIncomeOptions);

	});

</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.dealer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>