コード例 #1
0
ファイル: delete_skill.php プロジェクト: seans888/Bgy-Project
require 'path.php';
init_cobalt('Delete skill');
if (isset($_GET['skill_id'])) {
    $skill_id = urldecode($_GET['skill_id']);
    require_once 'form_data_skill.php';
}
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_delete']);
    require 'components/query_string_standard.php';
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_skill.php?{$query_string}");
    } elseif ($_POST['btn_delete']) {
        log_action('Pressed delete button');
        require_once 'subclasses/skill.php';
        $dbh_skill = new skill();
        $object_name = 'dbh_skill';
        require 'components/create_form_data.php';
        $dbh_skill->delete($arr_form_data);
        redirect("listview_skill.php?{$query_string}");
    }
}
require 'subclasses/skill_html.php';
$html = new skill_html();
$html->draw_header('Delete Skill', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('skill_id');
$html->detail_view = TRUE;
$html->draw_controls('delete');
$html->draw_footer();
コード例 #2
0
ファイル: personSkillAdd.php プロジェクト: cjbayliss/alloc
    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) {
        $skill->save();
    }
}
if ($_POST["delete_skill"]) {
    $skill = new skill();
    if ($_POST["new_skill_name"] != "") {
        $skill->set_id($_POST["new_skill_name"]);
        $skill->delete();
    }
}
$skill_classes = skill::get_skill_classes();
$skill_classes[""] = ">> OTHER >>";
$TPL["new_skill_classes"] = page::select_options($skill_classes, $_POST["skill_class"]);
$skills = skill::get_skills();
// if a skill class is selected and a skill that is not in that class is also selected, clear the skill as this is what the filter options will do
if ($skill_class && !in_array($skills[$_POST["skill"]], $skills)) {
    $_POST["skill"] = "";
}
$skills[""] = ">> NEW >>";
$TPL["new_skills"] = page::select_options($skills, $_POST["skill"]);
$TPL["main_alloc_title"] = "Edit Skills - " . APPLICATION_NAME;
if ($current_user->have_perm(PERM_PERSON_READ_MANAGEMENT)) {
    include_template("templates/personSkillAdd.tpl");