
                <h4 style="text-align:center">Apontamentos de Produção</h4>
                <table class="table table-condensed  table-bordered">
                    <thead>
                      <tr>
                        <th><h4 style="text-align:center">Grade</h4></th>
                        <th><h4 style="text-align:center">Registro</h4></th>
                        <th><h4 style="text-align:center">32</h4></th>
                        <th><h4 style="text-align:center">34</h4></th>
                        <th><h4 style="text-align:center">36</h4></th>
                        <th><h4 style="text-align:center">38</h4></th>
                        <th><h4 style="text-align:center">40</h4></th>
                        <th><h4 style="text-align:center">42</h4></th>
                        <th><h4 style="text-align:center">44</h4></th>
                        <th><h4 style="text-align:center">46</h4></th>
                        <th><h4 style="text-align:center">48</h4></th>
                        <th><h4 style="text-align:center">50</h4></th>
                        <th><h4 style="text-align:center">52</h4></th>
                      </tr>
                    </thead>

                    <tbody>
                        <?php 
                        $resultado2 = $mysqli->query($sql2);
                        while($row2 = $resultado2->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 $row2['titulo'] ?></td>
                                <td><?php echo $row2['obs_grade'] ?></td>

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

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

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

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

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

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

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

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

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

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

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

                                <td align="center"><?php echo $row2['subtotal'] ?></td>
                                    <?php $totalg2 = 0; ?>
                            </tr>
                        <?php } ?>
                    </tbody>
                    <tr>
                        <td>
							<?php if (($route) == 'oc_on') { ?>
								<a href="oc_index.php" class="btn btn-info">Retornar</a>
							<?php }	else {?>
								<a href="producao_index.php" class="btn btn-default">Retornar</a>
							<?php }	?>

                        </td>
                        <td>
                        <?php   $resultado2 = $mysqli->query($sql2);
                                $row2 = $resultado2->fetch_array(MYSQLI_ASSOC);?>
								<?php if (($route) == 'oc_on') { ?>
									<a<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#exampleModal" data-whatever="<?php echo $row22['id_oc']; ?>" data-whatevernome="<?php echo $row22['popular_name']; ?>"data-whateverdetalhes="<?php echo $row2['obsPed']; ?>">Enviar para Produção</button></a>
								<?php }	else {?>
									<a href="" class="btn btn-default" disabled>Apontamentos</a>
								<?php }	?>


                        </td>
                        <td align="center">
                            <input type="text" class="form-control" id="tdat2" name="tdat2" value="<?php echo $tdat2 ?>" readonly="readonly" style="min-width:55px;">
                        </td>
                        <td>
                            <input type="text" class="form-control" id="tqat2" name="tqat2" value="<?php echo $tqat2 ?>" readonly="readonly" disabled style="min-width:55px;">
                        </td>
                        <td>
                            <input type="text" class="form-control" id="tsat2" name="tsat2" value="<?php echo $tsat2 ?>" readonly="readonly" style="min-width:55px;">
                        </td>
                        <td>
                            <input type="text" class="form-control" id="toat2" name="toat2" value="<?php echo $toat2 ?>" readonly="readonly" style="min-width:55px;">
                        </td>
                        <td>
                            <input type="text" class="form-control" id="quat2" name="quat2" value="<?php echo $quat2 ?>" readonly="readonly" style="min-width:55px;">
                        </td>
                        <td>
                            <input type="text" class="form-control" id="qdat2" name="qdat2" value="<?php echo $qdat2 ?>" readonly="readonly" style="min-width:55px;">
                        </td>
                        <td>
                            <input type="text" class="form-control" id="qqat2" name="qqat2" value="<?php echo $qqat2 ?>" readonly="readonly" style="min-width:55px;">
                        </td>
                        <td>
                            <input type="text" class="form-control" id="qsat2" name="qsat2" value="<?php echo $qsat2 ?>" readonly="readonly" style="min-width:55px;"> 
                        </td>
                        <td>
                            <input type="text" class="form-control" id="qoat2" name="qoat2" value="<?php echo $qoat2 ?>" readonly="readonly" style="min-width:55px;">
                        </td>
                        <td>
                            <input type="text" class="form-control" id="ciat2" name="ciat2" value="<?php echo $ciat2 ?>" readonly="readonly" style="min-width:55px;">
                        </td>
                        <td>
                            <input type="text" class="form-control" id="cdat2" name="cdat2" value="<?php echo $cdat2 ?>" readonly="readonly" style="min-width:55px;">
                        </td>
                    </tr>
                </table>
