I just been to the http://demo.astbill.com site which is run under drupal and i was wondering

which modules might they be using to to be able to sort the table in ascending decending order
http://demo.astbill.com/astpbx?sort=asc&order=Account

then again they are probably are custom modules

Comments

robertDouglass’s picture

Hi,

you provided a dead link.

In general, Drupal comes with PHP functions (theme_table_sort I believe) to do the table sorting.

- Robert Douglass

-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net

styro’s picture

That page would be generated by a custom module, but the column sorting bit is already in Drupal. Look at the admin logs for an example.

I'm not sure how to code this stuff, but here would be a starting point:

http://drupaldocs.org/api/4.6/function/tablesort_init

--
Anton

london3’s picture

Hi

It is relativly easy to sort the table in Drupal. It is a standard drupal function.

http://astbill.com is open source. You can download the modules from
http://prdownloads.sourceforge.net/astbill/astbill-0.9.0.2.tar.bz2?download

$header = array(
array('data' => t('Account'), 'field' => 'accountcode', 'sort' => 'asc'),
array('data' => t('Type'), 'field' => 'tech'),
array('data' => t('Name')),
array('data' => t('Balance'), 'field' => 'balance'),
array('data' => t('Expenditure'), 'field' => 'sumprice'),
array('data' => t('Payments'), 'field' => 'sumpaid'),
array('data' => t('Calls'), 'field' => 'countcalls'),
array('data' => t('operations'), 'colspan' => 2)

);

$sql = "SELECT * FROM asvaccount2
where uid ='".$user->uid."'". tablesort_sql($header);
$result = pager_query($sql, $maxline);

When you have the data in the $header appending the tablesort_sql($header); to the sql allows drupal to sort it out.

Drupal is a fantastic tool. There are so many functions that make development easy. in AstBill we have only used a few of them. The successfull development of AstBill shows that Drupal is an exelent software development platform.

I hope this was usefull.

Are Casilla
http://astbill.com
http://astartelecom.com