Exemplo n.º 1
0
<?php

include "../../include.php";
url_query_require();
if ($posting) {
    $id = db_save("wiki_topics");
    db_checkboxes("tags", "wiki_topics_to_tags", "topicID", "tagID", $id);
    url_change("topic.php?id=" . $id);
}
echo drawTop();
$r = db_grab("SELECT id, title, description, type_id FROM wiki_topics WHERE id = " . $_GET["id"]);
$form = new intranet_form();
if ($page['is_admin']) {
    $form->addUser("created_user", "Posted By", $_SESSION["user_id"], false, true);
}
$form->addRow("itext", "Title", "title", $r["title"], "", true, 255);
$form->addRow("select", "Type", "type_id", "SELECT id, description FROM wiki_topics_types", $r["type_id"], true);
$form->addCheckboxes("tags", "Tags", "wiki_tags", "wiki_topics_to_tags", "topicID", "tagID", $_GET["id"]);
$form->addRow("textarea", "Description", "description", $r["description"], "", true);
$form->addRow("submit", "post wiki topic");
$form->draw("Add a Wiki Topic");
echo drawBottom();
Exemplo n.º 2
0
    if ($posting) {
        if (isset($_FILES["content"]["name"]) && !empty($_FILES["content"]["name"])) {
            list($_POST["content"], $_POST["fileTypeID"]) = file_get_uploaded("content", "docs_types");
        }
        if (isset($_FILES["image"]["name"]) && !empty($_FILES["image"]["name"])) {
            list($_POST["image"], $_POST["imageTypeID"]) = file_get_uploaded("image", "docs_types");
            //die($_POST["image"]);
        }
        $id = db_save("news_stories");
        db_checkboxes("corporationID", "news_stories_to_organizations", "newsID", "organizationID", $id);
        url_change("./?id=" . $id);
    }
    echo drawTop();
    $r = db_grab("SELECT \n\t\tn.headline,\n\t\tn.outlet,\n\t\tn.pubdate,\n\t\tn.url,\n\t\tn.description\n\t\tFROM news_stories n\n\t\tWHERE id = " . $_GET["id"]);
}
$form = new intranet_form();
$form->addCheckboxes("corporationID", "Organization", "organizations", "news_stories_to_organizations", "newsID", "organizationID", @$_GET["id"]);
$form->addRow("itext", "Headline", "headline", @$r["headline"], "", true, 255);
$form->addRow("itext", "News Outlet", "outlet", @$r["outlet"], "", true, 255);
$form->addRow("date", "Date", "pubdate", @$r["pubdate"], "", true);
$form->addRow("file", "Image<br>(optional)", "image", "", "", false);
$form->addRow("file", "File<br>(optional)", "content", "", "", true);
$form->addRow("itext", "URL<br>(optional)", "url", @$r["url"], "", false, 255);
$form->addRow("textarea-plain", "Description<br>(optional)", "description", @$r["description"]);
$form->addRow("submit", "Save Changes");
if (url_id()) {
    $form->draw("<a href='/news/'>In the News</a> &gt; Edit Story");
    echo drawBottom();
} else {
    $form->draw("Add New Story");
}
Exemplo n.º 3
0
        ?>
</td>
		<td align="right"><?php 
        echo format_date($t["created_date"]);
        ?>
</td>
	</tr>
	<?php 
    }
} else {
    echo drawEmptyResult("No Wiki Topics have been entered into the system yet.<br>Perhaps you would like to <a href='#bottom'>add one</a>?", 4);
}
?>
</table>

<a name="bottom"></a>

<?php 
if ($page['is_admin']) {
    $form = new intranet_form();
    if ($page['is_admin']) {
        $form->addUser("created_user", "Posted By", $_SESSION["user_id"], false, true);
    }
    $form->addRow("itext", "Title", "title", "", "", true, 255);
    $form->addRow("select", "Type", "type_id", "SELECT id, description FROM wiki_topics_types");
    $form->addCheckboxes("tags", "Tags", "wiki_tags", "wiki_topics_to_tags");
    $form->addRow("textarea", "Description", "description", "", "", true);
    $form->addRow("submit", "post wiki topic");
    $form->draw("Add a Wiki Topic");
}
echo drawBottom();
Exemplo n.º 4
0
    $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]");
    $form->addRow("select", "Rank", "rankID", "SELECT id, description from intranet_ranks", @$r["rankID"], true);
    $form->addRow("date", "Start Date", "startDate", @$r["startDate"], "", false);
    $form->addRow("date", "End Date", "endDate", @$r["endDate"], "", false);
    $form->addCheckboxes("permissions", "Permissions", "modules", "administrators", "userID", "moduleID", @$_GET["id"]);
}
$form->addGroup("Home Contact Information [private]");
$form->addRow("itext", "Address 1", "homeAddress1", @$r["homeAddress1"], "", false);
$form->addRow("itext", "Address 2", "homeAddress2", @$r["homeAddress2"], "", false);
$form->addRow("itext", "City", "homeCity", @$r["homeCity"], "", false);
$form->addRow("select", "State", "homeStateID", "SELECT stateID, stateName from intranet_us_states order by stateName", @$r["homeStateID"], false);
$form->addRow("itext", "ZIP", "homeZIP", @$r["homeZIP"], "", false, 5);