[Openfirst-cvscommit] members skills.php,NONE,1.1
Brought to you by:
xtimg
|
From: <xt...@us...> - 2003-06-01 05:59:59
|
Update of /cvsroot/openfirst/members
In directory sc8-pr-cvs1:/tmp/cvs-serv11531
Added Files:
skills.php
Log Message:
Add skills chart to members module.
--- NEW FILE: skills.php ---
<?php
/*
* openFIRST.members - skills.php
*
* Copyright (C) 2003,
* openFIRST Project
* Original Author: Tim Ginn <tim...@po...>
*
* 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($user->user)) {
?>
<?php
membersmenu($user->membertype);
$skills = array('Languages', 'Computer-Programming', 'Hands-on-Skills', 'Fundraising',
'Creativity', 'Organization', 'Time-Management', 'Research', 'Computer-Aided-Design', 'Teaching',
'Mentorship');
if(isset($_POST["$skills[0]"]) == true) {
for($x=0; $x < count($skills); $x++) {
if (isset($_POST["$skills[$x]"]) == true) {
if($_POST["$skills[$x]"] > 0) {
$skilled = $skilled . $skills[$x] . "|" . $_POST["$skills[$x]"] . ",";
}
}
}
$query = "UPDATE ofirst_members SET skills='$skilled' WHERE user='$user->user';";
$q = mysql_query($query);
unset($q);
$query = "SELECT * FROM ofirst_members WHERE user='$user->user';";
$q = mysql_query($query);
$user = mysql_fetch_object($q);
echo("Updated Skills");
}
?>
<h1>Skills</h1>
<p>You may use this page to customize the listing of skills that you have. Having skills from
this list allows those interested in starting a project to locate all the people with the required
skills. It also allows those members who are new to a team to quickly find out who it is they
should talk to regarding what.</p>
<form action='skills.php' method='post'>
<table>
<tr><th>Skill Name</th><th>Proficiency</th></tr>
<?php
if(isset($user->skills) == true) {
$skill = explode(",", $user->skills);
for($y = 0; $y < count($skills); $y++) {
$set = "n";
for($x = 0; $x < count($skill); $x++) {
$det = explode("|",$skill[$x]);
if($det[0] == $skills[$y]) {
echo("<tr><td>$det[0]</td>");
echo("<td><select name='$det[0]'><option value='0'>No skill</option>");
if ($det[1] == "1") {
echo("<option value='1' selected='selected'>Minimal skill</option>");
} else {
echo("<option value='1'>Minimal skill</option>");
}
if ($det[1] == "2") {
echo("<option value='2' selected='selected'>Not quite mediocre</option>");
} else {
echo("<option value='2'>Not quite mediocre</option>");
}
if ($det[1] == "3") {
echo("<option value='3' selected='selected'>Mediocre</option>");
} else {
echo("<option value='3'>Mediocre</option>");
}
if ($det[1] == "4") {
echo("<option value='4' selected='selected'>Competent</option>");
} else {
echo("<option value='4'>Competent</option>");
}
if ($det[1] == "5") {
echo("<option value='5' selected='selected'>Above Average</option>");
} else {
echo("<option value='5'>Above Average</option>");
}
if ($det[1] == "6") {
echo("<option value='6' selected='selected'>Professional</option>");
} else {
echo("<option value='6'>Professional</option>");
}
echo("</select></td></tr>");
$set = "y";
}
}
if($set == "n") {
echo("<tr><td>$skills[$y]</td><td><select name='$skills[$y]'>
<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>
</td></tr>");
}
}
} else {
echo("You do not have any skills set up.");
for($y = 0; $y < count($skills); $y++) {
echo("<tr><td>$skills[$y]</td><td><select name='$skills[$y]'>
<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>
</td></tr>");
}
}
?>
<tr><td></td><td><input type="submit" value="Set skills"> <input type="reset" value="Reset skills">
</table>
</form>
<?php } else {
showlogin();
}
include($footer); ?>
|