示例#1
0
 * 
 * allocPSA 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 Affero General Public
 * License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with allocPSA. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "../alloc.php";
// add new skill to database
if ($_POST["add_skill"]) {
    $failed = FALSE;
    $skill = new skill();
    if ($_POST["new_skill_class"] != "") {
        $skill->set_value('skillClass', $_POST["new_skill_class"]);
    } else {
        if ($_POST["other_new_skill_class"] != "") {
            $skill->set_value('skillClass', $_POST["other_new_skill_class"]);
        } else {
            $failed = TRUE;
        }
    }
    if ($_POST["other_new_skill_name"] != "") {
        $skill->set_value('skillName', $_POST["other_new_skill_name"]);
        // description for now can be the same as the name
        $skill->set_value('skillDescription', $_POST["other_new_skill_name"]);
    } else {
        $failed = TRUE;
    }
    if ($failed == FALSE && $skill->skill_exists() == FALSE) {