function SystemGroupSelect($RootSysGroup, $SelectedSysGroup)
{
    $SysGroupOptions = "";
    $db = rdb_connect();
    CheckForMDB2Error($db);
    $sql = 'select * from  ec_tbl_user_group_list(?, true) as(tree_id int, group_name text,
					left_tag integer, right_tag integer, depth bigint)';
    $st = $db->prepare($sql);
    $rows = $st->execute(array($RootSysGroup));
    CheckForMDB2Error($rows);
    MDB2Error($rows, "Error locating Rate Effective");
    $st->free();
    $row = $rows->fetchRow(MDB2_FETCHMODE_ASSOC);
    while ($row != null) {
        if ($row['tree_id'] == $SelectedSysGroup) {
            $Selected = "SELECTED";
        } else {
            $Selected = "";
        }
        $SysGroupOptions = $SysGroupOptions . "<option value=\"" . $row['tree_id'] . "\" " . $Selected . ">" . $row['group_name'] . "</option>";
        $row = $rows->fetchRow(MDB2_FETCHMODE_ASSOC);
    }
    return $SysGroupOptions;
}
Exemple #2
0
function executePreparedSQLUpdate($sqlStatement, $dataArray)
{
    $dbh = rdb_connect();
    $sth = $dbh->prepare($sqlStatement, null, MDB2_PREPARE_MANIP);
    //		if (MDB2::isError($sth)) {
    //			echo("executePreparedSQLUpdate: Failed to prepare".'<br>');
    //			displayErrorMessage($sth);
    //		}
    if (MDB2::isError($sth)) {
        return $sth;
    }
    $myx_result = $sth->execute($dataArray);
    $sth->free();
    //free the statement
    //		if (EC_DEBUG) {
    //			if (MDB2::isError($myx_result)) {
    //				echo ("executePreparedSQLUpdate: Failed to execute".'<br>');
    //				displayErrorMessage($myx_result);
    //			}
    //		}
    return $myx_result;
    //Returns the number of affected rows
}