/home/dvjjulio/softtrash/storage/framework/views/d1c743e66581fae3967c39a2baea6347
<?php $__env->startSection('content'); ?>
<style type="text/css">
    .filterable {
        margin-top: 15px;
    }
    .filterable .panel-heading .pull-right {
        margin-top: -20px;
    }
    .filterable .filters input[disabled] {
        background-color: transparent;
        border: none;
        cursor: auto;
        box-shadow: none;
        padding: 0;
        height: auto;
    }
    .filterable .filters input[disabled]::-webkit-input-placeholder {
        color: #333;
    }
    .filterable .filters input[disabled]::-moz-placeholder {
        color: #333;
    }
    .filterable .filters input[disabled]:-ms-input-placeholder {
        color: #333;
    }
</style>
<div id="page-content">
   <div class="content-header">
		<div class="header-section">
			<h1>
			<i class="fa fa-recycle"></i>Bienvenido<br><small>Sistema de Monitoreo a Recolectora</small>
			</h1>
		</div>
	</div>

	<div class="block">
		<div class="row">
			<div class="col-md-7 block">
				<div class="block-title">
					<h2><strong>Salida</strong> Trabajadores</h2>
				</div>
				<div class="table-responsive">
					<table id="general-table" class="table table-striped table-vcenter">
						<thead>
						<tr>
							<th>Usuario</th>
							<th>Vehiculo</th>
							<th>Hora Inicio</th>
							<th>Km Inicio</th>
							<th>Hora Fin</th>
							<th>Km Fin</th>
							<th>Total Km</th>
						</tr>
						</thead>
						<tbody>
							<?php if( $history->getData()->status != false ): ?>
								<?php foreach($history->getData()->data as $key => $histo): ?>
									<tr>
										<td><?php echo $histo->username." ".$histo->ape_pat; ?> </td>
										<td><?php echo $histo->placas; ?></td>
										<td><a href="javascript:void(0)" class="label label-success"><?php echo date('h:i:s a', strtotime($histo->hora_inicio)); ?></a></td>
										<td><?php echo $histo->kilometraje_inicio; ?></td>
										<td><a href="javascript:void(0)" class="label label-success"><?php echo ($histo->hora_termino == '00:00:00') ? '' : date('h:i:s a', strtotime($histo->hora_termino));; ?></a></td>
										<td><?php echo $histo->kilometraje_termino; ?></td>
										<td><?php echo ($histo->kilometraje_termino != '')? $histo->kilometraje_termino - $histo->kilometraje_inicio : ''; ?> </td>
									</tr>
								<?php endforeach; ?>
							<?php endif; ?>
						</tbody>
					</table>
				</div>
			</div>
			<div class="col-md-5 block">
				<div class="block-title">
					<h2><strong>Metas</strong> Clientes</h2>
				</div>
				<div class="table-responsive">
					<table id="general-table" class="table table-striped table-vcenter">
						<thead>
						<tr>
							<th>Cliente</th>
							<th>Usuario</th>
							<th>Hora</th>
							<th>Comentario</th>
						</tr>
						</thead>
						<tbody>
							<tr>
								<td>HOSPITAL SAN JAVIER</td>
								<td>Arturo</td>
								<td>8:50</td>
								<td>Todo Bien</td>
							</tr>
							<tr>
								<td>VISTA SUR RESIDENCIAL</td>
								<td>-</td>
								<td>-</td>
								<td>-</td>
							</tr>
							<tr>
								<td>EL MERCADITO</td>
								<td>-</td>
								<td>-</td>
								<td>-</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>

	<div class="block">
		<div class="block-title">
			<h2><strong>Cargas</strong> Recolectora</h2>
			<div class="block-options pull-right">
				<a href="javascript:void(0)" class="btn btn-alt btn-sm btn-default toggle-bordered enable-tooltip" data-toggle="button" title="" data-original-title="Fecha"><i class="fa fa-calendar"></i>
				<input type="text" id="fecha-welcome-datepicker" name="example-datepicker" class="form-control input-datepicker" onchange="Main.fecha(this)" data-date-format="yyyy-mm-dd" placeholder="yyyy-mm-dd">
				</a>
			</div>
		</div>

		<div class="panel filterable block full">
            <div class="pull-right">
                <button onclick="Main.tableFilter(this)" id="filter" class="btn btn-default btn-xs btn-filter"><span class="glyphicon glyphicon-filter"></span> Filter</button>
            </div>
			<table id="general-table" class="table table-hover">
				<thead>
					<tr class="filters"> 
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="No. Orden" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Usuario" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Vehiculo" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Cliente" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Material" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Cantidad" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Observaciones" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Inicio" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Fin" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Tiempo" disabled/>
						</th>
						<th class="text-center">
							<input type="text" class="form-control text-center" placeholder="Km" disabled/>
						</th>
						<th>Acciones</th>
					</tr>
				</thead>
				<tbody>
				<?php if( $orden->getData()->status != false ): ?>
					<?php foreach($orden->getData()->data as $key => $ordenes): ?>
						<tr>
							<td><?php echo $ordenes->orden_no; ?></td>
							<td><?php echo $ordenes->username; ?></td>
							<td><?php echo $ordenes->placas; ?></td>
							<td><?php echo $ordenes->nombre_comercial; ?></td>
							<td><?php echo $ordenes->unidad; ?></td>
							<td><?php echo number_format($ordenes->cantidad,2); ?></td>
							<td><?php echo $ordenes->observaciones; ?></td>
							<td><a href="<?php echo e('https://www.google.com.mx/maps/@'.$ordenes->lat_ini.','.$ordenes->lng_ini.',19z'); ?>" class="label label-<?php echo Helper::distanciaGeodesica($ordenes->cliente_lat,$ordenes->cliente_lng,$ordenes->lat_ini,$ordenes->lng_ini); ?>" target="blank"><?php echo date('h:i:s a', strtotime($ordenes->hora_inicio)); ?></a>
							</td>
							<td><a href="<?php echo e('https://www.google.com.mx/maps/@'.$ordenes->lat_ter.','.$ordenes->lng_ter.',19z'); ?>" class="label label-<?php echo Helper::distanciaGeodesica($ordenes->cliente_lat,$ordenes->cliente_lng,$ordenes->lat_ter,$ordenes->lng_ter); ?> " target="blank"><?php echo ($ordenes->hora_termino == '00:00:00')? '' : date('h:i:s a', strtotime($ordenes->hora_termino)); ?></a>
							</td>
							<td>
								<?php echo ($ordenes->hora_termino == '00:00:00')? '' : Helper::getDif($ordenes->hora_inicio,$ordenes->hora_termino); ?>

							</td>
							<td title="<?php echo $ordenes->km; ?>"><?php echo $ordenes->km_dif; ?><?php /* ($ordenes->hora_termino == '00:00:00')? '' : (($key == 0)? Helper::km_rest($ordenes->km, $ordenes->kilometraje_inicio): Helper::km_rest($ordenes->km, $orden->getData()->data[$key-1]->km))  */ ?></td>
							<td>
								<a href="javascript:void(0)" data-id="<?php echo $ordenes->id; ?>" data-toggle="tooltip" title="" class="btn btn-default btn-xs" data-original-title="Edit" onclick="Main.edit(this)"><i class="fa fa-pencil"></i></a>
							</td>
						</tr>
						<?php endforeach; ?>
					<?php endif; ?>
				</tbody>
			</table>
		</div>
	</div>

</div>
<div id="modalOrden" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Actualizar Orden</h4>
      </div>
      <div class="modal-body">
        <form id="form-actor" method="post" enctype="multipart/form-data" class="form-horizontal form-bordered" onsubmit="return false;">
            <input type="hidden" name="_token" id="csrf-token" value="<?php echo e(csrf_token()); ?>" />
             <div class="form-group">
                <label class="col-md-3 control-label">Usuario <span class="text-danger">*</span></label>
                <div class="col-md-6" >
                    <select id="user-select" class="form-control" required="required">
                        <option value="0">Selecciona</option>
                        <?php if(isset($users)): ?>
	                        <?php foreach($users as $key => $user): ?>
	                            <option value="<?php echo $user->id; ?>"><?php echo $user->username; ?></option>
	                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">No Orden<span class="text-danger">*</span></label>
                  <div class="col-md-6">
                    <input id="orden-input" class="form-control" type="number" required="required" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">Cliente <span class="text-danger">*</span></label>
                <div class="col-md-6" >
                    <select id="cliente-select" class="form-control" required="required">
                        <option value="0">Selecciona</option>
                        <?php if(isset($clientes)): ?>
	                        <?php foreach($clientes as $key => $cliente): ?>
	                            <option value="<?php echo $cliente->id; ?>"><?php echo $cliente->nombre_comercial; ?></option>
	                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">Cantidad<span class="text-danger">*</span></label>
                  <div class="col-md-6">
                    <input id="cantidad-input" class="form-control" type="number" required="required" placeholder="3.5" step="0.01" required="required"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">Camión <span class="text-danger">*</span></label>
                <div class="col-md-6" >
                    <select id="camion-select" class="form-control" required="required">
                        <option value="0">Selecciona</option>
                        <?php if(isset($camiones)): ?>
	                        <?php foreach($camiones as $key => $camion): ?>
	                            <option value="<?php echo $camion->id; ?>"><?php echo $camion->placas; ?></option>
	                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </div>
            </div>
           <!-- <div class="form-group">
                <label class="col-md-3 control-label">Kilometraje<span class="text-danger">*</span></label>
                  <div class="col-md-6">
                    <input id="km-input" class="form-control" type="text" required="required" />
                </div>
            </div>-->
            <div class="form-group">
                <label class="col-md-3 control-label">Reciclable </label>
                <div class="col-md-6" >
                    <select id="reciclable-select" class="form-control">
                        <option value="0">Selecciona</option>
                        <?php if(isset($reciclables)): ?>
	                        <?php foreach($reciclables as $key => $reciclable): ?>
	                            <option value="<?php echo $reciclable->id; ?>"><?php echo $reciclable->reciclable; ?></option>
	                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">Peso Reciclable</label>
                  <div class="col-md-6">
                    <input id="peso-reciclable-input" class="form-control" type="text"  />
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">Observaciones</label>
                  <div class="col-md-6">
                    <input id="obs-input" class="form-control" type="text"  />
                </div>
            </div>
            <div class="form-group form-actions">
                <div class="col-md-9 col-md-offset-3">
                    <button id="send-button" type="submit" data-id="" data-kminicio="" class="btn btn-sm btn-success" onclick="Main.getOrden(this);"><i class="fa fa-angle-right"></i> Guardar</button>
                </div>
            </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>
<?php echo Html::script("/js/main.js"); ?>

<script type="text/javascript">
    $('.filterable .filters input').keyup(function(e){
        /* Ignore tab key */
            var code = e.keyCode || e.which;
            if (code == '9') return;
            /* Useful DOM data and selectors */
            var $input = $(this),
            inputContent = $input.val().toLowerCase(),
            $panel = $input.parents('.filterable'),
            column = $panel.find('.filters th').index($input.parents('th')),
            $table = $panel.find('.table'),
            $rows = $table.find('tbody tr');
            /* Dirtiest filter function ever ;) */
            var $filteredRows = $rows.filter(function(){
                var value = $(this).find('td').eq(column).text().toLowerCase();
                return value.indexOf(inputContent) === -1;
            });
            /* Clean previous no-result if exist */
            $table.find('tbody .no-result').remove();
            /* Show all rows, hide filtered ones (never do that outside of a demo ! xD) */
            $rows.show();
            $filteredRows.hide();
            /* Prepend no-result row if all rows are filtered */
            if ($filteredRows.length === $rows.length) {
                $table.find('tbody').prepend($('<tr class="no-result text-center"><td colspan="'+ $table.find('.filters th').length +'">No result found</td></tr>'));
            }
        });
</script>  
<?php $__env->stopSection(); ?>   
<?php echo $__env->make('layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>