printEntete(); while ($row = mysql_fetch_object($lignes)) { $typ = new types_produits($row->num_type); $col1 = $typ->libelle . "\n" . $row->code; if ($row->num_rubrique) { $rub = new rubriques($row->num_rubrique); $col5 .= $rub->num_cp_compta; } $col4 = number_format($row->prix, 2, '.', '') . " " . $fac->devise . "\n" . number_format($row->tva, 2, '.', '') . " %\n" . number_format($row->remise, 2, '.', '') . " %"; $h = $h_tab * max($ourPDF->NbLines($w_code, $col1), $ourPDF->NbLines($w_lib, $row->libelle), $ourPDF->NbLines($w_qte, $row->nb), $ourPDF->NbLines($w_pri, $col4), $ourPDF->NbLines($w_dat, $col5)); $s = $y + $h; if ($s > $hauteur_page - $marge_bas) { $ourPDF->AddPage(); $ourPDF->SetXY($x_tab, $y_tab); $y = $ourPDF->GetY(); printEntete(); } $ourPDF->SetXY($x_code, $y); $ourPDF->Rect($x_code, $y, $w_code, $h); $ourPDF->MultiCell($w_code, $h_tab, $col1, 0, 'L'); $ourPDF->SetXY($x_lib, $y); $ourPDF->Rect($x_lib, $y, $w_lib, $h); $ourPDF->MultiCell($w_lib, $h_tab, $row->libelle, 0, 'L'); $ourPDF->SetXY($x_qte, $y); $ourPDF->Rect($x_qte, $y, $w_qte, $h); $ourPDF->MultiCell($w_qte, $h_tab, $row->nb, 0, 'R'); $ourPDF->SetXY($x_pri, $y); $ourPDF->Rect($x_pri, $y, $w_pri, $h); $ourPDF->MultiCell($w_pri, $h_tab, $col4, 0, 'R'); $ourPDF->SetXY($x_dat, $y); $ourPDF->Rect($x_dat, $y, $w_dat, $h);
if (isset($result["errno"])) { $errno = $result["errno"]; $errstr = $result["errstr"]; msg_error($l->g(344) . " " . $errno . " / " . $errstr); } else { if (!strstr($result[0], "200")) { msg_error($l->g(344) . " " . $result[0]); } else { msg_success($l->g(287) . " OK"); } } } else { msg_error($l->g(1244)); } } printEntete("<i>" . $l->g(560) . ": " . $server); echo close_form(); echo "<br>"; echo open_form($form_name1, '', "enctype='multipart/form-data' onsubmit=\"return verif_file_format('file_upload');\""); echo "<div class='" . $css . "' >"; echo $l->g(1048) . ": <input id='file_upload' name='file_upload' type='file' accept=''>"; echo "<br><br><input name='GO' id='GO' type='submit' value='" . $l->g(13) . "'>"; echo close_form(); echo "<br>"; echo "</div>"; } else { require_once 'require/function_computers.php'; require_once 'require/function_admininfo.php'; //list fields for form $form_fields_typeinput = array('COMPUTER_NAME_GENERIC' => $l->g(35), 'SERIAL_GENERIC' => $l->g(36), 'ADDR_MAC_GENERIC' => $l->g(95)); if (isset($protectedPost['Valid_modif_x'])) {
if ($protectedPost['Valid_modif_x']) { $sql = "DELETE FROM deploy WHERE name='%s'"; $arg = "label"; $msg = $l->g(261); if (trim($protectedPost['lbl']) != "") { $protectedPost["lbl"] = str_replace(array("\t", "\n", "\r"), array("", "", ""), $protectedPost["lbl"]); mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg); $sql = "INSERT INTO deploy VALUES('%s','%s')"; $arg = array('label', $protectedPost["lbl"]); $msg = $l->g(260); } mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg); msg_success($msg); } //Looking for the label $reqL = "SELECT content FROM deploy WHERE name='%s'"; $arg = "label"; $resL = mysql2_query_secure($reqL, $_SESSION['OCS']["readServer"], $arg); $val = mysql_fetch_object($resL); printEntete($l->g(263)); $form_name = 'admin_info'; echo "<br>"; echo open_form($form_name); $name_field = array("lbl"); $tab_name = array($l->g(262) . ": "); $type_field = array(1); $value_field = array($val->content); $tab_typ_champ = show_field($name_field, $type_field, $value_field); //$tab_typ_champ[0]['CONFIG']['SIZE']=100; tab_modif_values($tab_name, $tab_typ_champ, $tab_hidden, $title = "", $comment = "", $name_button = "modif", $showbutton = true, $form_name = 'NO_FORM'); echo close_form();
$size = 'as size'; } else { $name = ''; $date_create = ''; $date_modif = ''; $size = ''; } $sql .= "select '%s' " . $name . ",'%s' " . $date_create . ",'%s' " . $date_modif . ",'%s' " . $size . " union "; array_push($arg, $value); array_push($arg, rtrim($data['date_create'][$id], ".")); array_push($arg, rtrim($data['date_modif'][$id], ".")); array_push($arg, round($data['size'][$id] / 1024, 3) . " " . $l->g(516)); } $sql = substr($sql, 0, -6); $list_fields = array('name' => 'name', $l->g(951) => 'date_create', $l->g(952) => 'date_modif', $l->g(953) => 'size'); $list_col_cant_del = $list_fields; $default_fields = $list_fields; // $sql= "select '%s' as function,%s from deploy"; $tab_options['ARG_SQL'] = $arg; $tab_options['LBL']['name'] = $l->g(950); $tab_options['LIEN_LBL']['name'] = 'index.php?' . PAG_INDEX . '=' . $pages_refs['ms_csv'] . '&no_header=1&log='; $tab_options['LIEN_CHAMP']['name'] = 'name'; $tab_options['LIEN_TYPE']['name'] = 'POPUP'; $tab_options['POPUP_SIZE']['name'] = "width=900,height=600"; printEntete($l->g(928)); echo "<br>"; tab_req($table_name, $list_fields, $default_fields, $list_col_cant_del, $sql, $form_name, 80, $tab_options); echo close_form(); } else { msg_warning($l->g(766)); }
<?php //==================================================================================== // OCS INVENTORY REPORTS // Copyleft Erwan GOALOU 2010 (erwan(at)ocsinventory-ng(pt)org) // Web: http://www.ocsinventory-ng.org // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt //==================================================================================== require_once 'require/function_ipdiscover.php'; if (!isset($_SESSION['OCS']["mac"])) { loadMac(); } printEntete($l->g(312)); echo "<br>"; $form_name = 'ipdiscover'; echo open_form($form_name); //delete a subnet if (isset($protectedPost['SUP_PROF']) and $protectedPost['SUP_PROF'] != '' and $_SESSION['OCS']['CONFIGURATION']['IPDISCOVER'] == "YES") { $sql_del = "delete from subnet where netid='%s'"; $arg_del = $protectedPost['SUP_PROF']; mysql2_query_secure($sql_del, $_SESSION['OCS']["writeServer"], $arg_del); //delete cache unset($_SESSION['OCS']["ipdiscover"]); require_once BACKEND . 'ipdiscover/ipdiscover.php'; $tab_options['CACHE'] = 'RESET'; } if (isset($_SESSION['OCS']["ipdiscover"])) { $dpt = array_keys($_SESSION['OCS']["ipdiscover"]);
$sql = "DELETE FROM deploy where name='%s'"; $arg = $protectedPost['SUP_PROF']; mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg); } if (!isset($protectedPost['ADD_FILE'])) { echo open_form($form_name); $list_fields = array($l->g(283) => 'function', $l->g(49) => 'name', 'SUP' => 'name'); $list_col_cant_del = $list_fields; $default_fields = $list_fields; $sql = "select '%s' as function,%s from deploy where name != 'label'"; $tab_options['ARG_SQL'] = array($l->g(370), 'name'); $tab_options['LIEN_LBL'][$l->g(49)] = 'index.php?' . PAG_INDEX . '=' . $pages_refs['ms_view_file'] . '&prov=agent&no_header=1&value='; $tab_options['LIEN_CHAMP'][$l->g(49)] = 'name'; $tab_options['LIEN_TYPE'][$l->g(49)] = 'POPUP'; $tab_options['POPUP_SIZE'][$l->g(49)] = "width=900,height=600"; printEntete($l->g(1245)); echo "<br>"; ajaxtab_entete_fixe($list_fields, $default_fields, $tab_options, $list_col_cant_del); //echo show_modif($name,'ADD_FILE',8,"",$configinput=array('DDE'=>100)); echo "<input type=submit name=ADD_FILE value='" . $l->g(1048) . "'>"; echo close_form(); } if (isset($protectedPost['ADD_FILE']) and $protectedPost['ADD_FILE'] != '') { $css = "mvt_bordure"; $form_name1 = "SEND_FILE"; //search max_allowed_packet value on mysql conf $sql = "SHOW VARIABLES LIKE 'max_allowed_packet'"; $result = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"]); $value = mysqli_fetch_array($result); //pass oct to Mo $upload_max_filesize = $value['Value'] / 1048576;