Example #1
0
function OpenApp($title)
{
    $_retval = false;
    if (!OpenDB()) {
        return $_retval;
    }
    if (!empty($title)) {
        AppHeader($GLOBALS['appName'] . "-" . $title);
    }
    $GLOBALS['accessRights'] = "rw";
    // CHECK APPLICATION SECURITY HERE  (in this example, "r" gives read-only access and "rw" gives read/write access)
    if (empty($GLOBALS['accessRights']) || !isset($GLOBALS['accessRights']) || substr($GLOBALS['accessRights'], 0, 1) != "r") {
        echo "<p class='error'>You do not have permission to access this application";
    } else {
        $_retval = true;
    }
    return $_retval;
}
Example #2
0
?>

<div style='float:left;font-size:9pt;width:18%;color:blue;font-family:Verdana, Arial, Helvetica, sans-serif;'>
<p>In this scenario, you are a sales manager and you must assign your sales staff by customer and product category.
<p>Drag over cells to select them (doesn't work in FF if the cell is empty). You can also select using shift-click and ctrl-click. 
Ctrl-click cannot be used to select in Safari or Opera because this is the combination to invoke the context menu on those browsers.
<p>Once some cells are selected, right-click (ctrl-click in Opera or Safari) to select an employee from the pop-up menu.
<p>The selection will be filled with the selected employee. Notice that the
employee names and selections scroll with the grid.
</div>

<div class="container">

<?php 
if (OpenDB()) {
    AppHeader("Sales Assignments By Customer &amp; Product Category");
    echo "<p class='ricoBookmark'><span id='emptab_bookmark' style='font-size:10pt;'>&nbsp;</span></p>";
    DisplayTable();
}
CloseApp();
function DisplayTable()
{
    global $oDB;
    echo "<table id='emptab'>";
    echo "<thead><tr><th>ID</th><th>Company</th>";
    $rsLookup = $oDB->RunQuery("Select CategoryID, CategoryName From categories Order By CategoryName");
    while ($oDB->db->FetchRow($rsLookup, $row)) {
        echo "<th style='width:100px;'>" . $row[1] . "</th>";
    }
    $oDB->rsClose($rsLookup);
    echo "</tr></thead><tbody>";