Пример #1
0
function PrintCheckRequest($IdRequest, $OutputType = "compilazione")
{
    global $d;
    //echo "[Debug]: IdRequest: $IdRequest <br />";
    // Verifico se l'id passato è un array
    if (is_array($IdRequest)) {
        /* echo "[Debug]: l'id è un array, eseguo il conteggio
           massivo del dettaglio: <br />"; */
        // Flag per l'argomento passato
        $IsArray = True;
        $ElencoFiliali = "<br />";
        $indice_fil = 1;
        foreach ($IdRequest as $key_req => $field_req) {
            $errori = "";
            $check = CheckDettaglioRequest($field_req);
            $tmp_consuntivo = $check['consuntivo'];
            if (!isset($consuntivo)) {
                $consuntivo = $tmp_consuntivo;
                $errori = $check['consuntivo']['errori'];
                $request[0] = $check['request'];
                $ElencoFiliali .= $indice_fil . ") - " . $d->Inverti_Data($request[0]['data_pianif']) . " - " . $request[0]['den'] . "<br />";
                //. "<br />Errori: <br />$errori <br />";
            } else {
                $errori .= $check['consuntivo']['errori'];
                $tmp_request = $check['request'];
                foreach ($tmp_consuntivo as $key_c => $field_c) {
                    $consuntivo[$key_c] += $tmp_consuntivo[$key_c];
                }
                foreach ($request[0] as $key_r => $field_r) {
                    $request[0][$key_r] += $tmp_request[$key_r];
                }
                $ElencoFiliali .= $indice_fil . ") - " . $d->Inverti_Data($tmp_request['data_pianif']) . " - " . $tmp_request['den'] . "<br />";
                //. "<br />Errori: <br />$errori <br />";
            }
            $indice_fil += 1;
        }
    } else {
        /*
         echo "[Debug]: l'id è un numero ($IdRequest), eseguo il conteggio
         singolo del dettaglio: <br />";
        */
        $check = CheckDettaglioRequest($IdRequest);
        $consuntivo = $check['consuntivo'];
        $errori = $check['consuntivo']['errori'];
        $request[0] = $check['request'];
    }
    /*
     echo "<pre>check['request']";
     print_r($check['request']);
     echo "</pre>";
    */
    switch ($OutputType) {
        case "compilazione":
            /* echo "[Debug]: esiste una request (numerica) in sessione,
             * quindi estraggo i dati e verifico i campi <br />";
             * echo "[Debug]: id_request: " . $_SESSION['rollout']['id_request'] . " <br />";
             */
            $RequestString = "";
            // Composizione stringhe di verifica:
            if ($consuntivo['inc_srv'] != $request[0]['qi_server']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Incident Server: " . $consuntivo['inc_srv'] . " / " . $request[0]['qi_server'] . "</label>, ";
            if ($consuntivo['sp_srv_new'] != $request[0]['sp_srv_new']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Server Nuovi: " . $consuntivo['sp_srv_new'] . " / " . $request[0]['sp_srv_new'] . "</label>, ";
            if ($consuntivo['rit_srv'] != $request[0]['rit_srv']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Server Vecchi: " . $consuntivo['rit_srv'] . " / " . $request[0]['rit_srv'] . "</label>, ";
            if ($consuntivo['sos_pdl'] != $request[0]['sos_pdl']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Client Nuovi: " . $consuntivo['sos_pdl'] . " / " . $request[0]['sos_pdl'] . "</label>, ";
            if ($consuntivo['rit_pdl'] != $request[0]['rit_pdl']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Client Vecchi: " . $consuntivo['rit_pdl'] . " / " . $request[0]['rit_pdl'] . "</label>, <br />";
            if ($consuntivo['sos_prt_lan'] != $request[0]['sos_prt_lan']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Stampanti di rete nuove: " . $consuntivo['sos_prt_lan'] . " / " . $request[0]['sos_prt_lan'] . "</label>, ";
            if ($consuntivo['rit_prt_lan'] != $request[0]['rit_prt_lan']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Stampanti di rete Vecchie: " . $consuntivo['rit_prt_lan'] . " / " . $request[0]['rit_prt_lan'] . "</label>, ";
            if ($consuntivo['rit_mon'] != $request[0]['rit_mon']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Monitor Vecchi: " . $consuntivo['rit_mon'] . " / " . $request[0]['rit_mon'] . "</label>, <br />";
            if ($consuntivo['rit_let'] != $request[0]['rit_let']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Lettore Assegni Vecchi: " . $consuntivo['tot_rit_let'] . " / " . $request[0]['rit_let'] . "</label>, ";
            if ($consuntivo['rit_cas'] != $request[0]['rit_cas']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Stampanti di Cassa Vecchie: " . $consuntivo['rit_cas'] . " / " . $request[0]['rit_cas'] . "</label>, ";
            if ($consuntivo['sp_lett'] != $request[0]['sp_lett']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Lettori assegni nuovi: " . $consuntivo['sp_lett'] . " / " . $request[0]['sp_lett'] . "</label>, <br />";
            if ($consuntivo['rit_las'] != $request[0]['rit_las']) {
                $style = "class=\"err\"";
            } else {
                $style = "class=\"ok\"";
            }
            $RequestString .= "<label {$style}>Stampanti Laser Vecchie: " . $consuntivo['rit_las'] . " / " . $request[0]['rit_las'] . "</label>, ";
            // Fine sezione verifica compilazione.
            echo $RequestString;
            break;
        case "consuntivo":
            ?>
            <table class="dettaglio" style="width: 100%;" rules="all">
            <?php 
            if (!$IsArray) {
                ?>
                    <tr>
                        <th colspan="5">
                            Consuntivo Filiale: <?php 
                echo $request[0]['den'];
                ?>

                            &nbsp;
                            <a onclick="Javascript: go('home.php?act=rollout&amp;reset=0&amp;tomod=<?php 
                echo $request[0]['id_request'];
                ?>
'); void(0);"
                               title="Compila Dettaglio Request">
                                <img src="/Images/Links/arch.png" alt="arch" />
                            </a>

                            &nbsp;
                            <a onclick="Javascript: window.open('frm_pdf_dett_request.php?rid=<?php 
                echo $request[0]['id_request'];
                ?>
', '_blank'); void(0);"
                               title="Stampa Riepilogo Request">
                                <img src="/Images/Links/pdf.png" alt="pdf" />
                            </a>
                        </th>
                    </tr>

            <?php 
            } else {
                ?>
                    <tr>
                        <th colspan="5">
                            Consuntivo cumulativo in base ai criteri di ricerca
                        </th>
                        <th>
                            Elenco Filiali interessate dal conteggio:
                        </th>
                    </tr>
            <?php 
            }
            ?>

                <tr><th colspan="5"><br /></th></tr>

                <tr>
                    <th colspan="5">
                        Spedizioni:
                        <label><?php 
            printf("( %.2f € pezzo )", Spedizioni);
            ?>
</label>
                    </th>
                    <th rowspan="100" style="vertical-align: top;">
            <?php 
            echo $ElencoFiliali;
            ?>
                    </th>
                </tr>

                <tr>
                    <th style="text-align: center;"><label>Tipo Macchina:</label></th>
                    <th style="text-align: center;"><label>Previsti:</label></th>
                    <th style="text-align: center;"><label>Effettivi:</label></th>
                    <th style="text-align: center;"><label>Bilancio:</label></th>
                    <th style="text-align: center;"><label>Subtotale:</label></th>
                </tr>

                <tr>
                    <td style="text-align: right;">Server Nuovo:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sp_srv_new'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sp_srv_new'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['sp_srv_new'] - $request[0]['sp_srv_new'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sp_srv_new'] * Spedizioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sped'] += $consuntivo['sp_srv_new'] * Spedizioni;
                printf("%.2f €", $consuntivo['sp_srv_new'] * Spedizioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Pdl Nuovi:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sp_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sp_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['sp_pdl'] - $request[0]['sp_pdl'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sp_pdl'] * Spedizioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sped'] += $consuntivo['sp_pdl'] * Spedizioni;
                printf("%.2f €", $consuntivo['sp_pdl'] * Spedizioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Monitor:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sp_mon'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sp_mon'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sp_mon'] - $request[0]['sp_mon'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sp_mon'] * Spedizioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sped'] += $consuntivo['sp_mon'] * Spedizioni;
                printf("%.2f €", $consuntivo['sp_mon'] * Spedizioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante Laser:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sp_las'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sp_las'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sp_las'] - $request[0]['sp_las'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sp_las'] * Spedizioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sped'] += $consuntivo['sp_las'] * Spedizioni;
                printf("%.2f €", $consuntivo['sp_las'] * Spedizioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Lettore Barcode:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sp_bar'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sp_bar'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sp_bar'] - $request[0]['sp_bar'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sp_bar'] * Spedizioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sped'] += $consuntivo['sp_bar'] * Spedizioni;
                printf("%.2f €", $consuntivo['sp_bar'] * Spedizioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Lettore Assegni:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sp_lett'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sp_lett'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sp_lett'] - $request[0]['sp_lett'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sp_lett'] * Spedizioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sped'] += $consuntivo['sp_lett'] * Spedizioni;
                printf("%.2f €", $consuntivo['sp_lett'] * Spedizioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante di rete:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sp_prt_lan'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sp_prt_lan'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sp_prt_lan'] - $request[0]['sp_prt_lan'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sp_prt_lan'] * Spedizioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sped'] += $consuntivo['sp_prt_lan'] * Spedizioni;
                printf("%.2f €", $consuntivo['sp_prt_lan'] * Spedizioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Altro Hardware:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sp_altro_hw'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sp_altro_hw'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sp_altro_hw'] - $request[0]['sp_altro_hw'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sp_altro_hw'] * Spedizioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sped'] += $consuntivo['sp_altro_hw'] * Spedizioni;
                printf("%.2f €", $consuntivo['sp_altro_hw'] * Spedizioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <th colspan="4" style="text-align: right;">Totale Spedizioni:</th>
                    <th style="text-align: center;">
                        <label class="ok"><?php 
            printf("%.2f €", $consuntivo['tot_sped']);
            ?>
</label>
                    </th>
                </tr>

                <tr><th colspan="5"><br /></th></tr>

                <tr>
                    <th colspan="5">
                        Staging:
                        <label><?php 
            printf("( %.2f € pezzo )", Staging);
            ?>
</label>
                    </th>
                </tr>

                <tr>
                    <th style="text-align: center;"><label>Tipo Macchina:</label></th>
                    <th style="text-align: center;"><label>Previsti:</label></th>
                    <th style="text-align: center;"><label>Effettivi:</label></th>
                    <th style="text-align: center;"><label>Bilancio:</label></th>
                    <th style="text-align: center;"><label>Subtotale:</label></th>
                </tr>

                <tr>
                    <td style="text-align: right;">Server Nuovo:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['st_srv'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['st_srv'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['st_srv'] - $request[0]['st_srv'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['st_pdl'] * Staging == 0) {
                echo "-";
            } else {
                $consuntivo['tot_stag'] += $consuntivo['st_srv'] * Server;
                printf("%.2f €", $consuntivo['st_srv'] * Server);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Pdl Nuovi:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['st_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['st_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['st_pdl'] - $request[0]['st_pdl'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['st_pdl'] * Staging == 0) {
                echo "-";
            } else {
                $consuntivo['tot_stag'] += $consuntivo['st_pdl'] * Staging;
                printf("%.2f €", $consuntivo['st_pdl'] * Staging);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <th colspan="4" style="text-align: right;">Totale Staging:</th>
                    <th style="text-align: center;">
                        <label class="ok"><?php 
            printf("%.2f €", $consuntivo['tot_stag']);
            ?>
</label>
                    </th>
                </tr>

                <tr><th colspan="5"><br /></th></tr>

                <tr>
                    <th colspan="5">
                        Sostituzioni:
                        <label><?php 
            printf("( %.2f € pezzo  )", Sostituzioni);
            ?>
</label>
                    </th>
                </tr>

                <tr>
                    <th style="text-align: center;"><label>Tipo Macchina:</label></th>
                    <th style="text-align: center;"><label>Previsti:</label></th>
                    <th style="text-align: center;"><label>Effettivi:</label></th>
                    <th style="text-align: center;"><label>Bilancio:</label></th>
                    <th style="text-align: center;"><label>Subtotale:</label></th>
                </tr>

                <tr>
                    <td style="text-align: right;">Server:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sos_srv'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sos_srv'];
            ?>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sos_srv'] - $request[0]['sos_srv'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sos_srv'] * Sostituzioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sost'] += $consuntivo['sos_srv'] * Sostituzioni;
                printf("%.2f €", $consuntivo['sos_srv'] * Sostituzioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Pdl:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sos_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sos_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['sos_pdl'] - $request[0]['sos_pdl'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sos_pdl'] * Sostituzioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sost'] += $consuntivo['sos_pdl'] * Sostituzioni;
                printf("%.2f €", $consuntivo['sos_pdl'] * Sostituzioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Monitor:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sos_mon'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sos_mon'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sos_mon'] - $request[0]['sos_mon'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sos_mon'] * Sostituzioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sost'] += $consuntivo['sos_mon'] * Sostituzioni;
                printf("%.2f €", $consuntivo['sos_mon'] * Sostituzioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante di rete:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sos_prt_lan'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sos_prt_lan'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sos_prt_lan'] - $request[0]['sos_prt_lan'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sos_prt_lan'] * Sostituzioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sost'] += $consuntivo['sos_prt_lan'] * Sostituzioni;
                printf("%.2f €", $consuntivo['sos_prt_lan'] * Sostituzioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante laser:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sos_las'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sos_las'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sos_las'] - $request[0]['sos_las'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sos_las'] * Sostituzioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sost'] += $consuntivo['sos_las'] * Sostituzioni;
                printf("%.2f €", $consuntivo['sos_las'] * Sostituzioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Lettore Assegni:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sos_lett'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sos_lett'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sos_lett'] - $request[0]['sos_lett'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sos_lett'] * Sostituzioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sost'] += $consuntivo['sos_lett'] * Sostituzioni;
                printf("%.2f €", $consuntivo['sos_lett'] * Sostituzioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Lettore Barcode:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['sos_bar'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['sos_bar'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['sos_bar'] - $request[0]['sos_bar'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['sos_bar'] * Sostituzioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_sost'] += $consuntivo['sos_bar'] * Sostituzioni;
                printf("%.2f €", $consuntivo['sos_bar'] * Sostituzioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <th colspan="4" style="text-align: right;">Totale Sostituzioni:</th>
                    <th style="text-align: center;">
                        <label class="ok"><?php 
            printf("%.2f €", $consuntivo['tot_sost']);
            ?>
</label>
                    </th>
                </tr>

                <tr><th colspan="5"><br /></th></tr>

                <tr>
                    <th colspan="5">
                        Riconfigurazioni:
                        <label><?php 
            printf("( %.2f € pezzo )", Riconfigurazioni);
            ?>
</label>
                    </th>
                </tr>

                <tr>
                    <th style="text-align: center;"><label>Tipo Macchina:</label></th>
                    <th style="text-align: center;"><label>Previsti:</label></th>
                    <th style="text-align: center;"><label>Effettivi:</label></th>
                    <th style="text-align: center;"><label>Bilancio:</label></th>
                    <th style="text-align: center;"><label>Subtotale:</label></th>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante di rete:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['ric_prt_lan'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok">
                            <?php 
            /* dato che sul dettaglio con viene inserito
             * nulla riguardo le riconfigurazioni,
             * non utilizzo la variabile: $consuntivo['ric_prt_lan'];
             * ma riutilizzo lo stesso valore richiesto. */
            echo $request[0]['ric_prt_lan'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $request[0]['ric_prt_lan'] - $request[0]['ric_prt_lan'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($request[0]['ric_prt_lan'] * Riconfigurazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_ric'] += $request[0]['ric_prt_lan'] * Riconfigurazioni;
                printf("%.2f €", $request[0]['ric_prt_lan'] * Riconfigurazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Multifunzione:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['ric_multi'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok">
            <?php 
            /* dato che sul dettaglio con viene inserito
             * nulla riguardo le riconfigurazioni,
             * non utilizzo la variabile: $consuntivo['ric_multi'];
             * ma riutilizzo lo stesso valore richiesto. */
            echo $request[0]['ric_multi'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $request[0]['ric_multi'] - $request[0]['ric_multi'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($request[0]['ric_multi'] * Riconfigurazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_ric'] += $request[0]['ric_multi'] * Riconfigurazioni;
                printf("%.2f €", $request[0]['ric_multi'] * Riconfigurazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <th colspan="4" style="text-align: right;">Totale Riconfigurazioni:</th>
                    <th style="text-align: center;">
                        <label class="ok"><?php 
            printf("%.2f €", $consuntivo['tot_ric']);
            ?>
</label>
                    </th>
                </tr>

                <tr><th colspan="5"><br /></th></tr>

                <tr>
                    <th colspan="5">
                        Disinstallazioni:
                        <label><?php 
            printf("( %.2f € pezzo )", Disinstallazioni);
            ?>
</label>
                    </th>
                </tr>

                <tr>
                    <th style="text-align: center;"><label>Tipo Macchina:</label></th>
                    <th style="text-align: center;"><label>Previsti:</label></th>
                    <th style="text-align: center;"><label>Effettivi:</label></th>
                    <th style="text-align: center;"><label>Bilancio:</label></th>
                    <th style="text-align: center;"><label>Subtotale:</label></th>
                </tr>

                <tr>
                    <td style="text-align: right;">Server:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['dis_srv'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['dis_srv'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['dis_srv'] - $request[0]['dis_srv'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($request[0]['dis_srv'] * Disinstallazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_dis'] += $consuntivo['dis_srv'] * Disinstallazioni;
                printf("%.2f €", $request[0]['dis_srv'] * Disinstallazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Pdl:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['dis_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['dis_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['dis_pdl'] - $request[0]['dis_pdl'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['dis_pdl'] * Disinstallazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_dis'] += $consuntivo['dis_pdl'] * Disinstallazioni;
                printf("%.2f €", $consuntivo['dis_pdl'] * Disinstallazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Monitor:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['dis_mon'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['dis_mon'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['dis_mon'] - $request[0]['dis_mon'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['dis_mon'] * Disinstallazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_dis'] += $consuntivo['dis_mon'] * Disinstallazioni;
                printf("%.2f €", $consuntivo['dis_mon'] * Disinstallazioni);
            }
            ?>
                        </label>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante laser:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['dis_las'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['dis_las'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['dis_las'] - $request[0]['dis_las'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['dis_las'] * Disinstallazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_dis'] += $consuntivo['dis_las'] * Disinstallazioni;
                printf("%.2f €", $consuntivo['dis_las'] * Disinstallazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante di cassa:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['dis_cas'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['dis_cas'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['dis_cas'] - $request[0]['dis_cas'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['dis_cas'] * Disinstallazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_dis'] += $consuntivo['dis_cas'] * Disinstallazioni;
                printf("%.2f €", $consuntivo['dis_cas'] * Disinstallazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Lettore Assegni:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['dis_let'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['dis_let'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['dis_let'] - $request[0]['dis_let'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['dis_let'] * Disinstallazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_dis'] += $consuntivo['dis_let'] * Disinstallazioni;
                printf("%.2f €", $consuntivo['dis_let'] * Disinstallazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Lettore Barcode:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['dis_bar'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['dis_bar'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['dis_bar'] - $request[0]['dis_bar'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['dis_bar'] * Disinstallazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_dis'] += $consuntivo['dis_bar'] * Disinstallazioni;
                printf("%.2f €", $consuntivo['dis_bar'] * Disinstallazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Fax:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['dis_fax'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['dis_fax'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['dis_fax'] - $request[0]['dis_fax'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['dis_fax'] * Disinstallazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_dis'] += $consuntivo['dis_fax'] * Disinstallazioni;
                printf("%.2f €", $consuntivo['dis_fax'] * Disinstallazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Altro Hardware:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['dis_altro_hw'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['dis_altro_hw'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['dis_altro_hw'] - $request[0]['dis_altro_hw'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['dis_altro_hw'] * Disinstallazioni == 0) {
                echo "-";
            } else {
                $consuntivo['tot_dis'] += $consuntivo['dis_altro_hw'] * Disinstallazioni;
                printf("%.2f €", $consuntivo['dis_altro_hw'] * Disinstallazioni);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <th colspan="4" style="text-align: right;">Totale Disinstallazioni:</th>
                    <th style="text-align: center;">
                        <label class="ok"><?php 
            printf("%.2f €", $consuntivo['tot_dis']);
            ?>
</label>
                    </th>
                </tr>

                <tr><th colspan="5"><br /></th></tr>

                <tr>
                    <th colspan="5">
                        Ritiri:
                        <label><?php 
            printf("( %.2f € pezzo )", Ritiri);
            ?>
</label>
                    </th>
                </tr>

                <tr>
                    <th style="text-align: center;"><label>Tipo Macchina:</label></th>
                    <th style="text-align: center;"><label>Previsti:</label></th>
                    <th style="text-align: center;"><label>Effettivi:</label></th>
                    <th style="text-align: center;"><label>Bilancio:</label></th>
                    <th style="text-align: center;"><label>Subtotale:</label></th>
                </tr>

                <tr>
                    <td style="text-align: right;">Server:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_srv'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_srv'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['rit_srv'] - $request[0]['rit_srv'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_srv'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_srv'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_srv'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Pdl:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_pdl'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['rit_pdl'] - $request[0]['rit_pdl'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_pdl'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_pdl'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_pdl'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Monitor:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_mon'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_mon'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['rit_mon'] - $request[0]['rit_mon'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_mon'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_mon'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_mon'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante laser:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_las'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_las'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['rit_las'] - $request[0]['rit_las'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_las'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_las'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_las'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante di rete:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_prt_lan'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_prt_lan'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['rit_prt_lan'] - $request[0]['rit_prt_lan'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_prt_lan'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_prt_lan'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_prt_lan'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante di cassa:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_cas'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_cas'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['rit_cas'] - $request[0]['rit_cas'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_cas'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_cas'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_cas'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Lettore Assegni:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_let'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_let'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['rit_let'] - $request[0]['rit_let'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_let'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_let'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_let'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Lettore Barcode:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_bar'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_bar'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['rit_bar'] - $request[0]['rit_bar'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_bar'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_bar'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_bar'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Fax:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_fax'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_fax'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['rit_fax'] - $request[0]['rit_fax'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_fax'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_fax'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_fax'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Altro Hardware:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err"><?php 
            echo $request[0]['rit_altro_hw'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok"><?php 
            echo $consuntivo['rit_altro_hw'];
            ?>
</label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
                            <?php 
            echo $consuntivo['rit_altro_hw'] - $request[0]['rit_altro_hw'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['rit_altro_hw'] * Ritiri == 0) {
                echo "-";
            } else {
                $consuntivo['tot_rit'] += $consuntivo['rit_altro_hw'] * Ritiri;
                printf("%.2f €", $consuntivo['rit_altro_hw'] * Ritiri);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <th colspan="4" style="text-align: right;">Totale Ritiri:</th>
                    <th style="text-align: center;">
                        <label class="ok"><?php 
            printf("%.2f €", $consuntivo['tot_rit']);
            ?>
</label>
                    </th>
                </tr>

                <tr><th colspan="5"><br /></th></tr>

                <tr>
                    <th colspan="5">
                        Incident:
                        <label><?php 
            printf("( %.2f € pezzo )", pIncident);
            ?>
</label>
                    </th>
                </tr>

                <tr>
                    <th style="text-align: center;"><label>Tipo Macchina:</label></th>
                    <th style="text-align: center;"><label>Previsti:</label></th>
                    <th style="text-align: center;"><label>Effettivi:</label></th>
                    <th style="text-align: center;"><label>Bilancio:</label></th>
                    <th style="text-align: center;"><label>Subtotale:</label></th>
                </tr>

                <tr>
                    <td style="text-align: right;">Server:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err">
                            <?php 
            echo $request[0]['qi_server'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok">
                            <?php 
            echo $consuntivo['inc_srv'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['inc_srv'] - $request[0]['qi_server'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['inc_srv'] * Server == 0) {
                echo "-";
            } else {
                $consuntivo['tot_inc'] += $consuntivo['inc_srv'] * Server;
                printf("%.2f €", $consuntivo['inc_srv'] * Server);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Lettore assegni:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err">
            <?php 
            echo $request[0]['qi_lett'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok">
            <?php 
            echo $consuntivo['inc_lett'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['inc_lett'] - $request[0]['qi_lett'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['inc_lett'] * pIncident == 0) {
                echo "-";
            } else {
                $consuntivo['tot_inc'] += $consuntivo['inc_lett'] * pIncident;
                printf("%.2f €", $consuntivo['inc_lett'] * pIncident);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Monitor:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err">
                            <?php 
            echo $request[0]['qi_mon'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok">
            <?php 
            echo $consuntivo['inc_mon'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['inc_mon'] - $request[0]['qi_mon'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['inc_mon'] * pIncident == 0) {
                echo "-";
            } else {
                $consuntivo['tot_inc'] += $consuntivo['inc_mon'] * pIncident;
                printf("%.2f €", $consuntivo['inc_mon'] * pIncident);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <td style="text-align: right;">Stampante di cassa:</td>
                    <td style="text-align: center;" title="Previsti">
                        <label class="err">
                            <?php 
            echo $request[0]['qi_prt'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Effettivi">
                        <label class="ok">
            <?php 
            echo $consuntivo['inc_prt'];
            ?>
                        </label>
                    </td>
                    <td style="text-align: center;" title="Bilancio">
            <?php 
            echo $consuntivo['inc_prt'] - $request[0]['qi_prt'];
            ?>
                    </td>
                    <td style="text-align: center;">
                        <label class="ok">
            <?php 
            if ($consuntivo['inc_prt'] * pIncident == 0) {
                echo "-";
            } else {
                $consuntivo['tot_inc'] += $consuntivo['inc_mon'] * pIncident;
                printf("%.2f €", $consuntivo['inc_prt'] * pIncident);
            }
            ?>
                        </label>
                    </td>
                </tr>

                <tr>
                    <th colspan="4" style="text-align: right;">Totale Incident:</th>
                    <th style="text-align: center;">
                        <label class="ok"><?php 
            printf("%.2f €", $consuntivo['tot_inc']);
            ?>
</label>
                    </th>
                </tr>

            <?php 
            $consuntivo['tot_fil'] = $consuntivo['tot_sped'] + $consuntivo['tot_stag'] + $consuntivo['tot_sost'] + $consuntivo['tot_ric'] + $consuntivo['tot_dis'] + $consuntivo['tot_rit'] + $consuntivo['tot_inc'];
            ?>

                <tr><th colspan="5"><br /></th></tr>

                <tr>
                    <th colspan="4" style="text-align: right;">Totale Filiale:</th>
                    <th style="text-align: center;">
                        <label class="ok"><?php 
            printf("%.2f €", $consuntivo['tot_fil']);
            ?>
</label>
                    </th>
                </tr>

                <tr>
                    <th colspan="5">
                        <label class="err"><?php 
            echo $errori;
            ?>
</label>
                    </th>
                </tr>
            </table><?php 
            break;
        default:
            // caso non gestito
            echo "[Debug]: Formato di output non gestito: '{$OutputType}'. <br />";
            break;
    }
}
Пример #2
0
				<th>Filiale:</th>
				<th title="Pdl da spedire">Pdl:</th>
				<th title="Spedizione Lettori">Lett:</th>
				<th title="Spedizione Stampanti">Prt Lan:</th>
				<th>Comp:</th>
				<th>Srv:</th>
				<th>Stato Srv:</th>
				<th>Stato Fil:</th>
			</tr>
			<tr><th colspan="16"><hr /></th></tr>
			<?php 
    foreach ($Results as $key => $field) {
        $request = $d->GetRows("id_request, request, sp_pdl, rit_pdl, qi_lett, i_server, sp_lett, sp_srv_new, sos_prt_lan", "tab_request", "id_filiale = '" . $field['id_filiale_f'] . "'");
        $id_request = $request[0]['id_request'];
        $color = $field['color'];
        $check_full = CheckDettaglioRequest($field['id_filiale_f']);
        $check = $check_full['consuntivo'];
        if ($request[0]['i_server'] != "" && $request[0]['sp_srv_new'] == 0) {
            $srv = "OLD";
        } elseif ($request[0]['i_server'] == "" && $request[0]['sp_srv_new'] != 0) {
            $srv = "NEW";
        } else {
            $srv = "-";
        }
        $tot_pdl += $request[0]['sp_pdl'] - $check['sp_pdl'];
        $tot_let_sp += $request[0]['sp_lett'] - $check['sp_lett'];
        $tot_prt_lan += $request[0]['sos_prt_lan'] - $check['sos_prt_lan'];
        $dvk = $d->GetRows("stato_mch, color", "view_dvk", "id_request = '{$id_request}'", "", "", 1);
        if (empty($dvk[0]['color'])) {
            $color_srv = "";
            $stato_srv = "-";