本文整理汇总了PHP中ListViewSession::getRequestStartPage方法的典型用法代码示例。如果您正苦于以下问题:PHP ListViewSession::getRequestStartPage方法的具体用法?PHP ListViewSession::getRequestStartPage怎么用?PHP ListViewSession::getRequestStartPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListViewSession
的用法示例。
在下文中一共展示了ListViewSession::getRequestStartPage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRequestCurrentPage
public static function getRequestCurrentPage($currentModule, $query, $viewid, $queryMode = false)
{
global $list_max_entries_per_page, $adb;
$start = 1;
if (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true' && $_REQUEST['start'] != "last") {
return ListViewSession::getRequestStartPage();
}
if (!empty($_REQUEST['start'])) {
$start = $_REQUEST['start'];
if ($start == 'last') {
$count_result = $adb->query(mkCountQuery($query));
$noofrows = $adb->query_result($count_result, 0, "count");
if ($noofrows > 0) {
$start = ceil($noofrows / $list_max_entries_per_page);
}
}
if (!is_numeric($start)) {
$start = 1;
} elseif ($start < 1) {
$start = 1;
}
$start = ceil($start);
} else {
if (!empty($_SESSION['lvs'][$currentModule][$viewid]['start'])) {
$start = $_SESSION['lvs'][$currentModule][$viewid]['start'];
}
}
if (!$queryMode) {
$_SESSION['lvs'][$currentModule][$viewid]['start'] = intval($start);
}
return $start;
}
示例2: getDuplicateRecordsArr
/** Function to return the duplicate records data as a formatted array */
function getDuplicateRecordsArr($module)
{
global $adb, $app_strings, $list_max_entries_per_page, $theme;
$field_values_array = getFieldValues($module);
$field_values = $field_values_array['fieldnames_list'];
$fld_arr = $field_values_array['fieldnames_array'];
$col_arr = $field_values_array['columnnames_array'];
$fld_labl_arr = $field_values_array['fieldlabels_array'];
$ui_type = $field_values_array['fieldname_uitype'];
$dup_query = getDuplicateQuery($module, $field_values, $ui_type);
// added for page navigation
$dup_count_query = substr($dup_query, stripos($dup_query, 'FROM'), strlen($dup_query));
$dup_count_query = "SELECT count(*) as count " . $dup_count_query;
$count_res = $adb->query($dup_count_query);
$no_of_rows = $adb->query_result($count_res, 0, "count");
if ($no_of_rows <= $list_max_entries_per_page) {
$_SESSION['dup_nav_start' . $module] = 1;
} else {
if (isset($_REQUEST["start"]) && $_REQUEST["start"] != "" && $_SESSION['dup_nav_start' . $module] != $_REQUEST["start"]) {
$_SESSION['dup_nav_start' . $module] = ListViewSession::getRequestStartPage();
}
}
$start = $_SESSION['dup_nav_start' . $module] != "" ? $_SESSION['dup_nav_start' . $module] : 1;
$navigation_array = getNavigationValues($start, $no_of_rows, $list_max_entries_per_page);
$start_rec = $navigation_array['start'];
$end_rec = $navigation_array['end_val'];
$navigationOutput = getTableHeaderNavigation($navigation_array, "", $module, "FindDuplicate", "");
if ($start_rec == 0) {
$limit_start_rec = 0;
} else {
$limit_start_rec = $start_rec - 1;
}
$dup_query .= " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}";
//ends
$nresult = $adb->query($dup_query);
$no_rows = $adb->num_rows($nresult);
require_once 'modules/Vtiger/layout_utils.php';
if ($no_rows == 0) {
if ($_REQUEST['action'] == 'FindDuplicateRecords') {
//echo "<br><br><center>".$app_strings['LBL_NO_DUPLICATE']." <a href='javascript:window.history.back()'>".$app_strings['LBL_GO_BACK'].".</a></center>";
//die;
echo "<link rel='stylesheet' type='text/css' href='themes/{$theme}/style.css'>";
echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\n\t\t\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t\t<tbody><tr>\n\t\t\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('empty.jpg', $theme) . "' ></td>\n\t\t\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span class='genHeaderSmall'>{$app_strings['LBL_NO_DUPLICATE']}</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td class='small' align='right' nowrap='nowrap'>\n\t\t\t\t<a href='javascript:window.history.back();'>{$app_strings['LBL_GO_BACK']}</a><br> </td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody></table>\n\t\t\t\t</div>";
echo "</td></tr></table>";
exit;
} else {
echo "<br><br><table align='center' class='reportCreateBottom big' width='95%'><tr><td align='center'>" . $app_strings['LBL_NO_DUPLICATE'] . "</td></tr></table>";
die;
}
}
$rec_cnt = 0;
$temp = array();
$sl_arr = array();
$grp = "group0";
$gcnt = 0;
$ii = 0;
//ii'th record in group
while ($rec_cnt < $no_rows) {
$result = $adb->fetchByAssoc($nresult);
//echo '<pre>';print_r($result);echo '</pre>';
if ($rec_cnt != 0) {
$sl_arr = array_slice($result, 2);
array_walk($temp, 'lower_array');
array_walk($sl_arr, 'lower_array');
$arr_diff = array_diff($temp, $sl_arr);
if (count($arr_diff) > 0) {
$gcnt++;
$temp = $sl_arr;
$ii = 0;
}
$grp = "group" . $gcnt;
}
$fld_values[$grp][$ii]['recordid'] = $result['recordid'];
for ($k = 0; $k < count($col_arr); $k++) {
if ($rec_cnt == 0) {
$temp[$fld_labl_arr[$k]] = $result[$col_arr[$k]];
}
if ($ui_type[$fld_arr[$k]] == 56) {
if ($result[$col_arr[$k]] == 0) {
$result[$col_arr[$k]] = $app_strings['no'];
} else {
$result[$col_arr[$k]] = $app_strings['yes'];
}
}
if ($ui_type[$fld_arr[$k]] == 75 || $ui_type[$fld_arr[$k]] == 81) {
$vendor_id = $result[$col_arr[$k]];
if ($vendor_id != '') {
$vendor_name = getVendorName($vendor_id);
}
$result[$col_arr[$k]] = $vendor_name;
}
if ($ui_type[$fld_arr[$k]] == 57) {
$contact_id = $result[$col_arr[$k]];
if ($contact_id != '') {
$parent_module = 'Contacts';
$displayValueArray = getEntityName($parent_module, $contact_id);
if (!empty($displayValueArray)) {
foreach ($displayValueArray as $key => $field_value) {
//.........这里部分代码省略.........
示例3: setSessionVar
function setSessionVar($lv_array, $noofrows, $max_ent, $module = '', $related = '')
{
$start = '';
if ($noofrows >= 1) {
$lv_array['start'] = 1;
$start = 1;
} elseif ($related != '' && $noofrows == 0) {
$lv_array['start'] = 1;
$start = 1;
} else {
$lv_array['start'] = 0;
$start = 0;
}
if (isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$lv_array['start'] = ListViewSession::getRequestStartPage();
$start = ListViewSession::getRequestStartPage();
} elseif ($_SESSION['rlvs'][$module][$related]['start'] != '') {
if ($related != '') {
$lv_array['start'] = $_SESSION['rlvs'][$module][$related]['start'];
$start = $_SESSION['rlvs'][$module][$related]['start'];
}
}
if (isset($_REQUEST['viewname']) && $_REQUEST['viewname'] != '') {
$lv_array['viewname'] = vtlib_purify($_REQUEST['viewname']);
}
if ($related == '') {
$_SESSION['lvs'][$_REQUEST['module']] = $lv_array;
} else {
$_SESSION['rlvs'][$module][$related] = $lv_array;
}
if ($start < ceil($noofrows / $max_ent) && $start != '') {
$start = ceil($noofrows / $max_ent);
if ($related == '') {
$_SESSION['lvs'][$currentModule]['start'] = $start;
}
}
}
示例4: fixPostgresQuery
//Retreiving the no of rows
$count_result = $adb->query(mkCountQuery($query));
$num_records = $adb->query_result($count_result, 0, "count");
if ($num_records > 0) {
$displayFolder = true;
}
//navigation start
$max_entries_per_page = $list_max_entries_per_page;
//Postgres 8 fixes
if ($adb->dbType == "pgsql") {
$list_query = fixPostgresQuery($query, $log, 0);
}
if ($folder_id == $request_folderid) {
$start[$folder_id] = 1;
if (!empty($_REQUEST['start'])) {
$start[$folder_id] = ListViewSession::getRequestStartPage();
if ($start[$folder_id] == 'last') {
if ($num_records > 0) {
$start[$folder_id] = ceil($num_records / $max_entries_per_page);
}
}
if (!is_numeric($start[$folder_id])) {
$start[$folder_id] = 1;
}
}
}
$navigation_array = VT_getSimpleNavigationValues($start[$folder_id], $max_entries_per_page, $num_records);
if ($folder_id == $request_folderid) {
if (!is_array($_SESSION['lvs'][$currentModule]['start'])) {
$_SESSION['lvs'][$currentModule]['start'] = array();
}