%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/lightco1/upgrade.lightco.com.au/administrator/components/com_chatnox/
Upload File :
Create Path :
Current File : /home/lightco1/upgrade.lightco.com.au/administrator/components/com_chatnox/controller.php

<?php
/**
 * @version		$Id: controller.php 
 * @package		Chatnox
 * @subpackage	Chatnox
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative
 * of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and
 * details.
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

jimport( 'joomla.application.component.controller' );

/**
 * @package		Joomla
 * @subpackage	Config
 */
class ChatnoxController extends JControllerLegacy
{
	
	//Custom Constructor
	function __construct( $default = array())
	{
		parent::__construct( $default );
	}

	function display( )
	{
		//Set the default view, just in case
		$view = JRequest::getCmd('view');
		if(empty($view)) {
			JRequest::setVar('view', 'chatnox');
		};


		$db	=& JFactory::getDBO(); 
 
		$savechatnox = "";
		if (isset($_REQUEST['savechatnox']))
		$savechatnox =  $_REQUEST['savechatnox'];

		$groupid = "";
		if (isset($_REQUEST['groupid']))		
		$groupid =   $_REQUEST['groupid'];
		
		$chatnoxid = "";
		if (isset($_REQUEST['chatnoxid']))		
		$chatnoxid =  $_REQUEST['chatnoxid'];

		$cngroupid = "";
		if (isset($_REQUEST['cngroupid']))
		$cngroupid =  $_REQUEST['cngroupid'];

		if($cngroupid != "")
		{
				$sql ="delete from #__chatnox";
				$db->setQuery($sql );
				$db->query(); 			

				$sql ="insert into #__chatnox values('','".$cngroupid."')";
				$db->setQuery($sql );
				$db->query(); 				
		}

		if($savechatnox == "Save")
		{
			if($chatnoxid == 0)
			{
				$sql ="insert into #__chatnox values('','".$groupid."')";
				$db->setQuery($sql );
				$db->query(); 
			}else
			{
				$sql ="update #__chatnox set group_id ='".$groupid."' where id='".$chatnoxid."' ";
				$db->setQuery($sql );
				$db->query(); 
			}
		}
		
		parent::display();
	}
}

Zerion Mini Shell 1.0