<?php
	require 'conexion.php';
    date_default_timezone_set('America/Sao_Paulo');
    $id = $_POST['id'];
    $ativo = $_POST['ativo'];
	$obs_grade = $_POST['obs_grade'];
	$atualizado_em = date('d-m-y H:i:s');
	$dir = $_POST['dir'];

    $tituloc1 = $_POST['tituloc1'];
    $tdc1 = $_POST['tdc1'];
    $tqc1 = $_POST['tqc1'];
    $tsc1 = $_POST['tsc1'];
    $toc1 = $_POST['toc1'];
    $quc1 = $_POST['quc1'];
    $qdc1 = $_POST['qdc1'];
    $qqc1 = $_POST['qqc1'];
    $qsc1 = $_POST['qsc1'];
    $qoc1 = $_POST['qoc1'];
    $cic1 = $_POST['cic1'];
    $cdc1 = $_POST['cdc1'];
    $subtotalc1 = $_POST['subtotalc1'];
    $tituloc2 = $_POST['tituloc2'];
    $tdc2 = $_POST['tdc2'];
    $tqc2 = $_POST['tqc2'];
    $tsc2 = $_POST['tsc2'];
    $toc2 = $_POST['toc2'];
    $quc2 = $_POST['quc2'];
    $qdc2 = $_POST['qdc2'];
    $qqc2 = $_POST['qqc2'];
    $qsc2 = $_POST['qsc2'];
    $qoc2 = $_POST['qoc2'];
    $cic2 = $_POST['cic2'];
    $cdc2 = $_POST['cdc2'];
    $subtotalc2 = $_POST['subtotalc2'];
    $tituloc3 = $_POST['tituloc3'];
    $tdc3 = $_POST['tdc3'];
    $tqc3 = $_POST['tqc3'];
    $tsc3 = $_POST['tsc3'];
    $toc3 = $_POST['toc3'];
    $quc3 = $_POST['quc3'];
    $qdc3 = $_POST['qdc3'];
    $qqc3 = $_POST['qqc3'];
    $qsc3 = $_POST['qsc3'];
    $qoc3 = $_POST['qoc3'];
    $cic3 = $_POST['cic3'];
    $cdc3 = $_POST['cdc3'];
    $subtotalc3 = $_POST['subtotalc3'];
    $tituloc4 = $_POST['tituloc4'];
    $tdc4 = $_POST['tdc4'];
    $tqc4 = $_POST['tqc4'];
    $tsc4 = $_POST['tsc4'];
    $toc4 = $_POST['toc4'];
    $quc4 = $_POST['quc4'];
    $qdc4 = $_POST['qdc4'];
    $qqc4 = $_POST['qqc4'];
    $qsc4 = $_POST['qsc4'];
    $qoc4 = $_POST['qoc4'];
    $cic4 = $_POST['cic4'];
    $cdc4 = $_POST['cdc4'];
    $subtotalc4 = $_POST['subtotalc4'];
    $tituloc5 = $_POST['tituloc5'];
    $tdc5 = $_POST['tdc5'];
    $tqc5 = $_POST['tqc5'];
    $tsc5 = $_POST['tsc5'];
    $toc5 = $_POST['toc5'];
    $quc5 = $_POST['quc5'];
    $qdc5 = $_POST['qdc5'];
    $qqc5 = $_POST['qqc5'];
    $qsc5 = $_POST['qsc5'];
    $qoc5 = $_POST['qoc5'];
    $cic5 = $_POST['cic5'];
    $cdc5 = $_POST['cdc5'];
    $subtotalc5 = $_POST['subtotalc5'];
    
    $somatdc = $_POST['somatdc'];
    $somatqc = $_POST['somatqc'];  
    $somatsc = $_POST['somatsc'];  
    $somatoc = $_POST['somatoc'];  
    $somaquc = $_POST['somaquc'];  
    $somaqdc = $_POST['somaqdc'];  
    $somaqqc = $_POST['somaqqc'];  
    $somaqsc = $_POST['somaqsc'];  
    $somaqoc = $_POST['somaqoc'];  
    $somacic = $_POST['somacic'];  
    $somacdc = $_POST['somacdc'];  
    $somageralc = $_POST['somageralc'];   
    
    $sql = "UPDATE grade SET tituloc1=(UPPER('$tituloc1')),titulod1=(UPPER('$tituloc1')),tdc1='$tdc1',tqc1='$tqc1',tsc1='$tsc1',toc1='$toc1',quc1='$quc1',qdc1='$qdc1',qqc1='$qqc1',qsc1='$qsc1',qoc1='$qoc1',cic1='$cic1',cdc1='$cdc1',subtotalc1='$subtotalc1',tituloc2=(UPPER('$tituloc2')),titulod2=(UPPER('$tituloc2')),tdc2='$tdc2',tqc2='$tqc2',tsc2='$tsc2',toc2='$toc2',quc2='$quc2',qdc2='$qdc2',qqc2='$qqc2',qsc2='$qsc2',qoc2='$qoc2',cic2='$cic2',cdc2='$cdc2',subtotalc2='$subtotalc2', tituloc3=(UPPER('$tituloc3')),titulod3=(UPPER('$tituloc3')),tdc3='$tdc3',tqc3='$tqc3',tsc3='$tsc3',toc3='$toc3',quc3='$quc3',qdc3='$qdc3',qqc3='$qqc3',qsc3='$qsc3',qoc3='$qoc3',cic3='$cic3',cdc3='$cdc3',subtotalc3='$subtotalc3',tituloc4=(UPPER('$tituloc4')),tdc4='$tdc4',tqc4='$tqc4',tsc4='$tsc4',toc4='$toc4',quc4='$quc4',qdc4='$qdc4',qqc4='$qqc4',qsc4='$qsc4',qoc4='$qoc4',cic4='$cic4',cdc4='$cdc4',subtotalc4='$subtotalc4',tituloc5=(UPPER('$tituloc5')),tdc5='$tdc5',tqc5='$tqc5',tsc5='$tsc5',toc5='$toc5',quc5='$quc5',qdc5='$qdc5',qqc5='$qqc5',qsc5='$qsc5',qoc5='$qoc5',cic5='$cic5',cdc5='$cdc5',subtotalc5='$subtotalc5',somatdc='$somatdc',somatqc='$somatqc',somatsc='$somatsc',somatoc='$somatoc',somaquc='$somaquc',somaqdc='$somaqdc',somaqqc='$somaqqc',somaqsc='$somaqsc',somaqoc='$somaqoc',somacic='$somacic',somacdc='$somacdc',somageralc='$somageralc' WHERE grade.id_pedido='$id' and grade.dir='1'";
 
    $resultado = $mysqli->query($sql);

?>
        <META HTTP-EQUIV=REFRESH CONTENT = '0;URL=pedido_index.php'>