$numRows = $this->totalCount;
require_once ($this->bloxconfig['absolutepath'] . 'inc/Pagination.php');
$p = new Pagination(array(
'per_page' => $this->bloxconfig['limit'],
'num_links' => $this->bloxconfig['numLinks'],
'cur_page' => $this->bloxconfig['page'],
'total_rows' => $numRows,
'page_query_string' => $this->bloxconfig['pageVarKey'],
'use_page_numbers' => true));
This question has been answered by Bruno17. See the first response.
<meta charset="utf-8">
<!-- jQuery -->
<script src="js/jquery.min.js"></script>
<!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script>
<script src="../js/jquery.tablesorter.widgets.js"></script>
<!-- Tablesorter: pager -->
<link rel="stylesheet" href="../css/jquery.tablesorter.pager.css">
<script src="../js/widget-pager.js"></script>
<script>
$(function() {
$(".tablesorter")
.tablesorter({
theme : 'blue',
// this is the default setting
cssChildRow: "tablesorter-childRow",
// initialize zebra and filter widgets
widgets: ["zebra", "filter", "pager"],
widgetOptions: {
// output default: '{page}/{totalPages}'
// possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
pager_output: '{startRow} - {endRow} / {filteredRows} ({totalRows})', // '{page}/{totalPages}'
pager_removeRows: false,
// include child row content while filtering, if true
filter_childRows : true,
// class name applied to filter row and each input
filter_cssFilter : 'tablesorter-filter',
// search from beginning
filter_startsWith : false,
// Set this option to false to make the searches case sensitive
filter_ignoreCase : true
}
});
// hide child rows
$('.tablesorter-childRow td').hide();
// Toggle child row content (td), not hiding the row since we are using rowspan
// Using delegate because the pager plugin rebuilds the table after each page change
// "delegate" works in jQuery 1.4.2+; use "live" back to v1.3; for older jQuery - SOL
$('.tablesorter').delegate('.toggle', 'click' ,function(){
// use "nextUntil" to toggle multiple child rows
// toggle table cells instead of the row
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle();
return false;
});
// Toggle widgetFilterChildRows option
$('button.toggle-option').click(function(){
var c = $('.tablesorter')[0].config.widgetOptions,
o = !c.filter_childRows;
c.filter_childRows = o;
$('.state').html(o.toString());
// update filter; include false parameter to force a new search
$('table').trigger('search', false);
return false;
});
});
</script>
<div id="demo">
<div class="pager">
<img src="../assets/images/first.png" class="first" alt="First" />
<img src="../assets/images/previous.png" class="prev" alt="Prev" />
<span class="pagedisplay"></span> <!-- this can be any element, including an input -->
<img src="../assets/images/next.png" class="next" alt="Next" />
<img src="../assets/images/last.png" class="last" alt="Last" />
<select class="pagesize" title="Select page size">
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
</select>
<select class="gotoPage" title="Select page number"></select>
</div>
<table class="tablesorter">
<colgroup>
<col width="85" />
<col width="155" />
<col width="155" />
<col width="100" />
<col width="100" />
</colgroup>
<thead>
<tr>
<th>Id No #</th>
<th>Collection City</th>
<th>Delivery City</th>
<th>Date</th>
<th>Cubic Metres Available</th>
</tr>
</thead>
<tbody>
<!-- First row expanded to reveal the layout -->
<tr>
<td rowspan="2"> <!-- rowspan="2" makes the table look nicer -->
<a href="#" class="toggle">[[+id]] - More info</a> <!-- link to toggle view of the child row -->
</td>
<td>[[+deptown]]</td>
<td>[[+arrtown]]</td>
<td>[[+freightdate]]</td>
<td>[[+cubmt]]</td>
</tr>
<tr class="tablesorter-childRow"><td colspan="4"><div class="bold">Vehicle Type</div><div>[[+vehicletype]]<br></div></td></tr>
<tr class="tablesorter-childRow"><td colspan="4"><div class="bold">Job Details</div><div>[[+freightvehicledetail]]<br></div></td></tr>
<tr class="tablesorter-childRow"><td colspan="4"><div class="bold">Contact Details</div><div>[[+freightvehiclecontact]]<br></div></td></tr>
</tbody>
</table>
</div>Array
(
[path] => components/blox/
[absolutepath] => /home/transpo2/public_html/core/components/blox/
[packagename] => available-freight
[limit] => 0
[classname] => AvailableFreight
[tpls] => bloxouter:outerTpl||row:rowaTpl
[debug] => 1
[id] =>
[id_] =>
[distinct] => distinct
[projectname] => blox
[resourceclass] => modTable
[htmlouter] => div
[project] =>
[projectparent] => blox
[projectpath] => components/blox/projects/blox/modTable/
[task] => div
[outputSeparator] =>
[tplpath] => components/blox/projects/blox/modTable/div/templates/
[includespath] => components/blox/projects/blox/modTable/div/includes/
[cachepath] => components/blox/cache/
[includesfile] => components/blox/projects/blox/modTable/div/includes/getdatas.php
[includesclassfile] => components/blox/projects/blox/modTable/div/includes/getdatas.class.php
[includesclass] => Blox_modTable_Div
[onsavefile] => components/blox/projects/blox/modTable/div/includes/onsavedatas.php
[nowtimestamp] => 1403489838
[day] => 23
[month] => 06
[year] => 2014
[userID] => 0
[totalVar] => total
[pageVarKey] => page
[perPage] => 10
[numLinks] => 5
[page] => 1
[offset] => 0
[where] =>
[queries] => *
[selectfields] =>
[sortConfig] =>
[joins] =>
[keyField] => id
[parents] => 0
[depth] => 10
[bloxfolder] =>
[documents] => 999999999
[IDs] => 999999999
[filter] =>
[showdeleted] => 0
[showunpublished] => 0
[debugTime] => 0
)
Query String:
SELECT `AvailableFreight`.`id`, `AvailableFreight`.`freightcaptitle`, `AvailableFreight`.`vehicletype`, `AvailableFreight`.`deptown`, `AvailableFreight`.`arrtown`, `AvailableFreight`.`cubmt`, `AvailableFreight`.`freightdate`, `AvailableFreight`.`freightvehicledetail`, `AvailableFreight`.`freightvehiclecontact`, `AvailableFreight`.`_fromaddress_`, `AvailableFreight`.`published`, `AvailableFreight`.`createdby`, `AvailableFreight`.`createdon`, `AvailableFreight`.`editedby`, `AvailableFreight`.`editedon`, `AvailableFreight`.`deleted`, `AvailableFreight`.`deletedon`, `AvailableFreight`.`deletedby`, `AvailableFreight`.`publishedon`, `AvailableFreight`.`publishedby` FROM `modx_available-freight` AS `AvailableFreight`
Query String:
SELECT `AvailableFreight`.`id`, `AvailableFreight`.`freightcaptitle`, `AvailableFreight`.`vehicletype`, `AvailableFreight`.`deptown`, `AvailableFreight`.`arrtown`, `AvailableFreight`.`cubmt`, `AvailableFreight`.`freightdate`, `AvailableFreight`.`freightvehicledetail`, `AvailableFreight`.`freightvehiclecontact`, `AvailableFreight`.`_fromaddress_`, `AvailableFreight`.`published`, `AvailableFreight`.`createdby`, `AvailableFreight`.`createdon`, `AvailableFreight`.`editedby`, `AvailableFreight`.`editedon`, `AvailableFreight`.`deleted`, `AvailableFreight`.`deletedon`, `AvailableFreight`.`deletedby`, `AvailableFreight`.`publishedon`, `AvailableFreight`.`publishedby` FROM `modx_available-freight` AS `AvailableFreight`
Time to render (row): 0.0112369060516 seconds
Time to render all: 0.0152521133423 seconds
Total time: 0.142436027527 seconds
<meta charset="utf-8">
<!-- jQuery -->
<script src="js/jquery.min.js"></script>
<!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script>
<script src="../js/jquery.tablesorter.widgets.js"></script>
<!-- Tablesorter: pager -->
<link rel="stylesheet" href="../css/jquery.tablesorter.pager.css">
<script src="../js/widget-pager.js"></script>
<script>
$(function() {
$(".tablesorter")
.tablesorter({
theme : 'blue',
// this is the default setting
cssChildRow: "tablesorter-childRow",
// initialize zebra and filter widgets
widgets: ["zebra", "filter", "pager"],
widgetOptions: {
// output default: '{page}/{totalPages}'
// possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
pager_output: '{startRow} - {endRow} / {filteredRows} ({totalRows})', // '{page}/{totalPages}'
pager_removeRows: false,
// include child row content while filtering, if true
filter_childRows : true,
// class name applied to filter row and each input
filter_cssFilter : 'tablesorter-filter',
// search from beginning
filter_startsWith : false,
// Set this option to false to make the searches case sensitive
filter_ignoreCase : true
}
});
// hide child rows
$('.tablesorter-childRow td').hide();
// Toggle child row content (td), not hiding the row since we are using rowspan
// Using delegate because the pager plugin rebuilds the table after each page change
// "delegate" works in jQuery 1.4.2+; use "live" back to v1.3; for older jQuery - SOL
$('.tablesorter').delegate('.toggle', 'click' ,function(){
// use "nextUntil" to toggle multiple child rows
// toggle table cells instead of the row
$(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle();
return false;
});
// Toggle widgetFilterChildRows option
$('button.toggle-option').click(function(){
var c = $('.tablesorter')[0].config.widgetOptions,
o = !c.filter_childRows;
c.filter_childRows = o;
$('.state').html(o.toString());
// update filter; include false parameter to force a new search
$('table').trigger('search', false);
return false;
});
});
</script>
<div id="demo">
<div class="pager">
<img src="../assets/images/first.png" class="first" alt="First" />
<img src="../assets/images/previous.png" class="prev" alt="Prev" />
<span class="pagedisplay"></span> <!-- this can be any element, including an input -->
<img src="../assets/images/next.png" class="next" alt="Next" />
<img src="../assets/images/last.png" class="last" alt="Last" />
<select class="pagesize" title="Select page size">
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
</select>
<select class="gotoPage" title="Select page number"></select>
</div>
<table class="tablesorter">
<colgroup>
<col width="85" />
<col width="155" />
<col width="155" />
<col width="100" />
<col width="100" />
</colgroup>
<thead>
<tr>
<th>Id No #</th>
<th>Collection City</th>
<th>Delivery City</th>
<th>Date</th>
<th>Cubic Metres Available</th>
</tr>
</thead>
<tbody>
<!-- First row expanded to reveal the layout -->
[[+innerrows.row]]
</tbody>
</table>
</div>
<tr>
<td rowspan="2"> <!-- rowspan="2" makes the table look nicer -->
<a href="#" class="toggle">[[+id]] - More info</a> <!-- link to toggle view of the child row -->
</td>
<td>[[+deptown]]</td>
<td>[[+arrtown]]</td>
<td>[[+freightdate]]</td>
<td>[[+cubmt]]</td>
</tr>
<tr class="tablesorter-childRow"><td colspan="4"><div class="bold">Vehicle Type</div><div>[[+vehicletype]]<br></div></td></tr>
<tr class="tablesorter-childRow"><td colspan="4"><div class="bold">Job Details</div><div>[[+freightvehicledetail]]<br></div></td></tr>
<tr class="tablesorter-childRow"><td colspan="4"><div class="bold">Contact Details</div><div>[[+freightvehiclecontact]]<br></div></td></tr>

return time();
&where=`{"freightdate:>":"[[!now:date=`%Y-%m-%d 00:00:00`]]"}`