[Openfirst-cvscommit] feedback/admin index.php,NONE,1.1
Brought to you by:
xtimg
From: <xt...@us...> - 2003-06-28 00:33:27
|
Update of /cvsroot/openfirst/feedback/admin In directory sc8-pr-cvs1:/tmp/cvs-serv22309/admin Added Files: index.php Log Message: Add admin functions. --- NEW FILE: index.php --- <?php /* * openFIRST.feedback - admin/index.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Tim Ginn <tim...@sy...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ include("../../config/globals.php"); include($header); if(isset($_POST["feedbackusers"])) { echo("<p>The feedback users have been modified as per your request.</p>"); $line = explode("\n", $_POST["feedbackusers"]); foreach ($line as $lin) { $fname = (substr($lin, strpos($lin, " ") - strlen($lin))); $femail = substr($lin, 0, strpos($lin, " ")); if(trim($fname) != "" && trim($femail) != "") { $query = mysql_query("INSERT INTO ofirst_feedbackusers (name, email) VALUES ('$fname', '$femail');"); } } } echo("<h1>Feedback</h1> <p>Use this form to setup the users of the feedback system. Each user should be on a new line with their email address first, then a space and their name (as it should appear on the feedback form).</p> <form method='post' action='./'> "); $query = mysql_query("SELECT * FROM ofirst_feedbackusers ORDER BY name;"); if (mysql_num_rows($query) != 0){ echo("<textarea name='feedbackusers' rows='10' cols='50'>"); while($feedback = mysql_fetch_object($query)){ echo("$feedback->email$feedback->name\n"); } } else { echo("<textarea name='feedbackusers' rows='10' cols='50'>xt...@us... Tim Ginn"); } echo("</textarea><br /><input type='submit' value='Update Feedback Users' /> </form>"); include($footer); ?> |