예제 #1
0
파일: tf.php 프로젝트: cjbayliss/alloc
    }
    if ($tf->get_value("tfName") == "") {
        alloc_error("You must enter a name.");
    } else {
        if (!$tf->get_id()) {
            $db = new db_alloc();
            $q = prepare("SELECT count(*) AS tally FROM tf WHERE tfName = '%s'", $tf->get_value("tfName"));
            $db->query($q);
            $db->next_record();
            $tf_is_taken = $db->f("tally");
        }
        if ($tf_is_taken) {
            alloc_error("That TF name is taken, please choose another.");
        } else {
            $tf->set_value("tfComments", rtrim($tf->get_value("tfComments")));
            $tf->save();
            $TPL["message_good"][] = "Your TF has been saved.";
            $tf_is_new and $TPL["message_help"][] = "Please now add the TF Owners who are allowed to access this TF.";
        }
    }
} else {
    if ($_POST["delete"]) {
        $tf->delete();
        alloc_redirect($TPL["url_alloc_tfList"]);
        exit;
    }
}
if ($_POST["person_save"] || $_POST["person_delete"]) {
    $tfPerson = new tfPerson();
    $tfPerson->read_globals();
    $tfPerson->read_globals("person_");