Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sorting tables without sorting arrow
10-17-2013, 10:32 AM,
#1
Sorting tables without sorting arrow
I am not a system developer, but I got it simple.

Just edit the php file related to your table (it is written on the URL)
Sometimes tables must be split in two or more tables. e.g.: BOMInquiry.php (changes in bold)

hope it helps you

...
if (DB_num_rows($BOMResult)==0){
prnMsg(_('The bill of material for this part is not set up') . ' - ' . _('there are no components defined for it'),'warn');
} else {
echo '<a href="'.$RootPath.'/index.php">' . _('Return to Main Menu') . '</a>';
echo '<p class="page_title_text">
<img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title.'
</p>
<br />';

echo '<table class="selection">';
echo '<tr>
<th colspan="5">
<div class="centre"><b>' . $myrow[0] . ' : ' . _('per') . ' ' . $myrow[1] . '</b>
</div></th>
</tr>';

echo '<table class="selection">';
$TableHeader = '<tr>
<th class="ascending">' . _('Component') . '</th>
<th class="ascending">' . _('Description') . '</th>
<th>' . _('Quantity') . '</th>
<th class="ascending">' . _('Unit Cost') . '</th>
<th class="ascending">' . _('Total Cost') . '</th>
</tr>';
echo $TableHeader;

$j = 1;
$k=0; //row colour counter

$TotalCost = 0;

while ($myrow=DB_fetch_array($BOMResult)) {

if ($k==1){
echo '<tr class="EvenTableRows">';
$k=0;
} else {
echo '<tr class="OddTableRows">';
$k++;
}

$ComponentLink = '<a href="' . $RootPath . '/SelectProduct.php?StockID=' . $myrow['component'] . '">' . $myrow['component'] . '</a>';

/* Component Code Description Quantity Std Cost Total Cost */
printf('<td>%s</td>
<td>%s</td>
<td class="number">%s</td>
<td class="number">%.2f</td>
<td class="number">%.2f</td>
</tr>',
$ComponentLink,
$myrow['description'],
locale_number_format($myrow['quantity'],$myrow['decimalplaces']),
$myrow['standardcost'],
$myrow['componentcost']);

$TotalCost += $myrow['componentcost'];

$j++;
}
echo '<table class="selection">';

_____________________
Eduardo Marzolla
skype: edumarsola
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)