function Login($username, $pass, $session_name, $db) { // Rimuovo dal db tutte le sessioni salvate piu' vecchie di 1 ora: /* $q_old_ses = "DELETE FROM tab_session WHERE data <= date_sub('" . date('Y-m-d H:i:s') . "', interval 1 HOUR);"; $r_old_ses = mysql_query($q_old_ses, $db) or die (StampaErr($q_old_ses)); */ $Users = GetRows("tab_utenti, tab_tipi", "tab_utenti.user = '******' AND tab_utenti.tipo = tab_tipi.id_tipo", "", $db); // Se esiste un utente con questo nome verifica se la password e' corretta: if (count($Users) == 1) { if (md5($pass) == $Users[0]['pass']) { $_SESSION['id_user'] = $Users[0]['id_user']; // Memorizzo in sessione l'utente che ha effettato il login: $_SESSION[$session_name . 'user'] = $username; // Memorizzo in sessione l'id di sessione corrente: $_SESSION[$session_name . 'sess'] = session_id(); // Memorizzo in sessione la descrizione dell'utente se presente: $_SESSION['desc_user'] = $Users[0]['desc_user']; //Memorizzo in sessione il tipo di utente: $_SESSION['id_tipo'] = $Users[0]['id_tipo']; $_SESSION['tipo'] = $Users[0]['tipo']; $_SESSION['id_city'] = $Users[0]['id_city']; /* * Inserisco nel db i dati sul login effettuato: */ $Valori = array('session_id' => session_id(), 'id_user' => $Users[0]['id_user'], 'data' => date('Y-m-d H:i:s'), 'ip' => $_SERVER['REMOTE_ADDR'], 'action' => 'LogIn', 'user_agent' => $_SERVER['HTTP_USER_AGENT']); $Status = SaveRow($Valori, $Esclusioni, "tab_session", $db); ?> <label class="ok">Login effettuato, redirect in corso...</label> <script type="text/javascript"> document.location.href = "home.php?act=welc" </script> <?php } else { $RESULT = '<label class="err">La password è sbagliata.</label>'; } } else { /* FIXME 20/07/2010 Claudio Giordano: Generalizzare il messaggio? */ $RESULT = '<label class="err">L\'utente non esiste.</label>'; } return $RESULT; }
case "4": $chart = new PieChart(ChartWidth, ChartHeight); $chart->getPlot()->setGraphPadding(new Padding("5", "5", "50", "30")); $chart->setTitle("Chiamate per categoria"); $Stats = GetRows("view_call WHERE data_att <= '" . date('Y-m-d') . "' AND id_stato_call = '1'" . " group by categoria", "", "categoria", $db, 1, 'count(id_chiamata) as c_day,concat(categoria, " ", prz) as cat'); $dataSet = new XYDataSet(); foreach ($Stats as $key => $field) { $dataSet->addPoint(new Point("Categoria " . $field['cat'] . " € (" . $field['c_day'] . " chiamate)", $field['c_day'])); } $chart->setDataSet($dataSet); $chart->render(ChartPath); echo '<img src="' . ChartPath . '" alt="chart" />'; break; case "5": $chart = new PieChart(ChartWidth, ChartHeight); $chart->getPlot()->setGraphPadding(new Padding("5", "5", "50", "30")); $chart->setTitle("Chiamate per Provincia"); $Stats = GetRows("view_call WHERE data_att >= '2010-03-01' and data_att <= '2010-03-31" . "' AND id_stato_call = '1' AND id_tecnico = '2' and id_attivita != '45' GROUP BY Targa", "", "Targa", $db, 0, "count(id_chiamata) as tot_prov, Targa"); $dataSet = new XYDataSet(); foreach ($Stats as $key => $field) { $dataSet->addPoint(new Point("Provincia: " . $field['Targa'] . " (" . $field['tot_prov'] . ")", $field['tot_prov'])); } $chart->setDataSet($dataSet); $chart->render(ChartPath); echo '<img src="' . ChartPath . '" alt="chart" />'; break; } ?> </div>
require_once "{$root}/Function/DataTime.php"; require_once "{$root}/Class/XlsExport.php"; $Completate = GetRows("view_requests", "id_stato = '7'", "cod_fil", $db); foreach ($Completate as $key_c => $field_c) { $FileName = "export/RollOut_WIN7_RITIRI_FIL_" . $field_c['cod_fil'] . ".xls"; $x = new XlsExport($FileName, "export"); $x->xlsWriteLabel(0, 0, "Branch Code:"); $x->xlsWriteLabel(0, 1, $_SESSION['rollout']['cod_fil']); $x->xlsWriteLabel(1, 0, "N:"); $x->xlsWriteLabel(1, 1, "Tipologia Apparato:"); $x->xlsWriteLabel(1, 2, "Marca:"); $x->xlsWriteLabel(1, 3, "Modello:"); $x->xlsWriteLabel(1, 4, "Serial Number:"); $x->xlsWriteLabel(1, 5, "Asset:"); $xlsRow = 2; $Dettaglio = GetRows("view_macchine_assegnate", "id_request = '" . $field_c['id_request'] . "'", "tipo_mch", $db); foreach ($Dettaglio as $key => $field) { if ($field['provenienza'] == "DA FILIALE" && $field['tipo_mch'] != "Server") { $x->xlsWriteLabel($xlsRow, 0, $xlsRow - 1 . ")"); $x->xlsWriteLabel($xlsRow, 1, $field['tipo_mch']); $x->xlsWriteLabel($xlsRow, 2, $field['marca']); $x->xlsWriteLabel($xlsRow, 3, $field['modello']); $x->xlsWriteLabel($xlsRow, 4, $field['serial']); $x->xlsWriteLabel($xlsRow, 5, $field['asset']); $xlsRow++; } } $x->WriteFile(); } ?>
/* * 28/08/2009 23:48:31 CEST Claudio Giordano * 22/12/2009 convertita in ajax * * composizione live search */ $root = substr($_SERVER['DOCUMENT_ROOT'], 0, -1); require_once "{$root}/conti/connection.php"; require_once "{$root}/Function/Strings.php"; require_once "{$root}/Function/Db.php"; require_once "{$root}/Function/Debug.php"; require_once "{$root}/Function/DataTime.php"; $_GET['str'] = ExpandSearch($_GET['str']); $Sottoconti = GetRows("tab_sottoconti", "concat(\"(\", codice_sottoconto, \") \", descr_sottoconto) LIKE '%" . $_GET['str'] . "%'", "descr_sottoconto", $db, 1, "id_sottoconto, concat(\"(\", codice_sottoconto, \") \", descr_sottoconto) as descr_sottoconto"); $Anagrafiche = GetRows("tab_anagrafica", "rag_soc LIKE '%" . $_GET['str'] . "%'", "rag_soc", $db, 1); $Result = array(); foreach ($Sottoconti as $key => $field) { array_push($Result, $field['descr_sottoconto']); } foreach ($Anagrafiche as $key => $field) { array_push($Result, $field['rag_soc']); } ?> <?php if (count($Result) > 0) { ?> <table class="dettaglio" style="width: 100%;"> <?php foreach ($Result as $key => $field) {
<?php ob_end_clean(); require_once "fpdf/fpdf.php"; if (isset($_GET['pallet']) && trim($_GET['pallet']) != "") { //echo "[Debug]: esiste pallet <br />"; $_GET['pallet'] = stripslashes($_GET['pallet']); if (strlen($_GET['pallet']) > 50) { //echo "[Debug]: la lunghezza supera i 50 caratteri <br />"; $_GET['pallet'] = substr($_GET['pallet'], 0, 49); } $dett_pallet = GetRows("view_macchine", "pallet = '" . $_GET['pallet'] . "'", "tipo_mch", $db, 1); class PDF extends FPDF { //Page footer function Footer() { //Position at 1.5 cm from bottom $this->SetY(-15); $this->SetFont('Arial', '', 9); $this->Cell(40, 4, 'Data: ' . date('d/m/Y'), 0, '', 'L'); $this->Cell(0, 4, 'Pagina ' . $this->PageNo() . "/{nb}", 0, 0, 'C'); } } $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->SetMargins(6, 15, 6); $pdf->AddPage(); // Header $pdf->SetFont('Helvetica', 'B', 14); $pdf->Cell(200, 7, 'Dettaglio Pallet: ' . $_GET['pallet'], '', '', '');
?> <tr> <td> <?php echo "(" . $field['codice_sottoconto'] . ")"; ?> </td> <td> <?php echo htmlentities(ucfirst(strtolower($field['descr_sottoconto']))); ?> </td> <td style="text-align: right;"> <label class="ok"> <?php $Campi = GetRows("tab_dett_piano_conti", "id_sottoconto = '" . $field['id_sottoconto'] . "'", "", $db, 1, "sum(importo_a) as tot_avere"); if ($Campi[0]['tot_avere'] != "") { echo $Campi[0]['tot_avere']; $TotConto += $Campi[0]['tot_avere']; $TotAvere += $Campi[0]['tot_avere']; } else { echo "0.00"; } ?> </label> </td> </tr> <?php } } ?>
$r = safe_r_sql($q); if (safe_num_rows($r) == 1) { $row = safe_fetch($r); $ses = substr($row->AtTargetNo, 0, 1); $tar = substr($row->AtTargetNo, 1); } else { $ses = null; $tar = null; } } } } /* fine salvo */ $record = null; if ($id != 0) { $record = GetRows($id); $record = $record[0]; $record['dob'] = dateRenderer($record['dob'], get_text('DateFmt')); } else { $record = array('id' => 0, 'ioccode' => '', 'code' => '', 'status' => 0, 'session' => $ses !== null ? $ses : '', 'targetno' => $tar !== null ? $tar : '', 'firstname' => '', 'name' => '', 'sex_id' => 0, 'sex' => get_text('ShortMale', 'Tournament'), 'ctrl_code' => '', 'dob' => '', 'country_id' => 0, 'country_code' => '', 'country_name' => '', 'sub_team' => 0, 'country_id2' => 0, 'country_code2' => '', 'country_name2' => '', 'country_id3' => 0, 'country_code3' => '', 'country_name3' => '', 'division' => '--', 'class' => '--', 'ageclass' => '--', 'subclass' => '--', 'targetface' => 0, 'indcl' => 0, 'teamcl' => 0, 'indfin' => 0, 'teamfin' => 0, 'mixteamfin' => 0, 'wc' => 0, 'double' => 0); } $arrStatus = array(); foreach (array(1, 5, 6, 7, 8, 9) as $s) { $arrStatus[] = array('id' => $s, 'descr' => get_text('Status_' . $s)); } $comboStatus = ComboFromRs($arrStatus, 'id', 'descr', 1, null, array('0', ''), 'd_e_EnStatus_', 'd_e_EnStatus_'); $tmp = GetSessions('Q'); $sessions = array(); foreach ($tmp as $s) { $sessions[] = array('id' => $s->SesOrder, 'descr' => $s->Descr); }
<?php $root = substr($_SERVER['DOCUMENT_ROOT'], 0, -1); require_once "{$root}/Function/Strings.php"; require_once "{$root}/Function/Db.php"; require_once "{$root}/Function/Debug.php"; require_once "{$root}/Function/DataTime.php"; $voci = GetRows("tab_menu", "perm like '%" . $_SESSION['id_tipo'] . "%' AND gruppo = '" . $_GET['gruppo'] . "'", "titolo", $db); // onmouseout="javascript: document.getElementById('menu-voci').style.display = 'none'"; ?> <table style="width: 100%;" class="menu"> <?php foreach ($voci as $voce) { ?> <tr <?php //if (($voce['act'] == $_GET['gruppo'])) { echo 'class="selected"'; } ?> > <td> » <a href="<?php echo $voce['link']; ?> " title="<?php echo $voce['tip']; ?> " > <?php echo $voce['titolo']; ?>
/* * Barbatrucco per fare le righe alternate */ $eval4ref = ' if ($ref!=$style) { $ref=$style; {{:style}} } '; break; } //print $eval4ref;exit; $eval4ref = str_replace('{{:style}}', '$style=($style==\'warning\' ? \'\' : \'warning\');', $eval4ref); $MyHeader = '<tr>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordStatus&dir=' . $OrderCol['ordStatus'] . '">' . get_text('Status', 'Tournament') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordTar&dir=' . $OrderCol['ordTar'] . '">' . get_text('Session') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordTar&dir=' . $OrderCol['ordTar'] . '">' . get_text('Target') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordCode&dir=' . $OrderCol['ordCode'] . '">' . get_text('Code', 'Tournament') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordName&dir=' . $OrderCol['ordName'] . '">' . get_text('FamilyName', 'Tournament') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordName&dir=' . $OrderCol['ordName'] . '">' . get_text('Name', 'Tournament') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordEmail&dir=' . $OrderCol['ordEmail'] . '">' . get_text('Email', 'Tournament') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordCtrl&dir=' . $OrderCol['ordCtrl'] . '">' . get_text('DOB', 'Tournament') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordSex&dir=' . $OrderCol['ordSex'] . '">' . get_text('Sex', 'Tournament') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordCountryCode&dir=' . $OrderCol['ordCountryCode'] . '">' . get_text('Country') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordCountry&dir=' . $OrderCol['ordCountry'] . '">' . get_text('NationShort', 'Tournament') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordWc&dir=' . $OrderCol['ordWc'] . '">' . get_text('WheelChair', 'Tournament') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordDiv&dir=' . $OrderCol['ordDiv'] . '">' . get_text('Div') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordAgeCl&dir=' . $OrderCol['ordAgeCl'] . '">' . get_text('AgeCl') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordCl&dir=' . $OrderCol['ordCl'] . '">' . get_text('Cl') . '</a></td>' . '<td class="Title"><a class="LinkRevert" href="' . $_SERVER['PHP_SELF'] . '?AllTargets=' . $AllTargets . '&ord=ordSubCl&dir=' . $OrderCol['ordSubCl'] . '">' . get_text('SubCl', 'Tournament') . '</a></td>' . '<td class="Title">' . get_text('TargetType') . '</td>' . '<td class="Title"> </td>' . '</tr>' . "\n"; $Rows = GetRows(null, $OrderBy, $AllTargets); $JS_SCRIPT = array(phpVars2js(array('StrAreYouSure' => get_text('MsgAreYouSure'))), '<script type="text/javascript" src="' . $CFG->ROOT_DIR . 'Common/ajax/ObjXMLHttpRequest.js"></script>', '<script type="text/javascript" src="' . $CFG->ROOT_DIR . 'Common/Fun_JS.inc.js"></script>', '<script type="text/javascript" src="Fun_index_edit.js"></script>', '<script type="text/javascript"> function PopEdit(id,opts) { var other=(opts!==null ? \'&\'+opts : \'\'); OpenPopup(\'PopEdit.php?id=\'+id+other, \'PopEdit\', 910,700); } function chkAllTargets(ord,dir) { var url="index.php?ord="+ord+"&dir="+dir; var c=document.getElementById("AllTargets"); if (c.checked) {
?> </td> <td> <?php if ($field['id_cliente'] == 0) { echo "-"; } else { $anag = GetRows("tab_anagrafica", "id_anag = '" . $field['id_cliente'] . "'", "", $db); echo $anag[0]['ragione_sociale']; } ?> </td> <td> <?php $user = GetRows("tab_utenti", "id_user = '******'id_utente'] . "'", "", $db); echo $user[0]['user']; ?> </td> <th style="text-align: center; width: 24px;"> <a onclick="Javascript: popUpWindow('DettaglioOfferta', 'frm_vis_dettaglio_off.php?id_off=<?php echo $field['id_off']; ?> ', '250', '250', '650', '250')" title="Visualizza Dettaglio" style="cursor: pointer;"> <img src="..//Images/Links/db/info.png" alt="Dett" style="border: 0px; width: 14px; height: 14px;" /> </a> </th> <th style="text-align: center; width: 24px;">
$pdf->SetFont('Arial', '', 9); for ($a = 0; $a < $MaxConto; $a++) { if ($ScDare[$a]['id_sottoconto'] != "") { $SubTotD = GetRows("tab_dett_piano_conti", "id_sottoconto = '" . $ScDare[$a]['id_sottoconto'] . "'", "", $db, 1, "sum(importo_d) as tot_dare, sum(importo_a) as tot_avere"); $SubTot = sprintf("%.2f", $SubTotD[0]['tot_dare'] - $SubTotD[0]['tot_avere']); $TotContoD += $SubTotD[0]['tot_dare'] - $SubTotD[0]['tot_avere']; $TotDare += $SubTot; $pdf->Cell('13', '4', "(" . $ScDare[$a]['codice_sottoconto'] . ")", 0); $pdf->Cell('70', '4', $ScDare[$a]['descr_sottoconto'], 0); $pdf->Cell('17', '4', $SubTot, 'R', '', 'R'); } else { $pdf->Cell('100', '4', '', 'R'); //$pdf->Cell('100', '4', 'Totale Conto D: ' , 1, '', 'R'); } if ($ScAvere[$a]['id_sottoconto'] != "") { $SubTotA = GetRows("tab_dett_piano_conti", "id_sottoconto = '" . $ScAvere[$a]['id_sottoconto'] . "'", "", $db, 1, "sum(importo_d) as tot_dare, sum(importo_a) as tot_avere"); $SubTot = sprintf("%.2f", $SubTotA[0]['tot_avere'] - $SubTotA[0]['tot_dare']); $TotContoA += $SubTotA[0]['tot_avere'] - $SubTotA[0]['tot_dare']; $TotAvere += $SubTot; $pdf->Cell('13', '4', "(" . $ScAvere[$a]['codice_sottoconto'] . ")", 0); $pdf->Cell('70', '4', $ScAvere[$a]['descr_sottoconto'], 0); $pdf->Cell('17', '4', $SubTot, '', '', 'R'); } else { $pdf->Cell('100', '4', '', 0); } $pdf->Ln(); } $pdf->SetFont('Arial', 'B', 9); if ($SpDare[$i] != "") { $TotContoD = sprintf("%.2f", $TotContoD); $pdf->Cell('83', '4', 'Totale Conto:', 'T', '', 'R');
function CheckDettaglioRequest($db, $IdFiliale, $OutputType = "compilazione") { // Azzero l'array del consuntivo $consuntivo = array(); $consuntivo['sp_mon'] = 0; $consuntivo['sp_las'] = 0; $consuntivo['sp_bar'] = 0; $consuntivo['sp_lett'] = 0; $consuntivo['sp_altro_hw'] = 0; $consuntivo['sos_mon'] = 0; $consuntivo['sos_las'] = 0; $consuntivo['sos_bar'] = 0; $consuntivo['sos_lett'] = 0; // Estraggo il contenuto della request richiesta $request = GetRows("view_requests", "id_filiale = '" . $IdFiliale . "'", "", $db, 1); // Estraggo il dettaglio della request richiesta $dettaglio = GetRows("view_macchine_assegnate", "id_request = '" . $request[0]['id_request'] . "'", "tipo_mch", $db, 1); /* * Verifica del tipo di server richiesto e consegnato: */ if (preg_match(Incident, $request[0]['i_server'])) { // E' presente un incident per il server portato in filiale: $srv_richiesto = "Riciclato"; //$consuntivo['server'] = "Riciclato"; } else { // il server è nuovo: $srv_richiesto = "Nuovo"; //$consuntivo['server'] = "Nuovo"; } /* * Verifica il dettaglio della request: */ echo "[Debug]: totale pezzi: " . count($dettaglio) . " <br />"; if (count($dettaglio) > 0) { //echo "[Debug]: totale pezzi: " . count($dettaglio) . " <br />"; $RequestString = ""; $n_pz = 0; foreach ($dettaglio as $key => $field) { // Server: if ($field['tipo_mch'] == "Server" && $field['provenienza'] == "FORNITORE") { // il server è nuovo: $consuntivo['sp_srv_new'] += 1; // spedizione server nuovo $consuntivo['st_srv'] += 1; // staging $consuntivo['sos_srv'] += 1; // sostituzione $n_pz += 1; } if ($field['tipo_mch'] == "Server" && $field['provenienza'] == "MAINTENANCE") { //echo "[Debug]: il server proviene dal polmone // spedizione server da maintenance $consuntivo['qi_server'] += 1; /* * se il server non è nuovo non ha nè spedizione * nè staging nè sostituzione */ $consuntivo['sp_srv_new'] = 0; $consuntivo['st_srv'] = 0; $consuntivo['sos_srv'] = 0; $n_pz += 1; } if ($field['tipo_mch'] == "Server" && $field['provenienza'] == "DA FILIALE") { /* * il server è riciclato, * verifico su quante request corrisponde */ //echo "[Debug]: il server è riciclato, verifico su //quante request corrisponde <br />"; $ck_srv = GetRows("tab_dett_requests", "id_macchina = '" . $field['id_macchina'] . "'" . " AND id_request != '" . $_SESSION['rollout']['id_request'] . "'", "", $db, 1); if (count($ck_srv) > 0) { //echo "[Debug]: il server sta tornando in filiale come nuovo <br />"; //$consuntivo['qi_server'] += 1; //$n_pz += 1; } else { //echo "[Debug]: altrimenti il server è vecchio <br />"; if ($consuntivo['sp_srv_new'] > 0) { /* se la request prevede la sostituzione del * server vecchio con uno nuovo * allora bisogna considerare il ritiro del vecchio server */ $consuntivo['rit_srv'] += 1; } $n_pz += 1; } } if (trim($field['provenienza']) == "FORNITORE") { // switch tipo mch // case "Desktop": // break; } // Pdl Nuovi sostituzione: if ($field['tipo_mch'] == "Desktop" && trim($field['provenienza']) == "FORNITORE") { //echo "[Debug]: Pdl nuovo in sostituzione <br />"; //$sess_st_pdl += 1; $consuntivo['sp_pdl'] += 1; // spedizione $consuntivo['st_pdl'] += 1; // staging $consuntivo['sos_pdl'] += 1; // sostituzione $consuntivo['dis_pdl'] = $consuntivo['rit_pdl'] - $consuntivo['sos_pdl']; $n_pz += 1; } // Monitor Nuovi if ($field['tipo_mch'] == "Monitor" && trim($field['provenienza']) == "FORNITORE") { //echo "[Debug]: Pdl nuovo in sostituzione <br />"; //$sess_st_pdl += 1; $consuntivo['sp_mon'] += 1; // spedizione $consuntivo['sos_mon'] += 1; // sostituzione $n_pz += 1; } // Prt laser nuove: if ($field['tipo_mch'] == "Stampante laser" && trim($field['provenienza']) == "FORNITORE") { //echo "[Debug]: printer laser nuova in sostituzione <br />"; $consuntivo['sp_las'] += 1; $consuntivo['sos_las'] += 1; $n_pz += 1; } // Prt lan nuove: if ($field['tipo_mch'] == "Stampante di rete" && trim($field['provenienza']) == "FORNITORE") { //echo "[Debug]: printer di rete nuova in sostituzione <br />"; $consuntivo['sp_prt_lan'] += 1; $consuntivo['sos_prt_lan'] += 1; $n_pz += 1; } // lettore assegni: if ($field['tipo_mch'] == "Lettore assegni" && trim($field['provenienza']) == "FORNITORE") { //echo "[Debug]: lettore assegni nuovo in sostituzione <br />"; $consuntivo['sp_lett'] += 1; $consuntivo['sos_lett'] += 1; $n_pz += 1; } // lettore barcode: if ($field['tipo_mch'] == "Lettore barcode" && trim($field['provenienza']) == "FORNITORE") { //echo "[Debug]: lettore barcode nuovo in sostituzione <br />"; $consuntivo['sp_lett'] += 1; $consuntivo['sos_lett'] += 1; $n_pz += 1; } // altro hw nuovo con provenienza fornitore (sp_altro_hw): if ($field['tipo_mch'] == "Lettore barcode" && trim($field['provenienza']) == "FORNITORE") { //echo "[Debug]: lettore barcode nuovo in sostituzione <br />"; $consuntivo['sp_lett'] += 1; $consuntivo['sos_lett'] += 1; $n_pz += 1; } /* * Ritiro pdl old: * * tipo: 'Desktop' con provenienza 'DA FILIALE' * oppure inserimento rapido materiale vecchio * quindi con id_macchina == 'new' */ if ($field['tipo_mch'] == "Desktop" && trim($field['provenienza']) == "DA FILIALE") { //echo "[Debug]: ritito pdl old <br />"; $consuntivo['rit_pdl'] += 1; $consuntivo['dis_pdl'] = $consuntivo['rit_pdl'] - $consuntivo['sos_pdl']; $n_pz += 1; } // Ritiro monitor if (($field['tipo_mch'] == "Monitor Lcd" || $field['tipo_mch'] == "Monitor Crt") && trim($field['provenienza']) == "DA FILIALE") { //echo "[Debug]: ritito monitor <br />"; $consuntivo['rit_mon'] += 1; $consuntivo['dis_mon'] = $consuntivo['rit_mon'] - $consuntivo['sos_mon']; $n_pz += 1; } // Ritiro lettorini if ($field['tipo_mch'] == "Lettore assegni" && trim($field['provenienza']) == "DA FILIALE") { //echo "[Debug]: ritiro lettore assegni <br />"; $consuntivo['rit_let'] += 1; $n_pz += 1; } // Ritiro stampanti di cassa if ($field['tipo_mch'] == "Stampante di cassa" && trim($field['provenienza']) == "DA FILIALE") { //echo "[Debug]: ritiro stampante di cassa <br />"; $consuntivo['rit_cas'] += 1; $n_pz += 1; } // Ritiro stampanti laser if ($field['tipo_mch'] == "Stampante laser" && trim($field['provenienza']) == "DA FILIALE") { //echo "[Debug]: ritiro stampante laser <br />"; $consuntivo['rit_las'] += 1; $consuntivo['dis_las'] = ""; //($consuntivo['rit_las']-$request[0]['dis_las']); $n_pz += 1; } } echo "[Debug]: dis_pdl: " . $consuntivo['dis_pdl'] . " <br />"; echo "[Debug]: dis_mon: " . $consuntivo['dis_mon'] . " impossibile conteggiare <br />"; echo "[Debug]: dis_las: " . $consuntivo['dis_las'] . " impossibile conteggiare <br />"; /* echo "<pre>"; print_r($consuntivo); echo "</pre>"; */ ?> <table class="dettaglio" style="width: 50%;" rules="all"> <tr> <th colspan="5"> Consuntivo Filiale: <?php echo $request[0]['den']; ?> <a onclick="Javascript: go('home.php?act=rollout&reset=0&tomod=<?php echo $request[0]['id_request']; ?> '); void(0);" title="Compila Dettaglio Request"> <img src="/Images/Links/arch.png" alt="arch" /> </a> <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> <tr><th colspan="5"><br /></th></tr> <tr> <th colspan="5"> Spedizioni: <label><?php printf("( %.2f € pezzo )", Spedizioni); ?> </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"> <?php //echo $request[0]['sp_srv_new']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php //echo $consuntivo['sp_srv_new']; ?> </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;"> <?php //printf("%.2f €", ($consuntivo['sp_srv_new']*Spedizioni)); ?> </td> </tr> !--> <tr> <td style="text-align: right;"><label>Pdl Nuovi:</label></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"> <label><?php echo $consuntivo['sp_pdl'] - $request[0]['sp_pdl']; ?> </label> </td> <td style="text-align: center;"> <label class="ok"> <?php if ($consuntivo['sp_pdl'] * Spedizioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sp_pdl'] * Spedizioni); } ?> </label> </td> </tr> <tr> <td style="text-align: right;">Monitor:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sp_mon']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sp_mon']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['sp_mon'] - $request[0]['sp_mon']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['sp_mon'] * Spedizioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sp_mon'] * Spedizioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Stampante Laser:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sp_las']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sp_las']; // aggiungere check sul dettaglio ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['sp_las'] - $request[0]['sp_las']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['sp_las'] * Spedizioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sp_las'] * Spedizioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Lettore Barcode:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sp_bar']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sp_bar']; // aggiungere check sul dettaglio ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['sp_bar'] - $request[0]['sp_bar']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['sp_bar'] * Spedizioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sp_bar'] * Spedizioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Lettore Assegni:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sp_lett']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sp_lett']; // aggiungere check sul dettaglio ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['sp_lett'] - $request[0]['sp_lett']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['sp_lett'] * Spedizioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sp_lett'] * Spedizioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Stampante di rete:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sp_prt_lan']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sp_prt_lan']; ?> </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;"> <?php if ($consuntivo['sp_prt_lan'] * Spedizioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sp_prt_lan'] * Spedizioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Altro Hardware:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sp_altro_hw']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sp_altro_hw']; // aggiungere check sul dettaglio ?> </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;"> <?php if ($consuntivo['sp_altro_hw'] * Spedizioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sp_altro_hw'] * Spedizioni); } ?> </td> </tr> <tr><th colspan="5"><br /></th></tr> <tr> <th colspan="5"> Staging: <label><?php printf("( %.2f € pezzo )", Staging); ?> </label> </th> </tr> <tr> <td style="text-align: center;"><label>Tipo Macchina:</label></td> <td style="text-align: center;"><label>Previsti:</label></td> <td style="text-align: center;"><label>Effettivi:</label></td> <td style="text-align: center;"><label>Bilancio:</label></td> <td style="text-align: center;"><label>Subtotale:</label></td> </tr> <!--<tr> <td style="text-align: right;">Server Nuovo:</td> <td style="text-align: center;" title="Previsti"> <?php //echo $request[0]['st_srv']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php //echo $consuntivo['st_srv']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php //echo ($consuntivo['st_srv']-$request[0]['st_srv']); ?> </td> <td style="text-align: center;"> <?php //printf("%.2f €", ($consuntivo['st_srv']*Staging)); ?> </td> </tr>!--> <tr> <td style="text-align: right;">Pdl Nuovi:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['st_pdl']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['st_pdl']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['st_pdl'] - $request[0]['st_pdl']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['st_pdl'] * Staging == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['st_pdl'] * Staging); } ?> </td> </tr> <tr><th colspan="5"><br /></th></tr> <tr> <th colspan="5"> Sostituzioni: <label><?php printf("( %.2f € pezzo )", Sostituzioni); ?> </label> </th> </tr> <tr> <td style="text-align: center;"><label>Tipo Macchina:</label></td> <td style="text-align: center;"><label>Previsti:</label></td> <td style="text-align: center;"><label>Effettivi:</label></td> <td style="text-align: center;"><label>Bilancio:</label></td> <td style="text-align: center;"><label>Subtotale:</label></td> </tr> <!--<tr> <td style="text-align: right;">Server:</td> <td style="text-align: center;" title="Previsti"> <?php //echo $request[0]['sos_srv']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?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;"> <?php //printf("%.2f €", ($consuntivo['sos_srv']*Sostituzioni)); ?> </td> </tr>!--> <tr> <td style="text-align: right;">Pdl:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sos_pdl']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sos_pdl']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['sos_pdl'] - $request[0]['sos_pdl']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['sos_pdl'] * Sostituzioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sos_pdl'] * Sostituzioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Monitor:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sos_mon']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sos_mon']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['sos_mon'] - $request[0]['sos_mon']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['sos_mon'] * Sostituzioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sos_mon'] * Sostituzioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Stampante di rete:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sos_prt_lan']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sos_prt_lan']; ?> </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;"> <?php if ($consuntivo['sos_prt_lan'] * Sostituzioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sos_prt_lan'] * Sostituzioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Stampante laser:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sos_las']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sos_las']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['sos_las'] - $request[0]['sos_las']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['sos_las'] * Sostituzioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sos_las'] * Sostituzioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Lettore Assegni:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sos_lett']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sos_lett']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['sos_lett'] - $request[0]['sos_lett']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['sos_lett'] * Sostituzioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sos_lett'] * Sostituzioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Lettore Barcode:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['sos_bar']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['sos_bar']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['sos_bar'] - $request[0]['sos_bar']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['sos_bar'] * Sostituzioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['sos_bar'] * Sostituzioni); } ?> </td> </tr> <tr><th colspan="5"><br /></th></tr> <tr> <th colspan="5"> Riconfigurazioni: <label><?php printf("( %.2f € pezzo )", Riconfigurazioni); ?> </label> </th> </tr> <tr> <td style="text-align: center;"><label>Tipo Macchina:</label></td> <td style="text-align: center;"><label>Previsti:</label></td> <td style="text-align: center;"><label>Effettivi:</label></td> <td style="text-align: center;"><label>Bilancio:</label></td> <td style="text-align: center;"><label>Subtotale:</label></td> </tr> <tr> <td style="text-align: right;">Stampante di rete:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['ric_prt_lan']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?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']; ?> </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;"> <?php if ($request[0]['ric_prt_lan'] * Riconfigurazioni == 0) { echo "-"; } else { printf("%.2f €", $request[0]['ric_prt_lan'] * Riconfigurazioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Multifunzione:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['ric_multi']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?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']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $request[0]['ric_multi'] - $request[0]['ric_multi']; ?> </td> <td style="text-align: center;"> <?php if ($request[0]['ric_multi'] * Riconfigurazioni == 0) { echo "-"; } else { printf("%.2f €", $request[0]['ric_multi'] * Riconfigurazioni); } ?> </td> </tr> <tr><th colspan="5"><br /></th></tr> <tr> <th colspan="5"> Disinstallazioni: <label><?php printf("( %.2f € pezzo )", Disinstallazioni); ?> </label> </th> </tr> <tr> <td style="text-align: center;"><label>Tipo Macchina:</label></td> <td style="text-align: center;"><label>Previsti:</label></td> <td style="text-align: center;"><label>Effettivi:</label></td> <td style="text-align: center;"><label>Bilancio:</label></td> <td style="text-align: center;"><label>Subtotale:</label></td> </tr> <tr> <td style="text-align: right;">Server:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['dis_srv']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['dis_srv']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['dis_srv'] - $request[0]['dis_srv']; ?> </td> <td style="text-align: center;"> <?php if ($request[0]['dis_srv'] * Disinstallazioni == 0) { echo "-"; } else { printf("%.2f €", $request[0]['dis_srv'] * Disinstallazioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Pdl:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['dis_pdl']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['dis_pdl']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['dis_pdl'] - $request[0]['dis_pdl']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['dis_pdl'] * Disinstallazioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['dis_pdl'] * Disinstallazioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Monitor:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['dis_mon']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['dis_mon']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['dis_mon'] - $request[0]['dis_mon']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['dis_mon'] * Disinstallazioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['dis_mon'] * Disinstallazioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Stampante laser:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['dis_las']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['dis_las']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['dis_las'] - $request[0]['dis_las']; ?> </td> <td style="text-align: center;"> <?php if ($consuntivo['dis_las'] * Disinstallazioni == 0) { echo "-"; } else { printf("%.2f €", $consuntivo['dis_las'] * Disinstallazioni); } ?> </td> </tr> <tr> <td style="text-align: right;">Stampante di cassa:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['dis_cas']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['dis_cas']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['dis_cas'] - $request[0]['dis_cas']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Lettore Assegni:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['dis_let']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['dis_let']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['dis_let'] - $request[0]['dis_let']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Lettore Barcode:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['dis_bar']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['dis_bar']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['dis_bar'] - $request[0]['dis_bar']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Fax:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['dis_fax']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['dis_fax']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['dis_fax'] - $request[0]['dis_fax']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Altro Hardware:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['dis_altro_hw']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['dis_altro_hw']; ?> </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;"> subtotale </td> </tr> <tr><th colspan="5"><br /></th></tr> <tr> <th colspan="5"> Ritiri: <label><?php printf("( %.2f € pezzo )", Ritiri); ?> </label> </th> </tr> <tr> <td style="text-align: center;"><label>Tipo Macchina:</label></td> <td style="text-align: center;"><label>Previsti:</label></td> <td style="text-align: center;"><label>Effettivi:</label></td> <td style="text-align: center;"><label>Bilancio:</label></td> <td style="text-align: center;"><label>Subtotale:</label></td> </tr> <tr> <td style="text-align: right;">Server:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_srv']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_srv']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['rit_srv'] - $request[0]['rit_srv']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Pdl:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_pdl']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_pdl']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['rit_pdl'] - $request[0]['rit_pdl']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Monitor:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_mon']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_mon']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['rit_mon'] - $request[0]['rit_mon']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Stampante laser:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_las']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_las']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['rit_las'] - $request[0]['rit_las']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Stampante di rete:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_prt_lan']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_prt_lan']; ?> </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;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Stampante di cassa:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_cas']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_cas']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['rit_cas'] - $request[0]['rit_cas']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Lettore Assegni:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_let']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_let']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['rit_let'] - $request[0]['rit_let']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Lettore Barcode:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_bar']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_bar']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['rit_bar'] - $request[0]['rit_bar']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Fax:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_fax']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_fax']; ?> </td> <td style="text-align: center;" title="Bilancio"> <?php echo $consuntivo['rit_fax'] - $request[0]['rit_fax']; ?> </td> <td style="text-align: center;"> subtotale </td> </tr> <tr> <td style="text-align: right;">Altro Hardware:</td> <td style="text-align: center;" title="Previsti"> <?php echo $request[0]['rit_altro_hw']; ?> </td> <td style="text-align: center;" title="Effettivi"> <?php echo $consuntivo['rit_altro_hw']; ?> </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;"> subtotale </td> </tr> </table> <?php if ($consuntivo['sp_srv_new'] > 0 && $consuntivo['rit_srv'] <= 0) { echo "[Debug]: errore, manca il server ritirato <br />"; } echo "[Debug]: totale pezzi analizzati: {$n_pz} <br />"; //echo "[Debug]: valore ritiri: " . ($n_pz*1.00) . " € <br />"; } switch ($OutputType) { case "compilazione": if (is_numeric($_SESSION['rollout']['id_request'])) { /* 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 />"; */ //~ print_r($res); //~ echo "<br />"; if (intval($res[0]['i_server']) <= 0) { $res[0]['i_server'] = 1; } // Composizione stringhe di verifica: if ($sess_srv != $res[0]['i_server']) { $RequestString .= "<label class=\"err\">Server Nuovi: {$sess_srv}" . " / " . $res[0]['i_server'] . "</label>, "; } else { $RequestString .= "<label class=\"ok\">Server Nuovi: {$sess_srv}" . " / " . $res[0]['i_server'] . "</label>, "; } if ($sess_st_pdl != $res[0]['sos_pdl']) { $RequestString .= "<label class=\"err\">Client Nuovi: {$sess_st_pdl}" . " / " . $res[0]['sos_pdl'] . "</label>, "; } else { $RequestString .= "<label class=\"ok\">Client Nuovi: {$sess_st_pdl}" . " / " . $res[0]['sos_pdl'] . "</label>, "; } if ($sess_sos_prt_lan != $res[0]['sos_prt_lan']) { $RequestString .= "<label class=\"err\">Stampanti di Rete Nuove: {$sess_sos_prt_lan}" . " / " . $res[0]['sos_prt_lan'] . "</label>,<br />"; } else { $RequestString .= "<label class=\"ok\">Stampanti di Rete Nuove: {$sess_sos_prt_lan}" . " / " . $res[0]['sos_prt_lan'] . "</label>,<br />"; } if ($sess_rit_srv != "1") { $RequestString .= "<label class=\"err\">Server Vecchi: {$sess_rit_srv}" . " / 1</label>, "; } else { $RequestString .= "<label class=\"ok\">Server Vecchi: {$sess_rit_srv}" . " / 1</label>, "; } if ($sess_rit_pdl != $res[0]['rit_pdl']) { $RequestString .= "<label class=\"err\">Client Vecchi: {$sess_rit_pdl}" . " / " . $res[0]['rit_pdl'] . "</label>, <br />"; } else { $RequestString .= " <label class=\"ok\">Client Vecchi: {$sess_rit_pdl}" . " / " . $res[0]['rit_pdl'] . "</label>, <br />"; } if ($sess_rit_mon != $res[0]['rit_mon']) { $RequestString .= "<label class=\"err\">Monitor Vecchi: {$sess_rit_mon}" . " / " . $res[0]['rit_mon'] . "</label>, "; } else { $RequestString .= "<label class=\"ok\">Monitor Vecchi: {$sess_rit_mon}" . " / " . $res[0]['rit_mon'] . "</label>, "; } if ($sess_rit_let != $res[0]['rit_let']) { $RequestString .= "<label class=\"err\">Lettore Assegni Vecchi: {$sess_rit_let}" . " / " . $res[0]['rit_let'] . "</label>, <br />"; } else { $RequestString .= " <label class=\"ok\">Lettore Assegni Vecchi: {$sess_rit_let}" . " / " . $res[0]['rit_let'] . "</label>, <br />"; } if ($sess_rit_cas != $res[0]['rit_cas']) { $RequestString .= "<label class=\"err\">Stampanti di Cassa Vecchie: {$sess_rit_cas}" . " / " . $res[0]['rit_cas'] . "</label>, "; } else { $RequestString .= "<label class=\"ok\">Stampanti di Cassa Vecchie: {$sess_rit_cas}" . " / " . $res[0]['rit_cas'] . "</label>, "; } if ($sess_rit_las != $res[0]['rit_las']) { $RequestString .= "<label class=\"err\">Stampanti Laser Vecchie: {$sess_rit_las}" . " / " . $res[0]['rit_las'] . "</label>,<br />"; } else { $RequestString .= " <label class=\"ok\">Stampanti Laser Vecchie: {$sess_rit_las}" . " / " . $res[0]['rit_las'] . "</label>,<br />"; } // Fine sezione verifica compilazione. } break; case "consuntivo": //echo "[Debug]: caso consuntivo <br />"; break; } return array('request' => $request[0], 'consuntivo' => $consuntivo); }
for ($i = 0; $i < $tmpRow->ToNumDist; ++$i) { CalcQualRank($i, $divOld . $clOld); CalcQualRank($i, $div . $cl); } // individuale abs MakeIndAbs(); } // Ritorno l'elenco di tutte le classi $Select = "SELECT ClId FROM Classes WHERE ClTournament=" . StrSafe_DB($_SESSION['TourId']) . " ORDER BY ClViewOrder ASC "; $Rs = safe_r_sql($Select); if (safe_num_rows($Rs) > 0) { while ($Row = safe_fetch($Rs)) { $AllClasses .= '<cl_id>' . $Row->ClId . '</cl_id>' . "\n"; } } } else { $Errore = 1; } } else { $Errore = 1; } if (!debug) { header('Content-Type: text/xml'); } print '<response>' . "\n"; print '<error>' . $Errore . '</error>' . "\n"; print '<PARAM>' . "\n"; print $AllClasses; print '</PARAM>' . "\n"; print GetRows($_REQUEST['EnId']); print '</response>' . "\n";
} if (!$Rs) { $Errore = 1; } } //TODO (*) qui andrebbe il codice per aggiornare la rank e le squadre secondo EventClass se $Id!=0 // In ogni caso salvo la sessione del tizio $Update = "UPDATE Qualifications SET " . "QuSession=" . StrSafe_DB($_REQUEST['d_q_QuSession']) . ", " . "QuTargetNo=" . StrSafe_DB($_REQUEST['d_q_QuSession'] . $_REQUEST['d_q_QuTargetNo']) . " " . "WHERE QuId=" . StrSafe_DB($Id) . " "; $Rs = safe_w_sql($Update); if (debug) { print $Update . '<br><br>'; } if (!$Rs) { $Errore = 1; } } if (!debug) { header('Content-Type: text/xml'); } print '<response>'; print '<PARAM>'; print '<confirm_msg1><![CDATA[' . get_text('Archer') . ']]></confirm_msg1>'; print '<confirm_msg2><![CDATA[' . get_text('Country') . ']]></confirm_msg2>'; print '<confirm_msg3><![CDATA[' . get_text('OpDelete', 'Tournament') . ']]></confirm_msg3>'; print '<confirm_msg4><![CDATA[' . get_text('MsgAreYouSure') . ']]></confirm_msg4>'; print '</PARAM>'; print '<error>' . $Errore . '</error>'; print '<op>' . $Op . '</op>'; print GetRows($Id); print $xml; print '</response>';
$Rs = safe_r_sql($Select); if (safe_num_rows($Rs) > 0) { while ($Row = safe_fetch($Rs)) { $AllClasses .= '<cl_id><![CDATA[' . $Row->ClId . ']]></cl_id>' . "\n"; } } } // Produco l'xml di ritorno if (!debug) { header('Content-Type: text/xml; charset=UTF-8'); } print '<response>' . "\n"; print '<error>' . $Errore . '</error>' . "\n"; if ($Errore == 0) { print '<PARAM>' . "\n"; print $Sessions; print $Divisions; print $AllClasses; print $SubClasses; print '<confirm_msg1><![CDATA[' . get_text('Archer') . ']]></confirm_msg1>'; print '<confirm_msg2><![CDATA[' . get_text('Country') . ']]></confirm_msg2>'; print '<confirm_msg3><![CDATA[' . get_text('OpDelete', 'Tournament') . ']]></confirm_msg3>'; print '<confirm_msg4><![CDATA[' . get_text('MsgAreYouSure') . ']]></confirm_msg4>'; print '</PARAM>' . "\n"; if ($OrderBy != '') { print GetRows($EnId, $OrderBy); } else { print GetRows($EnId); } } print '</response>' . "\n";
<?php require_once "{$root}/Function/DataTime.php"; // Define variables $Values = array(50, 90, 30, 155, 50, 40, 320, 50, 40, 86, 240, 128, 650, 540, 320, 87, 99); $var = GetRows("tab_chiamate group by data_att", "", "data_att", $db, 0, "count(id_chiamata) as c_day, data_att"); $x = array(); $y = array(); foreach ($var as $key => $field) { array_push($x, $field['c_day']); array_push($y, $field['data_att']); } /* echo "<pre>x:"; print_r($x); echo "</pre>"; echo "<pre>y:"; print_r($y); echo "</pre>"; */ $imgWidth = 1250; $imgHeight = 300; $grid = 60; $graphspacing = 0.05; //Creation of new array with hight adjusted values while (list($key, $val) = each($x)) { if ($val > $max) { $max = $val; } }
<?php $root = substr($_SERVER['DOCUMENT_ROOT'], 0, -1); require_once "{$root}/Function/Db.php"; require_once "{$root}/Function/Debug.php"; require_once "{$root}/Function/DataTime.php"; require_once "{$root}/Function/Strings.php"; $Dettaglio = GetRows("view_call", "id_chiamata = '" . $_GET['tovis'] . "'", "", $db); ?> <table style="width: 100%;" class="form"> <tr> <th colspan="8" style="text-align: right;"> <a onclick="Javscript: document.getElementById('<?php echo $_GET['target']; ?> ').style.display = 'none';"> <img src="img/exit.png" alt="chiudi" /> Chiudi Dettaglio </a> </th> </tr> <tr><th colspan="2"><br /></th></tr> <tr><th colspan="2">Dettaglio Attività:</th></tr> <tr><th colspan="2"><hr /></th></tr> <tr> <td style="text-align: right;">N.Call: </td> <td>
//~ Escludo dalla selezione articoli gia' composti.AND ck_com = '1' ???? $Tab = "tab_conti, tab_sottoconti"; $Where = "tab_conti.id_conto = tab_sottoconti.id_conto"; $val = ModoRicerca($_POST['descr'], "tutto"); // Sostituisce agli spazi nella ricerca con "%" $temp_val = explode(" ", $val); $val = join("%", $temp_val); $Where .= " AND tab_sottoconti.descr_sottoconto LIKE '" . $val . "' "; /* * Se è stata scelta una categoria dal /Images/Links/ * usala per filtrare i risultati: */ if ($_POST['id_conto'] != "%") { $Where .= "AND tab_sottoconti.id_conto = '" . $_POST['id_conto'] . "'"; } $Sottoconti = GetRows($Tab, $Where, "descr_sottoconto", $db); } ?> <div id="search-form"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> "> <table class="form" width="100%"> <tr> <th colspan="3">Ricerca Conto:</th> <!--<td colspan="2" style="text-align: right;"> /* * 12/08/2009 17:13:22 CEST Claudio Giordano *
<?php if ($field['id_sottoconto'] != '' && $Conto[0]['req_anag'] == 0) { ?> <td> <a onclick="javascript: popUpWindow('SelezionaAnagrafica', 'frm_ricerca_avanzata.php?subact=piano_conti&key=<?php echo $key; ?> ', '300', '250', '870', '500');" > <?php if ($field['id_anagrafica'] == '') { ?> Seleziona Anagrafica <?php } else { $Anagrafica = GetRows("tab_anagrafica", "id_anag = '" . $field['id_anagrafica'] . "'", 'ragione_sociale', $db); echo $Anagrafica[0]['ragione_sociale']; } ?> </a> <?php if ($field['id_anagrafica'] != '') { ?> <a onclick="javascript: go_conf2('Eliminare il riferimento all\'anagrafica?', '?act=piano_conti&delanag=<?php echo $key; if (isset($_GET['tomod'])) { echo "&tomod=" . $_GET['tomod']; } ?> '); void(0);"
$Stati = GetRows("tab_stato_mch", "", "stato_mch", $db, 1); /* echo "<pre>"; print_r($Stati); echo "</pre>"; */ //Padding::Padding ($top, $right, $bottom, $left) define("ChartPath", "tmp/chart.png"); define("ChartWidth", 1000); define("ChartHeight", 400); $chart = new PieChart(ChartWidth, ChartHeight); $chart->getPlot()->setGraphPadding(new Padding("5", "5", "5", "5")); $chart->setTitle("Statistiche Magazzino RollOut"); $dataSet = new XYDataSet(); foreach ($Stati as $key => $field) { $stat = GetRows("tab_macchine", "id_stato = '" . $field['id_stato_call'] . "'", "", $db, 1, "count(id_macchina) as count"); /* echo "[Debug]: count stato: ".$stat[0]['count']." <br />"; */ $dataSet->addPoint(new Point($field['stato_call'] . " ( " . $stat[0]['count'] . " )", $stat[0]['count'])); } $chart->setDataSet($dataSet); $chart->render(ChartPath); ?> <img src="<?php echo ChartPath; ?> " alt="chart" /> </div>
<th>Data:</th> <th style="text-align: center;">N.Protocollo:</th> <th>Causale:</th> <th style="text-align: center;">N.Movimento:</th> </tr> <tr> <th colspan="2"><br /></th> <th style="text-align: right;">Imponibile:</th> <th style="text-align: right;">Imposta:</th> </tr> <tr><th colspan="8"><hr /></th></tr> <?php foreach ($Risultati as $key => $field) { $Sum4 = GetRows("view_piano_conti", "data_reg = '" . $field['data_reg'] . "' AND desc_iva = '4%'", "desc_iva", $db, 1, "sum(imponibile) as imponibile, sum(imposta) as imposta"); $Sum10 = GetRows("view_piano_conti", "data_reg = '" . $field['data_reg'] . "' AND desc_iva = '10%'", "desc_iva", $db, 1, "sum(imponibile) as imponibile, sum(imposta) as imposta"); $Sum20 = GetRows("view_piano_conti", "data_reg = '" . $field['data_reg'] . "' AND desc_iva = '20%'", "desc_iva", $db, 1, "sum(imponibile) as imponibile, sum(imposta) as imposta"); $ImponibileTot4 += $Sum4[0]['imponibile']; $ImpostaTot4 += $Sum4[0]['imposta']; $ImponibileTot10 += $Sum10[0]['imponibile']; $ImpostaTot10 += $Sum10[0]['imposta']; $ImponibileTot20 += $Sum20[0]['imponibile']; $ImpostaTot20 += $Sum20[0]['imposta']; ?> <tr> <th><?php echo Inverti_Data($field['data_reg']); ?> </th> <th style="text-align: center;"><?php echo $field['n_protocollo']; ?>
function SaveRow($Valori, $Esclusioni, $Tab, $db, $debug = 1, $CkFields = "") { $Unique = 0; //~ echo "[Debug]: CkFields: $CkFields <br />"; /* * Compongo la query con i dati provenienti dall'array del post: */ $q = "INSERT INTO {$Tab} "; $k = "("; $f = ") values ("; if ($Esclusioni != "") { foreach ($Valori as $key => $field) { if (!array_key_exists($key, $Esclusioni)) { $k .= "{$key}, "; $f .= "'" . trim(addslashes(stripslashes($field))) . "', "; } else { if ($debug != 1) { echo "Escludo la key: {$key} dalla Query <br />"; } } } } else { foreach ($Valori as $key => $field) { $k .= "{$key}, "; $f .= "'" . trim(addslashes(stripslashes($field))) . "', "; } } $f .= ");"; $q .= $k . $f; $q = str_replace(", )", ")", $q); /* * Check Verifica Unicità valori: */ $CkWere = ""; if ($CkFields != "") { $CkArray = explode(",", $CkFields); $CkWere .= "("; foreach ($CkArray as $key => $field) { $CkWere .= "{$field} = '" . trim(addslashes(stripslashes($Valori[$field]))) . "' "; if ($key < count($CkArray) - 1) { $CkWere .= "OR "; } } $CkWere .= ")"; $UniqueRows = GetRows($Tab, $CkWere, "", $db, $debug); $Unique = count($UniqueRows); } //~ echo "[Debug]: CkWere: $CkWere <br />"; //~ echo "[Debug]: Unique: $Unique <br />"; if ($debug != 1) { echo "[Debug][SaveRow]: {$q} <br />"; } SessionLog("[Debug][SaveRow]: {$q}", $db); /* * Query completata. */ if ($Unique == 0) { $r = mysql_query($q, $db) or die(StampaErr($q, '[SaveRow] ')); $Status = array(); //$Status[0] = "Debug => Query SaveRow: $q <br />"; $Status[0] = "<label class=\"ok\">Dati inseriti correttamente. (" . date('d/m/Y H:i:s') . ")</label>"; // Recupero l'id dell'ultimo elemento inserito: $Status[1] = mysql_insert_id(); } else { $Status[0] = "<label class=\"err\">Errore, uno dei campi inseriti non " . "risulta univoco, salvataggio annullato.</label> <br />"; $Status[1] = ""; /* $Status[0] .= "<table style=\"width: 100%;\" >"; foreach ($UniqueRows as $UniqueKey => $UniqueField) { $Status[0] .= "<tr>"; foreach ($UniqueField as $key => $field) { $Status[0] .= "<td>" . $field . "</td>"; } $Status[0] .= "</tr>"; } $Status[0] .= "</table>"; */ } $_SESSION['last_query'] = $q; return $Status; }
switch ($_POST['subact']) { case "documenti": if (!isset($_SESSION['documento']['dettaglio'])) { $_SESSION['documento']['dettaglio'] = array(); } array_push($_SESSION['documento']['dettaglio'], array('id' => '-', 'desc' => $_POST['desc'], 'prz' => sprintf("%.2f", $_POST['prz']), 'disp' => '-', 'cod_forn' => '-', 'cod_int' => '-', 'sco' => sprintf("%.2f", $_POST['sco']), 'qta' => sprintf("%.2f", $_POST['qta']))); break; case "piano_conti": if (!isset($_SESSION['piano']['dettaglio'])) { $_SESSION['piano']['dettaglio'] = array(); } array_push($_SESSION['piano']['dettaglio'], array('id' => '', 'da' => '', 'id_anagrafica' => '', 'desc' => $_POST['desc'], 'importo_d' => '', 'importo_a' => '', 'id_iva' => '', 'id_causale' => $_POST['causale'])); break; case "cat_merce": $unic = GetRows("tab_cat_merce", "categoria = '" . $_POST['desc'] . "'", "", $db, 0); $Campi = GetRows($Tab, $Where, $Order, $db); if (count($unic) != 0) { $errori .= "Errore, la categoria è già presente.<br />"; } else { $Valori = array('categoria' => $_POST['desc']); $Status = SaveRow($Valori, "", "tab_cat_merce", $db, 0); // salva -> ricarica lista cat -> aggiorna combo -> nascondi div } break; } //~ Riaggiorno la pagina genitore e chiudo il popup: ?> <!--<script type="text/javascript"> window.opener.location.href="home.php?act=<?php //echo $_GET['subact']; ?>
<?php $root = substr($_SERVER['DOCUMENT_ROOT'], 0, -1); require_once "connection.php"; require_once "{$root}/Function/Db.php"; require_once "{$root}/Function/Debug.php"; require_once "{$root}/Function/Strings.php"; $Province = GetRows("tab_province", "", "Prov", $db); if (isset($_POST['targa'])) { $Comuni = GetRows("tab_comuni", "ID_Prov = '" . $_POST['targa'] . "'", "Comune", $db); } if (isset($_POST['comune'])) { $WhereCom = "tab_comuni.ID = '" . $_POST['comune'] . "' AND tab_comuni.ID_Prov = tab_province.ID "; $Comune = GetRows("tab_comuni, tab_province", $WhereCom, "Comune", $db); } ?> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> "> <table cellpadding="1" cellspacing="1" border="0" style="width: 100%;"> <tr> <th colspan="3">Selezione Locatità</th> </tr> <tr> <td style="text-align: right; width: 4em;"> <label>Provincia:</label> </td> <td> <select name="targa" onchange="Javascript: posta('0',
if ($_GET['tipo'] == "c") { $sottoconto = GetRows("tab_conti", "id_conto = '" . $_GET['tomod'] . "'", "", $db); //~ $_POST['id_conto'] = $_GET['tomod']; $_POST['codice'] = $sottoconto[0]['codice_conto']; $_POST['descrizione'] = $sottoconto[0]['descr_conto']; } else { $sottoconto = GetRows("tab_sottoconti", "id_sottoconto = '" . $_GET['tomod'] . "'", "", $db); $_POST['id_conto'] = $_GET['id_conto']; $_POST['codice'] = $sottoconto[0]['codice_sottoconto']; $_POST['descrizione'] = $sottoconto[0]['descr_sottoconto']; $_POST['req_anag'] = $sottoconto[0]['req_anag']; } } } if (isset($_POST['id_conto']) && $_POST['id_conto'] != "-") { $Sottoconti = GetRows("tab_conti, tab_sottoconti", "tab_conti.id_conto = tab_sottoconti.id_conto AND tab_sottoconti.id_conto like '" . $_POST['id_conto'] . "'", "tab_conti.descr_conto, tab_sottoconti.descr_sottoconto", $db); } ?> <div id="search-form"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> "> <table style="width: 100%;" class="form"> <?php ShowEditBar("Aggiungi/Modifica Conto:", $_GET['tomod'], "new,save", $_GET['act']); ?> <tr>
} $pdf->Ln(); break; case "mastrini": //<!-- Intestazione mastrino !--> $pdf->SetFont('Arial', 'B', 9); if ($field['req_anag'] == 0 && $_GET['tipo'] == "movimenti") { $sc = "(" . $field['codice_sottoconto'] . ") " . $field['ragione_sociale']; } else { $sc = "(" . $field['codice_sottoconto'] . ") " . ucfirst(strtolower($field['descr_sottoconto'])); } $pdf->Cell(200, 4, $sc, 0, 0, ''); $pdf->Ln(); //<!-- Dettaglio mastrino !--> $cond_mastr = "id_sottoconto = '" . $field['id_sottoconto'] . "' {$descr_mastrino} {$interval_reg} {$interval_op}"; $DettaglioConto = GetRows("view_piano_conti", $cond_mastr, "data_reg", $db); $pdf->SetFont('Arial', '', 9); foreach ($DettaglioConto as $key_dett => $field_dett) { $Sottoconto = $field_dett['id_piano_conti'] . " - " . Inverti_Data($field_dett['data_reg']); $TotDare += $field_dett['importo_d']; $TotAvere += $field_dett['importo_a']; if (in_array($field_dett['id_conto'], $SpDare)) { $Saldo = round($TotDare - $TotAvere, 2); } else { $Saldo = round($TotAvere - $TotDare, 2); } if ($field_dett['importo_d'] == "0.00") { $field_dett['importo_d'] = "-"; } if ($field_dett['importo_a'] == "0.00") { $field_dett['importo_a'] = "-";
$_SESSION['offerta']['img-stp'] = $opt_off[0]['img1']; $_SESSION['offerta']['img-case'] = $opt_off[0]['img2']; $_SESSION['offerta']['img-monit'] = $opt_off[0]['img3']; $componenti = $d->GetRows("*", "tab_dett_offerte", "id_offerta = '" . $_GET['id_off'] . "' AND comp != 'acc'"); foreach ($componenti as $key => $field) { $dett_articolo = GetRows("tab_prodotti", "cod_forn = '" . $field['cod_forn'] . "'", "descr", $db); $_SESSION['macchina'][$field['comp']]['id'] = $field['id_articolo']; $_SESSION['macchina'][$field['comp']]['desc'] = $dett_articolo[0]['descr']; $_SESSION['macchina'][$field['comp']]['prz'] = $field['prz']; $_SESSION['macchina'][$field['comp']]['disp'] = $dett_articolo[0]['disp']; $_SESSION['macchina'][$field['comp']]['cod'] = $dett_articolo[0]['cod_forn']; $_SESSION['macchina'][$field['comp']]['qta'] = $field['qta']; } $accessori = GetRows("tab_dett_offerte", "id_offerta = '" . $_GET['id_off'] . "' AND comp = 'acc'", "", $db); foreach ($accessori as $key => $field) { $dett_accessorio = GetRows("tab_prodotti", "cod_forn = '" . $field['cod_forn'] . "'", "descr", $db); array_push($_SESSION['accessori'], array("id" => $field['id_articolo'], "desc" => $dett_accessorio[0]['descr'], "prz" => $field['prz'], "disp" => $dett_accessorio[0]['disp'], "cod" => $dett_accessorio[0]['cod_forn'], "qta" => $field['qta'])); } } $bullet = chr(149); $ImgStp = $_SESSION['img-stp']; $ImgCase = $_SESSION['img-case']; $ImgMonitor = $_SESSION['img-monit']; $LogoRM = "img/RM.jpg"; $Assemblaggio = 35 * 1.2; if (isset($_SESSION['macchina'])) { foreach ($_SESSION['macchina'] as $mch) { $TotOfferta += $mch['prz']; } $TotOfferta = $TotOfferta * 1.3 * 1.2; }