*/ 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 = '
'; $page_list2 .= $previous." ".$next.''; } } echo ''._BASKET.' : '._MORE_ACTIONS.' :
'; echo $page_list1; ?>