*/ require("test_admin.php"); require_once("class_db.php"); $db = new dbquery(); $func = new functions(); /* Configuration */ $title = _ADMIN_NOTIFICATION; $page_name = "notif"; $nb_show = $_SESSION['config']['nblinetoshow']; if( !isset($_GET['type']) ) $_GET['type'] = "basket"; if( $_GET['type'] == "basket" ) { //Retrieve the baskets list order by description $db->query("SELECT * FROM baskets bas left join mailer_rights mge on bas.basket_id = mge.basket_or_other ORDER BY bas.BASKET_NAME"); while( $res = $db->fetch_object() ) { if( $res->BASKET_OR_OTHER ) $baskets[] = array("RES_TABLE" => $res->RES_TABLE,"BASKET_ID" => $res->BASKET_ID,"BASKET_NAME" => $res->BASKET_NAME,"BASKET_DESC" => $res->BASKET_DESC,"RIGHTS" => true); else $baskets[] = array("RES_TABLE" => $res->RES_TABLE,"BASKET_ID" => $res->BASKET_ID,"BASKET_NAME" => $res->BASKET_NAME,"BASKET_DESC" => $res->BASKET_DESC,"RIGHTS" => false); } $nb_total = count($baskets); } else if( $_GET['type'] == "other" ) { //Retrieve the others notifs type from the {path_to_letterbox/xml/notif.xml} $others_notifs = new DomDocument(); $others_notifs->load("xml/notif.xml"); $xp_others_notifs = new domxpath($others_notifs); foreach($xp_others_notifs->query("/ROOT/NOTIFICATION") as $nt) { $ID = $nt->getElementsByTagName("ID")->item(0)->nodeValue; if( is_numeric($ID) ) { foreach( $xp_others_notifs->query("*",$nt) as $nt_field ) { $notif_types[$ID][$nt_field->nodeName] = $nt_field->nodeValue; } $db->query("SELECT * FROM mailer_rights WHERE BASKET_OR_OTHER ='".$ID."'"); if( $db->fetch_object() ) $notif_types[$ID]['RIGHTS'] = true; else $notif_types[$ID]['RIGHTS'] = false; } } $nb_total = count($notif_types); } //Number of pages $nb_pages = ceil($nb_total/$nb_show); if( !isset($_GET['start']) ) $_GET['start'] = 0; $link = "index.php?page=".$page_name."&type=".$_GET['type']; $link_without_type = "index.php?page=".$page_name; 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($_GET['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( $_GET['start'] > 0 ) { $start_prev = $_GET['start'] - $nb_show; $previous = ''; } if( $_GET['start'] <> $lastpage ) { $start_next = $_GET['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.'

'._BASKET.' : '._MORE_ACTIONS.' :

'; echo $page_list1; ?> $i ) ; $i++ ) { if($color == ' class="col"') { $color = ''; } else { $color = ' class="col"'; } ?> > = $i ) ; $i++ ) { if($color == ' class="col"') { $color = ''; } else { $color = ' class="col"'; } ?> >
show($baskets[$i]['BASKET_NAME']); ?> show($baskets[$i]['BASKET_DESC']); ?>
show($notif_types[$i]['DESC']); ?>