[Openfirst-cvscommit] members adduser.php,1.5,1.6 divisions.php,1.4,1.5 profile.php,1.17,1.18 update
Brought to you by:
xtimg
From: <dav...@us...> - 2003-11-09 02:51:35
|
Update of /cvsroot/openfirst/members In directory sc8-pr-cvs1:/tmp/cvs-serv958 Modified Files: adduser.php divisions.php profile.php updateprofile.php Log Message: Minor design changes that I felt need to be made. Index: adduser.php =================================================================== RCS file: /cvsroot/openfirst/members/adduser.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** adduser.php 23 Aug 2003 20:31:16 -0000 1.5 --- adduser.php 9 Nov 2003 02:51:32 -0000 1.6 *************** *** 26,103 **** * */ include("../config/globals.php"); include($header); if($user->membertype == "administrator") { if(isset($_POST["team"]) == true) { $user = $_POST["user"]; $firstname=$_POST["firstname"]; $lastname = $_POST["lastname"]; if($_POST["password"] == $_POST["password2"]) { if(isset($_POST["ndivision"]) == true && $_POST["ndivision"] != "") { $_POST["division"] = $_POST["ndivision"]; $q = ofirst_dbquery("INSERT INTO ofirst_divisions (division, description) VALUES ( ! '" . $_POST["division"] . "', '" . $_POST["divisiondescription"] . "');"); ! } ! $q = ofirst_dbquery("INSERT INTO ofirst_members (user, firstname, ! lastname, password, membertype, division, year, email, icq, aim, msn, ! yim, description, signature, picturelocation, team, dateregistered) ! VALUES ('". $_POST["user"] ."', '" . $_POST["firstname"] . "', ! '" . $_POST["lastname"] . "', '" . cryptpassword($_POST["password"], ! $encryption) . "', '" . $_POST["membertype"] ."', '" . ! $_POST["division"] . "', '" . $_POST["year"] . "', '" . ! $_POST["email"] . "', '" . $_POST["icq"] . "', '" . $_POST["aim"] . ! "', '" . $_POST["msn"] . "', '". $_POST["yim"] ."', '" . ! $_POST["description"] . "', '" . $_POST["signature"] . "', '" . ! $_POST["picturelocation"] . "', '" . $_POST["team"] . "', '" . ! date("Y-m-d") . "');"); ! echo("Added user: " . $_POST["user"]); ! } else { ! echo("Password does not match confirm password."); ! } ! } ?> <h1>Add Users</h1> <p>This utility will add users to the members area.</p> ! <table> ! <form method="post" action="adduser.php"> ! <tr> ! <th>Team Number</th> ! <td><input type="text" name="team" /></td> ! </tr> ! <tr> ! <th>User Name</th> ! <td><input type="text" name="user" /></td> ! </tr> ! <tr> ! <th>First Name</th> ! <td><input type="text" name="firstname" /></td> ! </tr> ! <tr> ! <th>Last Name</th> ! <td><input type="text" name="lastname" /></td> ! </tr> ! <tr> ! <th>Password</th> ! <td><input type="password" name="password" /></td> ! </tr> ! <tr> ! <th>Confirm Password</th> ! <td><input type="password" name="password2" /></td> ! </tr> ! <tr> ! <th>Member Type</th> ! <td> ! <select name="membertype"> ! <option value="administrator">Administrator</option> ! <option value="user" selected="selected">User</option> ! </select> ! </td> ! </tr> ! <tr> ! <th>Division</th> ! <td>Existing: ! <br><select name="division"> ! <?php $div = ofirst_dbquery("SELECT division FROM ofirst_divisions;"); while($d = ofirst_dbfetch_object($div)) { --- 26,127 ---- * */ + // Include system globals and headers include("../config/globals.php"); include($header); + // Check if member registering is an administrator if($user->membertype == "administrator") { + + // Make sure the team value is filled if(isset($_POST["team"]) == true) { + $user = $_POST["user"]; $firstname=$_POST["firstname"]; $lastname = $_POST["lastname"]; + + // Make sure password is the same as confirm password if($_POST["password"] == $_POST["password2"]) { + + // If new division is set then create it if(isset($_POST["ndivision"]) == true && $_POST["ndivision"] != "") { $_POST["division"] = $_POST["ndivision"]; $q = ofirst_dbquery("INSERT INTO ofirst_divisions (division, description) VALUES ( ! '" . $_POST["division"] . "', ! '" . $_POST["divisiondescription"] . "');"); ! } ! ! // Insert user data into the database ! ofirst_dbquery("INSERT INTO ofirst_members (user, firstname, ! lastname, password, membertype, division, year, email, icq, aim, msn, ! yim, description, signature, picturelocation, team, dateregistered) ! VALUES ( ! '". $_POST["user"] ."', ! '" . $_POST["firstname"] . "', ! '" . $_POST["lastname"] . "', ! '" . cryptpassword($_POST["password"],$encryption) . "', ! '" . $_POST["membertype"] ."', ! '" . $_POST["division"] . "', ! '" . $_POST["year"] . "', ! '" . $_POST["email"] . "', ! '" . $_POST["icq"] . "', ! '" . $_POST["aim"] . "', ! '" . $_POST["msn"] . "', ! '" . $_POST["yim"] ."', ! '" . $_POST["description"] . "', ! '" . $_POST["signature"] . "', ! '" . $_POST["picturelocation"] . "', ! '" . $_POST["team"] . "', ! '" . date("Y-m-d") . "');"); ! ! echo("<br><br>Added user: " . $_POST["user"] . "<br><br>"); ! } else { ! echo("<br><br>Password does not match confirm password.<br><br>"); ! } ! } ?> <h1>Add Users</h1> <p>This utility will add users to the members area.</p> ! <table width="484"> ! <form method="post" action="adduser.php"> ! <tr> ! <th> </th> ! <th>User Information</th> ! </tr> ! <tr> ! <th width="177">Team Number</th> ! <td width="295"><input type="text" name="team" /></td> ! </tr> ! <tr> ! <th>User Name</th> ! <td><input type="text" name="user" /></td> ! </tr> ! <tr> ! <th>First Name</th> ! <td><input type="text" name="firstname" /></td> ! </tr> ! <tr> ! <th>Last Name</th> ! <td><input type="text" name="lastname" /></td> ! </tr> ! <tr> ! <th>Password</th> ! <td><input type="password" name="password" /></td> ! </tr> ! <tr> ! <th>Confirm Password</th> ! <td><input type="password" name="password2" /></td> ! </tr> ! <tr> ! <th>Member Type</th> ! <td> <select name="membertype"> ! <option value="administrator">Administrator</option> ! <option value="user" selected="selected">User</option> ! </select> </td> ! </tr> ! <tr> ! <th>Division</th> ! <td>Existing: <br> <select name="division"> ! <?php ! // Check divisions in database $div = ofirst_dbquery("SELECT division FROM ofirst_divisions;"); while($d = ofirst_dbfetch_object($div)) { *************** *** 105,157 **** } ?> ! </select> ! <br>New ! <br><input type="text" name="ndivision" /> ! <br>Description of New Division ! <br><input type="text" name="divisiondescription" /> ! </td> ! </tr> ! <tr> ! <th>Year</th> ! <td><input type="text" name="year" value="<?php echo(date("Y")); ?>" /></td> ! </tr> ! <tr> ! <th>E-mail</th> ! <td><input type="text" name="email" /></td> ! </tr> ! <tr> ! <th>ICQ</th> ! <td><input type="text" name="icq" /></td> ! </tr> ! <tr> ! <th>AIM</th> ! <td><input type="text" name="aim" /></td> ! </tr> ! <tr> ! <th>MSN</th> ! <td><input type="text" name="msn" /></td> ! </tr> ! <tr> ! <th>YIM</th> ! <td><input type="text" name="yim" /></td> ! </tr> ! <tr> ! <th>Description</th> ! <td><textarea name="description">I have not yet updated my profile.</textarea></td> ! </tr> ! <tr> ! <th>Signature</th> ! <td><textarea name="signature">-- ! Team Member</textarea></td> ! </tr> ! <tr> ! <th>Picture Location</th> ! <td><input type="text" name="picture" value="nophoto.png" /></td> ! </tr> ! <tr> ! <th>Take Action</th> ! <td><input type="submit" value="Add User" /> <input type="reset" value="Clear Details" /></td> ! </tr> ! </form> </table> --- 129,180 ---- } ?> ! </select> <br> ! New <br> <input type="text" name="ndivision" /> <br> ! Description of New Division <br> <input type="text" name="divisiondescription" /> ! </td> ! </tr> ! <tr> ! <th>Year</th> ! <td><input type="text" name="year" value="<?php echo(date("Y")); ?>" /></td> ! </tr> ! <tr> ! <th>E-mail</th> ! <td><input type="text" name="email" /></td> ! </tr> ! <tr> ! <th>ICQ</th> ! <td><input type="text" name="icq" /></td> ! </tr> ! <tr> ! <th>AIM</th> ! <td><input type="text" name="aim" /></td> ! </tr> ! <tr> ! <th>MSN</th> ! <td><input type="text" name="msn" /></td> ! </tr> ! <tr> ! <th>YIM</th> ! <td><input type="text" name="yim" /></td> ! </tr> ! <tr> ! <th>Description</th> ! <td><textarea name="description" cols="40" rows="10">I have not yet updated my profile.</textarea> ! <br> <font size="1">(Emoticons and HTML compatible)</font></td> ! </tr> ! <tr> ! <th>Signature</th> ! <td><textarea name="signature" cols="40" rows="5">--Team Member</textarea></td> ! </tr> ! <tr> ! <th>Picture Location</th> ! <td><input type="text" name="picture" /> <font size="1">(Leave blank for ! no photo)</font></td> ! </tr> ! <tr> ! <th>Take Action</th> ! <td><input type="submit" value="Add User" /> <input type="reset" value="Clear Details" /></td> ! </tr> ! </form> </table> Index: divisions.php =================================================================== RCS file: /cvsroot/openfirst/members/divisions.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** divisions.php 28 Sep 2003 14:05:42 -0000 1.4 --- divisions.php 9 Nov 2003 02:51:32 -0000 1.5 *************** *** 26,60 **** * */ include("../config/globals.php"); include($header); - ?> ! ! <h1>Divisions</h1> ! <?php if(isset($user->division) == true) { $division = $user->division; } ! if(isset($_GET["division"]) == true) { $division = $_GET["division"]; } ! if(isset($division) == true && $division != "") { ! $div = ofirst_dbfetch_object(ofirst_dbquery("SELECT * FROM ofirst_divisions WHERE division='$division';")); ! echo("<h2>$div->division</h2> ! <p>$div->description</p> ! <h2>$div->division Division Members</h2>"); ! $members = ofirst_dbquery("SELECT user, firstname, lastname, year, dateregistered, lastseen FROM ofirst_members WHERE division='$div->division';"); ! echo("<table> ! <tr><th>Full Name</th><th>Year</th><th>Date Registered</th><th>Last Seen</th></tr>"); ! while ($m = ofirst_dbfetch_object($members)) { ! echo("<tr><td><a ! href='profile.php?id=$m->user'>$m->firstname $m->lastname</a></td><td>$m->year</td><td>$m->dateregistered</td><td>$m->lastseen</td></tr>"); ! } ! } else { ! $d = ofirst_dbquery("SELECT * FROM ofirst_divisions;"); ! echo("<table>"); ! while ($div = ofirst_dbfetch_object($d)) { ! echo("<tr><th><a href='divisions.php?division=$div->division'>$div->division</a></th><td>$div->description</td></tr>"); ! } ! echo("</table>"); } ?> ! ! <?php ! include($footer); ?> --- 26,77 ---- * */ + // Include system globals and headers include("../config/globals.php"); include($header); ?> ! <h1>Team Divisions/Groups</h1> ! <?php ! // Display information regarding division if(isset($user->division) == true) { $division = $user->division; } ! if(isset($_GET["division"]) == true) { $division = $_GET["division"]; } ! if(isset($division) == true && $division != "") { ! $div = ofirst_dbfetch_object(ofirst_dbquery("SELECT * FROM ofirst_divisions WHERE division='$division';")); ! ?> ! ! <table width="313"> ! <tr> ! <th><?php echo $div->division; ?></th> ! </tr> ! <tr> ! <td><?php echo $div->description; ?></td> ! </tr> ! </table> ! ! <h2><?php echo $div->division; ?> Members</h2> ! <table> ! <tr> ! <th>Full Name</th> ! <th>Year</th> ! <th>Date Registered</th> ! <th>Last Seen</th> ! </tr> ! <?php ! // Loop through and display all members ! $members = ofirst_dbquery("SELECT user, firstname, lastname, year, dateregistered, lastseen FROM ofirst_members WHERE division='$div->division';"); ! while ($m = ofirst_dbfetch_object($members)) { ! echo("<tr><td><a href='profile.php?id=$m->user'>$m->firstname $m->lastname</a></td><td>$m->year</td><td>$m->dateregistered</td><td>$m->lastseen</td></tr>"); ! } ! ?> ! </table> ! <?php } else { ?> ! <table> ! <?php ! // List divisions ! $d = ofirst_dbquery("SELECT * FROM ofirst_divisions;"); ! while ($div = ofirst_dbfetch_object($d)) { ! echo("<tr><th><a href='divisions.php?division=$div->division'>$div->division</a></th><td>$div->description</td></tr>"); ! } } ?> ! </table><br> ! <?php include($footer); ?> Index: profile.php =================================================================== RCS file: /cvsroot/openfirst/members/profile.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** profile.php 16 Oct 2003 22:49:04 -0000 1.17 --- profile.php 9 Nov 2003 02:51:32 -0000 1.18 *************** *** 26,91 **** * */ ! include("../config/globals.php"); include($header); ?> ! <h1>Members Profiles</h1> ! <?php ! function status($n) { ! if($n == "1") { ! return("Minimal Skill"); ! } elseif($n == "2") { ! return("Not quite mediocre"); ! } elseif($n == "3") { ! return("Mediocre"); ! } elseif($n == "4") { ! return("Competent"); ! } elseif($n == "5") { ! return("Above Average"); ! } elseif($n == "6") { ! return("Professional"); ! } ! } ! if(isset($_GET["action"]) == true && $_GET["action"] == "skillsearch") { ! $extra = " AND skills IS NOT NULL AND skills like '%" . $_GET["skill"] . "|" . $_GET["level"] . "%'"; ! } ! ! if(isset($_GET["id"]) == false) { ! ! ! ?> ! <table> ! <tr><th>Search by Skills</th><td><form action="profile.php" method="get"> ! <input type="hidden" value="skillsearch" name="action"> ! Find someone with ! <select name='level'> ! <option value='0' selected='selected'>No skill</option> ! <option value='1'>Minimal</option> ! <option value='2'>Not quite mediocre</option> ! <option value='3'>Mediocre</option> ! <option value='4'>Competent</option> ! <option value='5'>Above Average</option> ! <option value='6'>Professional</option> ! </select> ! at ! ! <select name='skill'> ! <?php ! $skills = array('Languages', 'Computer-Programming', 'Hands-on-Skills', 'Fundraising', ! 'Creativity', 'Organization', 'Time-Management', 'Research', 'Computer-Aided-Design', 'Teaching', ! 'Mentorship'); ! for($y = 0; $y < count($skills); $y++) { echo("<option value='" . $skills[$y] . "'>" . $skills[$y] . "</option>"); } ! ?> ! </select> ! ! <input type="submit" value="Search"></form></td></tr> ! </table> ! ! <br> ! <table> ! <tr> <th><a href="profile.php?orderby=user">Nick Name</a></th> <th><a href="profile.php?orderby=email">E-mail</a></th> --- 26,68 ---- * */ ! // Include system globals and headers include("../config/globals.php"); include($header); ?> ! <h1>Members Profiles</h1> ! <?php if(isset($_GET["id"]) == false) { ?> ! <table> ! <tr> ! <th>Search by Skills</th> ! <td><form action="profile.php" method="get"> ! <input type="hidden" value="skillsearch" name="action"> ! Find someone with ! <select name='level'> ! <option value='0' selected='selected'>No skill</option> ! <option value='1'>Minimal</option> ! <option value='2'>Not quite mediocre</option> ! <option value='3'>Mediocre</option> ! <option value='4'>Competent</option> ! <option value='5'>Above Average</option> ! <option value='6'>Professional</option> ! </select> at ! ! <select name='skill'> ! <?php ! // Declare types of different skills avaiable ! $skills = array('Languages', 'Computer-Programming', 'Hands-on-Skills', 'Fundraising', ! 'Creativity', 'Organization', 'Time-Management', 'Research', 'Computer-Aided-Design', 'Teaching', ! 'Mentorship'); ! // Loop through and view these skills for($y = 0; $y < count($skills); $y++) { echo("<option value='" . $skills[$y] . "'>" . $skills[$y] . "</option>"); } ! ?> ! </select> ! <input type="submit" value="Search"></form></td></tr> ! </table> ! <br> ! <table> ! <tr> <th><a href="profile.php?orderby=user">Nick Name</a></th> <th><a href="profile.php?orderby=email">E-mail</a></th> *************** *** 95,106 **** <th><a href="profile.php?orderby=picturelocation">Photo</a></th> </tr> ! <?php if(! isset($_GET["orderby"])) { $_GET["orderby"] = "user"; } ! if(isset($extra) == true && $extra != "") { $query = ofirst_dbquery("SELECT * FROM ofirst_members where " . $_GET["orderby"] . " is NOT NULL $extra ORDER BY " . $_GET["orderby"] . ";"); ! } else { ! $query = ofirst_dbquery("SELECT * FROM ofirst_members where " . $_GET["orderby"] . " is NOT NULL ORDER BY " . $_GET["orderby"] . ";"); ! } ! while($q = ofirst_dbfetch_object($query)) { echo "<td><a href='profile.php?id=$q->user'>$q->user</a></td>"; if($q->email != "") { echo("<td><img src='email.png' alt='email available' /></td>"); } else { echo("<td><img src='email-none.png' alt='email available' /></td>"); } --- 72,89 ---- <th><a href="profile.php?orderby=picturelocation">Photo</a></th> </tr> ! <?php ! // Check if skills have been selected to search for ! if(isset($_GET["action"]) == true && $_GET["action"] == "skillsearch") { ! $extra = " AND skills IS NOT NULL AND skills like '%" . $_GET["skill"] . "|" . $_GET["level"] . "%'"; ! } ! //Check if skills have been selected to order by if(! isset($_GET["orderby"])) { $_GET["orderby"] = "user"; } ! if(isset($extra) == true && $extra != "") { $query = ofirst_dbquery("SELECT * FROM ofirst_members where " . $_GET["orderby"] . " is NOT NULL $extra ORDER BY " . $_GET["orderby"] . ";"); ! } else { ! $query = ofirst_dbquery("SELECT * FROM ofirst_members where " . $_GET["orderby"] . " is NOT NULL ORDER BY " . $_GET["orderby"] . ";"); ! } ! ! while($q = ofirst_dbfetch_object($query)) { echo "<td><a href='profile.php?id=$q->user'>$q->user</a></td>"; if($q->email != "") { echo("<td><img src='email.png' alt='email available' /></td>"); } else { echo("<td><img src='email-none.png' alt='email available' /></td>"); } *************** *** 110,133 **** if($q->picturelocation != "") { echo("<td><img src='photo.png' alt='photo available' /></td>"); }else{ echo("<td><img src='photo-none.png' alt='email available' /></td>"); } echo("</tr>"); } ! ?> ! </table> ! <br> ! <?php } else { $query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user='" . $_GET["id"] . "';"); while($q = ofirst_dbfetch_object($query)) { if (function_exists('emoticon_translate')) { $q->description = emoticon_translate($q->description); } ! ! echo("<table width='600'><tr><th></th><th width='70%'>Member Information</th></tr><tr><td style='vertical-align: top;'>"); ! if($q->picturelocation == "") { ! echo("<img src='nophoto.png' alt='No photograph provided'>"); ! } else { ! echo("<img src='$q->picturelocation' alt='$q->firstname $q->lastname' />"); ! } ! if ($q->skills == "") { $q->skills = "No skills entered."; } if ($q->description == "") { $q->description = "No description entered."; } if ($q->division == "") { $q->division = "No division given."; } --- 93,138 ---- if($q->picturelocation != "") { echo("<td><img src='photo.png' alt='photo available' /></td>"); }else{ echo("<td><img src='photo-none.png' alt='email available' /></td>"); } echo("</tr>"); + } ! ?> ! </table><br> ! <?php } else { + + // Function to return status of a skill + function status($n) { + switch($n){ + case "1": + return("Minimal Skill"); + break; + case "2": + return("Not quite mediocre"); + break; + case "3": + return("Mediocre"); + break; + case "4": + return("Competent"); + break; + case "5": + return("Above Average"); + break; + case "6": + return("Professional"); + break; + } + } + + // Collect information to display in persons profile $query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user='" . $_GET["id"] . "';"); while($q = ofirst_dbfetch_object($query)) { + // Replace values for members profile description if (function_exists('emoticon_translate')) { $q->description = emoticon_translate($q->description); } ! ! // Replace values for display if information is not present ! if ($q->skills == "") { $q->skills = "No skills entered."; } if ($q->description == "") { $q->description = "No description entered."; } if ($q->division == "") { $q->division = "No division given."; } *************** *** 138,200 **** if ($q->lastseen == "") { $q->lastseen = "$q->firstname has never logged in."; } ! echo("</td><td><h2>$q->user</h2> ! <sub>Real Name: $q->firstname $q->lastname ! <br />Member since: $q->dateregistered ! <br />Last seen logged in: $q->lastseen</sub> ! <p> ! Division: <a href='divisions.php?division=$q->division'>$q->division</a> ! <br /> ! </p> ! ! <h3>Contact Information</h3> ! <p> ! <img src='email.png' alt='E-mail address' />: <a href='mailto: $q->email'>$q->email</a> ! <br /><img src='icq.png' alt='I Seek You (ICQ) Number' />: $q->icq ! "); ! if ($q->icq != "" && $q->icq != "0") { ! echo("<img src=\"http://wwp.icq.com/scripts/online.dll?icq=$q->icq&img=5\" alt=\"User status\" />"); } else { ! echo("none"); ! } ! echo("<br /><img src='msmsgs.png' alt='Microsoft Network: Messenger address' />: $q->msn"); ! if($q->msn == "") { ! echo("none"); ! } ! echo("<br /><img src='aim.png' alt='AOL Instant Messenger address' />: "); ! if ($q->aim != "") { ! echo("<a href='aim:goim?screenname=$q->aim&message=Hello+$q->firstname+$q->lastname,+I+was+just+browsing+your+profile+when+I+noticed+you+had+AIM.'>$q->aim</a>"); } else { ! echo("none"); ! } ! echo("<br /><img src='yahoo.png' alt='Yahoo! Messenger address' />: <a href='http://edit.yahoo.com/config/send_webmesg?.target=$q->yim&.src=pg'>$q->yim</a> "); ! if ($q->yim != "") { ! echo("<img src=\"http://opi.yahoo.com/online?u=$q->yim&m=g&t=1\" alt=\"User status\" />"); } else { ! echo("none"); ! } ! echo("</p> ! ! <h3>Description</h3> ! <p> ! $q->description ! </p> ! <h3>Skills</h3> ! <p>"); ! if(isset($q->skills)){ ! $skill = explode(",", $q->skills); ! echo "<table width='300'>"; ! for($y = 0; $y < count($skill); $y++) { $det = explode("|",$skill[$y]); ! echo("<tr><td>$det[0] - " . status($det[1]) . "</td></tr>"); ! } ! echo "</table>"; ! }else{ ! echo "No skills entered."; ! } ! echo("</p></td></tr></table>"); ! } } ! include($footer); ?> --- 143,266 ---- if ($q->lastseen == "") { $q->lastseen = "$q->firstname has never logged in."; } ! ?> ! <table width='600'> ! <tr> ! <th> </th> ! <th width='70%'>Member Information</th> ! </tr> ! <tr> ! <td style='vertical-align: top;'><br> ! <?php ! // Do not display an image if not available ! if($q->picturelocation == "") { ! echo("<center>No photograph provided!</center>"); ! } else { ! echo("<center><img src='$q->picturelocation' alt='$q->firstname $q->lastname' /></center>"); ! } ! ?> ! </td> ! <td> ! <font size='6'><b><?php echo $q->user; ?></b></font><br> ! <sub> ! Real Name: <?php echo $q->firstname." ".$q->lastname; ?><br /> ! Member since: <?php echo $q->dateregistered; ?> <br /> ! Last seen logged in: <?php echo $q->lastseen?><br> ! Division: <a href='divisions.php?division=<?php echo $q->division; ?>'><?php echo $q->division; ?></a><br /> ! </sub> <br> ! <table width='325'> ! <tr> ! <th width="32"> </th> ! <th width="256">Contact Information</th> ! </tr> ! <tr> ! <td><div align="center"><img src='email.png' alt='E-mail address' /></div></td> ! <td><a href='mailto: <?php echo $q->email; ?>'><?php echo $q->email; ?></a></td> ! </tr> ! <td><div align="center"><img src='icq.png' alt='I Seek You (ICQ) Number' /></div></td> ! <td> ! <?php ! // Check if ICQ information is available ! if ($q->icq != "" && $q->icq != "0") { ! echo("echo $q->icq; (<img src=\"http://wwp.icq.com/scripts/online.dll?icq=$q->icq&img=5\" alt=\"User status\" />)"); } else { ! echo("No ICQ contact!"); ! } ! ?> ! </td> ! </tr> ! <tr> ! <td><div align="center"><img src='msmsgs.png' alt='Microsoft Network: Messenger address' /></div></td> ! <td> ! <?php ! // Check if MSN information is available ! if($q->msn == "") { ! echo("No MSN contact!"); } else { ! echo $q->msn; ! } ! ?> ! </td> ! </tr> ! <tr> ! <td><div align="center"><img src='aim.png' alt='AOL Instant Messenger address' /></div></td> ! <td> ! <?php ! // Check if AIM information is available ! if ($q->aim != "") { ! echo("<a href='aim:goim?screenname=$q->aim&message=Hello+$q->firstname+$q->lastname,+I+was+just+browsing+your+profile+when+I+noticed+you+had+AIM.'>$q->aim</a>"); } else { ! echo("No AIM contact!"); ! } ! ?> ! </td> ! </tr> ! <tr> ! <td><div align="center"><img src='yahoo.png' alt='Yahoo! Messenger address' /></div></td> ! <td> ! <?php ! // Check if YIM information is available ! echo("<a href='http://edit.yahoo.com/config/send_webmesg?.target=$q->yim&.src=pg'>$q->yim</a>"); ! if ($q->yim != "") { ! echo("<img src=\"http://opi.yahoo.com/online?u=$q->yim&m=g&t=1\" alt=\"User status\" />"); ! } else { ! echo("No YIM contact!"); ! } ! ?> ! </td> ! </tr> ! </table> ! <table width="325"> ! <tr> ! <th>Description</th> ! </tr> ! <tr> ! <td><?php echo $q->description; ?></td> ! </tr> ! </table> ! <table width="325"> ! <tr> ! <th width="292">Skills</th> ! </tr> ! <?php ! // List skills neatly into a table ! if(isset($q->skills)){ ! $skill = explode(",", $q->skills); ! ! for($y = 0; $y < count($skill); $y++) { $det = explode("|",$skill[$y]); ! echo("<tr><td><b>$det[0]</b> - ".status($det[1])."</td></tr>\n"); ! } ! ! }else{ ! echo "<tr><td>No skills entered.</td></tr>\n"; ! } ! ?> ! </table> ! </td></tr></table> ! <?php } } ! include($footer); ! ?> \ No newline at end of file Index: updateprofile.php =================================================================== RCS file: /cvsroot/openfirst/members/updateprofile.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** updateprofile.php 2 Nov 2003 16:28:09 -0000 1.7 --- updateprofile.php 9 Nov 2003 02:51:32 -0000 1.8 *************** *** 26,33 **** * */ include("../config/globals.php"); include($header); ! if(isset($user->user)) { if (isset($_POST["firstname"]) == true) { --- 26,38 ---- * */ + // Include system globals and headers include("../config/globals.php"); include($header); ! // Check if user is a member ! if(! isset($user->user)) { ! showlogin(); ! } ! if (isset($_POST["firstname"]) == true) { *************** *** 38,55 **** } ! if($_POST["cellphonesms"] == "0") { ! $_POST["cellphonesms"] = true; ! $user->cellphonesms = "1"; ! } else { ! $_POST["cellphonesms"] = false; ! $user->cellphonesms = "0"; ! } ! if(isset($_POST["sendsmstestmessage"]) && $user->cellphonesms == true) { ! mail($_POST["cellphonenumber"] . "@" . $_POST["cellphonecarrier"], "SMS Test", "This is the test message you requested from $title."); ! echo("A test SMS Message has been sent, it should arrive soon, depending on the speed of your carrier's system."); ! } ! $query = "UPDATE ofirst_members SET firstname='" . $_POST["firstname"] . "', lastname='" . $_POST["lastname"] . "', --- 43,60 ---- } ! if($_POST["cellphonesms"] == "0") { ! $_POST["cellphonesms"] = true; ! $user->cellphonesms = "1"; ! } else { ! $_POST["cellphonesms"] = false; ! $user->cellphonesms = "0"; ! } ! if(isset($_POST["sendsmstestmessage"]) && $user->cellphonesms == true) { ! mail($_POST["cellphonenumber"] . "@" . $_POST["cellphonecarrier"], "SMS Test", "This is the test message you requested from $title."); ! echo("<br><br> A test SMS Message has been sent, it should arrive soon, depending on the speed of your carrier's system."); ! } ! $query = "UPDATE ofirst_members SET firstname='" . $_POST["firstname"] . "', lastname='" . $_POST["lastname"] . "', *************** *** 75,79 **** echo("<br><br>Password Changed. "); } elseif ($_POST["password"] != $_POST["cpassword"]) { ! echo("<br><br>The password and confirm password fields do not match."); } } --- 80,84 ---- echo("<br><br>Password Changed. "); } elseif ($_POST["password"] != $_POST["cpassword"]) { ! echo("<br><br>The password and confirm password fields do not match."); } } *************** *** 83,148 **** ?> ! <h1>Update Profile</h1> ! <p>You may use this page to update your members profile. You should also: <a href="skills.php">update your skills list</a>.</p> ! <form action='updateprofile.php' method='post'> ! <table> ! <tr> <th> </th> <th>Content</th></tr> ! <?php ! echo("<tr><th>Username</th><td>$user->user</td></tr> ! <tr><th>First Name</th><td><input type='text' name='firstname' value='$user->firstname' /></td></tr> ! <tr><th>Last Name</th><td><input type='text' name='lastname' value='$user->lastname' /></td></tr> ! <tr><th>Password</th><td><input type='password' name='password' value='' /></td></tr> ! <tr><th>Confirm Password</th><td><input type='password' name='cpassword' value='' /></td></tr> ! <tr><th>Division</th><td> ! Existing: ! <br><select name='division'>"); ! $div = ofirst_dbquery("SELECT division FROM ofirst_divisions;"); ! while($d = ofirst_dbfetch_object($div)) { ! echo("<option value='$d->division'"); ! if($d->division == $user->division) { echo(" selected='selected'"); } echo(">$d->division</option>"); } ! echo("</select> ! <br>New ! <br><input type='text' name='ndivision' /> ! <br>Description of New Division ! <br><input type='text' name='divisiondescription' /></td></tr> ! <tr><th>Year</th><td><input type='text' name='year' value='$user->year'></td></tr> ! <tr><th>E-mail Address</th><td><input type='text' name='email' value='$user->email'></td></tr> ! <tr><th>Cell Phone/Pager Information</th><td> ! Number (10 digit)<input type='text' value='$user->cellphonenumber' name='cellphonenumber' maxlength='10'> ! <br>Carrier <select name='cellphonecarrier'>"); ! $query = ofirst_dbquery("SELECT * FROM ofirst_cellphonecarriers ORDER BY fullname;"); ! while($sms = ofirst_dbfetch_object($query)) { ! if(($user->smsaddress == "" && $sms->smsaddress == "txt.bellmobility.ca") || ($user->cellphonecarrier == $sms->smsaddress)) { ! echo("<option value='$sms->smsaddress' selected='selected'>$sms->fullname</option>\n"); ! } else { ! echo("<option value='$sms->smsaddress'>$sms->fullname</option>\n"); ! } ! } ! if($user->cellphonesms == "1") { ! echo("</select><br><input type='checkbox' checked='checked' value='0' name='cellphonesms'>Device is SMS Enabled"); ! } else { ! echo("</select><br><input type='checkbox' value='0' name='cellphonesms'>Device is SMS Enabled"); ! } ! echo("<br><input type='checkbox' value='on' name='sendsmstestmessage'>Send a test SMS message to my device</td></tr> ! <tr><th>ICQ Number</th><td><input type='text' name='icq' value='$user->icq'></td></tr> ! <tr><th>AIM Screenname</th><td><input type='text' name='aim' value='$user->aim'></td></tr> ! <tr><th>MSN Messenger Address</th><td><input type='text' name='msn' value='$user->msn'></td></tr> ! <tr><th>Yahoo! Instant Messenger Address</th><td><input type='text' name='yim' value='$user->yim'></td></tr> ! <tr><th>Freeform Description</th><td><textarea name='description'>$user->description</textarea></td></tr> ! <tr><th>Signature</th><td><textarea name='signature'>$user->signature</textarea></td></tr> ! <tr><th>Picture Location</th><td><input type='text' name='picturelocation' value='$user->picturelocation'></td></tr> ! "); ! ?> ! <tr><td></td><td><input type="submit" value="Update Profile"> <input type="reset" value="Reset Profile"> ! </table> ! </form> <?php ! } else { ! showlogin(); ! } ! include($footer); ?> --- 88,186 ---- ?> ! <h1>Update Profile</h1> ! <p>You may use this page to update your members profile. You should also: <a href="skills.php">update your skills list</a>.</p> ! <form action='updateprofile.php' method='post'> ! <table> ! <tr> <th> </th> <th>Content</th></tr> ! <tr><th>Username</th><td><?php echo $user->user; ?></td></tr> ! <tr><th>First Name</th><td><input type='text' name='firstname' value='<?php echo $user->firstname; ?>' /></td></tr> ! <tr><th>Last Name</th><td><input type='text' name='lastname' value='<?php echo$user->lastname; ?>' /></td></tr> ! <tr><th>Password</th><td><input type='password' name='password' value='' /></td></tr> ! <tr><th>Confirm Password</th><td><input type='password' name='cpassword' value='' /></td></tr> ! <tr><th>Division</th> ! <td> ! Existing: ! <br><select name='division'> ! <?php ! $div = ofirst_dbquery("SELECT division FROM ofirst_divisions;"); ! while($d = ofirst_dbfetch_object($div)) { ! echo("<option value='$d->division'"); ! if($d->division == $user->division) { echo(" selected='selected'"); } echo(">$d->division</option>"); } ! ?> ! </select> ! <br> ! <br> ! <table width="75%"> ! <tr> ! <th>New Division</th> ! </tr> ! <tr> ! <td>Division Name<br> ! <input type='text' name='ndivision' /> <br> ! Description of New Division <br> <input type='text' name='divisiondescription' /></td> ! </tr> ! </table> </td> ! </tr> ! <tr><th>Year</th><td><input type='text' name='year' value='<?php echo $user->year; ?>'></td></tr> ! <tr><th>E-mail Address</th><td><input type='text' name='email' value='<?php echo $user->email; ?>'></td></tr> ! <tr><th>Cell Phone/Pager Information</th><td> ! Number (10 digit)<input type='text' value='<?php echo $user->cellphonenumber; ?>' name='cellphonenumber' maxlength='10'> ! <br>Carrier ! <select name='cellphonecarrier'> ! <?php ! // Populate cell phone carrier space ! $query = ofirst_dbquery("SELECT * FROM ofirst_cellphonecarriers ORDER BY fullname;"); ! while($sms = ofirst_dbfetch_object($query)) { ! if(($user->smsaddress == "" && $sms->smsaddress == "txt.bellmobility.ca") || ($user->cellphonecarrier == $sms->smsaddress)) { ! echo("<option value='$sms->smsaddress' selected='selected'>$sms->fullname</option>\n"); ! } else { ! echo("<option value='$sms->smsaddress'>$sms->fullname</option>\n"); ! } ! } ! ?> ! </select> ! <?php ! // Check user specified cell info ! if($user->cellphonesms == "1") { ! echo("</select><br><input type='checkbox' checked='checked' value='0' name='cellphonesms'>Device is SMS Enabled"); ! } else { ! echo("</select><br><input type='checkbox' value='0' name='cellphonesms'>Device is SMS Enabled"); ! } ! ?> ! <br><input type='checkbox' value='on' name='sendsmstestmessage'>Send a test SMS message to my device</td></tr> ! <tr> ! <th>ICQ Number</th><td><input type='text' name='icq' value='<?php echo $user->icq; ?>'></td> ! </tr> ! <tr> ! <th>AIM Screenname</th><td><input type='text' name='aim' value='<?php echo $user->aim; ?>'></td></tr> ! <tr> ! <th>MSN Messenger</th> ! <td><input type='text' name='msn' value='<?php echo $user->msn; ?>'></td></tr> ! <tr> ! <th>Yahoo! Instant Messenger</th> ! <td><input type='text' name='yim' value='<?php echo $user->yim; ?>'></td></tr> ! <tr> ! <th>Freeform Description</th><td><textarea name='description' cols="40" rows="10"><?php echo $user->description; ?></textarea></td> ! </tr> ! <tr> ! <th>Signature</th> ! <td><textarea name='signature' cols="40" rows="5"><?php echo $user->signature; ?></textarea></td> ! </tr> ! <tr> ! <th>Picture Location</th> ! <td><input type='text' name='picturelocation' value='<?php echo $user->picturelocation; ?>'></td> ! </tr> ! <tr> ! <td> </td> ! <td><input type="submit" value="Update Profile"> <input type="reset" value="Reset Profile"> ! </tr> ! </table> ! </form> <?php ! include($footer); ! ?> |