Exemplo n.º 1
0
    function showTransactions($option, &$rows, &$pageNav, &$lists, $member_id, $dateStart, $dateEnd)
    {
        JHTML::_('behavior.calendar');
        $numCols = 10;
        if (empty($member_id)) {
            $title = "Transactions";
        } else {
            $member = new CbodbMember($member_id);
            $title = "Transactions for <em>" . $member->nameFirst . " " . $member->nameLast . "</em> (member #{$member_id})";
            $numCols--;
        }
        ?>
  <h2><?php 
        print $title;
        ?>
</h2>
  <form action="index.php" method="post" name="adminForm">
  
  <table>
		<tr>
			<td align="left" width="100%">
	    	<strong>Filter:</strong>
        <span style="margin: 0 1em;">
				  Transaction Type: <?php 
        echo $lists['transaction_type'];
        ?>
        </span>
        <span style="margin: 0 1em;">
          Start Date: <input class="inputbox" type="text" name="dateStart" id="dateStart" size="11" dateStart="10" value="<?php 
        echo $dateStart;
        ?>
" />
          <input type="reset" class="button" value="..." onclick="return showCalendar('dateStart','%Y-%m-%d');" />
        </span>
        <span style="margin: 0 1em;">
          End Date: <input class="inputbox" type="text" name="dateEnd" id="dateEnd" size="11" maxlength="10" value="<?php 
        echo $dateEnd;
        ?>
" />
          <input type="reset" class="button" value="..." onclick="return showCalendar('dateEnd','%Y-%m-%d');" />
        </span>
        <input type="reset" class="button" value="clear dates" onclick="document.adminForm.dateEnd.value=''; document.adminForm.dateStart.value=''; return false;" />
        <input type="submit" name="Submit" value="Filter" />
			</td>
		</tr>
	</table>
  
  <table class="adminlist">
    <thead>
      <tr>
        <th width="20px">
          <input type="checkbox" name="toggle" 
               value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
        </th>
        <th>T.ID</th>
        <?php 
        if (empty($member_id)) {
            ?>
          <th>Member</th>
        <?php 
        }
        ?>
        <th>Time Open</th>
        <th>Time Closed</th>
        <th>Duration</th>
        <th>Credits</th>
        <th>Cash</th>
        <th>Type</th>
        <th>Comment</th>
      </tr>
    </thead>
  	<tfoot>
  		<tr>
  			<td colspan="<?php 
        echo $numCols;
        ?>
">
  				<?php 
        echo $pageNav->getListFooter();
        ?>
  			</td>
  		</tr>
  	</tfoot>

    <?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $checked = JHTML::_('grid.id', $i, $row->id);
            $edit_transaction_link = JFilterOutput::ampReplace('index.php?option=' . $option . '&task=editMember&cbodb_mode=transaction&cid=' . $row->id);
            ?>
      <tr class="<?php 
            echo "row{$k}";
            ?>
">
        <td>
          <?php 
            echo $checked;
            ?>
        </td>
        <td>
          <a href="<?php 
            echo $edit_transaction_link;
            ?>
" title="Edit transaction #<?php 
            echo $row->id;
            ?>
"><?php 
            echo $row->id;
            ?>
</a>
        </td>
        <?php 
            if (empty($member_id)) {
                ?>
          <?php 
                $member_name = $row->nameFirst . ' ' . $row->nameLast;
                $member_transactions_link = JFilterOutput::ampReplace('index.php?option=' . $option . '&task=transactions&member_id=' . $row->memberID);
                $member_transactions_link_markup = "<a href=\"{$member_transactions_link}\" title=\"List transactions for {$member_name}\">{$member_name}</a>";
                ?>
          <td>
            <?php 
                echo $member_transactions_link_markup;
                ?>
          </td>
        <?php 
            }
            ?>
        <td>
          <?php 
            echo $row->dateOpen;
            ?>
        </td>
        <td>
          <?php 
            echo $row->dateClosed;
            ?>
        </td>
        <td>
          <?php 
            echo show_transaction_totaltime($row->isOpen, $row->totalTime);
            ?>
        </td>
        <td>
          <?php 
            echo $row->credits;
            ?>
        </td>
        <td>
          <?php 
            echo $row->cash;
            ?>
        </td>
        <td>
          <?php 
            echo HTML_cbodb::translateTransactionType($row->type);
            ?>
        </td>
        <td>
          <?php 
            echo $row->comment;
            ?>
        </td>
      </tr>
      <?php 
            $k = 1 - $k;
        }
        ?>
  </table>
  <input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
  <input type="hidden" name="task" value="transactions" />
  <input type="hidden" name="cbodb_mode" value="transaction" />
  <input type="hidden" name="list_query_limit" value="<?php 
        echo $pageNav->limit;
        ?>
" />
  <input type="hidden" name="list_query_limitstart" value="<?php 
        echo $pageNav->limitstart;
        ?>
" />
  <input type="hidden" name="list_query_member_id" value="<?php 
        echo $member_id;
        ?>
" />
  <input type="hidden" name="list_query_dateStart" value="<?php 
        echo $dateStart;
        ?>
" />
  <input type="hidden" name="list_query_dateEnd" value="<?php 
        echo $dateEnd;
        ?>
" />
  <input type="hidden" name="boxchecked" value="0" />
  </form>
  <?php 
    }