Update of /cvsroot/openfirst/members
In directory sc8-pr-cvs1:/tmp/cvs-serv17357
Modified Files:
profile.php
Log Message:
Add skill search to members profiles
Index: profile.php
===================================================================
RCS file: /cvsroot/openfirst/members/profile.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** profile.php 12 Aug 2003 05:02:59 -0000 1.9
--- profile.php 12 Aug 2003 17:47:25 -0000 1.10
***************
*** 32,42 ****
<h1>Members Profiles</h1>
<?php
if(isset($_GET["id"]) == false) {
?>
<table>
<tr><th><a href="profile.php?orderby=user">Nick Name</a></th><th><a href="profile.php?orderby=team">Team</a></th><th><a href="profile.php?orderby=email">E-mail</a></th><th><a href="profile.php?orderby=msn">MSN</a></th><th><a href="profile.php?orderby=icq">ICQ</a></th><th><a href="profile.php?orderby=aim">AIM</a></th><th><a href="profile.php?orderby=picturelocation">Photo</th></tr>
<?php
if($_GET["orderby"] == "") { $_GET["orderby"] = "user"; }
! $query = mysql_query("SELECT * FROM ofirst_members where " . $_GET["orderby"] . " is NOT NULL ORDER BY " . $_GET["orderby"] . ";");
while($q = mysql_fetch_object($query)) {
echo("<tr><td><a href='profile.php?id=$q->user'>$q->user</a></td><td>$q->team</td>");
--- 32,97 ----
<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>
+
<table>
<tr><th><a href="profile.php?orderby=user">Nick Name</a></th><th><a href="profile.php?orderby=team">Team</a></th><th><a href="profile.php?orderby=email">E-mail</a></th><th><a href="profile.php?orderby=msn">MSN</a></th><th><a href="profile.php?orderby=icq">ICQ</a></th><th><a href="profile.php?orderby=aim">AIM</a></th><th><a href="profile.php?orderby=picturelocation">Photo</th></tr>
<?php
if($_GET["orderby"] == "") { $_GET["orderby"] = "user"; }
! if(isset($extra) == true && $extra != "") {
! $query = mysql_query("SELECT * FROM ofirst_members where " . $_GET["orderby"] . " is NOT NULL $extra ORDER BY " . $_GET["orderby"] . ";");
! } else {
! $query = mysql_query("SELECT * FROM ofirst_members where " . $_GET["orderby"] . " is NOT NULL ORDER BY " . $_GET["orderby"] . ";");
! }
while($q = mysql_fetch_object($query)) {
echo("<tr><td><a href='profile.php?id=$q->user'>$q->user</a></td><td>$q->team</td>");
***************
*** 120,138 ****
<p>");
- 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");
- }
- }
$skill = explode(",", $q->skills);
for($y = 0; $y < count($skill); $y++) {
--- 175,178 ----
|