Example #1
0
average (mean, median, mode)
counts (blank, non-blank)
percentage breakdowns

Need subtotalling/grouping capability, ie: show intermediate totals for the sum of all students in activity logs for each student, or show percentage breakdown of 1-5 ratings of all activities for each volunteer
--premise is that subtotalling/grouping can be done by any value in another column, or by any metadata for entries.

UI:  semi-wizard based.  pick a column (or pick add calculation column), pick calculation options, including grouping results.  

Note:  calculation columns (difference between order date and ship date for this record, for instance) will be implemented later, if necessary.

*/
// convert URL passed calcs to $_POST array
setURLCalcs();
$cols = getAllColList($fid, $frid, $groups);
$deleted = handleDelete();
// returns 1 if a deletion was made, 0 if not.
$visible_columns = explode(",", $_GET['cols']);
foreach ($cols as $f => $vs) {
    foreach ($vs as $row => $values) {
        if (in_array($values['ele_handle'], $visible_columns)) {
            $reqdcol = 'reqdcalc_column_' . $values['ele_id'];
            if (!in_array($values['ele_id'], $usedvals)) {
                // exclude duplicates...the array is not uniqued above because we don't want to merge it an unique it since that throws things out of order.
                $usedvals[] = $values['ele_id'];
                if (!$_POST[$reqdcol] and !in_array($values['ele_id'], $_POST['column'])) {
                    // Also exclude columns that have been used already.
                    if ($values['ele_colhead'] != "") {
                        $options[$values['ele_id']] = printSmart(trans($values['ele_colhead']), 60);
                    } else {
                        $options[$values['ele_id']] = printSmart(trans(strip_tags($values['ele_caption'])), 60);
Example #2
0
$fid = (isset($_POST['fid']) and is_numeric($_POST['fid'])) ? intval($_POST['fid']) : $fid;
$frid = (isset($_GET['frid']) and is_numeric($_GET['frid'])) ? intval($_GET['frid']) : "";
$frid = (isset($_POST['frid']) and is_numeric($_POST['frid'])) ? intval($_POST['frid']) : $frid;
$gperm_handler =& xoops_gethandler('groupperm');
$member_handler =& xoops_gethandler('member');
$groups = $xoopsUser ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
$uid = $xoopsUser ? $xoopsUser->getVar('uid') : 0;
if (!($scheck = security_check($fid, "", $uid, "", $groups, $mid, $gperm_handler))) {
    print "<p>" . _NO_PERM . "</p>";
    exit;
}
// main body of page goes here...
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
$returned = readQueryItems();
$cols = getAllColList($fid, $frid, $groups);
$returned = handleDelete($returned[0], $returned[1]);
// returns 1 if a deletion was made, 0 if not.
$items = $returned[0];
$hidden = $returned[1];
foreach ($cols as $f => $vs) {
    foreach ($vs as $row => $values) {
        $reqdcol = 'reqdcalc_column_' . $values['ele_id'];
        if (!in_array($values['ele_id'], $usedvals)) {
            // exclude duplicates...the array is not uniqued above because we don't want to merge it an unique it since that throws things out of order.
            $usedvals[] = $values['ele_id'];
            if ($values['ele_colhead'] != "") {
                $options[$values['ele_id']] = printSmart(trans($values['ele_colhead']), 60);
            } else {
                $options[$values['ele_id']] = printSmart(trans(strip_tags($values['ele_caption'])), 60);
            }
        }
Example #3
0
     // Submit Changes
     if (SEC_checkToken()) {
         $display .= CMT_handleEditSubmit($mode);
     } else {
         $display .= COM_refresh($_CONF['site_url'] . '/index.php');
     }
     break;
 case $LANG03[11]:
     // Submit Comment
     $display .= handleSubmit();
     // moved to function for readibility
     break;
 case $LANG_ADMIN['delete']:
 case 'delete':
     if (SEC_checkToken()) {
         $display .= handleDelete($formtype);
         // moved to function for readibility
     } else {
         $display .= COM_refresh($_CONF['site_url'] . '/index.php');
     }
     break;
 case 'view':
     $display .= handleView(true);
     // moved to function for readibility
     break;
 case 'display':
     $display .= handleView(false);
     // moved to function for readibility
     break;
 case 'report':
     $display .= COM_siteHeader('menu', $LANG03[27]) . CMT_reportAbusiveComment(COM_applyFilter($_GET['cid'], true), COM_applyFilter($_GET['type'])) . COM_siteFooter();
Example #4
0
    }
}
/**
 * Main logic to handle requests
 */
if (count($_GET) == 1 && array_key_exists('token', $_GET)) {
    showFirstAuthScreen();
} else {
    if (count($_POST) == 0) {
        showIntroPage();
    } else {
        if ($_POST['action'] == 'insert') {
            handlePost();
        } else {
            if ($_POST['action'] == 'delete') {
                handleDelete();
            } else {
                if ($_POST['action'] == 'delete_all') {
                    handleBatch();
                } else {
                    if ($_POST['action'] == 'edit') {
                        showEditMenu();
                    } else {
                        if ($_POST['action'] == 'update') {
                            handleUpdate();
                        } else {
                            showIntroPage();
                        }
                    }
                }
            }
Example #5
0
            $title = strip_tags($_POST['title']);
            $mode = COM_applyFilter($_POST['mode']);
            if ($type != 'article') {
                if (!in_array($type, $_PLUGINS)) {
                    $type = 'article';
                }
            }
            $pageBody .= PLG_displayComment($type, $sid, 0, $title, '', 'nobar', 0, 0) . $subReturn;
        }
    } else {
        echo COM_refresh($_CONF['site_url'] . '/index.php');
        exit;
    }
} elseif (isset($_POST['delete']) || $mode == 'delete') {
    if (SEC_checkToken()) {
        $pageBody .= handleDelete();
    } else {
        echo COM_refresh($_CONF['site_url'] . '/index.php');
        exit;
    }
} elseif (isset($_POST['sendreport'])) {
    if (SEC_checkToken()) {
        if (isset($_POST['type'])) {
            $type = $_POST['type'];
            if ($type != 'article') {
                if (!in_array($type, $_PLUGINS)) {
                    $type = 'article';
                }
            }
        } else {
            $type = '';
Example #6
0
        $not_cons_uid = $uid;
        // since this is a user specific notification, set a subscription for it
        $notification_handler =& xoops_gethandler('notification');
        $notification_handler->subscribe('form', $fid, $_POST['setwhen'], '', $mid, $not_cons_uid);
        $thisnot = $notification_handler->getNotification($mid, 'form', $fid, $_POST['setwhen'], $not_cons_uid);
    }
    $not_cons_con = ($_POST['setfor'] == "all" or count($_POST['terms']) == 0) ? "all" : serialize(array(serialize($_POST['elements']), serialize($_POST['ops']), serialize($_POST['terms'])));
    $template_filename = strstr($_POST['template'], ".tpl") ? str_replace(".tpl", "", $_POST['template']) : $_POST['template'];
    // strip .tpl out of the template name if it's present
    $sql = "INSERT INTO " . $xoopsDB->prefix("formulize_notification_conditions") . " (not_cons_fid, not_cons_event, not_cons_uid, not_cons_curuser, not_cons_groupid, not_cons_creator, not_cons_elementuids, not_cons_linkcreator, not_cons_elementemail, not_cons_con, not_cons_template, not_cons_subject) VALUES (\"{$fid}\", \"" . formulize_db_escape($_POST['setwhen']) . "\", \"{$not_cons_uid}\", \"{$not_cons_curuser}\", \"{$not_cons_groupid}\", \"{$not_cons_creator}\", \"{$not_cons_elementuids}\", \"{$not_cons_linkcreator}\", \"{$not_cons_elementemail}\", \"" . formulize_db_escape($not_cons_con) . "\", \"" . formulize_db_escape($template_filename) . "\", \"" . formulize_db_escape($_POST['subject']) . "\")";
    if (!($result = $xoopsDB->query($sql))) {
        exit("Error:  notification could not be saved.  SQL:<br>{$sql}<br>");
    }
    unset($_POST);
}
$deleted = handleDelete($uid, $fid, $mid);
// returns 1 if a deletion was made, 0 if not.
// Get all existing notifications
// $nots will be an array sent back by the q function
$nots = getCurNots($fid, $canSetNots, $xoopsUser->getVar('uid'));
$noNots = count($nots) == 0 ? true : false;
// get the groups and group names, and the elements with fullnames or usernames in them
if ($canSetNots) {
    $set_groups1 = $gperm_handler->getGroupIds("view_groupscope", $fid, $mid);
    $set_groups2 = $gperm_handler->getGroupIds("view_globalscope", $fid, $mid);
    $set_groups = array_merge((array) $set_groups1, (array) $set_groups2);
    // type casting required for php 5
    $group_names = $member_handler->getGroups("", true);
    foreach ($set_groups as $thisgroup) {
        $group_options[$thisgroup] = $group_names[$thisgroup]->getVar('name');
    }
Example #7
0
 case $LANG03[29]:
     // Submit Changes
     if (SEC_checkToken()) {
         $display .= CMT_handleEditSubmit($mode);
     } else {
         $display .= COM_refresh($_CONF['site_url'] . '/index.php');
     }
     break;
 case $LANG03[11]:
     // Submit Comment
     $display .= handleSubmit();
     // moved to function for readibility
     break;
 case 'delete':
     if (SEC_checkToken()) {
         $display .= handleDelete();
         // moved to function for readibility
     } else {
         $display .= COM_refresh($_CONF['site_url'] . '/index.php');
     }
     break;
 case 'view':
     $display .= handleView(true);
     // moved to function for readibility
     break;
 case 'display':
     $display .= handleView(false);
     // moved to function for readibility
     break;
 case 'report':
     $display .= COM_siteHeader('menu', $LANG03[27]) . CMT_reportAbusiveComment(COM_applyFilter($_GET['cid'], true), COM_applyFilter($_GET['type'])) . COM_siteFooter();
Example #8
0
        ?>
</td>
                    <td><?php 
        echo $row['code'];
        ?>
</td>
                    <td><?php 
        echo $row['is_confirmed'];
        ?>
</td>
                    <td><a href="index.php?page=admin&action=delete&id=<?php 
        echo $row['id'];
        ?>
">kustuta</a></td>
                </tr>
            <?php 
    }
    ?>
            </tbody>
        </table>
    </div>

<?php 
    if (isset($action, $id)) {
        handleDelete($action, $id);
    }
    ?>
    
<?php 
}
getFooter();