Example #1
0
 /**
  * @return Eccky
  */
 public static function GetInstance()
 {
     if (!self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #2
0
 private function _generPaypalParam($orderEntity)
 {
     $nvp = array();
     $nvp["returnURL"] = $this->_getReturnUrl($orderEntity['id']);
     $nvp["cancelURL"] = $this->_getCancelUrl();
     $nvp["actionType"] = "PAY";
     $nvp['currencyCode'] = "AUD";
     $nvp["clientDeviceId"] = "mydevice";
     $nvp["clientIp"] = WeFlex_Util::GetIp();
     $nvp["memo"] = "Thanks!";
     $nvp["feesPayer"] = "EACHRECEIVER";
     $nvp['receiverEmail'] = array();
     $nvp['receiverAmount'] = array();
     $nvp['primaryReceiver'] = array();
     $products = $orderEntity["cart_info"][TCVM_Cart_Imple::STEP_PRODUCT]["products"];
     foreach ($products as $id => $product) {
         if ($product["paypal"] == "us") {
             $nvp['receiverEmail']["us"] = TCVM::GetInstance()->config->payment->paypal->receiver->us;
             $nvp['receiverAmount']["us"] = $nvp['receiverAmount']["us"] + $product["price"];
             $nvp['primaryReceiver']["us"] = "false";
         } else {
             $nvp['receiverEmail']["au"] = TCVM::GetInstance()->config->payment->paypal->receiver->au;
             $nvp['receiverAmount']["au"] = $nvp['receiverAmount']["au"] + $product["price"];
             $nvp['primaryReceiver']["au"] = "false";
         }
     }
     //application fee
     if ($orderEntity["cart_info"][TCVM_Cart_Imple::STEP_PRODUCT]["new"]) {
         $nvp['receiverEmail']["us"] = TCVM::GetInstance()->config->payment->paypal->receiver->us;
         $nvp['receiverAmount']["us"] = $nvp['receiverAmount']["us"] + $orderEntity["cart_info"][TCVM_Cart_Imple::STEP_PRODUCT]["new"];
         $nvp['primaryReceiver']["us"] = "false";
     }
     return $nvp;
 }
Example #3
0
 function __construct()
 {
     $upload_url = TCVM::GetInstance()->config->product->courses->image->upload_url;
     $resizes = array();
     if (TCVM::GetInstance()->config->product->courses->image->resize) {
         foreach (TCVM::GetInstance()->config->product->courses->image->resize as $resize) {
             $resize_temp = explode('|', $resize);
             $resizes[] = $resize_temp;
         }
     }
     parent::__construct($upload_url, $resizes);
 }
Example #4
0
 public function changePassword($password)
 {
     $isLogin = $this->_getSession();
     if (!$isLogin) {
         throw new Exception("sorry you are not login");
     }
     if (!$password) {
         throw new Exception("sorry new password could not be empty");
     }
     $username = TCVM::GetInstance()->config->admin->username;
     $newpassword = md5($password);
     $model = TCVM_Admin_Model_Admin::GetInstance();
     $model->update(array("password" => $newpassword), array("username" => $username));
 }
Example #5
0
 public function save($data)
 {
     $id = $data['id'];
     $image = $data['image'];
     unset($data['id']);
     unset($data['image']);
     unset($data['perlink']);
     if ($id) {
         $this->_update($id, $data);
     } else {
         $id = $this->_create($data);
     }
     $this->_updateImage($id, $image);
     TCVM::CleanCache();
     return $id;
 }
Example #6
0
 function __construct()
 {
     $this->_request = Zend_Controller_Front::getInstance()->getRequest();
     $this->_paypal = new WeFlex_Api_Paypal_Nvp(TCVM::GetInstance()->config->payment->paypal->username, TCVM::GetInstance()->config->payment->paypal->password, TCVM::GetInstance()->config->payment->paypal->sign, TCVM::GetInstance()->config->payment->paypal->env);
 }
Example #7
0
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application'));
define('APPLICATION_PUBLIC_PATH', realpath(dirname(__FILE__)));
// Define application environment
defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/../library'), realpath(APPLICATION_PATH . '/library'), get_include_path())));
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('WeFlex');
$autoloader->registerNamespace('TCVM');
$autoloader->registerNamespace('Zend');
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
/**
 * application bootstrap;
 */
$application->bootstrap();
/**
 * WeFlex Start
 */
WeFlex_Application::GetInstance()->start(APPLICATION_ENV, APPLICATION_PATH . '/configs/tcvm.ini');
/**
 * Eccky Init
 */
TCVM::GetInstance()->init();
/**
 * application run
 */
$application->run();
Example #8
0
 public function cleancacheAction()
 {
     TCVM::CleanCache();
     die;
 }
Example #9
0
 public function indexAction()
 {
     $coursess = $this->_product->getsVisibleCourses("date_add ASC", null, null, TCVM::UseCache());
     $this->assign("coursess", $coursess);
     $this->title("TCVM Australia | Courses");
 }