function get_all($type, $properties = array())
{
    if ($type == 'user') {
        return get_all_users($properties);
    }
    return get_all_posts($type, $properties);
}
Example #2
0
function test_fangodb_getrow()
{
    $db = get_db();
    $all = get_all_users();
    $first_row = $all[0];
    $second_row = $all[1];
    assert($db->getRow('select * from users order by id') == $first_row);
    assert($db->getRow('select * from users where id = :id', array('id' => 2)) == $second_row);
}
Example #3
0
    $login_login->set_vars($login_login_render);
    $login_login->parse();
    $content = $login_login->final;
    $login_framework_render['content'] = $content;
    render_all();
}
function render_accounts()
{
    global $login_framework_render;
    global $parameters;
    foreach ($parameters as $parameter) {
        global ${$parameter};
    }
    $content = "";
    $login_account_list = new Template();
    $login_account_list->load('login_account_list');
    $login_account_list_render['accounts'] = '';
    $login_account_row = new Template();
    $login_account_row->load('login_account_row');
    $login_account_row_render['id'] = '';
    $login_account_row_render['username'] = '';
    $login_account_row_render['first_name'] = '';
    $login_account_row_render['last_name'] = '';
    $login_account_row_render['email'] = '';
    $login_account_row_render['access'] = '';
    $users = get_all_users();
    foreach ($users as $user) {
        $login_account_row_render['id'] = $user['userid'];
        $login_account_row_render['username'] = $user['username'];
        $login_account_row_render['first_name'] = $user['first_name'];
        $login_account_row_render['last_name'] = $user['last_name'];
        $login_account_row_render['email'] = $user['email'];
        $login_account_row_render['access'] = $user['access'];
        $login_account_row->set_vars($login_account_row_render);
        $login_account_row->parse();
        $login_account_list_render['accounts'] .= $login_account_row->final;
Example #4
0
function get_ldap_users()
{
    //TODO get the f*****g LDAP server working first
    $users = get_all_users();
    return $users;
}
Example #5
0
}

?>

<fieldset>
<legend>Current Users </legend>

<p> To Change or Delete a user, select it ... </p>
<?

# Setting a session token
$_SESSION["token"] = rand (0, 10000); 
$token = $_SESSION["token"];

$allUsers = get_all_users();
if (count ($allUsers)) {
    
    echo "<TABLE class=\"report\">";
    echo "<TR><TH>User Name</TH><TH>First Name</TH><TH>Last Name</TH><TH>e-mail</TH><TH>Group</TH><TH>Date Created</TH><TH>Last Login</TH></TR>";

    foreach ($allUsers as $indUser) {
        $indUser = str_replace ("___", "\M", $indUser);
        $indUserArray = explode ("\M", $indUser);
        if ($indUserArray[0] == $id) {
            $groupName = "$groupName,$indUserArray[5]";
        }
        else {
            if ($id != "") {
                echo "<TR><TD><a href=\"javascript:populate_users('$userName','$firstName','$lastName','$email', '$groupName')\"</a>$userName</TD><TD>$firstName</TD><TD>$lastName</TD><TD>$emailDisp</TD><TD>$groupName</TD><TD>$dateEntered</TH><TH>$lastLogin</TH></TR>";
                $groupName = "$indUserArray[5]";
Example #6
0
function list_users_action($uid)
{
    // needed to set the tab active
    $users_active = true;
    //check if the user is admin
    if (user_is_admin($uid)) {
        // dealing with user add form
        if (isset($_POST['lastname'])) {
            $user_added = get_user_by_uid($_POST['uid']);
            // user exists
            if ($user_added) {
                update_user($_POST);
            } else {
                add_user($_POST);
            }
        }
        // list all the users
        $users = get_all_users();
        require 'templates/users.php';
    } else {
        require 'templates/login.php';
    }
}
/**
 * Print Review Changes Block
 *
 * Prints a block allowing the user review all changes pending approval
 */
function review_changes_block($block = true, $config = "", $side, $index)
{
    global $pgv_lang, $ctype, $QUERY_STRING, $factarray, $PGV_IMAGE_DIR, $PGV_IMAGES;
    global $pgv_changes, $TEXT_DIRECTION, $SHOW_SOURCES, $PGV_BLOCKS;
    global $PHPGEDVIEW_EMAIL;
    if (empty($config)) {
        $config = $PGV_BLOCKS["review_changes_block"]["config"];
    }
    if ($pgv_changes) {
        //-- if the time difference from the last email is greater than 24 hours then send out another email
        $LAST_CHANGE_EMAIL = get_site_setting('LAST_CHANGE_EMAIL');
        if (time() - $LAST_CHANGE_EMAIL > 60 * 60 * 24 * $config["days"]) {
            $LAST_CHANGE_EMAIL = time();
            set_site_setting('LAST_CHANGE_EMAIL', $LAST_CHANGE_EMAIL);
            write_changes();
            if ($config["sendmail"] == "yes") {
                // Which users have pending changes?
                $users_with_changes = array();
                foreach (get_all_users() as $user_id => $user_name) {
                    foreach (get_all_gedcoms() as $ged_id => $ged_name) {
                        if (exists_pending_change($user_id, $ged_id)) {
                            $users_with_changes[$user_id] = $user_name;
                            break;
                        }
                    }
                }
                foreach ($users_with_changes as $user_id => $user_name) {
                    //-- send message
                    $message = array();
                    $message["to"] = $user_name;
                    $message["from"] = $PHPGEDVIEW_EMAIL;
                    $message["subject"] = $pgv_lang["review_changes_subject"];
                    $message["body"] = $pgv_lang["review_changes_body"];
                    $message["method"] = get_user_setting($user_id, 'contactmethod');
                    $message["url"] = PGV_SCRIPT_NAME . "?" . html_entity_decode($QUERY_STRING);
                    $message["no_from"] = true;
                    addMessage($message);
                }
            }
        }
        if (PGV_USER_CAN_EDIT) {
            $id = "review_changes_block";
            $title = print_help_link("review_changes_help", "qm", "", false, true);
            if ($PGV_BLOCKS["review_changes_block"]["canconfig"]) {
                if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) {
                    if ($ctype == "gedcom") {
                        $name = PGV_GEDCOM;
                    } else {
                        $name = PGV_USER_NAME;
                    }
                    $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">";
                    $title .= "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["admin"]["small"] . "\" width=\"15\" height=\"15\" border=\"0\" alt=\"" . $pgv_lang["config_block"] . "\" /></a>";
                }
            }
            $title .= $pgv_lang["review_changes"];
            $content = "";
            if (PGV_USER_CAN_ACCEPT) {
                $content .= "<a href=\"javascript:;\" onclick=\"window.open('edit_changes.php','_blank','width=600,height=500,resizable=1,scrollbars=1'); return false;\">" . $pgv_lang["accept_changes"] . "</a><br />";
            }
            if ($config["sendmail"] == "yes") {
                $content .= $pgv_lang["last_email_sent"] . format_timestamp($LAST_CHANGE_EMAIL) . "<br />";
                $content .= $pgv_lang["next_email_sent"] . format_timestamp($LAST_CHANGE_EMAIL + 60 * 60 * 24 * $config["days"]) . "<br /><br />";
            }
            foreach ($pgv_changes as $cid => $changes) {
                $change = $changes[count($changes) - 1];
                if ($change["gedcom"] == PGV_GEDCOM) {
                    $record = GedcomRecord::getInstance($change['gid']);
                    if ($record->getType() != 'SOUR' || $SHOW_SOURCES >= PGV_USER_ACCESS_LEVEL) {
                        $content .= '<b>' . PrintReady($record->getFullName()) . '</b> ' . getLRM() . '(' . $record->getXref() . ')' . getLRM();
                        switch ($record->getType()) {
                            case 'INDI':
                            case 'FAM':
                            case 'SOUR':
                            case 'OBJE':
                                $content .= $block ? '<br />' : ' ';
                                $content .= '<a href="' . encode_url($record->getLinkUrl() . '&show_changes=yes') . '">' . $pgv_lang['view_change_diff'] . '</a>';
                                break;
                        }
                        $content .= '<br />';
                    }
                }
            }
            global $THEME_DIR;
            if ($block) {
                require $THEME_DIR . 'templates/block_small_temp.php';
            } else {
                require $THEME_DIR . 'templates/block_main_temp.php';
            }
        }
    }
}
    $category_id = '';
}
$simple_search_form = new UserForm(UserForm::TYPE_SIMPLE_SEARCH, null, 'simple_search_form', null, api_get_self() . '?selectcat=' . $category_id);
$values = $simple_search_form->exportValues();
$keyword = '';
if (isset($_GET['search']) && !empty($_GET['search'])) {
    $keyword = Security::remove_XSS($_GET['search']);
}
if ($simple_search_form->validate() && empty($keyword)) {
    $keyword = $values['keyword'];
}
if (!empty($keyword)) {
    $users = find_students($keyword);
} else {
    if (isset($alleval) && isset($alllinks)) {
        $users = get_all_users($alleval, $alllinks);
    } else {
        $users = null;
    }
}
$offset = isset($_GET['offset']) ? $_GET['offset'] : '0';
// Main course category
$mainCourseCategory = Category::load(null, null, api_get_course_id(), null, null, api_get_session_id());
$flatviewtable = new FlatViewTable($cat[0], $users, $alleval, $alllinks, true, $offset, $addparams, $mainCourseCategory[0]);
$parameters = array('selectcat' => intval($_GET['selectcat']));
$flatviewtable->set_additional_parameters($parameters);
$params = array();
if (isset($_GET['export_pdf']) && $_GET['export_pdf'] == 'category') {
    $params['only_total_category'] = true;
    $params['join_firstname_lastname'] = true;
    $params['show_official_code'] = true;
Example #9
0
# This script creates a new account for a user, and inserts it into the database
#
header('Pragma: no-cache');
require_once 'shared.php';
# Make a connection to the database
$db_read = get_db_read();
$db_write = get_db_write();
$username = mysql_escape_string(htmlentities(trim($_POST['username'])));
$password = $_POST['password'];
$email = mysql_escape_string(htmlentities(trim($_POST['email'])));
$notify_comments = isset($_POST['notify_comments']) ? '1' : '0';
$notify_pictures = isset($_POST['notify_pictures']) ? '1' : '0';
if ($password != $_POST['password2']) {
    show_error_redirect_back("Passwords don't match!");
}
if (count(get_all_users(true, $db_read)) == 0) {
    $admin = '1';
} else {
    $admin = '0';
}
# Validate the variables
if (validate_username($username) == false) {
    show_error_redirect_back("Please enter a username made up of 3 - 14 alpha-numeric characters");
}
if (validate_password($password) == false) {
    show_error_redirect_back("Please enter a password that is at least 6 characters (it's for your own protection!)");
}
if (validate_email($email) == false) {
    show_error_redirect_back("Please enter a valid email address");
}
# Check if the username is being used
Example #10
0
$tpl->page_description = site_seo_description;
$tpl->keywords = site_seo_keywords;
$tpl->page_image = main_url . website_logo;
// Send SEO Data
//--PAGINATION--//
foreach ($vars as $var) {
    if (strpos($var, 'p:') === 0) {
        $page_no_var = $var;
        //get the current Page from URL
    }
}
$perpage = poets_per_page;
$paginate = paginate($perpage, $page_no_var);
$next_number = $paginate['next_number'];
//--get all authors--//
$get_user = get_all_users($database, $next_number, $perpage);
$tpl->all_user = $get_user;
$count_records = $database->count("users");
$total_pages = ceil($count_records / $perpage);
$current_count = count($get_user);
$page_array = array();
$page_array['current_page'] = $paginate['page_no'];
$page_array['total_pages'] = $total_pages;
$page_array['total_records'] = $count_records;
$page_array['current_count'] = $current_count;
$page_array['param_vars'] = $vars;
$page_array['page_no_var'] = $page_no_var;
$tpl->page_array = $page_array;
//$all_topics = $database->select("authors","*", array('status'=>1));
//
//$alphabetically = alphabetically($all_topics,['MAX'=>authors_per_alphabet, 'COUNT'=>true]);
Example #11
0
function print_user_messages($block = true, $config = "", $side, $index)
{
    global $pgv_lang, $PGV_IMAGE_DIR, $TEXT_DIRECTION, $PGV_STORE_MESSAGES, $PGV_IMAGES;
    $usermessages = getUserMessages(PGV_USER_NAME);
    $id = "user_messages";
    $title = print_help_link("mygedview_message_help", "qm", "", false, true);
    $title .= $pgv_lang["my_messages"] . "&nbsp;&nbsp;";
    if ($TEXT_DIRECTION == "rtl") {
        $title .= getRLM();
    }
    $title .= "(" . count($usermessages) . ")";
    if ($TEXT_DIRECTION == "rtl") {
        $title .= getRLM();
    }
    $content = "";
    $content .= "<form name=\"messageform\" action=\"\" onsubmit=\"return confirm('" . $pgv_lang["confirm_message_delete"] . "');\">";
    if (count($usermessages) == 0) {
        $content .= $pgv_lang["no_messages"] . "<br />";
    } else {
        $content .= '
			<script language="JavaScript" type="text/javascript">
			<!--
				function select_all() {
					';
        foreach ($usermessages as $key => $message) {
            if (isset($message["id"])) {
                $key = $message["id"];
            }
            $content .= '
						var cb = document.getElementById("cb_message' . $key . '");
						if (cb) {
							if (!cb.checked) cb.checked = true;
							else cb.checked = false;
						}
						';
        }
        $content .= '
				return false;
			}
			//-->
			</script>
		';
        $content .= "<input type=\"hidden\" name=\"action\" value=\"deletemessage\" />";
        $content .= "<table class=\"list_table\"><tr>";
        $content .= "<td class=\"list_label\">" . $pgv_lang["delete"] . "<br /><a href=\"javascript:;\" onclick=\"return select_all();\">" . $pgv_lang["all"] . "</a></td>";
        $content .= "<td class=\"list_label\">" . $pgv_lang["message_subject"] . "</td>";
        $content .= "<td class=\"list_label\">" . $pgv_lang["date_created"] . "</td>";
        $content .= "<td class=\"list_label\">" . $pgv_lang["message_from"] . "</td>";
        $content .= "</tr>";
        foreach ($usermessages as $key => $message) {
            if (isset($message["id"])) {
                $key = $message["id"];
            }
            $content .= "<tr>";
            $content .= "<td class=\"list_value_wrap\"><input type=\"checkbox\" id=\"cb_message{$key}\" name=\"message_id[]\" value=\"{$key}\" /></td>";
            $showmsg = preg_replace("/(\\w)\\/(\\w)/", "\$1/<span style=\"font-size:1px;\"> </span>\$2", PrintReady($message["subject"]));
            $showmsg = str_replace("@", "@<span style=\"font-size:1px;\"> </span>", $showmsg);
            $content .= "<td class=\"list_value_wrap\"><a href=\"javascript:;\" onclick=\"expand_layer('message{$key}'); return false;\"><img id=\"message{$key}_img\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["plus"]["other"] . "\" border=\"0\" alt=\"" . $pgv_lang["show_details"] . "\" title=\"" . $pgv_lang["show_details"] . "\" /> <b>" . $showmsg . "</b></a></td>";
            if (!empty($message["created"])) {
                $time = strtotime($message["created"]);
            } else {
                $time = time();
            }
            $content .= "<td class=\"list_value_wrap\">" . format_timestamp($time) . "</td>";
            $content .= "<td class=\"list_value_wrap\">";
            $user_id = get_user_id($message["from"]);
            if ($user_id) {
                $content .= PrintReady(getUserFullName($user_id));
                if ($TEXT_DIRECTION == "ltr") {
                    $content .= " " . getLRM() . " - " . htmlspecialchars($user_id, ENT_COMPAT, 'UTF-8') . getLRM();
                } else {
                    $content .= " " . getRLM() . " - " . htmlspecialchars($user_id, ENT_COMPAT, 'UTF-8') . getRLM();
                }
            } else {
                $content .= "<a href=\"mailto:" . $message["from"] . "\">" . str_replace("@", "@<span style=\"font-size:1px;\"> </span>", $message["from"]) . "</a>";
            }
            $content .= "</td>";
            $content .= "</tr>";
            $content .= "<tr><td class=\"list_value_wrap\" colspan=\"5\"><div id=\"message{$key}\" style=\"display: none;\">";
            $message["body"] = nl2br(htmlspecialchars($message["body"], ENT_COMPAT, 'UTF-8'));
            $message["body"] = expand_urls($message["body"]);
            $content .= PrintReady($message["body"]) . "<br /><br />";
            if (strpos($message["subject"], "RE:") === false) {
                $message["subject"] = "RE:" . $message["subject"];
            }
            if ($user_id) {
                $content .= "<a href=\"javascript:;\" onclick=\"reply('" . $user_id . "', '" . $message["subject"] . "'); return false;\">" . $pgv_lang["reply"] . "</a> | ";
            }
            $content .= "<a href=\"" . encode_url("index.php?action=deletemessage&message_id={$key}") . "\" onclick=\"return confirm('" . $pgv_lang["confirm_message_delete"] . "');\">" . $pgv_lang["delete"] . "</a></div></td></tr>";
        }
        $content .= "</table>";
        $content .= "<input type=\"submit\" value=\"" . $pgv_lang["delete_selected_messages"] . "\" /><br /><br />";
    }
    if (get_user_count() > 1) {
        $content .= $pgv_lang["message"] . " <select name=\"touser\">";
        if (PGV_USER_IS_ADMIN) {
            $content .= "<option value=\"all\">" . $pgv_lang["broadcast_all"] . "</option>";
            $content .= "<option value=\"never_logged\">" . $pgv_lang["broadcast_never_logged_in"] . "</option>";
            $content .= "<option value=\"last_6mo\">" . $pgv_lang["broadcast_not_logged_6mo"] . "</option>";
        }
        foreach (get_all_users() as $user_id => $user_name) {
            if ($user_id != PGV_USER_ID && get_user_setting($user_id, 'verified_by_admin') == 'yes' && get_user_setting($user_id, 'contactmethod') != 'none') {
                $content .= "<option value=\"" . $user_name . "\">" . PrintReady(getUserFullName($user_id)) . " ";
                if ($TEXT_DIRECTION == "ltr") {
                    $content .= stripLRMRLM(getLRM() . " - " . $user_name . getLRM());
                } else {
                    $content .= stripLRMRLM(getRLM() . " - " . $user_name . getRLM());
                }
                $content .= "</option>";
            }
        }
        $content .= "</select><input type=\"button\" value=\"" . $pgv_lang["send"] . "\" onclick=\"message(document.messageform.touser.options[document.messageform.touser.selectedIndex].value, 'messaging2', ''); return false;\" />";
    }
    $content .= "</form>";
    global $THEME_DIR;
    if ($block) {
        require $THEME_DIR . 'templates/block_small_temp.php';
    } else {
        require $THEME_DIR . 'templates/block_main_temp.php';
    }
}
Example #12
0
        get_all_users();
        break;
    case "administrators":
        get_all_users("administrator");
        break;
    case "authors":
        get_all_users("author");
        break;
    case "contributors":
        get_all_users("contributor");
        break;
    case "editors":
        get_all_users("editor");
        break;
    case "subscribers":
        get_all_users("subscriber");
        break;
    default:
        //echo " This value of parameter 'query' is not supported ";
        break;
}
function get_all_posts()
{
    $sites = wp_get_sites();
    foreach ($sites as $site) {
        switch_to_blog($site['blog_id']);
        get_all_posts_on_site();
    }
}
function get_all_posts_on_site()
{
Example #13
0
    static function userMessages()
    {
        global $pgv_lang, $PGV_IMAGE_DIR, $TEXT_DIRECTION, $PGV_STORE_MESSAGES, $PGV_IMAGES;
        $usermessages = getUserMessages(PGV_USER_NAME);
        $content = "<form name=\"messageform\" action=\"\" onsubmit=\"return confirm('{$pgv_lang['confirm_message_delete']}');\">";
        if (count($usermessages) == 0) {
            $content .= "{$pgv_lang['no_messages']}<br />\n";
        } else {
            $content .= '
				<script language="JavaScript" type="text/javascript">
				<!--
					function select_all() {
			';
            foreach ($usermessages as $k => $message) {
                if (isset($message['id'])) {
                    $k = $message['id'];
                }
                $content .= '
					var cb = document.getElementById("cb_message' . $k . '");
					if (cb) {
						if (!cb.checked) cb.checked = true;
						else cb.checked = false;
					}
				';
            }
            $content .= '
					return false;
				}
				//-->
				</script>
			';
            $content .= '<input type="hidden" name="action" value="deletemessage" />' . '<table class="list_table"><tr>' . "<td class=\"list_label\">{$pgv_lang['delete']}<br />\n<a href=\"javascript:;\" onclick=\"return select_all();\">{$pgv_lang['all']}</a></td>\n" . "<td class=\"list_label\">{$pgv_lang['message_subject']}</td>\n" . "<td class=\"list_label\">{$pgv_lang['date_created']}</td>\n" . "<td class=\"list_label\">{$pgv_lang['message_from']}</td>\n" . "</tr>\n";
            foreach ($usermessages as $k => $message) {
                if (isset($message['id'])) {
                    $k = $message['id'];
                }
                $content .= "<tr>\n<td class=\"list_value_wrap\"><input type=\"checkbox\" id=\"cb_message{$k}\" name=\"message_id[]\" value=\"{$k}\" /></td>\n";
                $showmsg = preg_replace("/(\\w)\\/(\\w)/", "\$1/<span style=\"font-size:1px;\"> </span>\$2", PrintReady($message['subject']));
                $showmsg = preg_replace("/@/", "@<span style=\"font-size:1px;\"> </span>", $showmsg);
                $content .= "<td class=\"list_value_wrap\"><a href=\"javascript:;\" onclick=\"expand_layer('message{$k}'); return false;\"><b>{$showmsg}</b> <img id=\"message{$k}_img\" src=\"{$PGV_IMAGE_DIR}/{$PGV_IMAGES['plus']['other']}\" border=\"0\" alt=\"\" title=\"\" /></a></td>\n";
                if (!empty($message['created'])) {
                    $t = strtotime($message['created']);
                } else {
                    $t = time();
                }
                $content .= '<td class="list_value_wrap">' . format_timestamp($t) . "</td>\n" . '<td class="list_value_wrap">';
                $user_id = get_user_id($message['from']);
                if ($user_id) {
                    $content .= PrintReady(getUserFullName($user_id));
                    if ($TEXT_DIRECTION == 'ltr') {
                        $content .= ' ' . getLRM() . ' - ' . htmlspecialchars($user_id, ENT_COMPAT, 'UTF-8') . getLRM();
                    } else {
                        $content .= ' ' . getRLM() . ' - ' . htmlspecialchars($user_id, ENT_COMPAT, 'UTF-8') . getRLM();
                    }
                } else {
                    $content .= "<a href=\"mailto:{$user_id}\">" . preg_replace("/@/", "@<span style=\"font-size:1px;\"> </span>", $user_id) . '</a>';
                }
                $content .= "</td>\n" . "</tr>\n" . "<tr>\n<td class=\"list_value_wrap\" colspan=\"5\"><div id=\"message{$k}\" style=\"display: none;\">";
                $message['body'] = expand_urls(nl2br(htmlspecialchars($message['body'], ENT_COMPAT, 'UTF-8')));
                $content .= PrintReady($message['body']) . "<br />\n<br />\n";
                if (preg_match("/RE:/", $message["subject"]) == 0) {
                    $message['subject'] = "RE:{$message['subject']}";
                }
                if ($user_id) {
                    $content .= "<a href=\"javascript:;\" onclick=\"reply('{$user_id}', '{$message['subject']}'); return false;\">{$pgv_lang['reply']}</a> | ";
                }
                $content .= "<a href=\"" . encode_url("index.php?action=deletemessage&message_id={$k}") . "\" onclick=\"return confirm('{$pgv_lang['confirm_message_delete']}');\">{$pgv_lang['delete']}</a></div></td>\n</tr>\n";
            }
            $content .= "</table>\n" . "<input type=\"submit\" value=\"{$pgv_lang['delete_selected_messages']}\" /><br />\n<br />\n";
        }
        if (get_user_count() > 1) {
            $content .= "{$pgv_lang['message']} <select name=\"touser\">";
            if (PGV_USER_IS_ADMIN) {
                $content .= "<option value=\"all\">{$pgv_lang['broadcast_all']}</option>\n" . "<option value=\"never_logged\">{$pgv_lang['broadcast_never_logged_in']}</option>\n" . "<option value=\"last_6mo\">{$pgv_lang['broadcast_not_logged_6mo']}</option>\n";
            }
            foreach (get_all_users() as $user_id => $user_name) {
                if ($user_id != PGV_USER_ID && get_user_setting($user_id, 'verified_by_admin') == 'yes') {
                    $content .= "<option value=\"{$user_id}\">" . PrintReady(getUserFullName($user_id)) . ' ';
                    if ($TEXT_DIRECTION == 'ltr') {
                        $content .= getLRM() . " - {$user_id}" . getLRM();
                    } else {
                        $content .= getRLM() . " - {$user_id}" . getRLM();
                    }
                    $content .= "</option>\n";
                }
            }
            $content .= "</select>\n<input type=\"button\" value=\"{$pgv_lang['send']}\" onclick=\"message(document.messageform.touser.options[document.messageform.touser.selectedIndex].value, 'messaging2', ''); return false;\" />\n";
        }
        $content .= "</form>\n";
        return $content;
    }
Example #14
0
# * If the viewer isn't logged in, it will ask them to log in/register.
# * If the viewer is logged in, it will list their information (categories, pictures).
# * If the viewer is an admin, display a list of users requiring authorization.
# * Display other stats (pictures, categories, etc).
#
header('Pragma: no-cache');
require 'shared.php';
# Make a connection to the database
$db = get_db_read();
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
if ($me) {
    $me['category_count'] = count(get_categories_by_user_id($me['user_id'], true, $db));
    $me['picture_count'] = count(get_pictures_by_user_id($me['user_id'], true, $db));
    $me['url'] = "show_user.php?user_id=" . $me['user_id'];
}
$users = get_all_users($me != null, $db);
# Set up the list of users (add appropriate information to the array)
$full_users = array();
$total_users = array();
$total_users['category_count'] = 0;
$total_users['picture_count'] = 0;
$total_users['url'] = "show_user.php";
while ($user_information = array_shift($users)) {
    $user_information['category_count'] = count(get_categories_by_user_id($user_information['user_id'], $me != null, $db));
    $user_information['picture_count'] = count(get_pictures_by_user_id($user_information['user_id'], $me != null, $db));
    $user_information['url'] = "show_user.php?user_id=" . $user_information['user_id'];
    array_push($full_users, $user_information);
    $total_users['category_count'] += $user_information['category_count'];
    $total_users['picture_count'] += $user_information['picture_count'];
    if (!$me) {
        $user_information['last_updated'] = $user_information['last_updated_public'];
Example #15
0
 static function _getLatestUserData($type = 'userid', $params = null)
 {
     global $DATE_FORMAT, $TIME_FORMAT, $pgv_lang;
     static $user = null;
     if ($user === null) {
         $users = get_all_users('DESC', 'reg_timestamp', 'username');
         $user = array_shift($users);
         unset($users);
     }
     switch ($type) {
         default:
         case 'userid':
             return $user;
         case 'username':
             return get_user_name($user);
         case 'fullname':
             return getUserFullName($user);
         case 'firstname':
             return get_user_setting($user, 'firstname');
         case 'lastname':
             return get_user_setting($user, 'lastname');
         case 'regdate':
             if (is_array($params) && isset($params[0]) && $params[0] != '') {
                 $datestamp = $params[0];
             } else {
                 $datestamp = $DATE_FORMAT;
             }
             return date($datestamp, get_user_setting($user, 'reg_timestamp'));
         case 'regtime':
             if (is_array($params) && isset($params[0]) && $params[0] != '') {
                 $datestamp = $params[0];
             } else {
                 $datestamp = $TIME_FORMAT;
             }
             return date($datestamp, get_user_setting($user, 'reg_timestamp'));
         case 'loggedin':
             if (is_array($params) && isset($params[0]) && $params[0] != '') {
                 $yes = $params[0];
             } else {
                 $yes = $pgv_lang['yes'];
             }
             if (is_array($params) && isset($params[1]) && $params[1] != '') {
                 $no = $params[1];
             } else {
                 $no = $pgv_lang['no'];
             }
             return get_user_setting($user, 'loggedin') == 'Y' ? $yes : $no;
     }
 }
Example #16
0
function get_content()
{
    ?>
<div id="content">	<!--------------------------------------- TARTALOM ---------------------------------------->
	<div id="content_menu">
<?php 
    get_menu(isset($_SESSION["nev"]));
    //megjeleniti a menut
    ?>
	</div>	<!-- content_menu -->
	<div id="content_content" style="overflow: auto">
<?php 
    if (!isset($_SESSION["nev"])) {
        //ha nincs bejelentkezve---------------------------------------------
        if (!isset($_POST["menu"])) {
            //ha nem kattintott egyetlen gombra sem
            ?>
				<p />&nbsp;<p />&nbsp;
				<p />A <a href="http://www.ubbcluj.ro/" target="_blank">BBTE</a> és 
				<a href="http://www.kmei.ro/" target="_blank">KMEI</a> által szervezett 2009/2010-es tanévi<br />
				<i>"Adatbázisok és webes alkalmazások fejlesztése"</i><br />továbbképző weboldala
				<p />Ha te is részt vettél a képzésen,<br />kérlek regisztrálj ezen az oldalon!
<!--				<p />&nbsp;<p />&nbsp;<p />&nbsp;<p />&nbsp;<p />&nbsp;<p />&nbsp;<p />&nbsp;<p />&nbsp;
				<p />Ha te is részt vettél a képzésen,<br />kérlek regisztrálj ezen az oldalon!-->
<?php 
        } else {
            //ha rakattintott valamelyik gombra
            switch ($_POST["menu"]) {
                case "be":
                    //Bejelentkezést/kijelentkezést megvalósító függvények
                    include "loginout_db.php";
                    include "loginout.php";
                    $hiba = 0;
                    $userneve = "";
                    if (isset($_POST["nev"]) || isset($_POST["jelszo"])) {
                        $hiba = db_login_check($_POST["nev"], $_POST["jelszo"], $userneve);
                    }
                    get_login($hiba, $userneve);
                    break;
                case "reg":
                    //Regisztrálást megvalósító függvények
                    include "register_db.php";
                    include "register.php";
                    $hiba = 0;
                    if (isset($_POST["nev"]) || isset($_POST["jelszo"]) || isset($_POST["jelszo2"]) || isset($_POST["email"]) || isset($_POST["email2"]) || isset($_POST["vnev"]) || isset($_POST["knev"])) {
                        $hiba = db_register_check($_POST);
                    }
                    get_register($hiba, $_POST);
                    break;
                case "weboldalrol":
                    get_page_info();
                    break;
            }
        }
    } else {
        //ha be van jelentkezve----------------------------------------------------------------------
        if (!isset($_POST["menu"])) {
            //ha nem kattintott egyetlen gombra sem
            ?>
				<p />&nbsp;<p />&nbsp;<p />&nbsp;
				<p />A <a href="http://www.ubbcluj.ro/" target="_blank">BBTE</a> és 
				<a href="http://www.kmei.ro/" target="_blank">KMEI</a> által szervezett 2009/2010-es tanévi<br />
				<i>"Adatbázisok és webes alkalmazások fejlesztése"</i><br />továbbképző weboldala
<?php 
        } else {
            //ha rakattintott valamelyik gombra
            switch ($_POST["menu"]) {
                case "menu0":
                    //az admin menu megjelenitese
                    //Adminsztracio fuggvenyek
                    include "admin_db.php";
                    include "admin.php";
                    get_admin_menu();
                    break;
                case "menu01":
                    //admin szamara listazodnak a felhasznalok
                    //Adminsztracio fuggvenyek
                    include "admin_db.php";
                    include "admin.php";
                    get_admin_menu();
                    get_admin_users();
                    break;
                case "menu011":
                    //admin modositja egy user adatait
                    //Adminsztracio fuggvenyek
                    include "admin_db.php";
                    include "admin.php";
                    get_admin_menu();
                    $hiba = 0;
                    if (isset($_POST["user"])) {
                        $hiba = db_admin_user_modify($_POST);
                    }
                    get_admin_user_modify($hiba, $_POST["nev"]);
                    break;
                case "menu012":
                    //admin veglegesen torli az adatbazisbol a usert
                    //Adminsztracio fuggvenyek
                    include "admin_db.php";
                    include "admin.php";
                    get_admin_menu();
                    $hiba = 0;
                    if (isset($_POST["user"])) {
                        $hiba = db_admin_user_delete($_POST);
                    }
                    get_admin_user_delete($hiba, $_POST["nev"]);
                    break;
                case "menu013":
                    //admin aktivalja a usert
                    //Adminsztracio fuggvenyek
                    include "admin_db.php";
                    include "admin.php";
                    get_admin_menu();
                    $hiba = 0;
                    if (isset($_POST["user"])) {
                        $hiba = db_admin_user_activate($_POST);
                    }
                    get_admin_user_activate($hiba, $_POST["nev"]);
                    break;
                case "menu02":
                    //admin modositja a linkgyujtemenyt
                    //Linkgyüjteményre vonatkozó függvények
                    include "links_db.php";
                    include "links.php";
                    //Adminsztracio fuggvenyek
                    include "admin_db.php";
                    include "admin.php";
                    get_admin_menu();
                    $hiba = 0;
                    if (isset($_POST["katid"])) {
                        //mar ki van valasztva a modositando linkkategoria
                        if (isset($_POST["nev"])) {
                            //kesz a modositas
                            $hiba = db_admin_modify_cathegory($_POST);
                        }
                        get_admin_modify_cathegory($hiba, $_POST["katid"]);
                    } else {
                        if (isset($_POST["linkid"])) {
                            //mar ki van valasztva a modositando link
                            if (isset($_POST["ref"])) {
                                //kesz a modositas
                                $hiba = db_admin_modify_link($_POST);
                            }
                            get_admin_modify_link($hiba, $_POST["linkid"]);
                        } else {
                            get_admin_links();
                        }
                    }
                    break;
                case "menu03":
                    //admin modositja a forum tartalmat
                    //A forumra vonatkozó függvények
                    include "forum_db.php";
                    include "forum.php";
                    //Adminsztracio fuggvenyek
                    include "admin_db.php";
                    include "admin.php";
                    get_admin_menu();
                    $hiba = 0;
                    if (isset($_POST["id"])) {
                        //ki van valasztva egy topik, az abba tartozo uzeneteket listazni
                        $id = $_POST["id"];
                    } else {
                        //nincs kivalasztva topik, a topikokat kell listazni
                        $id = 0;
                    }
                    if (isset($_POST["oldal"])) {
                        $oldal = $_POST["oldal"];
                    } else {
                        $oldal = 1;
                    }
                    if (isset($_POST["messageid"])) {
                        //mar ki van valasztva a modositando hozzaszolas
                        if (isset($_POST["operation"])) {
                            //kesz a modositas
                            $hiba = db_admin_modify_message($_POST);
                        }
                        get_admin_modify_message($hiba, $_POST["messageid"], $_POST["topicid"], $_POST["oldal"]);
                    } else {
                        if (isset($_POST["topicid"])) {
                            //mar ki van valasztva a modositando topik
                            if (isset($_POST["operation"])) {
                                //kesz a modositas
                                $hiba = db_admin_modify_topic($_POST);
                            }
                            get_admin_modify_topic($hiba, $_POST["topicid"]);
                        } else {
                            get_admin_forum($id, $oldal);
                        }
                    }
                    //h id=0, akkor a topikokat listazza, kulonben egy topikon belul az uzenetekt
                    break;
                case "ki":
                    //kijelentkezesre kattintottak
                    //Bejelentkezést/kijelentkezést megvalósító függvények
                    include "loginout_db.php";
                    include "loginout.php";
                    logout();
                    break;
                case "beallitasok":
                    //beallitasokra kattintott a felhasznalo
                    //Beállítások, opciók módosításához szükséges függvények
                    include "settings_db.php";
                    include "settings.php";
                    $hiba = 0;
                    if (isset($_POST["nev"]) || isset($_POST["jelszo"]) || isset($_POST["jelszo2"]) || isset($_POST["email"]) || isset($_POST["email2"]) || isset($_POST["vnev"]) || isset($_POST["knev"]) || isset($_POST["tel"]) || isset($_POST["cim"])) {
                        $hiba = db_settings_check($_POST);
                    }
                    get_settings($hiba, $_POST);
                    break;
                case "felhasznalok":
                    //a felhasznalokat akarja megtekinteni
                    get_all_users();
                    break;
                case "kepek":
                    //a "Kepek" menupont ill. a kepgaleriak eseten mindig ugyanaz tortenik
                //a "Kepek" menupont ill. a kepgaleriak eseten mindig ugyanaz tortenik
                case "kepek1":
                case "kepek2":
                case "kepek3":
                    //Képgalériák megjelenítéséhez a függvények
                    include "pixgals.php";
                    get_picture_galerys();
                    break;
                case "linkek":
                    //linkek megtekintese
                    //Linkgyüjteményre vonatkozó függvények
                    include "links_db.php";
                    include "links.php";
                    get_links();
                    break;
                case "ujkategoria":
                    //uj linkkategoriat akar valaki letrehozni vagy modositani
                    //Linkgyüjteményre vonatkozó függvények
                    include "links_db.php";
                    include "links.php";
                    $hiba = 0;
                    if (isset($_POST["katnev"])) {
                        //ha mar be voltak irva az uj linkkategoria adatai
                        $hiba = db_add_new_cathegory($_POST["katnev"]);
                        if ($hiba) {
                            get_new_cathegory($hiba);
                        }
                    } else {
                        if (isset($_POST["id"])) {
                            //ha mar beirta a modositasokat
                            $hiba = db_modify_cathegory($_POST);
                            if ($hiba) {
                                get_modify_cathegory($hiba, $_POST["id"]);
                            }
                        } else {
                            if (isset($_POST["linkkat"])) {
                                //ha modositani akarja a linkkategoriat, jon a form
                                get_modify_cathegory($hiba, $_POST["linkkat"]);
                            } else {
                                //kulonben jelenjen meg az uj linkkategoria adatai szamara a form
                                get_new_cathegory($hiba);
                            }
                        }
                    }
                    break;
                case "ujlink":
                    //uj linket akar valaki ajanlani vagy modositani
                    //Linkgyüjteményre vonatkozó függvények
                    include "links_db.php";
                    include "links.php";
                    $hiba = 0;
                    if (isset($_POST["kat"])) {
                        //ha mar be voltak irva az uj link adatai
                        $hiba = db_add_new_link($_POST);
                        if ($hiba) {
                            get_new_link($hiba, $_POST["kat"]);
                        }
                    } else {
                        if (isset($_POST["linkid"])) {
                            //ha mar beirta a modositasokat
                            db_modify_link($_POST);
                        } else {
                            if (isset($_POST["id"])) {
                                //ha modositani akarja a linket, jon a form
                                get_modify_link($_POST["id"]);
                            } else {
                                //kulonben jelenjen meg az uj link adatai szamara a form
                                get_new_link($hiba, $_POST["linkkat"]);
                            }
                        }
                    }
                    break;
                case "forum":
                    //forum topikjainak megtekinteses es szrkesztese
                    //A forumra vonatkozó függvények
                    include "forum_db.php";
                    include "forum.php";
                    if (isset($_POST["topikid"])) {
                        $id = $_POST["topikid"];
                    } else {
                        $id = 0;
                    }
                    //ekkor a topikok jelennek meg
                    if (isset($_POST["oldal"])) {
                        $oldal = $_POST["oldal"];
                    } else {
                        $oldal = 1;
                    }
                    get_forum($id, $oldal);
                    break;
                case "ujtopik":
                    //A forumra vonatkozó függvények
                    include "forum_db.php";
                    include "forum.php";
                    $hiba = 0;
                    if (isset($_POST["nev"])) {
                        //uj topik neve mar beirva
                        $hiba = topic_check($_POST["nev"]);
                    } else {
                        if (isset($_POST["id"]) && isset($_POST["ujnev"])) {
                            //mar beirta a modositasokat
                            $hiba = db_modify_topic($_POST["id"], $_POST["ujnev"], $_POST["oldal"]);
                        }
                    }
                    if (!isset($_POST["id"])) {
                        get_new_topic($hiba);
                    } else {
                        get_modify_topic($hiba, $_POST["id"], $_POST["oldal"]);
                    }
                    break;
                case "ujuzenet":
                    //A forumra vonatkozó függvények
                    include "forum_db.php";
                    include "forum.php";
                    $hiba = 0;
                    if (isset($_POST["uzenet"])) {
                        $hiba = message_check($_POST["uzenet"], $_POST["idezet"]);
                    }
                    if (isset($_POST["id"]) && isset($_POST["ujuzenet"])) {
                        $hiba = db_modify_message($_POST["topicid"], $_POST["id"], $_POST["ujuzenet"], $_POST["oldal"]);
                    }
                    if (!isset($_POST["id"])) {
                        get_new_message($hiba, $_POST["oldal"]);
                    } else {
                        get_modify_message($hiba, $_POST["topicid"], $_POST["id"], $_POST["mesg"], $_POST["oldal"]);
                    }
                    break;
                case "weboldalrol":
                    get_page_info();
                    break;
            }
        }
    }
    ?>
	</div>	<!-- content_content -->
</div>	<!-- content -->
<?php 
}
Example #17
0
/**
* add a new tag input field
*
* called for each fact to be edited on a form.
* Fact level=0 means a new empty form : data are POSTed by name
* else data are POSTed using arrays :
* glevels[] : tag level
*  islink[] : tag is a link
*     tag[] : tag name
*    text[] : tag value
*
* @param string $tag fact record to edit (eg 2 DATE xxxxx)
* @param string $upperlevel optional upper level tag (eg BIRT)
* @param string $label An optional label to echo instead of the default from the $factarray
* @param string $readOnly optional, when "READONLY", fact data can't be changed
* @param string $noClose optional, when "NOCLOSE", final "</td></tr>" won't be printed
* (so that additional text can be printed in the box)
* @param boolean $rowDisplay True to have the row displayed by default, false to hide it by default
*/
function add_simple_tag($tag, $upperlevel = "", $label = "", $readOnly = "", $noClose = "", $rowDisplay = true)
{
    global $factarray, $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES, $MEDIA_DIRECTORY, $TEMPLE_CODES;
    global $assorela, $tags, $emptyfacts, $main_fact, $TEXT_DIRECTION, $pgv_changes, $GEDCOM;
    global $NPFX_accept, $SPFX_accept, $NSFX_accept, $FILE_FORM_accept, $upload_count;
    global $tabkey, $STATUS_CODES, $SPLIT_PLACES, $pid, $linkToID;
    global $bdm, $PRIVACY_BY_RESN;
    global $lang_short_cut, $LANGUAGE;
    global $QUICK_REQUIRED_FACTS, $QUICK_REQUIRED_FAMFACTS, $PREFER_LEVEL2_SOURCES;
    if (substr($tag, 0, strpos($tag, "PLAC"))) {
        ?>
<script type="text/javascript">
		<!--
		function valid_lati_long(field, pos, neg) {
			// valid LATI or LONG according to Gedcom standard
			// pos (+) : N or E
			// neg (-) : S or W
			txt=field.value.toUpperCase();
			txt=txt.replace(/(^\s*)|(\s*$)/g,''); // trim
			txt=txt.replace(/ /g,':'); // N12 34 ==> N12.34
			txt=txt.replace(/\+/g,''); // +17.1234 ==> 17.1234
			txt=txt.replace(/-/g,neg); // -0.5698 ==> W0.5698
			txt=txt.replace(/,/g,'.'); // 0,5698 ==> 0.5698
			// 0�34'11 ==> 0:34:11
			txt=txt.replace(/\uB0/g,':'); // �
			txt=txt.replace(/\u27/g,':'); // '
			// 0:34:11.2W ==> W0.5698
			txt=txt.replace(/^([0-9]+):([0-9]+):([0-9.]+)(.*)/g, function($0, $1, $2, $3, $4) { var n=parseFloat($1); n+=($2/60); n+=($3/3600); n=Math.round(n*1E4)/1E4; return $4+n; });
			// 0:34W ==> W0.5667
			txt=txt.replace(/^([0-9]+):([0-9]+)(.*)/g, function($0, $1, $2, $3) { var n=parseFloat($1); n+=($2/60); n=Math.round(n*1E4)/1E4; return $3+n; });
			// 0.5698W ==> W0.5698
			txt=txt.replace(/(.*)([N|S|E|W]+)$/g,'$2$1');
			// 17.1234 ==> N17.1234
			if (txt!='' && txt.charAt(0)!=neg && txt.charAt(0)!=pos) txt=pos+txt;
			field.value = txt;
		}

		function toggle_lati_long() {
			tr = document.getElementsByTagName('tr');
			for (var i=0; i<tr.length; i++) {
				if (tr[i].id.indexOf("LATI")>=0 || tr[i].id.indexOf("LONG")>=0) {
					var disp = tr[i].style.display;
					if (disp=="none") {
						disp="table-row";
						if (document.all && !window.opera) disp = "inline"; // IE
					}
					else disp="none";
					tr[i].style.display=disp;
				}
			}
		}
		//-->
		</script>
		<?php 
    }
    if (!isset($noClose) && isset($readOnly) && $readOnly == "NOCLOSE") {
        $noClose = "NOCLOSE";
        $readOnly = "";
    }
    if (!isset($noClose) || $noClose != "NOCLOSE") {
        $noClose = "";
    }
    if (!isset($readOnly) || $readOnly != "READONLY") {
        $readOnly = "";
    }
    if (!isset($tabkey)) {
        $tabkey = 1;
    }
    if (empty($linkToID)) {
        $linkToID = $pid;
    }
    $subnamefacts = array("NPFX", "GIVN", "SPFX", "SURN", "NSFX", "_MARNM_SURN");
    @(list($level, $fact, $value) = explode(" ", $tag));
    // element name : used to POST data
    if ($level == 0) {
        if ($upperlevel) {
            $element_name = $upperlevel . "_" . $fact;
        } else {
            $element_name = $fact;
        }
        // ex: OCCU
    } else {
        $element_name = "text[]";
    }
    if ($level == 1) {
        $main_fact = $fact;
    }
    // element id : used by javascript functions
    if ($level == 0) {
        $element_id = $fact;
    } else {
        $element_id = $fact . floor(microtime() * 1000000);
    }
    // ex: SOUR56402
    if ($upperlevel) {
        $element_id = $upperlevel . "_" . $fact;
    }
    // ex: BIRT_DATE | DEAT_DATE ...
    // field value
    $islink = (substr($value, 0, 1) == "@" and substr($value, 0, 2) != "@#");
    if ($islink) {
        $value = trim(trim(substr($tag, strlen($fact) + 3)), " @\r");
    } else {
        $value = trim(substr($tag, strlen($fact) + 3));
    }
    if ($fact == 'REPO' || $fact == 'SOUR' || $fact == 'OBJE' || $fact == 'FAMC') {
        $islink = true;
    }
    // rows & cols
    switch ($fact) {
        case 'FORM':
            $rows = 1;
            $cols = 5;
            break;
        case 'LATI':
        case 'LONG':
        case 'NPFX':
        case 'SPFX':
        case 'NSFX':
            $rows = 1;
            $cols = 12;
            break;
        case 'DATE':
        case 'TIME':
        case 'TYPE':
            $rows = 1;
            $cols = 20;
            break;
        case 'GIVN':
        case 'SURN':
        case '_MARNM':
            $rows = 1;
            $cols = 25;
            break;
        case '_UID':
            $rows = 1;
            $cols = 50;
            break;
        case 'TEXT':
        case 'PUBL':
            $rows = 10;
            $cols = 70;
            break;
        case 'SHARED_NOTE_EDIT':
            $islink = 1;
            $fact = "NOTE";
            $rows = 15;
            $cols = 88;
            break;
        case 'SHARED_NOTE':
            $islink = 1;
            $fact = "NOTE";
            $rows = 1;
            $cols = $islink ? 8 : 40;
            break;
        case 'NOTE':
            if ($islink) {
                $rows = 1;
                $cols = $islink ? 8 : 40;
                break;
            } else {
                $rows = 10;
                $cols = 70;
                break;
            }
        case 'ADDR':
            $rows = 4;
            $cols = 40;
            break;
        case 'PAGE':
            $rows = 1;
            $cols = 50;
            break;
        default:
            $rows = 1;
            $cols = $islink ? 8 : 40;
            break;
    }
    // label
    $style = "";
    echo "<tr id=\"" . $element_id . "_tr\" ";
    if ($fact == "MAP" || $fact == "LATI" || $fact == "LONG") {
        echo " style=\"display:none;\"";
    }
    echo " >\n";
    if (in_array($fact, $subnamefacts) || $fact == "LATI" || $fact == "LONG") {
        echo "<td class=\"optionbox {$TEXT_DIRECTION} wrap width25\">";
    } else {
        echo "<td class=\"descriptionbox {$TEXT_DIRECTION} wrap width25\">";
    }
    // help link
    if (!in_array($fact, $emptyfacts)) {
        if ($fact == "DATE") {
            print_help_link("def_gedcom_date_help", "qm", "date");
        } else {
            if ($fact == "RESN") {
                print_help_link($fact . "_help", "qm");
            } else {
                if ($fact == "NOTE" && $islink) {
                    print_help_link("edit_add_SHARED_NOTE_help", "qm");
                } else {
                    print_help_link("edit_" . $fact . "_help", "qm");
                }
            }
        }
    }
    if ($fact == "_AKAN" || $fact == "_AKA" || $fact == "ALIA") {
        // Allow special processing for different languages
        $func = "fact_AKA_localisation_{$lang_short_cut[$LANGUAGE]}";
        if (function_exists($func)) {
            // Localise the AKA fact
            $func($fact, $pid);
        }
    } else {
        if ($fact == "AGNC" && !empty($main_fact)) {
            // Allow special processing for different languages
            $func = "fact_AGNC_localisation_{$lang_short_cut[$LANGUAGE]}";
            if (function_exists($func)) {
                // Localise the AGNC fact
                $func($fact, $main_fact);
            }
        }
    }
    if (PGV_DEBUG) {
        echo $element_name . "<br />\n";
    }
    // tag name
    if (!empty($label)) {
        if ($label == "Note" && $islink) {
            echo $pgv_lang["shared_note"];
        } else {
            echo $label;
        }
    } else {
        if ($fact == "NOTE" && $islink) {
            echo $pgv_lang["shared_note"];
        } else {
            if (isset($pgv_lang[$fact])) {
                echo $pgv_lang[$fact];
            } else {
                if (isset($factarray[$fact])) {
                    echo $factarray[$fact];
                } else {
                    echo $fact;
                }
            }
        }
    }
    echo "\n";
    // tag level
    if ($level > 0) {
        if ($fact == "TEXT" and $level > 1) {
            echo "<input type=\"hidden\" name=\"glevels[]\" value=\"" . ($level - 1) . "\" />";
            echo "<input type=\"hidden\" name=\"islink[]\" value=\"0\" />";
            echo "<input type=\"hidden\" name=\"tag[]\" value=\"DATA\" />";
            //-- leave data text[] value empty because the following TEXT line will
            //--- cause the DATA to be added
            echo "<input type=\"hidden\" name=\"text[]\" value=\"\" />";
        }
        echo "<input type=\"hidden\" name=\"glevels[]\" value=\"" . $level . "\" />\n";
        echo "<input type=\"hidden\" name=\"islink[]\" value=\"" . $islink . "\" />\n";
        echo "<input type=\"hidden\" name=\"tag[]\" value=\"" . $fact . "\" />\n";
        // Shared Notes Debug --------------------
        // echo "<br />Label = ".$label;
        // echo "<br />Level = ".$level;
        // echo "<br />Link = ".$islink;
        // echo "<br />Fact = ".$fact;
        // echo "<br />Value = ".$value;
        // End Debug -------------------
    }
    echo "\n</td>";
    // value
    echo "<td class=\"optionbox wrap\">\n";
    if (PGV_DEBUG) {
        echo $tag . "<br />\n";
    }
    // retrieve linked NOTE
    if ($fact == "NOTE" && $islink) {
        $noteid = $value;
    }
    if (in_array($fact, $emptyfacts) && (empty($value) || $value == "y" || $value == "Y")) {
        $value = strtoupper($value);
        //-- don't default anything to Y when adding events through people
        //-- default to Y when specifically adding one of these events
        if ($level == 1) {
            $value = "Y";
        }
        // default YES
        echo "<input type=\"hidden\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" value=\"" . $value . "\" />";
        if ($level <= 1) {
            echo "<input type=\"checkbox\" ";
            if ($value == "Y") {
                echo " checked=\"checked\"";
            }
            echo " onclick=\"if (this.checked) " . $element_id . ".value='Y'; else " . $element_id . ".value=''; \" />";
            echo $pgv_lang["yes"];
        }
    } else {
        if ($fact == "TEMP") {
            echo "<select tabindex=\"" . $tabkey . "\" name=\"" . $element_name . "\" >\n";
            echo "<option value=''>" . $pgv_lang["no_temple"] . "</option>\n";
            foreach ($TEMPLE_CODES as $code => $temple) {
                echo "<option value=\"{$code}\"";
                if ($code == $value) {
                    echo " selected=\"selected\"";
                }
                echo ">{$temple} ({$code})</option>\n";
            }
            echo "</select>\n";
        } else {
            if ($fact == "ADOP") {
                echo "<select tabindex=\"" . $tabkey . "\" name=\"" . $element_name . "\" >";
                foreach (array("BOTH" => $factarray["HUSB"] . "+" . $factarray["WIFE"], "HUSB" => $factarray["HUSB"], "WIFE" => $factarray["WIFE"]) as $k => $v) {
                    echo "<option value='{$k}'";
                    if ($value == $k) {
                        echo " selected=\"selected\"";
                    }
                    echo ">{$v}</option>";
                }
                echo "</select>\n";
            } else {
                if ($fact == "PEDI") {
                    echo "<select tabindex=\"" . $tabkey . "\" name=\"" . $element_name . "\" >";
                    foreach (array("" => $pgv_lang["unknown"], "birth" => $factarray["BIRT"], "adopted" => $pgv_lang["adopted"], "foster" => $pgv_lang["foster"], "sealing" => $pgv_lang["sealing"]) as $k => $v) {
                        echo "<option value='{$k}'";
                        if (UTF8_strtolower($value) == $k) {
                            echo " selected=\"selected\"";
                        }
                        echo ">{$v}</option>";
                    }
                    echo "</select>\n";
                } else {
                    if ($fact == "STAT") {
                        echo "<select tabindex=\"" . $tabkey . "\" name=\"" . $element_name . "\" >\n";
                        echo "<option value=''>No special status</option>\n";
                        foreach ($STATUS_CODES as $code => $status) {
                            echo "<option value=\"{$code}\"";
                            if ($code == $value) {
                                echo " selected=\"selected\"";
                            }
                            echo ">{$status}</option>\n";
                        }
                        echo "</select>\n";
                    } else {
                        if ($fact == "RELA") {
                            $text = strtolower($value);
                            // add current relationship if not found in default list
                            if (!array_key_exists($text, $assorela)) {
                                $assorela[$text] = $text;
                            }
                            echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" >\n";
                            foreach ($assorela as $key => $value) {
                                echo "<option value=\"" . $key . "\"";
                                if ($key == $text) {
                                    echo " selected=\"selected\"";
                                }
                                echo ">" . $assorela["{$key}"] . "</option>\n";
                            }
                            echo "</select>\n";
                        } else {
                            if ($fact == "_PGVU") {
                                $text = strtolower($value);
                                echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" >\n";
                                echo '<option value=""';
                                if ('' == $text) {
                                    echo ' selected="selected"';
                                }
                                echo ">-</option>\n";
                                foreach (get_all_users('asc', 'username') as $user_id => $user_name) {
                                    echo "<option value=\"" . $user_id . "\"";
                                    if ($user_id == $text) {
                                        echo " selected=\"selected\"";
                                    }
                                    echo ">" . $user_name . "</option>\n";
                                }
                                echo "</select>\n";
                            } else {
                                if ($fact == "RESN") {
                                    ?>
		<script type="text/javascript">
		<!--
		function update_RESN_img(resn_val) {
			document.getElementById("RESN_none").style.display="none";
			document.getElementById("RESN_locked").style.display="none";
			document.getElementById("RESN_privacy").style.display="none";
			document.getElementById("RESN_confidential").style.display="none";
			document.getElementById("RESN_"+resn_val).style.display="inline";
			if (resn_val=='none') resn_val='';
			document.getElementById("<?php 
                                    echo $element_id;
                                    ?>
").value=resn_val;
		}
		//-->
		</script>
		<?php 
                                    if (!$PRIVACY_BY_RESN && $level == 1) {
                                        // warn user that level 1 RESN tags have no effect when PRIVACY_BY_RESN is false
                                        echo "<small>" . $pgv_lang["resn_disabled"] . "</small>";
                                    }
                                    echo "<input type=\"hidden\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" value=\"" . $value . "\" />\n";
                                    echo "<table><tr valign=\"top\">\n";
                                    foreach (array("none", "locked", "privacy", "confidential") as $resn_index => $resn_val) {
                                        if ($resn_val == "none") {
                                            $resnv = "";
                                        } else {
                                            $resnv = $resn_val;
                                        }
                                        echo "<td><input tabindex=\"" . $tabkey . "\" type=\"radio\" name=\"RESN_radio\" onclick=\"update_RESN_img('" . $resn_val . "')\"";
                                        echo " value=\"" . $resnv . "\"";
                                        if ($value == $resnv) {
                                            echo " checked=\"checked\"";
                                        }
                                        echo " /><small>" . $pgv_lang[$resn_val] . "</small>";
                                        echo "<br />&nbsp;<img id=\"RESN_" . $resn_val . "\" src=\"images/RESN_" . $resn_val . ".gif\"  alt=\"" . $pgv_lang[$resn_val] . "\" title=\"" . $pgv_lang[$resn_val] . "\" border=\"0\"";
                                        if ($value == $resnv) {
                                            echo " style=\"display:inline\"";
                                        } else {
                                            echo " style=\"display:none\"";
                                        }
                                        echo " /></td>\n";
                                    }
                                    echo "</tr></table>\n";
                                } else {
                                    if ($fact == "_PRIM" or $fact == "_THUM") {
                                        echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" >\n";
                                        echo "<option value=\"\"></option>\n";
                                        echo "<option value=\"Y\"";
                                        if ($value == "Y") {
                                            echo " selected=\"selected\"";
                                        }
                                        echo ">" . $pgv_lang["yes"] . "</option>\n";
                                        echo "<option value=\"N\"";
                                        if ($value == "N") {
                                            echo " selected=\"selected\"";
                                        }
                                        echo ">" . $pgv_lang["no"] . "</option>\n";
                                        echo "</select>\n";
                                    } else {
                                        if ($fact == "SEX") {
                                            echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\">\n<option value=\"M\"";
                                            if ($value == "M") {
                                                echo " selected=\"selected\"";
                                            }
                                            echo ">" . $pgv_lang["male"] . "</option>\n<option value=\"F\"";
                                            if ($value == "F") {
                                                echo " selected=\"selected\"";
                                            }
                                            echo ">" . $pgv_lang["female"] . "</option>\n<option value=\"U\"";
                                            if ($value == "U" || empty($value)) {
                                                echo " selected=\"selected\"";
                                            }
                                            echo ">" . $pgv_lang["unknown"] . "</option>\n</select>\n";
                                        } else {
                                            if ($fact == "TYPE" && $level == '3') {
                                                //-- Build array of currently defined values for this Media Fact
                                                foreach ($pgv_lang as $varname => $typeValue) {
                                                    if (substr($varname, 0, 6) == "TYPE__") {
                                                        if ($varname != "TYPE__other") {
                                                            $type[strtolower(substr($varname, 6))] = $typeValue;
                                                        }
                                                    }
                                                }
                                                //-- Sort the array into a meaningful order
                                                array_flip($type);
                                                asort($type);
                                                array_flip($type);
                                                //-- Add "Other" at the end of the list
                                                $type["other"] = $pgv_lang["TYPE__other"];
                                                //-- Build the selector for the Media "TYPE" Fact
                                                echo "<select tabindex=\"" . $tabkey . "\" name=\"text[]\">";
                                                if ($value == "") {
                                                    echo "<option selected=\"selected\" value=\"\" > " . $pgv_lang["choose"] . " </option>";
                                                }
                                                $selectedValue = strtolower($value);
                                                foreach ($type as $typeName => $typeValue) {
                                                    echo "<option value=\"" . $typeName . "\" ";
                                                    if ($selectedValue == $typeName) {
                                                        echo "selected=\"selected\" ";
                                                    }
                                                    echo "> " . $typeValue . " </option>";
                                                }
                                                echo "</select>";
                                            } else {
                                                if ($fact == "NAME" && $upperlevel != 'REPO' || $fact == "_MARNM") {
                                                    // Populated in javascript from sub-tags
                                                    echo "<input type=\"hidden\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" onchange=\"updateTextName('" . $element_id . "');\" value=\"" . PrintReady(htmlspecialchars($value, ENT_COMPAT, 'UTF-8')) . "\" />";
                                                    echo "<span id=\"" . $element_id . "_display\">" . PrintReady(htmlspecialchars($value, ENT_COMPAT, 'UTF-8')) . "</span>";
                                                    echo " <a href=\"#edit_name\" onclick=\"convertHidden('" . $element_id . "'); return false;\"> ";
                                                    if (isset($PGV_IMAGES["edit_indi"]["small"])) {
                                                        echo "<img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["edit_indi"]["small"] . "\" border=\"0\" width=\"20\" alt=\"" . $pgv_lang["edit_name"] . "\" align=\"top\" />";
                                                    } else {
                                                        echo "<span class=\"age\">[" . $pgv_lang["edit_name"] . "]</span>";
                                                    }
                                                    echo "</a>";
                                                } else {
                                                    // textarea
                                                    if ($rows > 1) {
                                                        echo "<textarea tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" rows=\"" . $rows . "\" cols=\"" . $cols . "\">" . PrintReady(htmlspecialchars($value, ENT_COMPAT, 'UTF-8')) . "</textarea><br />\n";
                                                    } else {
                                                        // text
                                                        echo "<input tabindex=\"" . $tabkey . "\" type=\"text\" id=\"" . $element_id . "\" name=\"" . $element_name . "\" value=\"" . PrintReady(htmlspecialchars($value, ENT_COMPAT, 'UTF-8')) . "\" size=\"" . $cols . "\" dir=\"ltr\"";
                                                        echo " class=\"{$fact}\"";
                                                        echo " autocomplete=\"off\"";
                                                        if (in_array($fact, $subnamefacts)) {
                                                            echo " onblur=\"updatewholename();\" onkeyup=\"updatewholename();\"";
                                                        }
                                                        if ($fact == "DATE") {
                                                            echo " onblur=\"valid_date(this);\" onmouseout=\"valid_date(this);\"";
                                                        }
                                                        if ($fact == "LATI") {
                                                            echo " onblur=\"valid_lati_long(this, 'N', 'S');\" onmouseout=\"valid_lati_long(this, 'N', 'S');\"";
                                                        }
                                                        if ($fact == "LONG") {
                                                            echo " onblur=\"valid_lati_long(this, 'E', 'W');\" onmouseout=\"valid_lati_long(this, 'E', 'W');\"";
                                                        }
                                                        //if ($fact=="FILE") echo " onchange=\"if (updateFormat) updateFormat(this.value);\"";
                                                        echo " " . $readOnly . " />\n";
                                                    }
                                                    // split PLAC
                                                    if ($fact == "PLAC" && $readOnly == "") {
                                                        echo "<div id=\"" . $element_id . "_pop\" style=\"display: inline;\">\n";
                                                        print_specialchar_link($element_id, false);
                                                        print_findplace_link($element_id);
                                                        echo "</div>\n";
                                                        echo "<a href=\"javascript:;\" onclick=\"toggle_lati_long();\"><img src=\"images/buttons/target.gif\" border=\"0\" align=\"middle\" alt=\"" . $factarray["LATI"] . " / " . $factarray["LONG"] . "\" title=\"" . $factarray["LATI"] . " / " . $factarray["LONG"] . "\" /></a>";
                                                        if ($SPLIT_PLACES) {
                                                            if (!function_exists("print_place_subfields")) {
                                                                require "includes/functions/functions_places.php";
                                                            }
                                                            setup_place_subfields($element_id);
                                                            print_place_subfields($element_id);
                                                        }
                                                    } else {
                                                        if (($cols > 20 || $fact == "NPFX") && $readOnly == "") {
                                                            print_specialchar_link($element_id, false);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    // MARRiage TYPE : hide text field and show a selection list
    if ($fact == "TYPE" and $tags[0] == "MARR") {
        echo "<script type='text/javascript'>";
        echo "document.getElementById('" . $element_id . "').style.display='none'";
        echo "</script>";
        echo "<select tabindex=\"" . $tabkey . "\" id=\"" . $element_id . "_sel\" onchange=\"document.getElementById('" . $element_id . "').value=this.value;\" >\n";
        foreach (array("Unknown", "Civil", "Religious", "Partners") as $indexval => $key) {
            if ($key == "Unknown") {
                echo "<option value=\"\"";
            } else {
                echo "<option value=\"" . $key . "\"";
            }
            $a = strtolower($key);
            $b = strtolower($value);
            if (@strpos($a, $b) !== false or @strpos($b, $a) !== false) {
                echo " selected=\"selected\"";
            }
            echo ">" . $factarray["MARR_" . strtoupper($key)] . "</option>\n";
        }
        echo "</select>";
    }
    // popup links
    if ($readOnly == "") {
        if ($fact == "DATE") {
            print_calendar_popup($element_id);
        }
        if ($fact == "FAMC") {
            print_findfamily_link($element_id, "");
        }
        if ($fact == "FAMS") {
            print_findfamily_link($element_id, "");
        }
        if ($fact == "ASSO") {
            print_findindi_link($element_id, "");
        }
        if ($fact == "FILE") {
            print_findmedia_link($element_id, "0file");
        }
        if ($fact == "SOUR") {
            print_findsource_link($element_id);
            print_addnewsource_link($element_id);
            //print_autopaste_link($element_id, array("S1", "S2"), false, false, true);
            //-- checkboxes to apply '1 SOUR' to BIRT/MARR/DEAT as '2 SOUR'
            if ($level == 1) {
                echo '<br />';
                if ($PREFER_LEVEL2_SOURCES === '0') {
                    $level1_checked = '';
                    $level2_checked = '';
                } else {
                    if ($PREFER_LEVEL2_SOURCES === '1' || $PREFER_LEVEL2_SOURCES === true) {
                        $level1_checked = '';
                        $level2_checked = ' checked="checked"';
                    } else {
                        $level1_checked = ' checked="checked"';
                        $level2_checked = '';
                    }
                }
                if (strpos($bdm, 'B') !== false) {
                    echo '&nbsp;<input type="checkbox" name="SOUR_INDI" ', $level1_checked, ' value="Y" />';
                    echo $pgv_lang['individual'];
                    if (preg_match_all('/(' . PGV_REGEX_TAG . ')/', $QUICK_REQUIRED_FACTS, $matches)) {
                        foreach ($matches[1] as $match) {
                            if (!in_array($match, explode('|', PGV_EVENTS_DEAT))) {
                                echo '&nbsp;<input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="Y" />';
                                echo $factarray[$match];
                            }
                        }
                    }
                }
                if (strpos($bdm, 'D') !== false) {
                    if (preg_match_all('/(' . PGV_REGEX_TAG . ')/', $QUICK_REQUIRED_FACTS, $matches)) {
                        foreach ($matches[1] as $match) {
                            if (in_array($match, explode('|', PGV_EVENTS_DEAT))) {
                                echo '&nbsp;<input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="Y" />';
                                echo $factarray[$match];
                            }
                        }
                    }
                }
                if (strpos($bdm, 'M') !== false) {
                    echo '&nbsp;<input type="checkbox" name="SOUR_FAM" ', $level1_checked, ' value="Y" />';
                    echo $pgv_lang["family"];
                    if (preg_match_all('/(' . PGV_REGEX_TAG . ')/', $QUICK_REQUIRED_FAMFACTS, $matches)) {
                        foreach ($matches[1] as $match) {
                            echo '&nbsp;<input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="Y" />';
                            echo $factarray[$match];
                        }
                    }
                }
            }
        }
        if ($fact == "REPO") {
            print_findrepository_link($element_id);
            print_addnewrepository_link($element_id);
        }
        // Shared Notes Icons ========================================
        // $record=GedcomRecord::getInstance($value);
        if ($fact == "NOTE" && $islink) {
            print_findnote_link($element_id);
            print_addnewnote_link($element_id);
            if ($value != "") {
                echo "&nbsp;&nbsp;&nbsp;";
                print_editnote_link($value);
            }
            // If GEDFAct_assistant/_CENS/ module exists && we are on the INDI page
            // Then show the add Shared note assisted icon, if not  ... do not show
            if ($pid) {
                $type_pid = GedcomRecord::getInstance($pid);
                if (file_exists('modules/GEDFact_assistant/_CENS/census_1_ctrl.php') && $type_pid->getType() == "INDI") {
                    echo "&nbsp;&nbsp;&nbsp;";
                    print_addnewnote_assisted_link($element_id);
                }
            }
            echo "<br />";
        }
        // ===========================================================
        if ($fact == "OBJE") {
            print_findmedia_link($element_id, "1media");
        }
        if ($fact == "OBJE" && !$value) {
            print_addnewmedia_link($element_id);
            $value = "new";
        }
    }
    // current value
    if ($TEXT_DIRECTION == "ltr") {
        if ($fact == "DATE") {
            $date = new GedcomDate($value);
            echo $date->Display(false);
        }
        if (($fact == "ASSO" || $fact == "SOUR" || $fact == "OBJE" || $fact == "NOTE" && $islink) && $value) {
            $record = GedcomRecord::getInstance($value);
            if ($record) {
                echo ' ', PrintReady($record->getFullName()), ' (', $value, ')';
            } else {
                if ($value != "new") {
                    echo ' ', $value;
                }
            }
        }
    } else {
        if ($fact == "DATE") {
            $date = new GedcomDate($value);
            echo getRLM(), $date->Display(false), getRLM();
        }
        if (($fact == "ASSO" || $fact == "SOUR" || $fact == "OBJE" || $fact == "NOTE" && $islink) && $value) {
            $record = GedcomRecord::getInstance($value);
            if ($record) {
                echo getRLM(), PrintReady($record->getFullName()), ' ', getLRM(), '(', $value, ') ', getLRM(), getRLM();
            } else {
                if ($value != "new") {
                    echo getRLM(), $value, ' ', getRLM();
                }
            }
        }
    }
    /*
    	if ($fact=="NOTE" && $islink && $value!="") {
    		include('includes/functions/functions_print_lists.php'); 
    		echo "<tr><td class=\"descriptionbox ".$TEXT_DIRECTION." wrap width25\">";
    				print_help_link("edit_add_SHARED_NOTE_help", "qm");
    			//	echo $pgv_lang["admin_override"];
    			echo "Shared Note Links<br /><br />";
    		echo "</td><td class=\"optionbox wrap\">\n";
    			print_indi_list(fetch_linked_indi($value, "NOTE", "1"));
    		echo "</td></tr>\n";
    	}
    */
    // pastable values
    if ($readOnly == "") {
        if ($fact == "SPFX") {
            print_autopaste_link($element_id, $SPFX_accept);
        }
        if ($fact == "NSFX") {
            print_autopaste_link($element_id, $NSFX_accept);
        }
        if ($fact == "FORM") {
            print_autopaste_link($element_id, $FILE_FORM_accept, false, false);
        }
    }
    if ($noClose != "NOCLOSE") {
        echo "</td></tr>\n";
    }
    $tabkey++;
    return $element_id;
}
Example #18
0
<?php

include 'general_header.php';
include 'bd_helpers.php';
header('Content-Type: application/json');
echo get_all_users();
<?php

require_once "../includes/sessions.php";
require_once "../includes/db-connection.php";
require_once "../includes/functions.php";
$page = "manage-users.php";
?>

<!-- Query database for all users -->
<?php 
$users_list = get_all_users();
?>

<?php 
include '../includes/layouts/header.php';
?>

<body>

<div id="wrapper">

  <!-- Sidebar -->
  <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <?php 
include '../includes/layouts/admin-head.php';
?>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse navbar-ex1-collapse">
      <?php 
Example #20
0
$d_LangName = "lang_name_" . "english";
$doc_lang = $pgv_lang[$d_LangName];
$new_usermanual_filename = "docs/" . $languages[$LANGUAGE] . "/PGV-manual-" . $language_settings[$LANGUAGE]["lang_short_cut"] . ".html";
if (file_exists($new_usermanual_filename)) {
    $usermanual_filename = $new_usermanual_filename;
    $d_LangName = "lang_name_" . $languages[$LANGUAGE];
    $doc_lang = $pgv_lang[$d_LangName];
}
$d_img_module_str = "&nbsp;";
if (file_exists("img_editconfig.php")) {
    $d_img_module_str = "<a href=\"img_editconfig.php?action=edit\">" . $pgv_lang["img_admin_settings"] . "</a><br />";
}
$err_write = file_is_writeable("config.php");
$verify_msg = false;
$warn_msg = false;
foreach (get_all_users() as $user_id => $user_name) {
    if (get_user_setting($user_id, 'verified_by_admin') != 'yes' && get_user_setting($user_id, 'verified') == 'yes') {
        $verify_msg = true;
    }
    $comment_exp = get_user_setting($user_id, 'comment_exp');
    if (!empty($comment_exp) && strtotime($comment_exp) != "-1" && strtotime($comment_exp) < time("U")) {
        $warn_msg = true;
    }
    if ($verify_msg && $warn_msg) {
        break;
    }
}
?>
<script type="text/javascript">
<!--
function showchanges() {
Example #21
0
    if ($str == 'all') {
        $query = "SELECT * FROM `users` ";
        $query .= "INNER JOIN `ranks` ";
        $query .= "ON users.ranks_id = ranks.id ";
        $query .= "INNER JOIN `programs` ";
        $query .= "ON users.programs_id = programs.id ";
        $query .= "ORDER BY users.last_name ";
    } else {
        $query = 'SELECT * FROM `users` ';
        $query .= "INNER JOIN `ranks` ";
        $query .= "ON users.ranks_id = ranks.id ";
        $query .= "INNER JOIN `programs` ";
        $query .= "ON users.programs_id = programs.id ";
        $query .= 'WHERE first_name LIKE ';
        $query .= '"%' . $str . '%"';
        $query .= ' OR last_name LIKE ';
        $query .= '"%' . $str . '%"';
        $query .= "ORDER BY users.id ";
    }
}
get_all_users($query);
/*$result_set = mysqli_query($connection, $query);
//$result = mysqli_fetch_assoc($result_set);

if (mysqli_num_rows($result_set) != 0) {
	// displaying records.
	echo output_users($result_set);
} else {
	echo "No records found.";
    //get_all_users();
}*/
function build_leaderboard_div()
{
    $board = '<div id="leaderboard" class="white-popup">';
    $board .= '<table>';
    $board .= '  <thead>';
    $board .= '    <tr>';
    $board .= '      <th colspan="3" class="table-title">Leaderboard</th>';
    $board .= '    </tr>';
    $board .= '    <tr>';
    $board .= '      <th>#</th>';
    $board .= '      <th>Name</th>';
    $board .= '      <th>Total ' . get_points_name_plural() . '</th>';
    $board .= '    </tr>';
    $board .= '  </thead>';
    $board .= '  <tbody>';
    $users = get_all_users();
    $names = array();
    $scores = array();
    foreach ($users as $user) {
        $total_points = 0;
        $total_points += get_regular_points_for_mission_tab($user->id);
        $total_points += get_bonus_points_for_mission_tab($user->id);
        $user_name = get_user_name($user->id);
        array_push($names, $user_name);
        array_push($scores, $total_points);
    }
    array_multisort($scores, SORT_DESC, $names);
    $pos = 1;
    for ($i = 0; $i < count($scores); $i++) {
        if ($scores[$i] > 0 && $pos < 11) {
            $board .= '    <tr>';
            $board .= '      <td>' . $pos . '</td>';
            $board .= '      <td>' . $names[$i] . '</td>';
            $board .= '      <td>' . $scores[$i] . '</td>';
            $board .= '    </tr>';
            $pos++;
        }
    }
    $board .= '  </tbody>';
    $board .= '</table>';
    $board .= '</div>';
    return $board;
}
	/**
 	 * This method return a graph containing information about evaluations
     * inside courses in sessions, it's used inside get_block method for
     * showing it inside dashboard interface
 	 * @return string  img html
 	 */
    public function get_evaluations_courses_in_sessions_graph()
    {
		$graphs = array();
		if (!empty($this->sessions)) {
			$session_ids = array_keys($this->sessions);
			foreach ($session_ids as $session_id) {
				$courses_code = array_keys(Tracking::get_courses_list_from_session($session_id));
				$courses_graph = array();
				foreach ($courses_code as $course_code) {
					$cats = Category::load(null, null, $course_code, null, null, $session_id);
					if (isset($cats) && isset($cats[0])) {
						$alleval = $cats[0]->get_evaluations(null, true, $course_code);
						$alllinks = $cats[0]->get_links(null, true);
						$users = get_all_users($alleval, $alllinks);
						$datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks);
						$evaluation_sumary = $datagen->get_evaluation_sumary_results();
						if (!empty($evaluation_sumary)) {
							$items = array_keys($evaluation_sumary);
							$max = $min = $avg = array();
							foreach ($evaluation_sumary as $evaluation) {
								$max[] = $evaluation['max'];
								$min[] = $evaluation['min'];
								$avg[] = $evaluation['avg'];
							}
							// Dataset definition
						    $data_set = new pData;
						    $data_set->AddPoint($max, "Max");
						    $data_set->AddPoint($avg, "Avg");
						    $data_set->AddPoint($min, "Min");
						    $data_set->AddPoint($items, "Items");
						    $data_set->SetXAxisName(get_lang('EvaluationName'));
							$data_set->SetYAxisName(get_lang('Percentage'));
							$data_set->AddAllSeries();
						   	$data_set->RemoveSerie("Items");
						   	$data_set->SetAbsciseLabelSerie("Items");
						    $graph_id = $this->user_id.'StudentEvaluationGraph';
							$cache = new pCache();
							// the graph id
							$data = $data_set->GetData();
							if ($cache->IsInCache($graph_id, $data)) {
								//if we already created the img
								$img_file = $cache->GetHash($graph_id, $data);
							} else {
								// Initialise the graph
                                $angle = -30;
							    $test = new pChart($this->bg_width, $this->bg_height);
							    $test->setFontProperties(api_get_path(LIBRARY_PATH) . 'pchart/fonts/tahoma.ttf', 8);
                                $test->fixHeightByRotation(
                                    $data_set->GetData(),
                                    $data_set->GetDataDescription(),
                                    $angle
                                );
                                $test->setGraphArea(50, 30, $this->bg_width - 75, $this->bg_height - 75);
                                $test->drawFilledRoundedRectangle(
                                    7,
                                    7,
                                    $this->bg_width - 20,
                                    $test->YSize - 20,
                                    5,
                                    240,
                                    240,
                                    240
                                );
                                $test->drawRoundedRectangle(
                                    5,
                                    5,
                                    $this->bg_width - 18,
                                    $test->YSize - 18,
                                    5,
                                    230,
                                    230,
                                    230
                                );
							    $test->drawGraphArea(255,255,255,TRUE);
							    $test->setFixedScale(0,100,5);
                                $test->drawScale(
                                    $data_set->GetData(),
                                    $data_set->GetDataDescription(),
                                    SCALE_ADDALL,
                                    150,
                                    150,
                                    150,
                                    TRUE,
                                    $angle,
                                    2,
                                    TRUE
                                );
							    $test->setColorPalette(0,105,221,34);
								$test->setColorPalette(1,255,135,30);
								$test->setColorPalette(2,255,0,0);
							    $test->drawGrid(4,TRUE,230,230,230,50);
							    // Draw the 0 line
							    $test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf',6);
							    $test->drawTreshold(0,143,55,72,TRUE,TRUE);
							    // Draw the bar graph
							    $test->drawOverlayBarGraph($data_set->GetData(),$data_set->GetDataDescription(), 100);
							    // Finish the graph
							    $test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf',8);
							    $test->drawLegend($this->bg_width-80,20,$data_set->GetDataDescription(),255,255,255);
							    $test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf',10);
							    $test->setColorPalette(0,50,50,50);
								$test->setColorPalette(1,50,50,50);
								$test->setColorPalette(2,50,50,50);
							    $test->writeValues($data_set->GetData(),$data_set->GetDataDescription(),array("Min", "Max", "Avg"));
							    $cache->WriteToCache($graph_id, $data_set->GetData(), $test);
								ob_start();
								$test->Stroke();
								ob_end_clean();
								$img_file = $cache->GetHash($graph_id, $data_set->GetData());
							}
							if (!empty($img_file)) {
								$courses_graph[$course_code] = '<img src="'.api_get_path(WEB_ARCHIVE_PATH).$img_file.'">';
							}
						}
					}
				}
				if (!empty($courses_graph)) {
					$graphs[$session_id] = $courses_graph;
				}
			}
		}
    	return $graphs;
 	}
Example #24
0
        {
            $arr = array();
            $sql = 'SELECT user_name, password, role, person_id, to_char(date_registered, \'dd/mm/YYYY hh24:mi:ss\') as date_registered FROM users';
            $stid = oci_parse($conn, $sql);
            $res = oci_execute($stid);
            if (!$res) {
                $err = oci_error($stid);
                echo htmlentities($err['message']);
            }
            while ($row = oci_fetch_array($stid, OCI_ASSOC)) {
                array_push($arr, $row);
            }
            oci_free_statement($stid);
            return $arr;
        }
        $rows = get_all_users($conn);
        ?>

		<!-- Display User table contents -->
		<table class="table">
			<thead>
				<tr>
				<th>User Name</th>
				<th>Password</th>
				<th>Role</th>
				<th>PersonID</th>
				<th>Date Registered</th>
				</tr>
			</thead>
			<tbody>
			<?php 
Example #25
0
<?=js_include("dragdrop")?>
<?=js_include("controls")?>
<?=js_include("news")?>
<?=css_include("style")?>
</head>
<body>
	<?include(APPPATH."/views/header.php");?>
<div id='body'>
	<div id='left'>
		<div class='leftBox'>
			<div class='leftBox_header'>
				<h2> Хэрэглэгчид</h2>
			</div>
			<div class='leftBox_body'>
				<?php
					$users = get_all_users();
					foreach ($users->result() as $user):
				 ?>
				 <p><?=$user->login?></p>
					<?endforeach;?>
			</div>
			<div class='leftBox_footer'>
			</div>
		</div>
	</div>
	<div id='right'>
		<div class='rightBox'>
			<div class='rightBox_header'>
				<h2>Мэдээ Засах</h2>
			</div>
			<div class='rightBox_body'><br/>
Example #26
0
}
switch ($category) {
    case 'all':
        $result = get_all_active_users();
        break;
    case 'teacher':
        $result = get_all_active_teachers();
        break;
    case 'student':
        $result = get_all_active_students();
        break;
    case 'pending':
        $result = get_all_pending_users();
        break;
    default:
        $result = get_all_users();
        break;
}
?>

<div class="row transperent-background">

	<div class="col-lg-12">
		<h2 class="page-header">Our Students And Teachers</h2>
	</div>
</div>

<div class="row-fluid">

<?php 
category_button('All Active Users', 'list.php?show=all', mysql_num_rows(get_all_active_users()));