Example #1
0
function ModuleMenu($head, $module_id, $arr_menu, $arr_images = "")
{
    $ui = $GLOBALS['ui'];
    $wb = $GLOBALS['wb'];
    $c = "<table class='plain'>\n";
    $c .= "<tr>\n";
    $c .= "<td colspan='2' class='bold'>" . $head . "</td>\n";
    $c .= "</tr>\n";
    /* LOOP ALL THE ITEMS IN THE MENU ARRAY */
    for ($i = 0; $i < count($arr_menu); $i++) {
        /* CHECK THE ACL FOR THIS MODULE */
        //echo $GLOBALS['wui']->RoleID()."<br>";
        //echo $module."<br>";
        //echo $arr_menu[$i]."<br>";
        if (CheckAccess($GLOBALS['wui']->RoleID(), $module_id, $arr_menu[$i])) {
            $friendly = InitCap($arr_menu[$i]);
            if (defined('_VALID_MVH_MOBILE_')) {
                $c .= "<tr><td colspan='2'>+<a href='index.php?module=" . EscapeData($_GET['module']) . "&task=" . $arr_menu[$i] . "'>" . $friendly . "</a></td></tr>";
            } else {
                $c .= "<tr>\n";
                $c .= "<td width='16'><img src='" . $wb . "images/" . $arr_images[$i] . "'></td>\n";
                $c .= "<td><a href='index.php?module=" . EscapeData($_GET['module']) . "&task=" . $arr_menu[$i] . "'>" . $friendly . "</a></td>\n";
                $c .= "</tr>\n";
            }
        }
    }
    $c .= "</table>\n";
    return $c;
}
Example #2
0
function LogHistory($description)
{
    $db = $GLOBALS['db'];
    if (empty($description)) {
        return False;
    }
    $sql = "INSERT INTO " . $GLOBALS['database_prefix'] . "core_history (workspace_id,teamspace_id,description,user_id,module,task,log_date)\n\t\t\t\tVALUES (\n\t\t\t\t'" . $GLOBALS['workspace_id'] . "',\n\t\t\t\t'" . $GLOBALS['teamspace_id'] . "',\n\t\t\t\t'" . EscapeData($description) . "',\n\t\t\t\t'" . $_SESSION['user_id'] . "',\n\t\t\t\t'" . EscapeData($_GET['module']) . "',\n\t\t\t\t'" . EscapeData($_GET['task']) . "',\n\t\t\t\tsysdate()\n\t\t\t\t)";
    $result = $db->Query($sql);
    if ($db->AffectedRows($result) > 0) {
        return True;
    } else {
        return False;
    }
}
Example #3
0
function ShowMoreInfo()
{
    return GetColumnValue("intro_description", "core_help_more_info", "module", EscapeData($_GET['module']), "");
}
Example #4
0
function ShowSQLError($sql_id,$query="") {
	echo "An error has occured. Report being generated now...<br>";

	echo "Error: ".$sql_id."<br>";
	echo "This is the SQL error:<p>";
	echo mysql_error()."<p>";
	echo "This is the SQL:<p>";
	echo $query."<br>";

	//echo $data."<br>";
	$db=$GLOBALS['db'];
	$sql="INSERT INTO error_sql_data (sql_id, output) VALUES ('".EscapeData($sql_id)."','".EscapeData(mysql_error())."')";
	//echo $sql."<br>";
	//$db->query($sql);
	echo "Report generated. Please go back and continue. The problem will be resolved soon.<br>";
	die();
}