コード例 #1
0
ファイル: admin.caddy.html.php プロジェクト: bizanto/Hooked
    function showOrders(&$lists, $field = null, $order = null)
    {
        global $mainframe, $mosConfig_list_limit, $mosConfig_absolute_path;
        JToolBarHelper::title(JText::_('SimpleCaddy_Orders'));
        JToolBarHelper::deleteList();
        JToolBarHelper::editListX();
        JToolBarHelper::custom('export', 'archive', 'archive', 'Export', true, false);
        JToolBarHelper::custom('control', 'back.png', 'back.png', 'Main', false, false);
        $cfg = new sc_configuration();
        $currency = $cfg->get("currency");
        $tsep = $cfg->get("thousand_sep");
        $decsep = $cfg->get("decimal_sep");
        $decs = $cfg->get("decimals");
        $pageNav = $lists['nav'];
        $rows = $lists['lst'];
        ?>
		<script language="javascript">
			function submitme(option) {
			a=option.split(",");
			document.adminForm.field.value=a[0];
			document.adminForm.order.value=a[1];
			document.adminForm.submit();
			}
		</script>
		<form method="post" name="adminForm" action="index2.php">
			<table>
				<tr>
					<td width="100%">
						<?php 
        echo JText::_('Filter');
        ?>
:
						<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
						<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
						<button onclick="document.getElementById('search').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
					</td>
				</tr>
			</table>
				<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
					<tr>
						<th width="20">
							<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
						</th>
						<th class="title" nowrap="nowrap">ID</th>
						<th class="title" nowrap="nowrap"><?php 
        echo JText::_('SC_NAME');
        ?>
&nbsp;<?php 
        echo display::showSortArrows("name");
        ?>
</th>
						<th class="title" nowrap="nowrap"><?php 
        echo JText::_('SC_EMAIL');
        ?>
&nbsp;<?php 
        echo display::showSortArrows("email");
        ?>
</th>
						<th class="title tdright" nowrap="nowrap"><?php 
        echo JText::_('SC_DATE');
        ?>
&nbsp;<?php 
        echo display::showSortArrows("orderdt");
        ?>
</th>
						<th class="title tdright" nowrap="nowrap"><?php 
        echo JText::_('SC_TOTAL');
        ?>
&nbsp;<?php 
        echo display::showSortArrows("total");
        ?>
</th>
						<th class="title" nowrap="nowrap"><?php 
        echo JText::_('SC_ORDER_STATUS');
        ?>
&nbsp;<?php 
        echo display::showSortArrows("status");
        ?>
</th>
						<th class="title" nowrap="nowrap">&nbsp;</th>
					</tr>
				<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            ?>
					<tr class="<?php 
            echo "row{$k}";
            ?>
">
						<td width="20">
							<input type="checkbox" id="cb<?php 
            echo $i;
            ?>
" name="cid[]" value="<?php 
            echo $row->id;
            ?>
" onclick="isChecked(this.checked);" />
						</td>
						<td width="20">
							<a href="#view" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','view')">
							<?php 
            echo $row->id;
            ?>
							</a>
						</td>
						<td width="10%">
							<a href="#view" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','view')">
							<?php 
            echo $row->name;
            ?>
							</a>
						</td>
						<td width="10%">
							<?php 
            echo "<a href='mailto:{$row->email}'>{$row->email}</a>";
            ?>
						</td>
						<td width="10%" class="tdright">
							<?php 
            echo date("d-m-Y", $row->orderdt);
            ?>
						</td>
						<td width="10%" class="tdright">
						<?php 
            echo number_format($row->total + $row->tax, $decs, $decsep, $tsep);
            ?>
						</td>
						<td>
							<?php 
            echo "<span class='" . strtolower($row->status) . "'>{$row->status}</span>";
            ?>
						</td>
						<td>
							&nbsp;
						</td>
			<?php 
            $k = 1 - $k;
        }
        ?>
				</tr>
			</table>
			<?php 
        echo $pageNav->getListFooter();
        $field = JRequest::getVar('field', '');
        $order = JRequest::getVar('order', '');
        ?>
			<input type="hidden" name="option" value="com_caddy" />
			<input type="hidden" name="action" value="orders" />
			<input type="hidden" name="task" value="" />
			<input type="hidden" name="field" value="<?php 
        echo $field;
        ?>
" />
			<input type="hidden" name="order" value="<?php 
        echo $order;
        ?>
" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="hidemainmenu" value="0" />
		</form>
		<?php 
    }