Your IP : 216.73.216.170


Current Path : /var/www/iplanru/data/www/i-plan.ru/components/com_pay/helpers/
Upload File :
Current File : /var/www/iplanru/data/www/i-plan.ru/components/com_pay/helpers/pay.php

<?php

// No direct access
defined( '_JEXEC' ) or die;

/**
 * Component helper
 * @author kirdinyuri
 */
class PayHelper
{

	public function setDocument( $title = '', $basepath, $metadesc = '', $metakey = '' )
	{
		$doc = JFactory::getDocument();
		JHtml::_( 'bootstrap.framework' );
		JHtml::_( 'bootstrap.loadCss' );
		//$doc->addScript( $basepath . '/components/com_pay/assets/scripts/pay.js' );
		$doc->addStyleSheet( $basepath . '/components/com_pay/assets/styles/pay.css' );
		$app = JFactory::getApplication();
		if ( empty( $title ) ) {
			$title = $app->getCfg( 'sitename' );
		} elseif ( $app->getCfg( 'sitename_pagetitles', 0 ) == 1 ) {
			$title = JText::sprintf( 'JPAGETITLE', $app->getCfg( 'sitename' ), $title );
		} elseif ( $app->getCfg( 'sitename_pagetitles', 0 ) == 2 ) {
			$title = JText::sprintf( 'JPAGETITLE', $title, $app->getCfg( 'sitename' ) );
		}
		$doc->setTitle( $title );
		if ( trim( $metadesc ) ) {
			$doc->setDescription( $metadesc );
		}
		if ( trim( $metakey ) ) {
			$doc->setMetaData( 'keywords', $metakey );
		}
	}
	
	public function mymail($msg,$subject,$mmail)
		{
			$mailer =& JFactory::getMailer();						
			$conf = new JConfig();
			$sender = array( 
				$conf->mailfrom,
				$conf->fromname);
			$mailer->setSender($sender);		
			$mailer->addRecipient($mmail);
			$mailer->setSubject($subject);
			$mailer->isHTML(true);
			$mailer->Encoding = 'base64';
			$mailer->setBody($msg);
			$send =& $mailer->Send();
			return $send;
		}
	public function GetValue($sql)
		{
			$db =&JFactory::getDBO();
			$count='';
			$ret='';
			$field='val';
			$db->setQuery($sql, 0, $count);
			$rows = $db->loadObjectList();
			if (count($rows)<>0)
			foreach ($rows as $row)
				{$ret=$row->$field;};
			return $ret;
		}
		
	public function query($query)
		{
			$db =&JFactory::getDBO();
			$db->setquery($query); 
			return $db->query($query);
		}
}