$cursort = $_POST['cursort']; $cursorttype = $_POST['cursorttype']; if ($cursort != '') { if ($cursorttype == '1') { $cursort_type = 'ASC'; } else { $cursort_type = 'DESC'; } $orderBy = " {$cursort} {$cursort_type}"; } else { $orderBy = " iVerifiedID DESC "; } ## ENDS HERE ### $groupBy = " iOrganizationID "; $limit = " LIMIT " . ($page - 1) * $REC_LIMIT_FRONT . ", " . $REC_LIMIT_FRONT . " "; $jtbl = " INNER JOIN " . PRJ_DB_PREFIX . "_organization_master org on orgpf.iOrganizationID=org.iOrganizationID "; $orglist = $orgprefvrfyObj->getJoinTableInfo($jtbl, 'org.*,orgpf.eStatus', $where, $orderBy, $groupBy, $limit, 'yes'); // prints($orglist); exit; $count = $orglist['tot']; unset($orglist['tot']); if (!isset($pgajxobj)) { require_once SITE_CLASS_GEN . "class.paging-ajax.php"; } $pgajxobj = new Paging($count, $page, "listorgs", $REC_LIMIT_FRONT); $paging = $pgajxobj->getListPG($page); $pgmsg = $pgajxobj->setMessage("Records"); // echo $pgmsg; exit; $smarty->assign('orglist', $orglist); $smarty->assign('count', $count); $smarty->assign('paging', $paging); $smarty->assign('pgmsg', $pgmsg);