<?php
require_once('../../../includes/load.php');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $id = remove_junk($db->escape($_POST['id']));
    $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']));
    $actualizar=date("Y-m-d H:i:s");
;

 
    $query ="UPDATE tb_maestra SET sueldo_oper='$CFOSUELDO',sctr='$CFOSctr',bono='$CFOBono',epps='$CFOEpps',accesorios_seg='$CFOAccS',movilidad='$CFOMovi',alimentacion='$CFOAli',otros_gastoscv='$CFOOG',total_cfoperaciones='$CFOTotalOpera',total_cf='$CFTotalADMOPE',total_cfkm='$CFOtotalKM',precio_comb='$PreCVComb',combustible='$CVComb',neuma_km='$CVNeuma',mtto_prevkmtotal='$CVMttoPrevKMSeg',mtto_prevkm='$CVMttoPrevKM',mtto_correctkmtotal='$CVMttoCorrecKMSeg',mtto_correctkm='$CVMttoCorrecKM',TotalCostoVariable='$CVTotalCV',KmRecorrido='$CVKm',TotalCostos='$CVcostotal',TotalTarifa='$tarifaxkm',updated_at='$actualizar' WHERE id= '$id'";
   
    if ($db->query($query)) {
        echo 'success';
    } else {
        echo 'fail';
    }
} 




