Esempio n. 1
0
function stylebox($css_name, $css_info, $classes)
{
    $show_name = showgoodname($css_name);
    $boxname = "style_{$css_name}" . "_box";
    $activesection = $_SESSION["activesection"];
    $activetheme = $_SESSION["activetheme"];
    $debug = $_SESSION["debug"];
    $allstylesrbtn = getvardata("allstylesrbtn", "no", 99);
    //$debug = "true";
    if ($debug == "true") {
        echo "<!-- in showstyle with [{$css_name}]:";
        print_r($css_info);
        echo "-->\n";
    }
    $name_prefix = "";
    $source = isset($css_info["source"]) ? $css_info["source"] : "unknown";
    unset($css_info["source"]);
    $type = isset($css_info["type"]) ? $css_info["type"] : $name_prefix;
    unset($css_info["type"]);
    $section = isset($css_info["section"]) ? $css_info["section"] : "default";
    unset($css_info["section"]);
    // section is section, source is theme
    $name_prefix = $type == "class" ? "." : $name_prefix;
    $name_prefix = $type == "id" ? "#" : $name_prefix;
    $insection = $section == $activesection && $source == $activetheme ? "insec" : "nonsec";
    //echo "<!-- testing [$section] vs [$activesection] and [$source] vs [$activetheme] => [$insection] -->\n";
    $insection = $section == "system" ? "isdefault" : $insection;
    $showstyle = $allstylesrbtn == "no" && $insection == "nonsec" ? "noshow" : "";
    echo "\t\t<div name=\"{$boxname}\" id=\"{$boxname}\" class=\"{$classes} {$insection} {$showstyle}\">\n";
    echo "\t\t\t<table border=0 cellspacing=0 cellpadding=0>\n";
    echo "\t\t\t\t<tr><td colspan=3 width=170px>{$name_prefix}" . "{$show_name}</td></tr>\n";
    if (count($css_info) > 0) {
        foreach ($css_info as $thisplace => $placeinfo) {
            $name = $placeinfo["name"];
            $value = $placeinfo["value"];
            echo "\t\t\t\t<tr>\n";
            echo "\t\t\t\t\t<td width=20px>&nbsp;</td>\n";
            echo "\t\t\t\t\t<td width=120px;>{$name} :</td>\n";
            echo "\t\t\t\t\t<td width=120px>{$value}</td>\n";
            echo "\t\t\t\t</tr>\n";
        }
    } else {
        echo "\t\t\t\t<tr><td colspan=3>Click to add a new style</td></tr>";
    }
    echo "\t\t\t</table>\n";
    echo "\t\t</div>\n";
}
Esempio n. 2
0
function dologin()
{
    $webname = $_SERVER["PHP_SELF"];
    $username = getvardata("username", "");
    $password = getvardata("password", "");
    $errormsg = getvardata("errormsg", "");
    $shandle = $_SESSION["shandle"];
    echo "<form name='mlogin' id='mlogin' action=\"{$webname}\" method='POST'>\n";
    echo "<input type=hidden name=nextact  id=nextact  value=\"{$nextact}\">\n";
    echo "<input type=hidden name=errormsg id=errormsg value=\"{$errormsg}\">\n";
    echo "<input type=hidden name=username id=username value=\"{$username}\">\n";
    echo "<input type=hidden name=password id=password value=\"{$password}\">\n";
    $sql = "select password from accounts where username=\"{$username}\" limit 1";
    echo "<!-- sql[{$sql}] -->\n";
    $sresult = mysql_query($sql, $shandle) or die("cannot connect to accounts table");
    $sdata = mysql_fetch_array($sresult);
    $kpass = $sdata["password"];
    $upass = md5($password);
    $logstate = $upass == $kpass ? "authenticated" : "everyone";
    $errstate = $upass == $kpass ? "" : "Incorrect username or password, please try again or contact the site administrator";
    echo "<!-- testing1 [{$upass}] vs [{$kpass}] => [{$logstate}] -->\n";
    $nextact = "view";
    if ($logstate == "authenticated") {
        //echo "<!-- testing [$upass] vs [$kpass] => [$logstate] -->\n";
        $_SESSION["logstate"] = $logstate;
        $_SESSION["menuset"] = "false";
        $_SESSION["username"] = $username;
        unset($_SESSION["menulist"]);
        $nextact = "home";
    } else {
        $errormsg = "Bad username or password";
    }
    echo "</form>\n";
    echo "<script type='text/javascript'>\n";
    echo "  document.forms[0].errormsg.value='{$errormsg}';\n";
    echo "  document.forms[0].nextact.value='{$nextact}';\n";
    echo "  document.forms[0].submit();\n";
    echo "</script>\n";
}
Esempio n. 3
0
function showActiveTabs($roles, $debug = false)
{
    // we have an array of 0 or more members
    // each is a role for an actor
    // we want to show tabs, 1 for each
    // if none have been defined, then point at the config menu
    $nextact = getvardata("nextact", "view", 99);
    $activetab = getvardata("activetab", "client", 99);
    if ($debug) {
        echo "<!-- nextact[{$nextact}] activetab[{$activetab}] -->\n";
    }
    if (count($roles) < 1) {
        $roles[0] = "config";
    }
    echo "<div name='activetabs' id='activetabs' class='tabDiv'>\n";
    echo "<table><tr><td class='tabtitle'>{$nextact}</td>\n";
    foreach ($roles as $thisone => $rolename) {
        $selected = $rolename == $activetab ? "active" : "notactive";
        echo "<td class=\"{$selected} tabstyle\" onclick=\"doTab('{$rolename}');\">{$rolename}</td>";
    }
    echo "</tr></table>\n";
    echo "</div>\n";
}
Esempio n. 4
0
$debug = false;
$rnd = genkey(6);
$shandle = initi("{$docroot}", $modbase);
trackhit($shandle, $webname, $scriptname, "", "", "mysqli", false, $dev);
// now let's make sure all tables exist
check_tables($shandle, $docroot, $debug);
// now we'll make set visable css attribute based on browser
$btype = !isset($_SESSION["btype"]) ? strtolower(browsertype($browser)) : $_SESSION["btype"];
$block = $btype == "msie" ? "block" : "inline";
$_SESSION["browser"] = $btype;
$_SESSION["shandle"] = $shandle;
$_SESSION["debug"] = $debug;
// check for authentication
$logstate = (isset($_SESSION["logstate"]) and $_SESSION["logstate"] == "authenticated") ? "isauth" : "unauth";
$authtitle = (isset($_SESSION["logstate"]) and $_SESSION["logstate"] == "authenticated") ? "Login Authenticated" : "You must log in for access";
$nextact = getvardata("nextact", "home", 99);
$_SESSION["nextact"] = $nextact;
openpage($btype);
echo "<body class='bodydiv'>\n";
if ($dev) {
    echo "<div class='{$btype}' title=\"Browser type {$btype} detected\" onclick=\"go('home');\"></div>\n";
    echo "<div id='xquery' class='noquery' title=\"Javascript needs to be activated for ROAM to work\"></div>\n";
    echo "<div id='logstate' class='{$logstate}' title=\"{$authtitle}\"></div>\n";
}
echo "<form name='mform' i='mform' action=\"{$scriptname}\" method='POST'>\n";
echo "\t<input type='hidden' name='nextact' id='nextact' value='{$nextact}'>\n";
show_menu();
echo "<div name='mainbox' id='mainbox' class='mboxdiv'>\n";
if (file_exists($nextact)) {
    include $nextact;
} else {
Esempio n. 5
0
<?php

date_default_timezone_set("America/Vancouver");
$webname = $_SERVER["SERVER_NAME"];
$scriptname = $_SERVER["PHP_SELF"];
$docroot = $_SERVER["DOCUMENT_ROOT"];
$modbase = "{$docroot}/tracker";
include_once "{$docroot}/baselib/baselib.php";
include_once "{$docroot}/baselib/config.php";
if (session_id() == "") {
    session_start();
}
$shandle = init();
trackhit($shandle, $webname, $scriptname, "showtext", "sumrep", "mysql");
$repname = getvardata("repname", "sumrep.txt.php", 99);
show_source($repname);
Esempio n. 6
0
<?php

$modbase = "modules/login";
setstyle($modbase . "/");
$cp_nextact = getvardata("cp_nextact", "view");
$user = getvardata("user", "");
$pass = getvardata("pass", "");
$answer = getvardata("answer", "");
$pass1 = getvardata("pass1", "");
$pass2 = getvardata("pass2", "");
$error = getvardata("error", "");
echo "<input type=hidden name='cp_nextact' id='cp_nextact' value=\"{$cp_nextact}\">\n";
switch ($cp_nextact) {
    case "view":
        getname($shandle, $user, $pass);
        break;
    case "veriname":
        veriname($shandle, $user, $pass);
        break;
    case "requestion":
        requestion($shandle, $user, $answer, $error);
        break;
    case "reanswer":
        checkanswer($shandle, $user, $answer);
        break;
    case "getnewpass":
        getnewpass($user, $pass1, $pass2, $error);
        break;
    case "badanswer":
        badanswer($user);
        break;
Esempio n. 7
0
<?php

$modbase = "modules/login";
setstyle($modbase . "/");
$username = getvardata("username", "unknown");
$fullname = getvardata("fullname", "");
$password = getvardata("password", "");
$passchk = getvardata("passchk", "");
$email = getvardata("email", "");
$question = getvardata("question", "");
$answer = getvardata("answer", "");
$ru_nextact = getvardata("ru_nextact", "view");
$error = getvardata("error", "unknown");
switch ($ru_nextact) {
    case "view":
        fillform($shandle, $username, $fullname, $password, $passchk, $email, $question, $answer, $ru_nextact, $error);
        break;
    case "verify":
        $error = "";
        // unknown user? unknown email? valid email?
        $sql = "select username,email from accounts where username=\"{$username}\" limit 1";
        //echo "<!-- username chk[$sql] -->\n";
        $sresult = mysql_query($sql, $shandle) or die("cannot connect to accounts table");
        $sdata = mysql_fetch_array($sresult);
        $uname = $sdata["username"];
        $usemail = $sdata["email"];
        if ($uname == $username) {
            $error .= " The username is already used by someone, please choose another username or <a href='#' onclick=\"gotopage('pages/login/sendpass.inc');\">this link</a> will help you recover your password";
        }
        if ($usemail == $email) {
            $error .= " The email address you have specified is already used by someone, please choose another email address or <a href='#' onclick=\"gotopage('pages/login/sendpass.inc');\">this link</a> will help you recover your password";
Esempio n. 8
0
<?php

date_default_timezone_set("America/Vancouver");
$webname = $_SERVER["SERVER_NAME"];
$scriptname = $_SERVER["PHP_SELF"];
$docroot = $_SERVER["DOCUMENT_ROOT"];
$modbase = "{$docroot}/tracker";
include_once "{$docroot}/baselib/baselib.php";
include_once "{$docroot}/baselib/config.php";
if (session_id() == "") {
    session_start();
}
$shandle = init();
$uselink = getvardata("link", "unknown");
trackhit($shandle, $webname, $scriptname, "skip to page", "{$uselink}", "");
header("Location:{$uselink}");
Esempio n. 9
0
$baseref = $_SESSION["baseref"];
$docroot = $_SESSION["docroot"];
$shandle = $_SESSION["shandle"];
$goplace = isset($goplace) ? $goplace : "login";
$pathspec = isset($pathspec) ? $pathspec : "pages/login";
$logmod = isset($logmod) ? $logmod : "{$pathspec}";
$exitplace = isset($exitplace) ? $exitplace : "staff";
$weblog = "{$baseref}/{$pathspec}";
echo "<!-- 2 [{$goplace}][{$pathspec}][{$logmod}][{$weblog}] -->\n";
ichecktables($shandle, "accounts", "{$logmod}/config/accounts.sql");
setstyle("/{$pathspec}/", true);
// get post variables
$username = getvardata("username", "", 00);
$password = getvardata("password", "", 99);
$shortcut = getvardata("shortcut", "splash.php", 99);
$debug = getvardata("debug", false, 99);
//echo "<!-- in login with [$shortcut] -->\n";
// ok if we have username & password, let's see if we can find a match
$showpage = "false";
$errstate = "";
if (strlen($username) > 0 && strlen($password) > 0) {
    $sql = "select password from accounts where username=\"{$username}\" limit 1";
    if ($debug) {
        echo "<!-- sql[{$sql}] -->\n";
    }
    $sresult = mysqli_query($shandle, $sql);
    $sdata = mysqli_fetch_array($sresult);
    $kpass = $sdata["password"];
    $upass = md5($password);
    $logstate = $upass == $kpass ? "authenticated" : "everyone";
    $errstate = $sdata === FALSE ? "Username not found!<br />" : "";
Esempio n. 10
0
// contact database and make sure we have the table setup
$shandle = initi("{$docroot}", $modbase);
ichecktables($shandle, "activecss", "{$baseref}/css/activecss/activecss.sql");
// proto for trackhit is:
//trackhit($shandle,$webname,$scriptname,"theme","$theme");
$btype = !isset($_SESSION["btype"]) ? browsertype($browser) : $_SESSION["btype"];
$block = $btype == "msie" ? "block" : "inline";
//echo "<!-- session:";print_r($_SESSION);echo "-->\n";
$nextact = getvardata("nextact", "home", 99);
$activebrowser = getvardata("activebrowser", "msie", 99);
$activetheme = getvardata("activetheme", "default", 99);
$activepage = getvardata("activepage", "default", 99);
$activesection = getvardata("activesection", "default", 99);
$debug = getvardata("debug", "false", 99);
$elaps = getvardata("elaps", "0.00", 99);
$allstylesrbtn = getvardata("allstylesrbtn", "no", 99);
// get default browser and default theme
$sql = "select theme,css_name,css_selector from activecss where conditional=\"default\" and looking_for=\"browser\" limit 1";
if ($debug == "true") {
    echo "<!-- sql[{$sql}] -->\n";
}
$sresult = mysqli_query($shandle, $sql) or die("Cannot talk to active css");
$sdata = mysqli_fetch_array($sresult);
$deftheme = $sdata["theme"];
$defbrowser = $sdata["css_name"];
$defsection = $sdata["css_selector"];
// save session vars for use in functions
if ($nextact == "reset") {
    session_destroy();
    session_start();
    $nextact = "home";
Esempio n. 11
0
////////////////////////////////////////////////////////////////////
$css_rules = array();
if (session_id() == "") {
    session_start();
}
$webname = $_SERVER["SERVER_NAME"];
$docroot = $_SERVER["DOCUMENT_ROOT"];
$browser = $_SERVER["HTTP_USER_AGENT"];
$modbase = "{$docroot}/tracker";
include_once "{$docroot}/baselib/baselib.php";
include_once "{$docroot}/baselib/iconfig.php";
$btype = browsertype($browser);
$activesource = getvardata("activesource", "activecss", 99);
$theme = getvardata("theme", "default", 99);
$debug = getvardata("debug", false, 99);
$page = getvardata("page", "all", 99);
$shandle = !isset($_SESSSION["shandle"]) ? initi($docroot, $modbase) : $_SESSION["shandle"];
$sql = "select looking_for, css_name from {$activesource} where conditional=\"default\" limit 1";
if ($debug) {
    echo "<!-- sql[{$sql}] -->\n";
}
$sresult = mysqli_query($shandle, $sql) or die("cannot connect to activecss: " . mysqli_connect_error());
$sdata = mysqli_fetch_array($sresult);
$default_condition = $sdata["looking_for"];
$default_seeking = $sdata["css_name"];
if ($debug) {
    echo "<!-- result[{$default_seeking}]-->\n";
}
$sql = "select css_name,css_selector,css_value,css_place from {$activesource} where conditional=\"{$default_condition}\" and looking_for=\"{$default_seeking}\" and theme=\"{$theme}\" order by css_place";
if ($debug) {
    echo "<!-- sql[{$sql}] -->\n";
Esempio n. 12
0
function sectionbox()
{
    $sectionlist = array();
    $shandle = $_SESSION["shandle"];
    $debug = $_SESSION["debug"];
    $activesection = getvardata("activesection", "default", 99);
    if ($debug == "true") {
        echo "<!-- activesection[{$activesection}]-->\n";
    }
    $sql = "select looking_for,theme,css_selector from activecss where conditional=\"sectionlist\" order by looking_for";
    if ($debug == "true") {
        echo "<!-- section sql[{$sql}] -->\n";
    }
    $sresult = mysqli_query($shandle, $sql) or die("Cannot talk to activecss: ");
    while ($sdata = mysqli_fetch_array($sresult)) {
        $thissection = $sdata["looking_for"];
        $thisname = $sdata["theme"];
        $thisicon = $sdata["css_selector"];
        $sectionlist[$thissection]["name"] = $thisname;
        $sectionlist[$thissection]["icon"] = $thisicon;
        $_SESSION["sectionlist"][$thissection]["name"] = $thisname;
        $_SESSION["sectionlist"][$thissection]["icon"] = $thisicon;
    }
    // now we have a list of known browsers
    if ($debug == "true") {
        echo "<!-- sections:";
        print_r($_SESSION["sectionlist"]);
        echo "-->\n";
    }
    $classlist = "windowbox hbar";
    echo "\t<div name='sectionbox' id='sectionbox' class='eboxdiv'>\n";
    showcard("new", "section", "New Section", "sections.gif", "{$classlist} selectable", "onclick=\"sectionchange('New Section');\"");
    foreach ($sectionlist as $thissection => $sectioninfo) {
        if ($debug == "true") {
            echo "<!-- testing [{$thissection}] vs [{$activesection}] -->\n";
        }
        $selected = $thissection == $activesection ? "isactive" : "inactive";
        $sectionname = $sectioninfo["name"];
        $sectionicon = $sectioninfo["icon"];
        showcard($thissection, "section", $sectionname, $sectionicon, "{$classlist} isection selectable draggable {$selected}", "");
    }
    echo "\t</div>\n";
}
Esempio n. 13
0
<?php

$modbase = "modules/login";
setstyle($modbase . "/");
$sp_nextact = getvardata("sp_nextact", "view");
$username = getvardata("username", "");
$email = getvardata("email", "");
$question = getvardata("question", "");
$answer = getvardata("answer", "");
$fullname = getvardata("fullname", "");
echo "<!-- sp_nextact[{$sp_nextact}] username[{$username}] answer[{$answer}] -->\n";
if ($sp_nextact == "answered" && strlen($username) > 0 && strlen($answer) > 0) {
    $sql = "select answer from accounts where username=\"{$username}\" limit 1";
    //echo "<!-- answer [$sql] -->\n";
    $sresult = mysql_query($sql, $shandle) or die("cannot answer the question");
    $sdata = mysql_fetch_array($sresult);
    $theanswer = $sdata["answer"];
    $sp_nextact = strlen($theanswer) > 0 && $theanswer == $answer ? "answered" : "badanswer";
} else {
    $sp_nextact = $sp_nextact == "answer" ? "badanswer" : $sp_nextact;
}
echo "<input type=hidden name='sp_nextact' id='sp_nextact' value=\"{$sp_nextact}\">\n";
switch ($sp_nextact) {
    case "view":
        inputing($username, $email);
        break;
    case "ask":
        askuser($shandle, $username, $email, $question, $answer);
        break;
    case "retry":
        retry($username, $email);
Esempio n. 14
0
<?php

$debug = true;
$docroot = $_SESSION["docroot"];
$subroot = subroot(__FILE__, $_SESSION["scriptname"]);
if ($debug) {
    echo "<!-- subroot[{$subroot}] -->\n";
}
setstyle(subroot(__FILE__, $_SESSION["scriptname"]), true);
require "{$docroot}{$subroot}/objects.php";
require "{$docroot}{$subroot}/view.php";
$inaction = getvardata("inaction", "view", 99);
$activetab = getvardata("activetab", "client", 99);
echo "<input type=hidden name='inaction' id='inaction' value='{$inaction}'>\n";
echo "<input type=hidden name='activetab' id='activetab' value='{$activetab}'>\n";
// we are not included in top scope, look for values in $_SESSION
$nextact = $_SESSION["nextact"];
$tablist = getActiveTabs($activetab);
showActiveTabs($tablist);
$thisclient = new actor("WRO001", $debug);
$thisclient->getActorData();
showActorData($thisclient);
getActorJava();
/////////////////////////////////////////////////////////
// functions from here to eof
/////////////////////////////////////////////////////////
function getActiveTabs($tabtype, $debug = false)
{
    $roles = array();
    $counter = 0;
    $shandle = $_SESSION["shandle"];
Esempio n. 15
0
function editstyle($stylearray, $name)
{
    $name = $name == "" ? getvardata("name", "", 99) : $name;
    $acton = getvardata("acton", "unknown", 99);
    $statusmessage = "";
    //echo "<!-- acton [$acton] -->\n";
    //echo "<!-- edit style with [$name]:";print_r($stylearray);echo "-->\n";
    $section = $stylearray["section"];
    $type = $stylearray["type"];
    $source = $stylearray["source"];
    unset($stylearray["section"]);
    unset($stylearray["type"]);
    unset($stylearray["source"]);
    $source = $source == "" ? $_SESSION["activetheme"] : $source;
    $section = $section == "" ? $_SESSION["activesection"] : $section;
    $type = $type == "" ? "class" : $type;
    //echo "<!-- edit style with [$name][$section][$type][$source]:";print_r($stylearray);echo "-->\n";
    // set up $_POST["css_parts"] and $_POST["css_values"] from stylearray
    $css_index = 1;
    if (!isset($_POST["css_parts"])) {
        foreach ($stylearray as $this_place => $props) {
            $tname = $props["name"];
            $tvalue = $props["value"];
            $_POST["css_parts"][$css_index] = $tname;
            $_POST["css_values"][$css_index++] = $tvalue;
        }
    }
    //echo "<!-- display [css_parts]:";print_r($_POST["css_parts"]);echo "-->\n";
    //echo "<!-- display [css_values]:";print_r($_POST["css_values"]);echo "-->\n";
    $new_place = 1;
    // acton == 1 when we're gonna add a new property
    switch ($acton) {
        case "1":
            $new_place = count($stylearray);
            $new_place++;
            $_POST["css_parts"][$new_place] = "";
            $_POST["css_value"][$new_place] = "";
            break;
        case "2":
            // update the mysql table
            $statusmessage = updatestyles($name, $section, $type, $source);
            break;
    }
    $name = showgoodname($name);
    $stylename = $type == "class" ? ".{$name}" : "#{$name}";
    $section = $section == "" ? "default" : $section;
    $nameline = $name == "" ? "<td>style Name?</td><td><input type='text' name='name' id='name' value=\"\"></td>" : "<td colspan=2>{$stylename}</td>";
    echo "<table>\n";
    echo "\t<tr><td>theme:{$source}</td><td>section:{$section}</td></tr>\n";
    echo "\t<tr>{$nameline}</td></tr>\n";
    if (isset($_POST["css_parts"]) and count($_POST["css_parts"]) > 0) {
        $index = 0;
        $focuson = "unknown";
        foreach ($_POST["css_parts"] as $this_part => $this_name) {
            $this_value = isset($_POST["css_values"][$this_part]) ? $_POST["css_values"][$this_part] : "";
            $showpicker = strpos($this_name, "color") > -1 ? "picker" : "static";
            echo "<tr>\n";
            echo "<td colspan=2><input type='text' name=css_parts[] id=\"x{$this_part}\" value=\"{$this_name}\"></td>\n";
            echo "<td colspan=2><input type='text' class=\"{$showpicker}\" name=css_values[] id=\"y{$this_part}\" value=\"{$this_value}\"></td>\n";
            echo "</tr>\n";
            $focuson = $focuson == "unknown" ? "x{$this_part}" : $focuson;
        }
    } else {
        echo "<td><input type='text' name=css_parts[] id=css_parts[] value=\"\"></td>\n";
        echo "<td><input type='text' name=css_values[] id=css_values[] value=\"\"></td>\n";
        $focuson = "name";
    }
    echo "<tr>\n";
    echo "<td><input type=button name='abtn' id='abtn' value='Add New' onclick=\"nextaction('1');\"></td>\n";
    echo "<td><input type=button name='sbtn' id='sbtn' value='Update' onclick=\"nextaction('2');\"></td>\n";
    echo "<td><input type=button name='qbtn' id='qbtn' value='Quit' onclick=\"oops();\"></td>\n";
    echo "</tr>\n";
    echo "<tr><td colspan=2><hr/></td></tr>\n";
    echo "<tr><td colspan=2>{$statusmessage}</td></tr>\n";
    echo "</table>\n";
    setfocus($focuson);
}
Esempio n. 16
0
function selectsome($shandle)
{
    $uset = getvardata("uset", "");
    $boxopen = getvardata("boxopen", "");
    $courselist = isset($_POST["courselist"]) ? $_POST["courselist"] : "";
    $showbox = $boxopen == "false" ? "display='none';" : "display='block';";
    //echo "<!-- courselist[\n";print_r($courselist);echo "] -->\n";
    $outlist = "";
    $sql = "select plan_name,description from client_plan where plan_set=\"{$uset}\" order by plan_id";
    //echo "<!-- sql[$sql] -->\n";
    $sresult = mysql_query($sql, $shandle) or die("Cannot connect to client_plan");
    while ($sdata = mysql_fetch_array($sresult)) {
        $tid = $sdata["plan_name"];
        $tdes = $sdata["description"];
        $outlist[$tid] = $tdes;
    }
    echo "\t\t\t\t\tMouseover this cell to display course list\n";
    echo "\t\t\t\t\t<div name='seldiv' id='seldiv' class='selbox' onmouseout=\"vswitch('seldiv','none');\" onmouseover=\"vswitch('seldiv','block');\" style=\"{$showbox}\">\n";
    foreach ($outlist as $thiscourse => $thisdes) {
        $checked = "";
        $oclass = "oclass";
        if (is_array($courselist)) {
            if (array_key_exists($thiscourse, $courselist)) {
                $checked = $courselist[$thiscourse] == "on" ? "CHECKED" : "";
                $oclass = $courselist[$thiscourse] == "on" ? "iclass" : "oclass";
            }
        }
        //echo "<span id='x$thiscourse' class='$oclass' onmouseover=\"document.getElementById('x$thiscourse').className='vclass';\" onmouseout=\"document.getElementById('x$thiscourse').className='$oclass';\" onclick=\"pickchange('x$thiscourse');\">\n";
        echo "\t\t\t\t\t\t<span id='x{$thiscourse}' class='{$oclass}' onmouseover=\"mswitch('x{$thiscourse}','vclass');\" onmouseout=\"mswitch('x{$thiscourse}','{$oclass}');\" onclick=\"pickchange('{$thiscourse}');\">\n";
        echo "\t\t\t\t\t\t\t<input type='checkbox' name='courselist[{$thiscourse}]' id='_{$thiscourse}' {$checked}/>{$thisdes}\n";
        echo "\t\t\t\t\t\t</span><br/>\n";
    }
    echo "\t\t\t\t\t</div>\n";
}