It looks like you're new here. If you want to get involved, click one of these buttons!
//changed by rdhital to improve the pagination
function getNavigationValues($display, $noofrows, $limit)
{
$navigation_array = Array();
global $limitpage_navigation;
if(isset($_REQUEST['allflag']) && $_REQUEST['allflag'] == 'All'){
$navigation_array['start'] =1;
$navigation_array['first'] = 1;
$navigation_array['end'] = 1;
$navigation_array['prev'] =0;
$navigation_array['next'] =0;
$navigation_array['end_val'] =$noofrows;
$navigation_array['current'] =1;
$navigation_array['allflag'] ='Normal';
$navigation_array['verylast'] =1;
return $navigation_array;
}
$start = ((($display * $limit) - $limit)+1);
$end = $start + ($limit-1);
if($end > $noofrows)
{
$end = $noofrows;
}
$paging = ceil ($noofrows / $limit);
// Display the navigation
if ($display > 1) {
$previous = $display - 1;
}
else {
$previous=0;
}
if ($noofrows != $limit) {
$last = $paging;
$first = 1;
if ($paging > $limitpage_navigation) {
$first = $display-floor(($limitpage_navigation/2));
if ($first<1) $first=1;
$last = ($limitpage_navigation - 1) + $first;
}
if ($last > $paging ) {
$first = $paging - ($limitpage_navigation - 1);
$last = $paging;
}
}
if ($display < $paging) {
$next = $display + 1;
}
else {
$next=0;
}
$navigation_array['start'] = $start;
$navigation_array['first'] = $first;
$navigation_array['end'] = $last;
$navigation_array['prev'] = $previous;
$navigation_array['next'] = $next;
$navigation_array['end_val'] = $end;
$navigation_array['current'] = $display;
$navigation_array['allflag'] ='All';
$navigation_array['verylast'] =$paging;
return $navigation_array;
}
$limitpage_navigation = '9';//change this number to whatever you want. This is the number of pages that will appear in the pagination.
//modified rdhital to improve the pagination
function getTableHeaderNavigation($navigation_array, $url_qry,$module='',$action_val='index',$viewid='')
{
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$output = '<td align="right">';
$dir_name=getModuleDirName($module);
$output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start=1&viewname='.$viewid.'&allflag='.$navigation_array['allflag'].'" >'.$navigation_array['allflag'].'</a>&nbsp;';
if(($navigation_array['prev']) != 0)
{
$output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start=1&viewname='.$viewid.'" title="First"><img src="'.$image_path.'start.gif" border="0" align="absmiddle"></a>&nbsp;';
$output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start='.$navigation_array['prev'].'&viewname='.$viewid.'"><img src="'.$image_path.'previous.gif" border="0" align="absmiddle"></a>&nbsp;';
}
else
{
$output .= '<img src="'.$image_path.'start_disabled.gif" border="0" align="absmiddle">&nbsp;';
$output .= '<img src="'.$image_path.'previous_disabled.gif" border="0" align="absmiddle">&nbsp;';
}
for ($i=$navigation_array['first'];$i<=$navigation_array['end'];$i++){
if ($navigation_array['current']==$i){
$output .='<b>'.$i.'</b>&nbsp;';
}
else{
$output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start='.$i.'&viewname='.$viewid.'" >'.$i.'</a>&nbsp;';
}
}
if(($navigation_array['next']) !=0)
{
$output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start='.$navigation_array['next'].'&viewname='.$viewid.'"><img src="'.$image_path.'next.gif" border="0" align="absmiddle"></a>&nbsp;';
$output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start='.$navigation_array['verylast'].'&viewname='.$viewid.'"><img src="'.$image_path.'end.gif" border="0" align="absmiddle"></a>&nbsp;';
}
else
{
$output .= '<img src="'.$image_path.'next_disabled.gif" border="0" align="absmiddle">&nbsp;';
$output .= '<img src="'.$image_path.'end_disabled.gif" border="0" align="absmiddle">&nbsp;';
}
$output .= '</td>';
return $output;
}
// Setting the record count string
if ($navigation_array['start'] == 1)
{
if($noofrows != 0)
$start_rec = $navigation_array['start'];
else
$start_rec = 0;
if($noofrows > $list_max_entries_per_page)
{
$end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
}
else
{
$end_rec = $noofrows;
}
}
else
{
if($navigation_array['next'] > $list_max_entries_per_page)
{
$start_rec = $navigation_array['next'] - $list_max_entries_per_page;
$end_rec = $navigation_array['next'] - 1;
}
else
{
$start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
$end_rec = $noofrows;
}
}
// Setting the record count string
//modified by rdhital
$start_rec = $navigation_array['start'];
$end_rec = $navigation_array['end_val'];
Comments
i also like how in your screen shots you have the navigation bar at the bottom of the list as well as the top. i don't know how you did it but if someone else wants to add that here's how i did it.
in listview.html files copy the code:
about 5 lines down to just below "{listentity}".
the way you did is the best way and is the exact way i did it. i just didnt realise somebody else might want it.
raju
great!!!
could you provide the changed files for download?
thanks
steffen
i could provide it but i have loads of custom changes made in my system so i am afraid they might disturb the vtiger function. thats why i provided the code. anyway if i get time later i will download patch 2 and make the changes tehre and submit the files. if there is someone who can upload the files could you please upload it for the others. thanks
raju
dg
thank you for the contribution you have given.
this has been integrated into the product.
thanks & regards,
jaguar
can you please give a little more detail on where this goes?
detrie
thankyou
biagio