*/ include_once('addon_collectivities.php'); class coll extends dbquery { /** * * @access private * @var integer */ private $the_start; /** * Redefinition of the LetterBox object constructor */ function __construct() { // configure the sql argument order by if(isset($_GET['start'])) { $this->the_start = strip_tags($_GET['start']); } else { $this->the_start = 0; } } /** * List of domains * * @param string $where $where clause * @param string $what sort info */ public function coll_list($where = "",$what = "") { // draw the domains list $func = new functions(); /* Configuration */ $title = _COLL_LIST; $page_name = "coll"; $nb_show = $_SESSION['config']['nblinetoshow']; if(!empty($what)) { $what = "&what=".$what; } if(!empty($where)) { $where = " where ".$where; } /***********************/ $all_coll = get_xml_value(); if($nb_pages > 1) { $next_start = 0; $page_list1 = '

'; $lastpage = 0; for($i = 0;$i <> $nb_pages; $i++) { $page_name = $i + 1; $the_line = $i + 1; if($this->the_start == $next_start) { $page_list1 .= ""; $page_list2 .= ""; } else { $page_list1 .= ""; $page_list2 .= ""; } $next_start = $next_start + $nb_show; $lastpage = $next_start; } $lastpage = $lastpage - $nb_show; $previous = ""; $next = ""; if($this->the_start > 0) { $start_prev = $this->the_start - $nb_show; $previous = ''; } if($this->the_start <> $lastpage) { $start_next = $this->the_start + $nb_show; $next = ''; } $page_list1 = $page_list1.""; $page_list2 = $page_list2.""; if($previous <> '' || $next <> '') { if(empty($previous)) { $previous = " "; } if(empty($next)) { $next = " "; } $page_list1 .= $previous." ".$next.'

'; $page_list2 .= $previous." ".$next.'

'; } } echo '

'.$title.'

'; ?> >
connect(); $this->query('SELECT ID, SERVICE FROM '.$_SESSION['tablename']['services'].' WHERE ENABLED = "Y" '); $dep_list = array(); while ($ssline = $this->fetch_array()) { array_push($dep_list, array("ID" => $ssline[0], "LABEL" =>$ssline[1])); } ?>

*

 






connect(); //First, delete actual coll_serv $this->query("DELETE FROM `".$_SESSION['tablename']['coll_serv']."` WHERE ID_COLL = '".$id_coll."'"); for ($i=0; $iquery("INSERT INTO `".$_SESSION['tablename']['coll_serv']."` ( `ID_COLL` , `ID_SERV` ) VALUES ('".$id_coll."', '".$selected_departments[$i]."')"); } header("location: index.php?page=coll"); exit; } } ?>