Need help with below issue...........
Posted: Wed Oct 05, 2016 3:50 pm
Hi,
Sorry for so lengthy post........
Really appreciate the help in resolving the below issue.......
I have 3 option like 1) Bulk Resume (2) Candidates (3) Search All
Search All is working fine.......
Logic wise Bulk/Candidate are also working fine but number of records are getting more for eg: Overall record is 100 in which bulk are 20 and Candidates are 80 for me first and second option is also showing 100 records which is bug........it should display as per the data
Both are in 2 different files.......
To display the number of records.....
=======================================
Thanks,
Nick
Sorry for so lengthy post........
Really appreciate the help in resolving the below issue.......
I have 3 option like 1) Bulk Resume (2) Candidates (3) Search All
Search All is working fine.......
Logic wise Bulk/Candidate are also working fine but number of records are getting more for eg: Overall record is 100 in which bulk are 20 and Candidates are 80 for me first and second option is also showing 100 records which is bug........it should display as per the data
Both are in 2 different files.......
To display the number of records.....
Code: Select all
<?php if (!empty($this->rs)): ?>
<p class="note">Search Results <?php $this->_($this->pageStart); ?> to <?php $this->_($this->pageEnd); ?> of <?php $this->_($this->totalResults); ?></p>
Code: Select all
public function getPage()
{
$sbase=new SearchBase();
$arrFilter = $sbase->buildFilter();
$filter=$arrFilter["where"];
$column=$arrFilter["extra_column"];
$join=$arrFilter["extra_join"];
//$isSearchAttachment=(isset($_REQUEST["bulk_resume"]) && $_REQUEST["bulk_resume"]);
if(is_array($_GET['bulk_resume']))
$isSearchAttachment=implode(',', $_GET['bulk_resume']);
else
$isSearchAttachment=$_GET['bulk_resume'];
if(isset($isSearchAttachment))
{
if ($isSearchAttachment == '2')
{
$sql = sprintf(
"SELECT
attachment.attachment_id AS attachmentID,
attachment.data_item_id AS candidateID,
attachment.title AS title,
attachment.text AS text,
candidate.first_name AS firstName,
candidate.last_name AS lastName,
candidate.city AS city,
candidate.state AS state,
DATE_FORMAT(
candidate.date_created, '%%m-%%d-%%y'
) AS dateCreated,
candidate.date_created AS dateCreatedSort,
DATE_FORMAT(
candidate.date_modified, '%%m-%%d-%%y'
) AS dateModified,
candidate.date_modified AS dateModifiedSort,
owner_user.first_name AS ownerFirstName,
owner_user.last_name AS ownerLastName,
CONCAT(owner_user.last_name, owner_user.first_name) AS ownerSort
%s
FROM
attachment
LEFT JOIN candidate
ON attachment.data_item_id = candidate.candidate_id
AND attachment.site_id = candidate.site_id
LEFT JOIN user AS owner_user
ON candidate.owner = owner_user.user_id
%s
WHERE
resume = 1
AND
%s
AND
(attachment.data_item_type = %s)
AND
attachment.site_id = %s
AND
(ISNULL(candidate.is_admin_hidden) OR (candidate.is_admin_hidden = 0))
AND
(ISNULL(candidate.is_active) OR (candidate.is_active = 1))
%s
ORDER BY
%s %s
LIMIT %s, %s",
empty($column)?"":",{$column}",
$join,
$this->_WHERE,
DATA_ITEM_CANDIDATE,
$this->_siteID,
$filter,
$this->_sortBy,
$this->_sortDirection,
$this->_thisPageStartRow,
$this->_rowsPerPage
);
}
elseif ($isSearchAttachment == '3')
{
$sql = sprintf(
"SELECT
attachment.attachment_id AS attachmentID,
attachment.data_item_id AS candidateID,
attachment.title AS title,
attachment.text AS text,
candidate.first_name AS firstName,
candidate.last_name AS lastName,
candidate.city AS city,
candidate.state AS state,
DATE_FORMAT(
candidate.date_created, '%%m-%%d-%%y'
) AS dateCreated,
candidate.date_created AS dateCreatedSort,
DATE_FORMAT(
candidate.date_modified, '%%m-%%d-%%y'
) AS dateModified,
candidate.date_modified AS dateModifiedSort,
owner_user.first_name AS ownerFirstName,
owner_user.last_name AS ownerLastName,
CONCAT(owner_user.last_name, owner_user.first_name) AS ownerSort
%s
FROM
attachment
LEFT JOIN candidate
ON attachment.data_item_id = candidate.candidate_id
AND attachment.site_id = candidate.site_id
LEFT JOIN user AS owner_user
ON candidate.owner = owner_user.user_id
%s
WHERE
resume = 1
AND
%s
AND
(attachment.data_item_type = %s OR attachment.data_item_type = %s)
AND
attachment.site_id = %s
AND
(ISNULL(candidate.is_admin_hidden) OR (candidate.is_admin_hidden = 0))
AND
(ISNULL(candidate.is_active) OR (candidate.is_active = 1))
%s
ORDER BY
%s %s
LIMIT %s, %s",
empty($column)?"":",{$column}",
$join,
$this->_WHERE,
DATA_ITEM_CANDIDATE,
DATA_ITEM_BULKRESUME,
$this->_siteID,
$filter,
$this->_sortBy,
$this->_sortDirection,
$this->_thisPageStartRow,
$this->_rowsPerPage
);
}elseif($isSearchAttachment == '1')
{
$sql = sprintf(
"SELECT
attachment.attachment_id AS attachmentID,
attachment.data_item_id AS candidateID,
attachment.title AS title,
attachment.text AS text,
candidate.first_name AS firstName,
candidate.last_name AS lastName,
candidate.city AS city,
candidate.state AS state,
DATE_FORMAT(
candidate.date_created, '%%m-%%d-%%y'
) AS dateCreated,
candidate.date_created AS dateCreatedSort,
DATE_FORMAT(
candidate.date_modified, '%%m-%%d-%%y'
) AS dateModified,
candidate.date_modified AS dateModifiedSort,
owner_user.first_name AS ownerFirstName,
owner_user.last_name AS ownerLastName,
CONCAT(owner_user.last_name, owner_user.first_name) AS ownerSort
%s
FROM
attachment
LEFT JOIN candidate
ON attachment.data_item_id = candidate.candidate_id
AND attachment.site_id = candidate.site_id
LEFT JOIN user AS owner_user
ON candidate.owner = owner_user.user_id
%s
WHERE
resume = 1
AND
%s
AND
(attachment.data_item_type = %s)
AND
attachment.site_id = %s
AND
(ISNULL(candidate.is_admin_hidden) OR (candidate.is_admin_hidden = 0))
AND
(ISNULL(candidate.is_active) OR (candidate.is_active = 1))
%s
ORDER BY
%s %s
LIMIT %s, %s",
empty($column)?"":",{$column}",
$join,
$this->_WHERE,
DATA_ITEM_BULKRESUME,
$this->_siteID,
$filter,
$this->_sortBy,
$this->_sortDirection,
$this->_thisPageStartRow,
$this->_rowsPerPage
);
}
}
return $this->_db->getAllAssoc($sql);
}Nick