function _print($type, $namel, $options, $list, $prefix)
 {
     global $loc;
     assert('$loc');
     assert('!empty($namel)');
     //    $loc_share = new Localize(OBIB_LOCALE, "shared"); //  //jalg multi 5-7-2015
     $loc_share = new Localize(OBIB_LOCALE, "shared");
     if ($type == 'session_id') {
         return;
     }
     if (isset($options['hidden'])) {
         //jalg multi 5-7-2015
         return;
     }
     if ($type == 'group') {
         echo '<tr><td class="' . $prefix . 'group" colspan="2">';
         Params::printForm($list, $prefix, $namel);
         echo '</td></tr>';
         return;
     }
     if ($type == 'order_by') {
         $title = 'Sort By';
     } elseif (isset($options['title']) && $options['title']) {
         $title = $options['title'];
     } else {
         $title = $namel[count($namel) - 1];
     }
     $name = $prefix . array_shift($namel);
     foreach ($namel as $n) {
         $name .= '[' . $n . ']';
     }
     if (isset($options['default'])) {
         $default = $options['default'];
     } else {
         $default = '';
     }
     echo '<tr class="' . $prefix . 'param">';
     echo '<td><label for="' . H($name) . '">';
     echo $loc->getText($title);
     echo '</label></td><td>';
     switch ($type) {
         case 'string':
             echo inputField('text', $name, $default);
             break;
         case 'date':
             echo inputField('date', $name, $default);
             break;
         case 'select':
             $l = array();
             foreach ($list as $v) {
                 list($n, $o) = $v;
                 if (isset($o['title']) && $o['title']) {
                     $l[$n] = $loc->getText($o['title']);
                 } elseif (strcmp($name, "rpt_material_type") == 0 || strcmp($name, "rpt_collection") == 0) {
                     $l[''] = $loc_share->getText("any");
                     foreach ($o as $i) {
                         $l[$o['code']] = $o['description'];
                     }
                 } else {
                     $l[$n] = $n;
                 }
             }
             echo inputField('select', $name, $default, NULL, $l);
             break;
         case 'order_by':
             $l = array();
             foreach ($list as $v) {
                 list($n, $o) = $v;
                 if (isset($o['title']) and $o['title']) {
                     $l[$n] = $loc->getText($o['title']);
                 } else {
                     $l[$n] = $n;
                 }
                 $l[$n . '!r'] = $l[$n] . ' ' . $loc->getText('reportsReverse');
                 //   $l[$n.'!r'] = $l[$n].' ('.$loc->getText("Reverse").')';// revisar de ALX
             }
             echo inputField('select', $name, $default, NULL, $l);
             break;
         default:
             assert(NULL);
     }
     echo '</td></tr>';
 }
Beispiel #2
0
?>

<form name="layoutparamform" method="GET" action="../shared/layout.php">
<input type="hidden" name="name" value="<?php 
echo H($_REQUEST["name"]);
?>
" />
<input type="hidden" name="rpt" value="<?php 
echo H($_REQUEST["rpt"]);
?>
" />
<input type="hidden" name="tab" value="<?php 
echo H($tab);
?>
" />
<input type="hidden" name="filled" value="<?php 
echo H('1');
?>
" />

<?php 
Params::printForm($defs, 'lay_');
?>

<input type="submit" value="Submit" class="button" />
</form>
<?php 
include "../shared/footer.php";
?>
?>
    header('Location: ../reports/index.php');
    exit(0);
}
Nav::node('reportcriteria', 'Report Criteria');
include "../shared/header.php";
#****************************************************************************
#*  getting form vars
#****************************************************************************
require "../shared/get_form_vars.php";
echo '<h1>' . $loc->getText($rpt->title()) . '</h1>';
if (isset($_REQUEST['msg'])) {
    echo '<p><font class="error">' . H($_REQUEST['msg']) . '</font></p>';
}
?>

<form name="reportcriteriaform" method="GET" action="../reports/run_report.php">
<input type="hidden" name="type" value="<?php 
echo H($rpt->type());
?>
" />

<?php 
$format = array(array('select', '__format', array('title' => 'Format'), array(array('paged', array('title' => 'HTML (page-by-page)')), array('html', array('title' => 'HTML (one big page)')), array('csv', array('title' => 'CSV')))));
$params = array_merge($rpt->paramDefs(), $format);
Params::printForm($params);
?>

<input type="submit" value="Submit" class="button" />
</form>
<?php 
include "../shared/footer.php";
Beispiel #4
0
 function _print($type, $namel, $options, $list, $prefix)
 {
     global $loc;
     assert('$loc');
     assert('!empty($namel)');
     if ($type == 'session_id') {
         return;
     }
     if (isset($options['hidden'])) {
         return;
     }
     if ($type == 'group') {
         echo '<tr><td class="' . $prefix . 'group" colspan="2">';
         Params::printForm($list, $prefix, $namel);
         echo '</td></tr>';
         return;
     }
     if ($type == 'order_by') {
         $title = 'Sort By';
     } elseif (isset($options['title']) && $options['title']) {
         $title = $options['title'];
     } else {
         $title = $namel[count($namel) - 1];
     }
     $name = $prefix . array_shift($namel);
     foreach ($namel as $n) {
         $name .= '[' . $n . ']';
     }
     if (isset($options['default'])) {
         $default = $options['default'];
     } else {
         $default = '';
     }
     echo '<tr class="' . $prefix . 'param">';
     echo '<td><label for="' . H($name) . '">';
     echo $loc->getText($title);
     echo '</label></td><td>';
     switch ($type) {
         case 'string':
         case 'date':
             echo inputField('text', $name, $default);
             break;
         case 'select':
             $l = array();
             foreach ($list as $v) {
                 list($n, $o) = $v;
                 if (isset($o['title']) && $o['title']) {
                     $l[$n] = $loc->getText($o['title']);
                 } else {
                     $l[$n] = $n;
                 }
             }
             echo inputField('select', $name, $default, NULL, $l);
             break;
         case 'order_by':
             $l = array();
             foreach ($list as $v) {
                 list($n, $o) = $v;
                 if (isset($o['title']) and $o['title']) {
                     $l[$n] = $loc->getText($o['title']);
                 } else {
                     $l[$n] = $n;
                 }
                 $l[$n . '!r'] = $l[$n] . ' (Reverse)';
             }
             echo inputField('select', $name, $default, NULL, $l);
             break;
         default:
             assert(NULL);
     }
     echo '</td></tr>';
 }