<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | Common database model class. It use for common functions             |
// | File name : common.php                                               |
// | PHP version >= 5.2                                                   |
// | Created On 4 January 2012                                            |
// +----------------------------------------------------------------------+
// | Author: Rajath Kamal <rajath.k@armiasystems.com>                     |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems ? 2010                                      |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------|



class ControllerAuthorize extends BaseController
{
	/*
		construction function. we can initialize the models here
	*/
     public $userName   =   '';
     public $userPass   =   '';
     public $userId     =   0;
     
     public function init()
     { 
                 parent::init();
                 $this->_session = new LibSession();
                 if($this->_session->get('user_id')=="")
                   {
                       $this->switchmodule(ConfigUrl::base('default'));
                       exit;
                   }
                 $this->_common		        = new ModelCommon;
		// $this->_modelauthorize		= new ModelAuthorize;
 
                 
   
                 $this->Libauthorize_class      = new  LibAuthorize_class();

     }



    
	public function process()
	{

           

            // User Information

           $this->userName = $this->_session->get('user_login');

           $this->userPass = $this->_session->get('user_pass');
           
           $this->userId   = $this->_session->get('user_id');


           $this->Libauthorize_class  = new  LibAuthorize_class();

           $authorizeEnable      =   $this->_common->selectRow("settings","value","settingfield='authorize_enable'");

           $authorizeLoginId     =   $this->_common->selectRow("settings","value","settingfield='authorize_loginid'");

           $authorizeTransKey    =   $this->_common->selectRow("settings","value","settingfield='authorize_transkey'");

           $authorizeEmail       =   $this->_common->selectRow("settings","value","settingfield='authorize_email'");

           $authorizeTestMode    =   $this->_common->selectRow("settings","value","settingfield='authorize_test_mode'");

            $amount   =   $this->_common->selectRow("settings","value","settingfield='nFeatured_Amount'");


            $adminCurrency    =   $this->_common->selectRow("settings","value","settingfield='admin_currency'");



           



           $authorizeInfo =array();


           $authorizeInfo['x_login'] = $authorizeLoginId;
           $authorizeInfo['x_tran_key'] = $authorizeTransKey;
           $authorizeInfo['email'] = $authorizeEmail;
           $authorizeInfo['testMode'] = $authorizeTestMode;
           $authorizeInfo['currency_code'] =$adminCurrency;
           
           

           $authorizeInfo['amount'] = $amount;

           

           $authorizeInfo['expMonth']=$this->post('expM');
           $authorizeInfo['expYear']=$this->post('expY');


          

           $authorizeInfo['cvv']=$this->post('cvv');

           $authorizeInfo['ccno']=$this->post('ccno');


          

           $this->Libauthorize_class->submit_authorize_post($authorizeInfo);





        

        //$this->view->txtUserFirstName       = $txtUserFirstName;



          
            
	}


        public function success($listId)
        {

            
        }
	
	 
     
    

		

}
?>