PHP Developers Network
http://forums.devnetwork.net/

Need help with below issue...........
http://forums.devnetwork.net/viewtopic.php?f=2&t=143016
Page 1 of 1

Author:  joinnavdev [ Wed Oct 05, 2016 3:50 pm ]
Post subject:  Need help with below issue...........

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.....
Syntax: [ Download ] [ Hide ]
<?php if (!empty($this->rs)): ?>
<p class="note">Search Results &nbsp;<?php $this->_($this->pageStart); ?> to <?php $this->_($this->pageEnd); ?> of <?php $this->_($this->totalResults); ?></p>
 

=======================================

Syntax: [ Download ] [ Hide ]
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);
}


Thanks,
Nick

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/