"Fossies" - the Fresh Open Source Software Archive

Member "phpESP/admin/include/where/report.inc" (1 Aug 2005, 2908 Bytes) of package /linux/www/old/phpESP-2.1.4.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) fasm source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "report.inc" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 /* $Id$ */
    4 
    5 /* vim: set tabstop=4 shiftwidth=4 expandtab: */
    6 
    7 // Written by James Flemer
    8 // <jflemer@alum.rpi.edu>
    9 
   10     // see if a survey has been selected
   11     if(!empty($_GET['sid'])) {
   12         $sid = intval($_GET['sid']);
   13         if(empty($_GET['details']))
   14             $_GET['details'] = 1; // by default, show details in report
   15 
   16         /* check ACL to see if user is allowed to view
   17          * _this_ survey */
   18         $srealm = auth_get_survey_realm($sid);
   19         if($_SESSION['acl']['superuser'] != 'Y' &&
   20                 !auth_is_owner($sid, $_SESSION['acl']['username']) &&
   21                 !in_array($srealm, array_intersect(
   22                         $_SESSION['acl']['pdesign'],
   23                         $_SESSION['acl']['pall'])) &&
   24                 !auth_no_access(_('to access this form'))) {
   25             return;
   26         }
   27 ?>
   28 <table cellspacing="0" cellpadding="4">
   29 <tr><td>
   30 <?php
   31         $ret = survey_report($sid, $_GET['details']);
   32         if($ret != '')
   33             echo(mkerror($ret));
   34 ?>
   35 </td></tr>
   36 </table>
   37 <?php echo("<a href=\"". $GLOBALS['ESPCONFIG']['ME'] ."?where=report\">" . _('Go back to Report Menu') . "</a>\n"); ?><br>
   38 <?php echo("<a href=\"". $GLOBALS['ESPCONFIG']['ME'] ."?where=manage\">" . _('Go back to Management Interface') . "</a>\n"); ?>
   39 <?php
   40         return;
   41     }
   42 
   43 // No SurveyId specified, so build a table of
   44 // surveys to choose from ...
   45 
   46     $statusbad = (STATUS_DELETED);
   47     if($_SESSION['acl']['superuser'] == 'Y') {
   48         $sql = "SELECT id,name,title,owner,realm FROM ".$GLOBALS['ESPCONFIG']['survey_table']."
   49             WHERE NOT (status & $statusbad)
   50             ORDER BY id DESC";
   51     } else {
   52         $realms = array_to_insql(
   53             array_intersect(
   54                 $_SESSION['acl']['pall'],
   55                 $_SESSION['acl']['pdesign']));
   56         $sql = "SELECT id,name,title,owner,realm FROM ".$GLOBALS['ESPCONFIG']['survey_table']." WHERE (owner=".
   57             _addslashes($_SESSION['acl']['username']) ." ||
   58             realm $realms)
   59             AND NOT (status & $statusbad)
   60             ORDER BY id DESC";
   61     }
   62     $result = execute_sql($sql);
   63 
   64 ?>
   65 <h2><?php echo(_('View Form Report')); ?></h2>
   66 <?php echo(_('Pick Form to View')); ?>
   67 <table cellspacing="0" cellpadding="4">
   68     <tr class="header">
   69         <th><?php echo(_('ID')); ?></th>
   70         <th><?php echo(_('Name')); ?></th>
   71         <th><?php echo(_('Title')); ?></th>
   72         <th><?php echo(_('Owner')); ?></th>
   73         <th><?php echo(_('Group')); ?></th>
   74     </tr>
   75 <?php
   76     $bg = '';
   77     while(list($sid, $name, $title, $owner, $realm) = fetch_row($result)) {
   78         $result->MoveNext();
   79         if($bg != $ESPCONFIG['bgalt_color1'])
   80             $bg = $ESPCONFIG['bgalt_color1'];
   81         else
   82             $bg = $ESPCONFIG['bgalt_color2'];
   83 ?>
   84     <tr style="background-color: <?php echo($bg); ?>;">
   85         <td><?php echo($sid); ?></td>
   86         <td><a href="<?php echo("". $GLOBALS['ESPCONFIG']['ME'] .htmlentities("?where=report&sid=${sid}")); ?>">
   87             <?php echo($name); ?></a>
   88         </td>
   89         <td><?php echo($title); ?></td>
   90         <td><?php echo($owner); ?></td>
   91         <td><?php echo($realm); ?></td>
   92     </tr>
   93 <?php
   94     }
   95 ?>
   96 </table>
   97 <?php echo("<a href=\"". $GLOBALS['ESPCONFIG']['ME'] ."?where=manage\">" . _('Go back to Management Interface') . "</a>\n"); ?>