Esempio n. 1
0
        echo drawServerMessage("Your personal info hasn't been updated in a while.  Please update this form and click Save at the bottom.  Your home and emergency contact information will remain private -- only senior staff (and their assistants) have access to it.");
    } elseif (empty($user["updatedOn"])) {
        echo drawServerMessage("Welcome to the Intranet!  Since this is your first time logging in, please make certain that the staff information here is correct, then click 'save changes' at the bottom.  (The emergency and home info is private and optional.)");
    }
} elseif (isset($_GET["requestID"])) {
    $r = db_grab("SELECT \n\t\tu.firstname,\n\t\tu.nickname,\n\t\tu.lastname,\n\t\tu.title, \n\t\tu.email,  \n\t\tu.bio, \n\t\tu.phone, \n\t\tu.officeID, \n\t\tu.corporationID,\n\t\tu.departmentID,\n\t\tu.createdOn,\n\t\tGETDATE() startDate\n\t\tFROM users_requests u WHERE id = " . $_GET["requestID"]);
} else {
    $r["startDate"] = db_grab("SELECT GETDATE()");
}
//set default rank
if (!isset($r["rankID"])) {
    $r["rankID"] = db_grab("SELECT id FROM intranet_ranks WHERE isDefault = 1");
}
$isRequired = isset($_GET["id"]) && $_GET["id"] == $user["id"] && $locale == "/_seedco/";
$form = new intranet_form();
$form->addGroup("Public Information");
$form->addRow("itext", "First Name", "firstname", @$r["firstname"], "", true, 50);
$form->addRow("itext", "Nickname", "nickname", @$r["nickname"], "", false, 50);
$form->addRow("itext", "Last Name", "lastname", @$r["lastname"], "", true, 50);
$form->addRow("itext", "Email", "email", @$r["email"], "", true, 50);
$form->addRow("itext", "Title", "title", @$r["title"], "", false, 100);
$form->addRow("select", "Organization", "corporationID", "SELECT id, description FROM organizations ORDER BY description", @$r["corporationID"], false);
$form->addRow("department", "Department", "departmentID", "", @$r["departmentID"]);
$form->addRow("select", "Location", "officeID", "SELECT id, name from intranet_offices order by name", @$r["officeID"], true);
$form->addRow("phone", "Phone", "phone", @format_phone($r["phone"]), "", true, 14);
$form->addRow("textarea-plain", "Bio", "bio", @$r["bio"]);
$form->addCheckboxes('skills', 'Skills', 'skills', 'users_to_skills', 'user_id', 'skill_id', $_GET['id']);
$form->addRow("file", "Image", "userfile");
if ($isAdmin) {
    //some fields are admin-only (we don't want people editing the staff page on the website)
    $form->addGroup("Administrative Information [public, but not editable by staff]");