- Posts: 27
- Thank you received: 1
<td class="maintext" align="center" valign="middle">
<a href="index.php?option=com_jsjobs&c=jsjobs&task=deleteresumesearch&bd=<?php echo $search->id; ?>">
<img width="15" height="15" src="components/com_jsjobs/images/delete.png" /></a>
</td>
function deleteresumesearch() //delete resume search
{
global $mainframe;
$model = $this->getModel('jsjobs', 'JSJobsModel');
$session = &JFactory::getSession();
$user =& JFactory::getUser();
$uid=$user->id;
$params = & $mainframe->getPageParameters('com_jsjobs');
$Itemid = JRequest::getVar('Itemid');
$params = & $mainframe->getPageParameters('com_jsjobs');
$data = JRequest :: get('post');
$link = 'index.php?option=com_jsjobs&c=jsjobs&view=employer&layout=my_resumesearches&Itemid='.$Itemid;
$searchid = JRequest::getVar('rs');
$return_value = $model->deleteResumeSearch($searchid, $uid);
if ($return_value == 1) {
$msg = JText :: _('JS_SEARCH_DELETED');
}elseif ($return_value == 2){
$msg = JText :: _('JS_NOT_YOUR_SEARCH');
}else{
$msg = JText :: _('JS_ERROR_DELETING_SEARCH');
}
$this->setRedirect($link, $msg);
//$this->setRedirect(JRoute::_($link), $msg);
}
function deleteResumeSearch($searchid, $uid)
{
$db = &$this->getDBO();
$row = &$this->getTable('resumesearch');
if (is_numeric($searchid) == false) return false;
$query = "SELECT COUNT(search.id) FROM ".$db->nameQuote('#__js_job_resumesearches')." AS search
WHERE search.id = ".$searchid." AND search.uid = ".$uid;
//echo '<br> SQL '.$query;
$db->setQuery($query);
$searchtotal = $db->loadResult();
if ($searchtotal > 0){ // this search is same user
if (!$row->delete($searchid))
{
$this->setError($row->getErrorMsg());
return false;
}
}else return 2;
return true;
}
function deleteresumesearch() //delete resume search
{
global $mainframe;
$model = $this->getModel('jsjobs', 'JSJobsModel');
$user =& JFactory::getUser();
$uid=$user->id;
$Itemid = JRequest::getVar('Itemid');
$link = 'index.php?option=com_jsjobs&c=jsjobs&view=employer&layout=my_resumesearches&Itemid='.$Itemid;
$searchid = JRequest::getVar('rs');
$return_value = $model->deleteResumeSearch($searchid, $uid);
if ($return_value == 1) {
$msg = JText :: _('JS_SEARCH_DELETED');
}elseif ($return_value == 2){
$msg = JText :: _('JS_NOT_YOUR_SEARCH');
}else{
$msg = JText :: _('JS_ERROR_DELETING_SEARCH');
}
$this->setRedirect($link, $msg);
//$this->setRedirect(JRoute::_($link), $msg);
}