The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: NO INSERT HTML TO MYSQL
PostPosted: Sun Jun 24, 2012 10:07 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Jan 30, 2011 11:05 am
Posts: 18
hi
I used the following components

http://extensions.joomla.org/extensions ... rveys/9954
link fo download
http://www.joomla6teen.com/files/extens ... _first.zip

no insert code html into record?
Please help me :(


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: Mon Jun 25, 2012 7:22 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Jan 30, 2011 11:05 am
Posts: 18
is code



Code:
<?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);

    }
   
}



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 



Who is online

Users browsing this forum: Exabot [Bot], thanhtuan01 and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group