<?php
require_once('../../../includes/load.php');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $anio = remove_junk($db->escape($_POST['anio']));
	$mes = remove_junk($db->escape($_POST['mes']));
    $placa = remove_junk($db->escape($_POST['placa']));
    $DatosMV = remove_junk($db->escape($_POST['DatosMV']));
    $DatosPlaca = remove_junk($db->escape($_POST['DatosPlaca']));
    $DatosPlaca = remove_junk($db->escape($_POST['DatosPlaca']));
    $DatosNMotor = remove_junk($db->escape($_POST['DatosNMotor']));
    $DatosMttoP = remove_junk($db->escape($_POST['DatosMttoP']));
    $DatosMPropio = remove_junk($db->escape($_POST['DatosMPropio']));
    $DatosRendC = remove_junk($db->escape($_POST['DatosRendC']));
    $DatosCA = remove_junk($db->escape($_POST['DatosCA']));
    $CFDepre = remove_junk($db->escape($_POST['CFDepre']));
    $CFGps = remove_junk($db->escape($_POST['CFGps']));
	$CFSoat = remove_junk($db->escape($_POST['CFSoat']));
    $CFImp = remove_junk($db->escape($_POST['CFImp']));
    $CFGADM = remove_junk($db->escape($_POST['CFGADM']));
    $CFServP = remove_junk($db->escape($_POST['CFServP']));
    $CFOD = remove_junk($db->escape($_POST['CFOD']));
    $CFRevtec = remove_junk($db->escape($_POST['CFRevtec']));
    $CFOG = remove_junk($db->escape($_POST['CFOG']));
    $CFTotalADM = remove_junk($db->escape($_POST['CFTotalADM']));
    $CFOSUELDO = remove_junk($db->escape($_POST['CFOSUELDO']));
    $CFOSctr = remove_junk($db->escape($_POST['CFOSctr']));
    $CFOBono = remove_junk($db->escape($_POST['CFOBono']));
    $CFOEpps = remove_junk($db->escape($_POST['CFOEpps']));
	$CFOAccS = remove_junk($db->escape($_POST['CFOAccS']));
	$CFOMovi = remove_junk($db->escape($_POST['CFOMovi']));
    $CFOAli = remove_junk($db->escape($_POST['CFOAli']));
    $CFOOG = remove_junk($db->escape($_POST['CFOOG']));
    $CFOTotalOpera = remove_junk($db->escape($_POST['CFOTotalOpera']));
    $CFTotalADMOPE = remove_junk($db->escape($_POST['CFTotalADMOPE']));
    $CFOtotalKM = remove_junk($db->escape($_POST['CFOtotalKM']));
    $CVComb = remove_junk($db->escape($_POST['CVComb']));
    $CVNeuma = remove_junk($db->escape($_POST['CVNeuma']));
    $CVMttoPrevKM = remove_junk($db->escape($_POST['CVMttoPrevKM']));
    $CVMttoPrevKMSeg = remove_junk($db->escape($_POST['CVMttoPrevKMSeg']));

    $CVMttoCorrecKM = remove_junk($db->escape($_POST['CVMttoCorrecKM']));
    $CVMttoCorrecKMSeg = remove_junk($db->escape($_POST['CVMttoCorrecKMSeg']));
    $CVTotalCV = remove_junk($db->escape($_POST['CVTotalCV']));
    $PreCVComb = remove_junk($db->escape($_POST['PreCVComb']));
    $CVKm = remove_junk($db->escape($_POST['CVKm']));
    $CVcostotal = remove_junk($db->escape($_POST['CVcostotal']));
    $tarifaxkm = remove_junk($db->escape($_POST['tarifaxkm']));
    $registro=date("Y-m-d H:i:s");
;

 
    $query ="INSERT INTO tb_maestra (depreciacion, gps, soat, imp_vehicular, gasto_adm, serv_public, otras_depre, rev_tecnica, otros_gastos, total_cfadm, sueldo_oper, sctr, bono, epps, accesorios_seg, movilidad, alimentacion, otros_gastoscv, total_cfoperaciones, total_cf, total_cfkm, precio_comb, mtto_prevkmtotal, mtto_correctkmtotal, combustible, neuma_km, mtto_prevkm, mtto_correctkm, TotalCostoVariable, KmRecorrido, TotalCostos, TotalTarifa, anio, mes, placa, created_at) VALUES ('$CFDepre','$CFGps','$CFSoat','$CFImp','$CFGADM','$CFServP','$CFOD','$CFRevtec','$CFOG','$CFTotalADM','$CFOSUELDO','$CFOSctr','$CFOBono','$CFOEpps','$CFOAccS','$CFOMovi','$CFOAli','$CFOOG','$CFOTotalOpera','$CFTotalADMOPE','$CFOtotalKM','$PreCVComb','$CVMttoPrevKMSeg','$CVMttoCorrecKMSeg','$CVComb','$CVNeuma','$CVMttoPrevKM','$CVMttoCorrecKM','$CVTotalCV','$CVKm','$CVcostotal','$tarifaxkm','$anio','$mes','$placa','$registro')";
   
    if ($db->query($query)) {
        echo 'success';
    } else {
        echo 'fail';
    }
} 




