/** * Generate a XHProf Display View given the various params * */ function generate_report() { extract($this->params, EXTR_SKIP); // specific run to display? if ($run) { // run may be a single run or a comma separate list of runs // that'll be aggregated. If "wts" (a comma separated list // of integral weights is specified), the runs will be // aggregated in that ratio. foreach (explode(',', $run) as $run_id) { $this->runs[] = new XHProf_UI\Run($this->dir, $namespace, $run_id); } if ($compare) { $this->runs = array($this->runs[0], new XHProf_UI\Run($this->dir, $namespace, $compare)); if (($data1 = $this->runs[0]->get_data()) && ($data2 = $this->runs[1]->get_data())) { $this->_setup_metrics($data2); return new XHProf_UI\Report\Diff($this, $data1, $data2); } } elseif (count($this->runs) == 1) { if ($data = $this->runs[0]->get_data()) { $this->_setup_metrics($data); return new XHProf_UI\Report\Single($this, $data); } } else { $wts = strlen($wts) > 0 ? explode(',', $wts) : null; if ($data = Compute::aggregate_runs($this, $this->runs, $wts)) { $this->_setup_metrics($data); return new XHProf_UI\Report\Single($this, $data); } } } return false; }
echo "<TD align=\"right\"><input type=\"image\" name=\"del[$k]\" src=\"../../library/images/xbut.gif\" title=\"".$script_transl['delete'].$script_transl['thisrow']."!\" /></td></tr>\n"; } echo "</table>\n"; echo "<div class=\"FacetSeparatorTD\" align=\"center\">$script_transl[2]</div>\n"; echo "<table class=\"Tlarge\">\n"; echo "<input type=\"hidden\" value=\"".$form['numrat']."\" name=\"numrat\">\n"; echo "<input type=\"hidden\" value=\"".$form['expense_vat']."\" name=\"expense_vat\">\n"; echo "<input type=\"hidden\" value=\"".$form['spevar']."\" name=\"spevar\">\n"; echo "<input type=\"hidden\" value=\"".$form['stamp']."\" name=\"stamp\">\n"; echo "<input type=\"hidden\" value=\"".$form['round_stamp']."\" name=\"round_stamp\">\n"; echo "<input type=\"hidden\" value=\"".$form['cauven']."\" name=\"cauven\">\n"; echo "<input type=\"hidden\" value=\"".$form['caucon']."\" name=\"caucon\">\n"; echo "<input type=\"hidden\" value=\"".$form['caumag']."\" name=\"caumag\">\n"; $somma_spese = $form['traspo'] + $form['speban']*$form['numrat'] + $form['spevar']; $calc = new Compute; $calc->add_value_to_VAT_castle($castle,$somma_spese,$form['expense_vat']); if ($calc->total_exc > $admin_aziend['taxstamp_limit'] && $form['virtual_taxstamp'] > 0 ) { $form['taxstamp'] = $admin_aziend['taxstamp']; } echo "<tr>"; echo "<td align=\"right\" class=\"FacetFieldCaptionTD\">$script_transl[26]</td>\n"; echo "<td colspan=\"2\" class=\"FacetDataTD\"><input type=\"text\" name=\"imball\" value=\"".$form['imball']."\" maxlength=\"50\" size=\"25\" class=\"FacetInput\">\n"; $select_spediz = new SelectValue("imballo"); $select_spediz -> output('imball', 'imball'); echo "</td>"; echo "<td align=\"right\" class=\"FacetFieldCaptionTD\">$script_transl[27]</td>\n"; echo "<td colspan=\"3\" class=\"FacetDataTD\"><input type=\"text\" name=\"spediz\" value=\"".$form["spediz"]."\" maxlength=\"50\" size=\"25\" class=\"FacetInput\">\n"; $select_spediz = new SelectValue("spedizione"); $select_spediz -> output('spediz', 'spediz');
function getDocumentsAccounts($type='___',$vat_section=1,$date=false,$protoc=999999999) { global $gTables,$admin_aziend; $calc = new Compute; $type = substr($type,0,1); if ($date){ $p=' AND (YEAR(datfat)*1000000+protoc) <= '.(substr($date,0,4)*1000000+$protoc); $d=' AND datfat <= '.$date; } else { $d=''; $p=''; } $from = $gTables['tesdoc'].' AS tesdoc LEFT JOIN '.$gTables['pagame'].' AS pay ON tesdoc.pagame=pay.codice LEFT JOIN '.$gTables['clfoco'].' AS customer ON tesdoc.clfoco=customer.codice LEFT JOIN '.$gTables['anagra'].' AS anagraf ON customer.id_anagra=anagraf.id'; $where = "id_con = 0 AND seziva = $vat_section AND tipdoc LIKE '$type"."__' $d $p"; $orderby = "datfat ASC, protoc ASC"; $result = gaz_dbi_dyn_query('tesdoc.*, pay.tippag,pay.numrat,pay.incaut,pay.tipdec,pay.giodec,pay.tiprat,pay.mesesc,pay.giosuc,pay.id_bank, customer.codice, customer.speban AS addebitospese, CONCAT(anagraf.ragso1,\' \',anagraf.ragso2) AS ragsoc,CONCAT(anagraf.citspe,\' (\',anagraf.prospe,\')\') AS citta', $from,$where,$orderby); $doc=array(); $ctrlp=0; while ($tes = gaz_dbi_fetch_array($result)) { if ($tes['protoc'] <> $ctrlp) { // la prima testata della fattura if ($ctrlp>0 && ($doc[$ctrlp]['tes']['stamp'] >= 0.01 || $doc[$ctrlp]['tes']['taxstamp'] >= 0.01 )) { // non è il primo ciclo faccio il calcolo dei bolli del pagamento e lo aggiungo ai castelletti $calc->payment_taxstamp($calc->total_imp+$calc->total_vat+$carry-$rit-$ivasplitpay+$taxstamp, $doc[$ctrlp]['tes']['stamp'],$doc[$ctrlp]['tes']['round_stamp']*$doc[$ctrlp]['tes']['numrat']); $calc->add_value_to_VAT_castle($doc[$ctrlp]['vat'],$taxstamp+$calc->pay_taxstamp,$admin_aziend['taxstamp_vat']); $doc[$ctrlp]['vat']=$calc->castle; // aggiungo il castelleto conti if (!isset($doc[$ctrlp]['acc'][$admin_aziend['boleff']])) { $doc[$ctrlp]['acc'][$admin_aziend['boleff']]['import'] = 0; } $doc[$ctrlp]['acc'][$admin_aziend['boleff']]['import'] += $taxstamp+$calc->pay_taxstamp; } $carry=0; $ivasplitpay=0; $cast_vat=array(); $cast_acc=array(); $somma_spese=0; $totimpdoc=0; $totimp_decalc=0.00; $n_vat_decalc=0; $spese_incasso=$tes['numrat']*$tes['speban']; $taxstamp=0; $rit=0; } else { $spese_incasso=0; } // aggiungo il bollo sugli esenti/esclusi se nel DdT c'è ma non è ancora stato mai aggiunto if ($tes['taxstamp']>=0.01 && $taxstamp<0.01) { $taxstamp=$tes['taxstamp']; } if ($tes['virtual_taxstamp'] == 0 || $tes['virtual_taxstamp'] == 3) { // se è a carico dell'emittente non lo aggiungo al castelletto IVA $taxstamp = 0.00; } if ($tes['traspo']>=0.01) { if (!isset($cast_acc[$admin_aziend['imptra']]['import'])) { $cast_acc[$admin_aziend['imptra']]['import'] = $tes['traspo']; } else { $cast_acc[$admin_aziend['imptra']]['import'] += $tes['traspo']; } } if ($spese_incasso>=0.01) { if (!isset($cast_acc[$admin_aziend['impspe']]['import'])) { $cast_acc[$admin_aziend['impspe']]['import'] = $spese_incasso; } else { $cast_acc[$admin_aziend['impspe']]['import'] += $spese_incasso; } } if ($tes['spevar']>=0.01) { if (!isset($cast_acc[$admin_aziend['impvar']]['import'])) { $cast_acc[$admin_aziend['impvar']]['import'] = $tes['spevar']; } else { $cast_acc[$admin_aziend['impvar']]['import'] += $tes['spevar']; } } //recupero i dati righi per creare il castelletto $from = $gTables['rigdoc'].' AS rows LEFT JOIN '.$gTables['aliiva'].' AS vat ON rows.codvat=vat.codice'; $rs_rig = gaz_dbi_dyn_query('rows.*,vat.tipiva AS tipiva',$from, "rows.id_tes = ".$tes['id_tes'],"id_tes DESC"); while ($r = gaz_dbi_fetch_array($rs_rig)) { if ($r['tiprig'] <= 1) {//ma solo se del tipo normale o forfait //calcolo importo rigo $importo = CalcolaImportoRigo($r['quanti'],$r['prelis'],array($r['sconto'],$tes['sconto'])); if ($r['tiprig'] == 1) { $importo = CalcolaImportoRigo(1,$r['prelis'], $tes['sconto']); } //creo il castelletto IVA if (!isset($cast_vat[$r['codvat']]['impcast'])) { $cast_vat[$r['codvat']]['impcast']=0; $cast_vat[$r['codvat']]['ivacast']=0; $cast_vat[$r['codvat']]['periva']=$r['pervat']; $cast_vat[$r['codvat']]['tipiva']=$r['tipiva']; } $cast_vat[$r['codvat']]['impcast']+=$importo; $cast_vat[$r['codvat']]['ivacast']+=round(($importo*$r['pervat'])/ 100,2); $totimpdoc += $importo; //creo il castelletto conti if (!isset($cast_acc[$r['codric']]['import'])) { $cast_acc[$r['codric']]['import'] = 0; } $cast_acc[$r['codric']]['import']+=$importo; $rit+=round($importo*$r['ritenuta']/100,2); // aggiungo all'accumulatore l'eventuale iva non esigibile (split payment PA) if ($r['tipiva']=='T') { $ivasplitpay += round(($importo*$r['pervat'])/ 100,2); } } elseif($r['tiprig'] == 3) { $carry += $r['prelis'] ; } } $doc[$tes['protoc']]['tes']=$tes; $doc[$tes['protoc']]['acc']=$cast_acc; $doc[$tes['protoc']]['car']=$carry; $doc[$tes['protoc']]['isp']=$ivasplitpay; $doc[$tes['protoc']]['rit']=$rit; $somma_spese += $tes['traspo'] + $spese_incasso + $tes['spevar'] ; $calc->add_value_to_VAT_castle($cast_vat,$somma_spese,$tes['expense_vat']); $doc[$tes['protoc']]['vat']=$calc->castle; $ctrlp=$tes['protoc']; } if ($doc[$ctrlp]['tes']['stamp'] >= 0.01 || $taxstamp >= 0.01 ) { // a chiusura dei cicli faccio il calcolo dei bolli del pagamento e lo aggiungo ai castelletti $calc->payment_taxstamp($calc->total_imp+$calc->total_vat+$carry-$rit-$ivasplitpay+$taxstamp, $doc[$ctrlp]['tes']['stamp'],$doc[$ctrlp]['tes']['round_stamp']*$doc[$ctrlp]['tes']['numrat']); // aggiungo al castelletto IVA $calc->add_value_to_VAT_castle($doc[$ctrlp]['vat'],$taxstamp+$calc->pay_taxstamp,$admin_aziend['taxstamp_vat']); $doc[$ctrlp]['vat']=$calc->castle; // aggiungo il castelleto conti if (!isset($doc[$ctrlp]['acc'][$admin_aziend['boleff']])) { $doc[$ctrlp]['acc'][$admin_aziend['boleff']]['import'] = 0; } $doc[$ctrlp]['acc'][$admin_aziend['boleff']]['import'] += $taxstamp+$calc->pay_taxstamp; } return $doc; }
function computeTot($data,$carry,$stamp_percent=false,$round=5) { $vat=0; $tax=0; $sta=0; foreach($data as $k=>$v) { $tax += $v['imponi']; $vat += round($v['imponi']*$v['periva'])/ 100; } $tot=$vat+$tax; if ($stamp_percent) { // è stata passata la percentuale $v_stamp = new Compute; $sta = $v_stamp->payment_taxstamp($tot+$carry,$stamp_percent,$round); $tot+=$v_stamp->pay_taxstamp; } return array('taxable'=>$tax,'vat'=>$vat,'stamp'=>$sta,'tot'=>$tot); }
function setXMLtot() { $calc = new Compute(); $this->totivafat = 0.0; $this->totimpfat = 0.0; $this->totimpmer = 0.0; $this->tot_ritenute = $this->ritenuta; $this->virtual_taxstamp = $this->tesdoc['virtual_taxstamp']; $this->impbol = 0.0; $this->BolloVirtuale = ''; // ovviamente il bollo potrà essere solo virtuale ma comunque lo setto per evidenziare l'errore if ($this->tesdoc['virtual_taxstamp'] == 2 || $this->tesdoc['virtual_taxstamp'] == 3) { // bollo virtualmente assolto $this->BolloVirtuale = 'SI'; } $this->totriport = $this->riporto; $this->speseincasso = $this->tesdoc['speban'] * $this->pagame['numrat']; if (!isset($this->castel)) { $this->castel = array(); } if (!isset($this->totimp_body)) { $this->totimp_body = 0; } $this->totimpmer = $this->totimp_body; $this->totimp_body = 0; if (!isset($this->totimp_doc)) { $this->totimp_doc = 0; } $this->totimpfat = $this->totimp_doc; $this->totimp_doc = 0; $somma_spese = $this->tot_trasporto + $this->speseincasso + $this->tesdoc['spevar']; $calc->add_value_to_VAT_castle($this->body_castle, $somma_spese, $this->tesdoc['expense_vat']); if ($this->tesdoc['stamp'] > 0) { $calc->payment_taxstamp($calc->total_imp + $this->totriport + $calc->total_vat - $this->tot_ritenute + $this->taxstamp - $this->ivasplitpay, $this->tesdoc['stamp'], $this->tesdoc['round_stamp'] * $this->pagame['numrat']); $this->impbol = $calc->pay_taxstamp; } $this->totimpfat = $calc->total_imp; $this->totivafat = $calc->total_vat; // aggiungo gli eventuali bolli al castelletto $chk_taxstamp = true; if ($this->virtual_taxstamp == 0 || $this->virtual_taxstamp == 3) { // se è a carico dell'emittente non lo aggiungo al castelletto IVA $chk_taxstamp = false; } if ($this->impbol >= 0.01 || $this->taxstamp >= 0.01 && $chk_taxstamp) { $this->impbol += $this->taxstamp; $calc->add_value_to_VAT_castle($calc->castle, $this->impbol, $this->azienda['taxstamp_vat']); } elseif (!$chk_taxstamp) { // bollo da non addebitare ma esistente $this->impbol = $this->taxstamp; } $this->cast = $calc->castle; $this->riporto = 0; $this->ritenute = 0; }
function setTotal() { $calc = new Compute(); $this->totivafat = 0.0; $this->totimpfat = 0.0; $this->totimpmer = 0.0; $this->tot_ritenute = $this->ritenuta; $this->virtual_taxstamp = $this->tesdoc['virtual_taxstamp']; $this->impbol = 0.0; $this->totriport = $this->riporto; $this->speseincasso = $this->tesdoc['speban'] * $this->pagame['numrat']; $this->cast = array(); if (!isset($this->castel)) { $this->castel = array(); } if (!isset($this->totimp_body)) { $this->totimp_body = 0; } $this->totimpmer = $this->totimp_body; $this->totimp_body = 0; $somma_spese = $this->tottraspo + $this->speseincasso + $this->tesdoc['spevar']; $calc->add_value_to_VAT_castle($this->body_castle, $somma_spese, $this->tesdoc['expense_vat']); if ($this->tesdoc['stamp'] > 0) { $calc->payment_taxstamp($calc->total_imp + $this->totriport + $calc->total_vat - $calc->total_isp - $this->tot_ritenute + $this->taxstamp, $this->tesdoc['stamp'], $this->tesdoc['round_stamp'] * $this->pagame['numrat']); $this->impbol = $calc->pay_taxstamp; } $this->totimpfat = $calc->total_imp; $this->totivafat = $calc->total_vat; $this->totivasplitpay = $calc->total_isp; // aggiungo gli eventuali bolli al castelletto if ($this->virtual_taxstamp == 0 || $this->virtual_taxstamp == 3) { // se è a carico dell'emittente non lo aggiungo al castelletto IVA $this->taxstamp = 0.0; } if ($this->impbol >= 0.01 || $this->taxstamp >= 0.01) { $calc->add_value_to_VAT_castle($calc->castle, $this->taxstamp + $this->impbol, $this->azienda['taxstamp_vat']); } $this->cast = $calc->castle; $this->riporto = 0; $this->ritenute = 0; $this->castel = array(); }
function getDocumentsBill($upd=false) { global $gTables,$admin_aziend; $calc = new Compute; $from = $gTables['tesdoc'].' AS tesdoc LEFT JOIN '.$gTables['pagame'].' AS pay ON tesdoc.pagame=pay.codice LEFT JOIN '.$gTables['clfoco'].' AS customer ON tesdoc.clfoco=customer.codice LEFT JOIN '.$gTables['anagra'].' AS anagraf ON anagraf.id=customer.id_anagra'; $where = "(tippag = 'B' OR tippag = 'T' OR tippag = 'V') AND geneff = '' AND tipdoc LIKE 'FA_'"; $orderby = "datfat ASC, protoc ASC, id_tes ASC"; $result = gaz_dbi_dyn_query('tesdoc.*, pay.tippag,pay.numrat,pay.tipdec,pay.giodec,pay.tiprat,pay.mesesc,pay.giosuc, customer.codice, customer.speban AS addebitospese, CONCAT(anagraf.ragso1,\' \',anagraf.ragso2) AS ragsoc,CONCAT(anagraf.citspe,\' (\',anagraf.prospe,\')\') AS citta', $from,$where,$orderby); $doc=array(); $ctrlp=0; while ($tes = gaz_dbi_fetch_array($result)) { //il numero di protocollo contiene anche l'anno nei primi 4 numeri $year_prot=intval(substr($tes['datfat'],0,4))*1000000+$tes['protoc']; if ($year_prot <> $ctrlp) { // la prima testata della fattura if ($ctrlp>0 && ($doc[$ctrlp]['tes']['stamp'] >= 0.01 || $taxstamp >= 0.01 )) { // non è il primo ciclo faccio il calcolo dei bolli del pagamento e lo aggiungo ai castelletti $calc->payment_taxstamp($calc->total_imp+$calc->total_vat+$carry-$rit+$taxstamp, $doc[$ctrlp]['tes']['stamp'],$doc[$ctrlp]['tes']['round_stamp']*$doc[$ctrlp]['tes']['numrat']); $calc->add_value_to_VAT_castle($doc[$ctrlp]['vat'],$taxstamp+$calc->pay_taxstamp,$admin_aziend['taxstamp_vat']); $doc[$ctrlp]['vat']=$calc->castle; // aggiungo il castelleto conti if (!isset($doc[$ctrlp]['acc'][$admin_aziend['boleff']])) { $doc[$ctrlp]['acc'][$admin_aziend['boleff']]['import'] = 0; } $doc[$ctrlp]['acc'][$admin_aziend['boleff']]['import'] += $taxstamp+$calc->pay_taxstamp; } $carry=0; $somma_spese=0; $cast_vat=array(); $totimp_decalc=0.00; $n_vat_decalc=0; $totimpdoc=0; $spese_incasso=$tes['numrat']*$tes['speban']; $taxstamp=0; $rit=0; } else { $spese_incasso=0; } // aggiungo il bollo sugli esenti/esclusi se nel DdT c'è ma non è ancora stato mai aggiunto if ($tes['taxstamp']>=0.01 && $taxstamp<0.01) { $taxstamp=$tes['taxstamp']; } if ($tes['virtual_taxstamp'] == 0 || $tes['virtual_taxstamp'] == 3 ) { // se è a carico dell'emittente non lo aggiungo al castelletto IVA $taxstamp = 0.00; } //recupero i dati righi per creare il castelletto $from = $gTables['rigdoc'].' AS rows LEFT JOIN '.$gTables['aliiva'].' AS vat ON rows.codvat=vat.codice'; $rs_rig = gaz_dbi_dyn_query('rows.*,vat.tipiva AS tipiva',$from, "rows.id_tes = ".$tes['id_tes'],"id_tes DESC"); while ($r = gaz_dbi_fetch_array($rs_rig)) { if ($r['tiprig'] <= 1) {//ma solo se del tipo normale o forfait //calcolo importo rigo $importo = CalcolaImportoRigo($r['quanti'],$r['prelis'],array($r['sconto'],$tes['sconto'])); if ($r['tiprig'] == 1) { $importo = CalcolaImportoRigo(1,$r['prelis'], $tes['sconto']); } //creo il castelletto IVA if (!isset($cast_vat[$r['codvat']]['import'])) { $cast_vat[$r['codvat']]['impcast']=0; $cast_vat[$r['codvat']]['ivacast']=round(($importo*$r['pervat'])/ 100,2);; $cast_vat[$r['codvat']]['import']=0; $cast_vat[$r['codvat']]['periva']=$r['pervat']; $cast_vat[$r['codvat']]['tipiva']=$r['tipiva']; } $cast_vat[$r['codvat']]['impcast']+=$importo; $cast_vat[$r['codvat']]['import']+=$importo; $totimpdoc += $importo; $rit+=round($importo*$r['ritenuta']/100,2); } elseif($r['tiprig'] == 3) { $carry += $r['prelis'] ; } } $doc[$year_prot]['tes']=$tes; $doc[$year_prot]['car']=$carry; $doc[$year_prot]['rit']=$rit; $ctrlp=$year_prot; $somma_spese += $tes['traspo'] + $spese_incasso + $tes['spevar'] ; $calc->add_value_to_VAT_castle($cast_vat,$somma_spese,$tes['expense_vat']); $doc[$ctrlp]['vat']=$calc->castle; // segno l'effetto come generato if ($upd) { gaz_dbi_query ("UPDATE ".$gTables['tesdoc']." SET geneff = 'S' WHERE id_tes = ".$tes['id_tes'].";"); } } if ($doc[$ctrlp]['tes']['stamp'] >= 0.01 || $taxstamp >= 0.01 ) { // a chiusura dei cicli faccio il calcolo dei bolli del pagamento e lo aggiungo ai castelletti $calc->payment_taxstamp($calc->total_imp+$calc->total_vat+$carry-$rit+$taxstamp, $doc[$ctrlp]['tes']['stamp'],$doc[$ctrlp]['tes']['round_stamp']*$doc[$ctrlp]['tes']['numrat']); // aggiungo al castelletto IVA $calc->add_value_to_VAT_castle($doc[$ctrlp]['vat'],$taxstamp+$calc->pay_taxstamp,$admin_aziend['taxstamp_vat']); $doc[$ctrlp]['vat']=$calc->castle; // aggiungo il castelleto conti if (!isset($doc[$ctrlp]['acc'][$admin_aziend['boleff']])) { $doc[$ctrlp]['acc'][$admin_aziend['boleff']]['import'] = 0; } $doc[$ctrlp]['acc'][$admin_aziend['boleff']]['import'] += $doc[$ctrlp]['tes']['taxstamp']+$calc->pay_taxstamp; } return $doc; }
SENZA ALCUNA GARANZIA; senza neppure la garanzia implicita di NEGOZIABILITA` o di APPLICABILITA` PER UN PARTICOLARE SCOPO. Si veda la Licenza Pubblica Generica GNU per avere maggiori dettagli. Ognuno dovrebbe avere ricevuto una copia della Licenza Pubblica Generica GNU insieme a questo programma; in caso contrario, si scriva alla Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Stati Uniti. -------------------------------------------------------------------------- */ require("../../library/include/datlib.inc.php"); $admin_aziend=checkAdmin(); require("../../library/include/ciftolet.inc.php"); require('../../library/tcpdf/tcpdf.php'); $calc = new Compute; if (! isset($_GET['id_tes'])){ header("Location: report_effett.php"); exit; } if ($_GET['id_tes'] == 'SEL') { $where = "scaden BETWEEN '".intval($_GET['scaini'])."' AND '".intval($_GET['scafin'])."' AND progre BETWEEN '".intval($_GET['proini'])."' AND '".intval($_GET['profin'])."'"; } else { $where = "id_tes = ".intval($_GET['id_tes']); } $logo=$admin_aziend['image']; $result = gaz_dbi_dyn_query("*", $gTables['effett'], $where,"tipeff, id_tes"); $pdf=new TCPDF();
<?php include 'InitTest.php'; include_once "../core/Compute.php"; include_once "../core/Network.php"; include_once "../core/NetworkLayer3.php"; $compute = new Compute($App); $network = new Network($App); $networkLayer3 = new NetworkLayer3($App); // Liste des serveurs echo "Liste des serveurs : </br>"; $compute->action("listServers"); $servers = json_decode($App->show(), true)["Servers"]; $id = null; foreach ($servers as $server) { echo $server['name'] . " " . $server['id'] . " " . $server['ipv4'] . "<br>"; if (strcmp($server['name'], "bob")) { $id = $server['id']; } } echo "</br>"; // Liste des networks echo "Liste des network : </br>"; $network->action("list_network_ids"); $servers = json_decode($App->show(), true)["ListNetworkIds"]; $id = null; foreach ($servers as $server) { echo $server . "<br>"; } echo "</br>"; // Liste des floatingip
/** * Return a trimmed version of the XHProf raw data. Note that the raw * data contains one entry for each unique parent/child function * combination.The trimmed version of raw data will only contain * entries where either the parent or child function is in the list * of $functions_to_keep. * * Note: Function main() is also always kept so that overall totals * can still be obtained from the trimmed version. * * @param array XHProf raw data * @param array array of function names * * @return array Trimmed XHProf Report */ public static function trim_run($data, $fn2keep) { // convert list of functions to a hash with function as the key $fn_map = array_fill_keys($fn2keep, 1); // always keep main() as well so that overall totals can still // be computed if need be. $fn_map['main()'] = 1; $_data = array(); foreach ($data as $parent_child => $info) { list($parent, $child) = Compute::parse_parent_child($parent_child); if (isset($fn_map[$parent]) || isset($fn_map[$child])) { $_data[$parent_child] = $info; } } return $_data; }