. */ include("./include/include.php"); if( $_SERVER['REQUEST_METHOD']=="GET" ) { admin_header(); }else { admin_header(true, true); } if( !in_array("export_maillist", $_SESSION['sess_functions']) ) { echoln("You are not authorized to see this page."); }else { if( $_SERVER['REQUEST_METHOD']=="GET" ) { echoln("

Mailing list export

"); echoln("Note: only people selected for this workshop will show up here, the choices made "); echoln("by the participants do not influence this list. Also, the participant accepted status "); echoln("must be either 'accepted' or 'arrived'."); echoln("
"); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln(" "); echoln("
Output format:"); echoln(" "); echoln("
Save the resulting file to disk. Go to the mailing list you want to edit, select 'Membership Management...' and 'Mass Subscription'."); echoln(" Then you click on 'Browse...', select the file (at the location where you saved it) and press 'Submit your changes'."); echoln("
"); echoln("
Save the resulting file to disk. Go to the mailing list you want to edit, select the menu 'List management' - 'Subscriber management'."); echoln(" Then you click on the tab 'Bulk operations'. Here you can import the file by clicking 'Browse...', select the file (at the location where you saved it) and press"); echoln(" 'Import'."); #echoln("
"); echoln("
Workshop:"); $query="SELECT `id`, `title` FROM `workshops`"; if( @mysql_num_rows( $res=doquery($query) )>0 ) { echoln(" "); }else { echoln(" No workshops found."); } echoln("
"); echoln("

"); echoln("

"); admin_footer(); }else { $workshop = get_int('workshop'); $format = get_var('format'); if( $workshop<1 ) { echoln("You did not select a workshop. Please select one."); }elseif( $format!="nl" AND $format!="nlname" ) { echoln("You did not select the output format. Please select it."); }else { $query="SELECT `FirstName`, `LastName`, `Email` FROM `persons` WHERE (`Accepted`='yes' OR `Accepted`='confirmed' OR `Accepted`='arrived') AND (`WorkshopIDSlot1`=".addslashes($workshop)." OR `WorkshopIDSlot2`=".addslashes($workshop).") ORDER BY `FirstName`, `LastName`"; if( @mysql_num_rows( $res=doquery($query) )>0 ) { $data = ""; while( $row = mysql_fetch_array($res) ) { switch( $format ) { case "nl": $data .= $row['Email']."\n"; break; case "nlname": $data .= $row['Email']." ".$row['FirstName']." ".$row['LastName']."\n"; break; default: } } $data .= "\n"; header("Last-Modified: " . gmdate("D, d M Y H:i ") . " GMT"); header('Pragma: no-cache'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header("Content-length: ".strlen($data)); header("Content-disposition: attachment; filename=\"workshop_".$workshop."-".$format.".txt\""); header("Content-type: application/octet-stream"); header("Content-Transfer-Encoding: binary"); header('Pragma: public'); echo $data; }else { echoln("There are no people in the current selection. Nothing to download."); } } } } ?>