Your IP : 216.73.216.170


Current Path : /var/www/iplanru/data/www/iplan.5018.vps.agava.net/components/com_pay/views/payment/
Upload File :
Current File : /var/www/iplanru/data/www/iplan.5018.vps.agava.net/components/com_pay/views/payment/view.html.php

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

/**
 * View for  current element
 * @author kirdinyuri
 */
class PayViewPayment extends JViewLegacy
{

	protected $item;

	protected $form;
	
	protected $script;

	/**
	 * Method of display current template
	 * @param type $tpl
	 */
	public function display( $tpl = null )
	{
		$this->item = $this->get( 'Item' );
		$this->form = $this->get( 'Form' );
		$this->loadHelper( 'pay' );
		
		$method=$this->form->getValue( 'method' );
		if ($method=='bpg') $thistitle= "Форма покупки готового бизнес-плана";
		if ($method=='bpn') $thistitle= "Форма заказа бизнес-плана";
		if ($method=='mig') $thistitle= "Форма покупки готового маркетингового исследования";
		if ($method=='min') $thistitle= "Форма заказа маркетингового исследования";
		if ($method=='teo') $thistitle= "Форма заказа технико-экономического обоснования (ТЭО)";
		if ($method=='bpo') $thistitle= "Форма покупки готового бизнес-плана он-лайн";
		if ($method=='mio') $thistitle= "Форма покупки готового маркетингового исследования он-лайн";
		if ($method=='ocn') $thistitle= "Форма заказа оценки";
		if ($method=='gmn') $thistitle= "Форма заказа геомаркетинга";
		if ($method=='') $thistitle= "Форма заказа";
		
		payHelper::setDocument( $thistitle, $this->baseurl );
		
		parent::display( $tpl );
		
		// Устанавливаем документ.
		$this->setDocument();
	}


	protected function setDocument()
	{
		$document = JFactory::getDocument();
		/*$document->addScript(JURI::root() . $this->script);
		$document->addScript(
		JURI::root() . "components/com_pay/views/payment/submitbutton.js");*/
		JText::script('COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE');
	}
	
	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;
	}
	
	function query($query)
	{
		$db =&JFactory::getDBO();
		$db->setquery($query); 
		return $db->query($query);
	}
	
	function geterrortext($err,$mes)
	{
		if (count($err)<>0) {
			foreach ($err as $item)
				$err_text.="<p><span style=\"color: red;\">{$item}</span></p>";
		}
		if (count($mes)<>0) {
			foreach ($mes as $item)
				$mes_text.="<p><span style=\"color: green;\">{$item}</span></p>";
		}
		if ($err_text<>'' or $mes_text<>'')
			return '<hr>'.$err_text.$mes_text.'<hr>';
		else
			return '';
	}
	
	function getcode($str){
		$str1=strtoupper(md5(time().$str));
		$str2=strtoupper(md5(time().$str1));
		$str3=strtoupper(md5(time().$str2));
		$str4=strtoupper(md5(time().$str3));
		return substr($str1,0,4).'-'.substr($str2,0,4).'-'.substr($str3,0,4).'-'.substr($str4,0,5);
	}
}