is codeCode:
<?php
// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
//jimport( 'joomla.application.component.model' );
class AbstractModelAbstract extends JModel
{
function sendAbstract($send)
{
global $mainframe;
//JRequest::checkToken('request') or jexit( 'Invalid Token' );
$db =& JFactory::getDBO();
$user =& JFactory::getUser();
$query = 'SELECT count( * ) FROM #__abstract WHERE sender_id = "'.$user->id.'" and status > 0';
$db->setQuery( $query );
$count = $db->loadResult();
$id = JRequest::getInt('id', NULL);
$cat_id = JRequest::getInt('cat_id', '');
$title = JRequest::getVar('title', '', 'post');
$present = JRequest::getVar('present', 'none', 'post');
$author = JRequest::getVar('author', '', 'post');
$institute = JRequest::getVar('institute', '', 'post');
$background = JRequest::getVar('background', '', 'post');
$objective = JRequest::getVar('objective', '', 'post');
$method = JRequest::getVar('method', '', 'post');
$result = JRequest::getVar('result', '', 'post');
$conclusion = JRequest::getVar('conclusion', '', 'post');
$www = JRequest::getVar('www', '', 'post');
if($user->get('guest')) {
$msg = 'Sorry you cann\'t send this Abstract.';
}
elseif($cat_id == "") {
$msg = 'Please Select a Category.';
}
elseif($title == "") {
$msg = 'Please enter a subject.';
}
elseif($author == "") {
$msg = 'Please enter the name of Author.';
}
elseif($institute == "") {
$msg = 'Please enter the name of Institution(s).';
}
elseif($background == "") {
$msg = 'Please enter Background.';
}
elseif($objective == "") {
$msg = 'Please enter Objective.';
}
elseif($method == "") {
$msg = 'Please enter Method.';
}
elseif($result == "") {
$msg = 'Please enter Results.';
}
elseif($conclusion == "") {
$msg = 'Please enter Conclusion.';
}
else {
$insert = new stdClass;
$insert->id = $id;
$insert->cat_id = $cat_id;
$insert->sender_id = $user->id;
$insert->title = $title;
$insert->present = $present;
$insert->author = $author;
$insert->institute = $institute;
$insert->background = $background;
$insert->objective = $objective;
$insert->method = $method;
$insert->result = $result;
$insert->conclusion = $conclusion;
if($send) {
$insert->status = 1;
}
if($id == NULL) {
$rslt = $db->insertObject('#__abstract', $insert, 'id');
$id = $db->insertid();
}
else {
$rslt = $db->updateObject('#__abstract', $insert, 'id');
}
}
$mainframe->redirect('index.php?option=com_abstract&view=cpanel', $msg);
}
}