<div class="row">
    <input type="hidden" id="id" value="<?php echo $_GET['id']; ?>" />
    <input type="hidden" id="winTitulo" value="<?php echo $_GET['winTitulo']; ?>" />
    <input type="hidden" id="codigo" value="<?php echo $_GET['codigo']; ?>" />
    <div class="col s12">
        <div class="container">
            <div class="section section-data-tables">
                <!-- DataTables example -->
                <div class="row">
                    <div class="col s12 m12 l12">
                        <div id="revenue-chart" class="card">
                            <!--<div id="button-trigger" class="card card card-default scrollspy">-->
                            <div class="card-content">
                                <h6 id="tituloFrom"><b></b>                                  
                                </h6>                                
                                <!--Le da sobras al boton -> gradient-shadow-->
                                <br>
                                <form class="formValidate" id="formValidate">
                                    <div class="row">
                                        <div class="col m5">
                                            <div class="input-field col m12 s12">
                                                <label for="txtTaller">Taller</label>
                                                <input id="txtTaller" name="txtTaller" type="text" data-error=".errorTxt1">
                                                <small class="errorTxt1"></small>
                                            </div>
                                        </div>
                                        <div class="col m7">
                                            <div class="input-field col m12 s12">
                                                <label for="txtDireccion">Dirección</label>
                                                <input id="txtDireccion" name="txtDireccion" type="text" data-error=".errorTxt2">
                                                <small class="errorTxt2"></small>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="row">
                                        <div class="col m3">
                                            <div class="input-field col m12 s12">
                                                <label for="txtKm">Km</label>
                                                <input id="txtKm" name="txtKm" type="text" data-error=".errorTxt3">
                                                <small class="errorTxt3"></small>
                                            </div>
                                        </div>
                                        <div class="col m9">
                                            <div class="input-field col m12 s12">
                                                <label for="txtPiezas">Piezas</label>
                                                <textarea id="txtPiezas" name="txtPiezas" type="text" class="materialize-textarea" data-error=".errorTxt4"></textarea>
                                                <small class="errorTxt4"></small>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col m5">                                               
                                            <div class="input-field col m12 s12">
                                                <select id="cboTipoMantenimiento" name="cboTipoMantenimiento" class="select2-size-sm browser-default" data-placeholder="Tipo de mantenimiento" multiple="multiple" data-error=".errorTxt8">
                                                </select>
                                                <small class="errorTxt8"></small>
                                            </div>
                                        </div>
                                        <div class="col m3">
                                            <div class="input-field col m12 s12">
                                                <label for="txtFechaM">Fecha de mant.</label>
                                                <input type="text" class="datepicker" id="txtFechaM" name="txtFechaM" data-error=".errorTxt5">
                                                <small class="errorTxt5"></small>
                                            </div>
                                        </div>
                                        <div class="col m2">
                                            <div class="input-field col m12 s12">
                                                <label for="txtCostoRepuestos">Costo repuest.</label>
                                                <input id="txtCostoRepuestos" name="txtCostoRepuestos" type="text" data-error=".errorTxt6">
                                                <small class="errorTxt6"></small>
                                            </div>
                                        </div>
                                        <div class="col m2">
                                            <div class="input-field col m12 s12">
                                                <label for="txtCostoMO">Costo M.O.</label>
                                                <input id="txtCostoMO" name="txtCostoMO" type="text" data-error=".errorTxt7">
                                                <small class="errorTxt7"></small>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col m12">
                                            <div class="input-field col s12">
                                                <button class="btn waves-effect waves-light light-blue darken-2 right" type="button" onclick="guardarMantenimiento()">Guardar
                                                    <!--<i class="material-icons right">send</i>-->
                                                </button>
                                                <button class="btn waves-effect waves-light red accent-2 right mr-1" type="button" onclick="regresar()">Cancelar
                                                    <!--<i class="material-icons right">send</i>-->
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                                <br>
                                <br>
                                <br>
                                <h6>Lista de mantenimientos</h6>
                                <div class="row">
                                    <div class="col s12">
                                        <table id="scroll-vert-hor" class="display nowrap">
                                            <thead>
                                                <tr>
                                                    <th class="center">N°</th>
                                                    <th class="center">Taller</th>
                                                    <th class="center">Dirección</th>
                                                    <th class="center">Mantenimiento</th>
                                                    <th class="center">KM</th>
                                                    <th class="center">Piezas</th>
                                                    <th class="center">fecha</th>
                                                    <th class="center">Cost. Rep.</th>
                                                    <th class="center">Cost. M.O.</th>
                                                    <th class="center">Cost. Total</th>
                                                    <th class="center">Acciones</th>
                                                </tr>
                                            </thead>
                                            <tbody id="cuerpoTablaMant">

                                            </tbody>
                                            <tfoot>
                                            </tfoot>
                                        </table>
                                    </div>
                                </div> 
                                <div class="row">
                                    <div class="col s5">
                                        <table>
                                            <tbody>
                                                <tr>
                                                    <td>Total costo repuestos</td>
                                                    <td class="right"><h6 id="totalCMO"></h6> </td>
                                                </tr>
                                                <tr>
                                                    <td>Total costo mano de obra</td>
                                                    <td class="right"><h6 id="totalCR"></h6>  </td>
                                                </tr>
                                                <tr>
                                                    <td>Total costo</td>
                                                    <td class="right"><h6 id="totalVehiculo"></h6>  </td>
                                                </tr>
                                            </tbody>
                                        </table>                        
                                    </div>
                                </div>
                            </div>
                        </div>                        
                    </div>                    
                </div>                
            </div>            
        </div>
    </div>
</div>
<script src="view/js/Mantenedores/despachadorVehiculoMantenimiento.js"></script>  