Exemplo n.º 1
0
<?php

include "../../include.php";
if ($posting) {
    langTranslatePost('title');
    $id = db_save('organizations');
    url_drop('id');
} elseif (url_action('delete') && url_id('delete_id')) {
    db_delete('organizations', $_GET['delete_id']);
    url_drop('delete_id,action');
}
echo drawTop();
if (url_id()) {
    //form
    $f = new form('organizations', @$_GET['id']);
    $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title')));
    langUnsetFields($f, 'title');
    langTranslateCheckbox($f);
    echo $f->draw();
} else {
    //modules list
    $t = new table('organizations', drawHeader());
    $t->set_column('draggy', 'd', '&nbsp;');
    $t->set_column('title', 'l', getString('title'));
    $t->set_column('delete', 'd', '&nbsp;');
    $result = db_table('SELECT id, title' . langExt() . ' title FROM organizations WHERE is_active = 1 ORDER BY precedence');
    foreach ($result as &$r) {
        $r['draggy'] = draw_img('/images/icons/move.png');
        $r['title'] = draw_link('organizations.php?id=' . $r['id'], $r['title']);
        $r['delete'] = drawColumnDelete($r['id']);
    }
Exemplo n.º 2
0
<?php

include "../../include.php";
if ($posting) {
    langTranslatePost('title');
    $id = db_save('modules');
    url_drop('id');
}
echo drawTop();
if (url_id()) {
    //form
    $f = new form('modules', @$_GET['id']);
    $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title')));
    langUnsetFields($f, 'title');
    langTranslateCheckbox($f);
    echo $f->draw();
} else {
    //modules list
    $t = new table('modules', drawHeader());
    $t->set_column('is_selected', 'd', '&nbsp;');
    $t->set_column('draggy', 'd', '&nbsp;');
    $t->set_column('title', 'l', getString('title'));
    $t->set_column('pages', 'r');
    $result = db_table('SELECT m.id, m.title' . langExt() . ' title, m.is_active, (SELECT COUNT(*) FROM pages p WHERE p.module_id = m.id AND p.modulette_id IS NULL) pages FROM modules m ORDER BY m.precedence');
    $t->set_draggable('draggy');
    foreach ($result as &$r) {
        $r['is_selected'] = draw_form_checkbox('foo', $r['is_active'], false, 'ajax_set(\'modules\', \'is_active\', ' . $r['id'] . ', ' . abs($r['is_active'] - 1) . ');');
        $r['draggy'] = draw_img('/images/icons/move.png');
        $r['title'] = draw_link('./?id=' . $r['id'], $r['title']);
        $r['pages'] = draw_link('pages.php?module_id=' . $r['id'], format_quantitize($r['pages'], 'page'));
    }
Exemplo n.º 3
0
            url_change('/staff/add_edit.php?id=' . $_SESSION['user_id']);
        }
    }
    //handle side menu pref updates
    error_debug('handle side menu pref updates', __FILE__, __LINE__);
    if (isset($_GET['module'])) {
        //todo ajax
        if (db_grab('SELECT COUNT(*) FROM users_to_modules_closed WHERE module_id = ' . $_GET['module'] . ' AND user_id = ' . $_SESSION['user_id'])) {
            db_query('DELETE FROM users_to_modules_closed WHERE module_id = ' . $_GET['module'] . ' AND user_id = ' . $_SESSION['user_id']);
        } else {
            db_query('INSERT INTO users_to_modules_closed ( module_id, user_id ) VALUES ( ' . $_GET['module'] . ', ' . $_SESSION['user_id'] . ' )');
        }
        url_query_drop('module');
    } elseif (isset($_GET['channel_id'])) {
        $_SESSION['channel_id'] = empty($_GET['channel_id']) ? false : $_GET['channel_id'];
        url_drop('channel_id');
    }
}
//obsolete functions
error_debug('include obsolete.php', __FILE__, __LINE__);
include DIRECTORY_ROOT . '/obsolete.php';
//done!
error_debug('done processing include!', __FILE__, __LINE__);
//draw functions
function drawColumnDelete($id)
{
    return draw_img('/images/icons/delete.png', 'javascript:confirmDelete(' . $id . ');');
}
function drawEmail($message)
{
    //parse out a regular screen and make it look good in email
Exemplo n.º 4
0
include '../../include.php';
if ($posting) {
    if ($_GET['doc_id'] == 'new') {
        $_GET['doc_id'] = false;
    }
    if ($uploading) {
        $_POST['extension'] = file_type($_FILES['content']['name']);
        $_POST['content'] = file_get_uploaded('content');
    }
    $id = db_save('dl_docs', @$_GET['doc_id']);
    db_checkboxes('categories', 'dl_docs_to_categories', 'doc_id', 'category_id', $id);
    url_drop('id');
} elseif (url_action('delete')) {
    db_delete('dl_docs');
    url_drop('id,action');
}
echo drawTop();
if (!empty($_GET['doc_id'])) {
    if ($_GET['doc_id'] == 'new') {
        $_GET['doc_id'] = false;
    }
    $f = new form('dl_docs', @$_GET['doc_id'], ($_GET['doc_id'] ? 'Edit' : 'Add') . ' Document');
    $f->set_title_prefix($page['breadcrumbs']);
    $f->set_field(array('name' => 'title', 'label' => getString('title'), 'type' => 'text'));
    $f->unset_fields('extension');
    $f->set_field(array('name' => 'content', 'label' => getString('file'), 'type' => 'file', 'additional' => getString('upload_max') . file_get_max()));
    $f->set_field(array('name' => 'categories', 'label' => getString('categories'), 'type' => 'checkboxes', 'options_table' => 'dl_categories', 'option_title' => 'title', 'linking_table' => 'dl_docs_to_categories', 'object_id' => 'doc_id', 'option_id' => 'category_id'));
    echo $f->draw();
} else {
    $result = db_table('SELECT 
Exemplo n.º 5
0
<?php

include "include.php";
if (url_action('delete')) {
    db_delete('bb_topics_types');
    url_drop('action,id');
}
echo drawTop();
$t = new table('bb_topics_types', drawHeader($page['is_admin'] ? array('category_edit.php' => getString('category_new')) : false));
$t->set_column('category', 'l', getString('category'));
$t->set_column('topics', 'r', getString('topics'));
if ($page['is_admin']) {
    $t->set_column('delete', 'd', '&nbsp;');
}
$result = db_table('SELECT 
		y.id, 
		y.title' . langExt() . ' category, 
		(SELECT COUNT(*) FROM bb_topics t WHERE t.type_id = y.id AND t.is_active = 1) topics 
	FROM bb_topics_types y 
	WHERE y.is_active = 1
	ORDER BY y.title');
foreach ($result as &$r) {
    $r['category'] = draw_link('category.php?id=' . $r['id'], $r['category']);
    if ($page['is_admin']) {
        $r['delete'] = draw_img('/images/icons/delete.png', url_query_add(array('action' => 'delete', 'id' => $r['id']), false));
    }
}
echo $t->draw($result, 'No categories added yet');
echo drawBottom();
Exemplo n.º 6
0
<?php

include "../../include.php";
if (url_id() && url_action('delete')) {
    db_delete('web_news_blurbs', $_GET['delete_id']);
    url_drop('action,delete_id');
}
echo drawTop();
$blurbs = db_table("SELECT b.id, b.title, b.publish_date FROM web_news_blurbs b WHERE b.is_active = 1 ORDER BY b.publish_date DESC");
$t = new table("web_news_blurbs");
$t->set_column("title");
$t->set_column("publish_date", "r");
$t->set_column('delete', 'c', '&nbsp;');
$t->set_title(drawHeader(array("add new" => "edit/")));
foreach ($blurbs as &$b) {
    $b["title"] = draw_link("edit/?id=" . $b["id"], $b["title"]);
    $b["publish_date"] = format_date($b["publish_date"]);
    $b['delete'] = draw_img('/images/icons/delete.gif', url_query_add(array('action' => 'delete', 'id' => $b['id']), false));
}
echo $t->draw($blurbs);
echo drawBottom();
Exemplo n.º 7
0
<?php

include "../include.php";
if (url_action("delete")) {
    db_query("UPDATE intranet_jobs SET \n\t\t\t\tdeletedOn = GETDATE(),\n\t\t\t\tdeletedBy = {$user["id"]},\n\t\t\t\tisActive = 0\n\t\t\tWHERE id = " . $_GET["id"]);
    url_drop();
}
if ($posting) {
    $userID = $isAdmin ? $_POST["createdBy"] : $user["id"];
    format_post_html("description");
    db_query("INSERT INTO intranet_jobs (\n    \ttitle,\n    \tdescription,\n\t\tcorporationID,\n\t\tofficeID,\n\t\tcreatedBy,\n\t\tcreatedOn,\n\t\tisActive\n\t) VALUES (\n\t\t'" . $_POST["title"] . "',\n\t\t" . $_POST["description"] . ",\n\t\t" . $_POST["corporationID"] . ",\n\t\t" . $_POST["officeID"] . ",\n\t\t" . $userID . ",\n\t\tGETDATE(),\n\t\t1\n    );");
    url_change();
}
drawTop();
?>
<table class="left" cellspacing="1">
	<?php 
if ($isAdmin) {
    $colspan = 4;
    echo drawHeaderRow("Open Positions", $colspan, "new", "#bottom");
} else {
    $colspan = 3;
    echo drawHeaderRow("Open Positions", $colspan);
}
?>
	<tr>
		<th align="left" width="50%">Title</th>
		<th align="left" width="30%">Location</th>
		<th align="right" width="20%"><nobr>Last Update</nobr></th>
		<?php 
if ($isAdmin) {
Exemplo n.º 8
0
<?php

include '../include.php';
//need a type
url_query_require('./');
if (url_action('delete')) {
    db_delete('external_orgs', $_GET['org_id']);
    url_drop('action,org_id');
}
echo drawTop();
//main table
echo drawTableStart();
if ($page['is_admin']) {
    echo drawHeaderRow($page['breadcrumbs'] . format_string(db_grab('SELECT title' . langExt() . ' title FROM external_orgs_types WHERE id = ' . $_GET['id'])), 1, getString('add_new'), '#bottom');
} else {
    echo drawHeaderRow($page['breadcrumbs'] . format_string(db_grab('SELECT title' . langExt() . ' title FROM external_orgs_types WHERE id = ' . $_GET['id'])));
}
$orgs = db_query('SELECT 
	o.id, o.url, o.title' . langExt() . ' title, o.description' . langExt() . ' description 
	FROM external_orgs o 
		' . getChannelsWhere('external_orgs', 'o', 'org_id') . '
		AND (SELECT COUNT(*) FROM external_orgs_to_types t WHERE t.org_id = o.id AND t.type_id = ' . $_GET['id'] . ' > 0)
	ORDER BY o.title');
if (db_found($orgs)) {
    while ($o = db_fetch($orgs)) {
        ?>
	<tr>
		<td class='text'>
			<?php 
        if ($page['is_admin']) {
            ?>
Exemplo n.º 9
0
<?php

include "../../include.php";
//download
if (url_action("delete")) {
    db_query("UPDATE policy_docs SET is_active = 0, deleted_date = GETDATE(), deleted_user = {$_SESSION["user_id"]} WHERE id = " . $_GET["id"]);
    url_drop("id, action");
} elseif (url_id()) {
    $d = db_grab("SELECT d.name, t.extension, d.content FROM policy_docs d JOIN docs_types t ON d.type_id = t.id WHERE d.id = " . $_GET["id"]);
    //db_query("INSERT INTO docs_views ( documentID, user_id, viewedOn ) VALUES ( {$_GET["id"]}, {$_SESSION["user_id"]}, GETDATE() )");
    file_download($d["content"], $d["name"], $d["extension"]);
}
//get nav options
$options = array();
$categories = db_query("SELECT id, description FROM policy_categories ORDER BY description");
while ($c = db_fetch($categories)) {
    if (!isset($_GET["category"])) {
        url_query_add(array("category" => $c["id"]));
    }
    $options[str_replace(url_base(), "", url_query_add(array("category" => $c["id"]), false))] = $c["description"];
}
echo drawTop();
echo drawNavigationRow($options, "areas", true);
?>
<table class="left">
	<?php 
if ($page['is_admin']) {
    echo drawheaderRow("", 4, "add", "edit/");
} else {
    echo drawheaderRow("", 3);
}
Exemplo n.º 10
0
<?php

include "../../include.php";
echo drawTop();
if (url_action("delete")) {
    db_delete("news_stories");
    url_drop("action,id");
} elseif (url_id()) {
    $r = db_grab("SELECT \n\t\tn.headline,\n\t\tn.outlet,\n\t\tn.content,\n\t\td2.extension docExt,\n\t\td2.icon,\n\t\td2.description docTypeDesc,\n\t\tn.image,\n\t\td.extension imageExt,\n\t\tn.pubDate,\n\t\tn.url,\n\t\tn.description,\n\t\tISNULL(n.updated_date, n.created_date) updated\n\t\tFROM news_stories n\n\t\tLEFT JOIN docs_types d ON n.imageTypeID = d.id\n\t\tLEFT JOIN docs_types d2 ON n.fileTypeID = d2.id\n\t\tWHERE n.id = " . $_GET["id"]);
    if ($r["image"]) {
        //should be has_image, but whatever
        $filename = DIRECTORY_WRITE . "/news/thumbnail-" . $_GET["id"] . "." . $r["imageExt"];
        file_dynamic($filename, $r["updated"], "SELECT image FROM news_stories WHERE id = " . $_GET["id"]);
    }
    echo drawTableStart();
    echo drawHeaderRow("News Item", 2, "edit", "edit.php?id=" . $_GET["id"]);
    ?>
	<tr>
		<td class="left">Organization(s)</td>
		<td><?php 
    $organizations = db_query("SELECT \n\t\t\to.description \n\t\t\tFROM news_stories_to_organizations ns2o\n\t\t\tJOIN organizations o ON ns2o.organizationID = o.id\n\t\t\tWHERE ns2o.newsID = " . $_GET["id"]);
    while ($o = db_fetch($organizations)) {
        echo $o["description"] . "<br>";
    }
    ?>
</td>
	</tr>
	<tr>
		<td class="left">Headline</td>
		<td class="big"><?php 
    echo draw_img(DIRECTORY_WRITE . "/news/thumbnail-" . $_GET["id"] . "." . $r["imageExt"], false, "", "news-thumbnail");