Пример #1
0
<?php

include '../../include.php';
if ($posting) {
    format_post_bits('is_selected');
    langTranslatePost('name,description');
    $id = db_save('soc_members');
    url_change_post('../');
}
echo drawTop();
$f = new form('soc_members', @$_GET['id'], $page['title']);
$f->set_field(array('name' => 'name' . langExt(), 'type' => 'text', 'label' => getString('title')));
$f->set_field(array('name' => 'country_id', 'type' => 'select', 'sql' => 'SELECT id, en FROM jr_countries ORDER BY en'));
$f->set_field(array('name' => 'description' . langExt(), 'type' => 'textarea', 'class' => 'tinymce', 'label' => getString('description')));
langUnsetFields($f, 'name,description');
langTranslateCheckbox($f);
$f->set_title_prefix($page['breadcrumbs']);
echo $f->draw();
echo drawBottom();
Пример #2
0
<?php

include "../include.php";
if ($posting) {
    format_post_bits("isInstancePage, isSecure, isAdmin");
    db_query("UPDATE pages SET \n\t\tname = '{$_POST["title"]}',\n\t\tisAdmin = {$_POST["isAdmin"]},\n\t\tprecedence = {$_POST["precedence"]},\n\t\tisInstancePage = {$_POST["isInstancePage"]},\n\t\tisSecure = {$_POST["isSecure"]},\n\t\tmoduleID = '{$_POST["moduleID"]}',\n\t\thelpText = '{$_POST["helpText"]}'\n\t\tWHERE id = " . $_GET["id"]);
    url_change($_POST["returnTo"]);
}
drawTop();
$r = db_grab("SELECT\n\tp.id,\n\tp.name title,\n\tp.helpText,\n\tm.id moduleID,\n\tm.name module,\n\tp.isAdmin,\n\tp.isSecure,\n\tp.precedence,\n\tp.isInstancePage,\n\tp2.url\n\tFROM pages p\n\tJOIN modules m ON p.moduleID = m.id\n\tJOIN pages p2 ON m.homePageID = p2.id\n\tWHERE p.id = " . $_GET["id"]);
$form = new intranet_form();
$form->addRow("hidden", "", "returnTo", $_GET["returnTo"]);
$form->addRow("itext", "Title", "title", $r["title"], "", true, 50);
$form->addRow("itext", "Precedence", "precedence", $r["precedence"], "", true, 50);
$form->addRow("checkbox", "Is Admin", "isAdmin", $r["isAdmin"], "", true, 50);
$form->addRow("checkbox", "Is Instance Page", "isInstancePage", $r["isInstancePage"], "", true, 50);
$form->addRow("checkbox", "Is Secure", "isSecure", $r["isSecure"], "", true, 50);
$form->addRow("select", "Module", "moduleID", "SELECT id, name FROM modules WHERE isActive = 1 ORDER BY name", $r["moduleID"], $r["moduleID"]);
//$form->addRow("text", "Module", "", "<span class='" . str_replace("/", "", $r["url"]) . " block'>" . $r["module"] . "</span>");
$form->addRow("textarea", "Help Text", "helpText", $r["helpText"]);
$form->addRow("submit", "Save Changes");
$form->draw("Edit Page Info");
drawBottom();
Пример #3
0
<?php

include '../include.php';
if ($posting) {
    error_debug("handling bb post");
    format_post_bits("isAdmin,temporary");
    $id = db_enter("bulletin_board_topics", "title |description isAdmin temporary");
    db_query("UPDATE bulletin_board_topics SET threadDate = GETDATE() WHERE id = " . $id);
    if ($_POST["isAdmin"] == "'1'") {
        //send admin email
        //get topic
        $r = db_grab("SELECT \n\t\t\t\tt.title,\n\t\t\t\tt.description,\n\t\t\t\tu.userID,\n\t\t\t\tISNULL(u.nickname, u.firstname) firstname,\n\t\t\t\tu.lastname,\n\t\t\t\tt.createdOn\n\t\t\t\tFROM bulletin_board_topics t\n\t\t\t\tJOIN intranet_users u ON t.createdBy = u.userID\n\t\t\t\tWHERE t.id = " . $id);
        //construct email
        $message = drawEmailHeader();
        $message .= drawServerMessage("<b>Note</b>: This is an Administration/Human Resources topic from the <a href='http://" . $server . "/bulletin_board/'>Intranet Bulletin Board</a>.  For more information, please contact the <a href='mailto:hrpayroll@seedco.org'>Human Resources Department</a>.");
        $message .= '<table class="center">';
        $message .= drawHeaderRow("Email", 2);
        $message .= drawThreadTop($r["title"], $r["description"], $r["userID"], $r["firstname"] . " " . $r["lastname"], $r["createdOn"]);
        $message .= '</table>' . drawEmailFooter();
        $headers = "MIME-Version: 1.0\r\n";
        $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
        $headers .= "From: " . $_josh["email_default"] . "\r\n";
        //get addresses & send
        $users = db_query("SELECT email FROM intranet_users WHERE isactive = 1");
        while ($u = db_fetch($users)) {
            mail($u["email"], $r["title"], $message, $headers);
        }
    }
    syndicateBulletinBoard();
    url_change();
}
Пример #4
0
<?php

include 'include.php';
if ($posting) {
    error_debug('handling bb post', __FILE__, __LINE__);
    format_post_bits('is_admin');
    langTranslatePost('title,description');
    $id = db_save('bb_topics');
    db_query('UPDATE bb_topics SET thread_date = GETDATE(), replies = (SELECT COUNT(*) FROM bb_followups WHERE topic_id = ' . $id . ') WHERE id = ' . $id);
    if (getOption('channels')) {
        db_checkboxes('channels', 'bb_topics_to_channels', 'topic_id', 'channel_id', $id);
    }
    //notification
    if ($_POST['is_admin'] == '1') {
        //get addresses of everyone & send with message
        emailUser(db_array('SELECT email FROM users WHERE is_active = 1'), $_POST['title'], drawEmail(bbDrawTopic($id, true)));
    } elseif (getOption('bb_notifypost') && getOption('channels') && getOption('languages')) {
        //get addresses of everyone with indicated interests and send
        $channels = array_post_checkboxes('channels');
        $languages = db_table('SELECT id, code FROM languages');
        foreach ($languages as $l) {
            $addresses = db_array('SELECT DISTINCT u.email FROM users u JOIN users_to_channels_prefs u2cp ON u.id = u2cp.user_id WHERE u.is_active = 1 AND u.language_id = ' . $l['id'] . ' AND u2cp.channel_id IN (' . implode(',', $channels) . ')');
            $topic = db_grab('SELECT 
						ISNULL(u.nickname, u.firstname) firstname, 
						u.lastname, 
						t.title' . langExt($l['code']) . ' title, 
						t.description' . langExt($l['code']) . ' description, 
						y.title' . langExt($l['code']) . ' type,
						t.created_date
					FROM bb_topics t
					LEFT JOIN bb_topics_types y ON t.type_id = y.id