//pour le traitement des champs if ($list_id_diff != "") { $sql = "select distinct ID from hardware where ID NOT IN (" . implode(',', $list_id_diff) . ")"; if ($list_id_norm != "") { $sql .= " AND ID IN (" . implode(',', $list_id_norm) . ")"; } elseif ($list_id_restraint != "") { $sql .= " AND ID IN (" . $list_id_restraint . ")"; } $result = mysqli_query($_SESSION['OCS']["readServer"], $sql) or mysqli_error($_SESSION['OCS']["readServer"]); while ($item = mysqli_fetch_object($result)) { $list_id[] = $item->ID; } } else { $list_id = $list_id_norm; } $_SESSION['OCS']['ID_REQ'] = id_without_idgroups($list_id); $_SESSION['OCS']['list_tables_request'][$table_tabname] = $list_tables_request; //passage en SESSION des requêtes pour les groupes dynamiques sql_group_cache($cache_sql); // /* if (isset($where)) $_SESSION['OCS']['WHERE_REQ']=$where; else unset($_SESSION['OCS']['WHERE_REQ']);*/ } //Utilisation du cache pour éviter de rejouer la recherche if ($protectedPost['Valid-search'] and $protectedPost['Valid'] == '') { // print_r($_SESSION['OCS']['list_tables_request']); //recupération de la liste des ID $list_id = $_SESSION['OCS']['ID_REQ']; //récupération des tables touchées par les requetes
function add_trait_select($img, $list_id, $form_name, $list_pag) { global $l; $_SESSION['OCS']['ID_REQ'] = id_without_idgroups($list_id); echo "<script language=javascript>\n\t\tfunction garde_check(image,id)\n\t\t {\n\t\t\tvar idchecked = '';\n\t\t\tfor(i=0; i<document." . $form_name . ".elements.length; i++)\n\t\t\t{\n\t\t\t\tif(document." . $form_name . ".elements[i].name.substring(0,5) == 'check'){\n\t\t\t if (document." . $form_name . ".elements[i].checked)\n\t\t\t\t\t\tidchecked = idchecked + document." . $form_name . ".elements[i].name.substring(5) + ',';\n\t\t\t\t}\n\t\t\t}\n\t\t\tidchecked = idchecked.substr(0,(idchecked.length -1));\n\t\t\twindow.open(\"index.php?" . PAG_INDEX . "=\"+image+\"&head=1&idchecked=\"+idchecked,\"rollo\",\"location=0,status=0,scrollbars=1,menubar=0,resizable=0,width=800,height=500\");\n\t\t\t\n\t\t}\n\t</script>"; echo "<table align='center' width='30%' border='0'>"; echo "<tr><td>"; foreach ($img as $key => $value) { echo "<td align=center><a href=# onclick=garde_check(\"" . $list_pag[$key] . "\",\"" . $list_id . "\")><img src='" . $key . "' title='" . $value . "' ></a></td>"; } echo "</tr></tr></table>"; }
function add_trait_select($img, $list_id, $form_name, $list_pag) { global $l; $_SESSION['OCS']['ID_REQ'] = id_without_idgroups($list_id); echo "<script language=javascript>\n\t\tfunction garde_check(image,id)\n\t\t {\n\t\t\tvar idchecked = '';\n\t\t\tfor(i=0; i<document." . $form_name . ".elements.length; i++)\n\t\t\t{\n\t\t\t\tif(document." . $form_name . ".elements[i].name.substring(0,5) == 'check'){\n\t\t\t if (document." . $form_name . ".elements[i].checked)\n\t\t\t\t\t\tidchecked = idchecked + document." . $form_name . ".elements[i].name.substring(5) + ',';\n\t\t\t\t}\n\t\t\t}\n\t\t\tidchecked = idchecked.substr(0,(idchecked.length -1));\n\t\t\twindow.open(\"index.php?" . PAG_INDEX . "=\"+image+\"&head=1&idchecked=\"+idchecked,\"rollo\",\"location=0,status=0,scrollbars=1,menubar=0,resizable=0,width=800,height=500\");\n\t\t\t\n\t\t}\n\t</script>"; ?> <div class="btn-group"> <?php foreach ($img as $key => $value) { echo '<button type="button" onclick=garde_check("' . $list_pag[$key] . '","' . $list_id . '") class="btn btn-default">' . $value . '</button>'; } ?> </div> <?php }
function add_trait_select($img, $list_id, $form_name, $list_pag, $comp = false) { global $l; $_SESSION['OCS']['ID_REQ'] = id_without_idgroups($list_id); echo "<script language=javascript>\n\t\tfunction garde_check(image,id,computer)\n\t\t {\n\t\t\tvar idchecked = '';\n\t\t\tvar cptr = 0;\n\t\t\tfor(i=0; i<document." . $form_name . ".elements.length; i++)\n\t\t\t{\n\t\t\t\tif(document." . $form_name . ".elements[i].name.substring(0,5) == 'check'){\n\t\t\t if (document." . $form_name . ".elements[i].checked){\n\t\t\t\t\t\tidchecked = idchecked + document." . $form_name . ".elements[i].name.substring(5) + ',';\n\t\t\t\t\t\tcptr ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\tif(computer){\n\t\t\t\tif(cptr == 0){\n\t\t\t\t\talert('" . $l->g(7015) . "');\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\tidchecked = idchecked.substr(0,(idchecked.length -1));\n\t\t\tif(!computer){\n\t\t\t\twindow.open(\"index.php?" . PAG_INDEX . "=\"+image+\"&head=1&idchecked=\"+idchecked,\"rollo\");\n\t\t\t}else{\n\t\t\t\twindow.open(\"index.php?" . PAG_INDEX . "=\"+image+\"&head=1&idchecked=\"+idchecked+\"&comp=\"+computer,\"rollo\");\n\t\t\t}\t\t\t\n\t\t}\n\t</script>"; ?> <div class="btn-group"> <?php foreach ($img as $key => $value) { echo '<button type="button" onclick=garde_check("' . $list_pag[$key] . '","' . $list_id . '","' . $comp . '") class="btn btn-default">' . $value . '</button>'; } ?> </div> <?php }