            <h3 style="text-align:center">Grades</h3>
            <table class="table table-condensed  table-bordered">
                <thead>
                  <tr>
                    <th><h4 style="text-align:center">Setor</h4></th>
                    <th><h4 style="text-align:center">Obs</h4></th>
                    <th><h5 style="text-align:center">%</h5></th>                            
                    <th><h3 style="text-align:center">32</h3></th>
                    <th><h3 style="text-align:center">34</h3></th>
                    <th><h3 style="text-align:center">36</h3></th>
                    <th><h3 style="text-align:center">38</h3></th>
                    <th><h3 style="text-align:center">40</h3></th>
                    <th><h3 style="text-align:center">42</h3></th>
                    <th><h3 style="text-align:center">44</h3></th>
                    <th><h3 style="text-align:center">46</h3></th>
                    <th><h3 style="text-align:center">48</h3></th>
                    <th><h3 style="text-align:center">50</h3></th>
                    <th><h3 style="text-align:center">52</h3></th>
                    <th><h3 style="text-align:center">Subtotal</h3></th>
                  </tr>
                </thead>

                <tbody>
                    <?php 
                    $resultado1 = $mysqli->query($sql1);
                    while($row = $resultado1->fetch_array(MYSQLI_ASSOC)) { ?>
                        
                        <input type="hidden" id="id_grade" name="id_grade" value="<?php echo $row['id_grade']; ?>" />
                        <input type="hidden" id="id" name="id" value="<?php echo $row['id']; ?>" />
                        <tr>
                            <td><?php echo $row['titulo'] ?></td>
                            <td><?php echo $row['obs_grade'] ?></td>
                            <td><?php echo $row['ajuste'] ?></td>

                            <td align="center"><?php echo $row['tda'] ?></td>
                                <?php $tdat += $row['tda']; ?>

                            <td align="center"><?php echo $row['tqa'] ?></td>
                                <?php $tqat += $row['tqa'];?>

                            <td align="center"><?php echo $row['tsa'] ?></td>
                                <?php $tsat += $row['tsa'];?> 

                            <td align="center"><?php echo $row['toa'] ?></td>
                                <?php $toat += $row['toa'];?> 

                            <td align="center"><?php echo $row['qua'] ?></td>
                                <?php $quat += $row['qua'];?> 

                            <td align="center"><?php echo $row['qda'] ?></td>
                                <?php $qdat += $row['qda'];?> 

                            <td align="center"><?php echo $row['qqa'] ?></td>
                                <?php $qqat += $row['qqa'];?> 

                            <td align="center"><?php echo $row['qsa'] ?></td>
                                <?php $qsat += $row['qsa'];?> 

                            <td align="center"><?php echo $row['qoa'] ?></td>
                                <?php $qoat += $row['qoa'];?> 

                            <td align="center"><?php echo $row['cia'] ?></td>
                                <?php $ciat += $row['cia'];?> 

                            <td align="center"><?php echo $row['cda'] ?></td>
                                <?php $cdat += $row['cda'];?> 

                            <td align="center"><?php echo $row['subtotal'] ?></td>
                                <?php $totalg += $row['subtotal']; ?>
                            </td>
                        </tr>
                    <?php } ?>
                </tbody>
                
                
                <tr>
                <td>
                    <a href="oc_index.php" class="btn btn-info">Retornar</a>
                </td>

                    <td>
                        <?php   $resultado1 = $mysqli->query($sql1);
                                $row = $resultado1->fetch_array(MYSQLI_ASSOC);?>

                                <a<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#exampleModal" data-whatever="<?php echo $row2['id_oc']; ?>" data-whatevernome="<?php echo $row2['popular_name']; ?>"data-whateverdetalhes="<?php echo $row2['obsPed']; ?>">Enviar para Produção</button></a>
                    </td>
                    <td>
                    </td>                    
                    <td align="center">
                        <input type="text" class="form-control" id="tdat" name="tdat" value="<?php echo $tdat ?>" readonly="readonly" style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="tqat" name="tqat" value="<?php echo $tqat ?>" readonly="readonly" disabled style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="tsat" name="tsat" value="<?php echo $tsat ?>" readonly="readonly" style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="toat" name="toat" value="<?php echo $toat ?>" readonly="readonly" style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="quat" name="quat" value="<?php echo $quat ?>" readonly="readonly" style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="qdat" name="qdat" value="<?php echo $qdat ?>" readonly="readonly" style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="qqat" name="qqat" value="<?php echo $qqat ?>" readonly="readonly" style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="qsat" name="qsat" value="<?php echo $qsat ?>" readonly="readonly" style="min-width:55px;"> 
                    </td>
                    <td>
                        <input type="text" class="form-control" id="qoat" name="qoat" value="<?php echo $qoat ?>" readonly="readonly" style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="ciat" name="ciat" value="<?php echo $ciat ?>" readonly="readonly" style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="cdat" name="cdat" value="<?php echo $cdat ?>" readonly="readonly" style="min-width:55px;">
                    </td>
                    <td>
                        <input type="text" class="form-control" id="totalg" name="totalg" value="<?php echo $totalg ?>" readonly="readonly" style="min-width:60px;">
                    </td>
                </tr>
            </table>