Esempio n. 1
0
 function paymentmethodsAction()
 {
     $this->checkLogin();
     if (isset($_REQUEST['get_peyment_method'])) {
         AF::setJsonHeaders('json');
         $paymentType = AF::get($_REQUEST, 'payment_type', 0);
         $paymentMethods = Payments::methods($paymentType);
         if ($paymentMethods) {
             Message::echoJsonSuccess(array('message' => $paymentMethods));
         } else {
             Message::echoJsonError(__('incorrect_payment_type'));
         }
     }
     exit;
 }
Esempio n. 2
0
 public function createAction()
 {
     $model = new Pixelrate();
     if (isset($_POST['get_peyment_method'])) {
         AF::setJsonHeaders('json');
         $paymentType = AF::get($_POST, 'payment_type', 0);
         $paymentMethods = Payments::methods($paymentType);
         if ($paymentMethods) {
             Message::echoJsonSuccess(array('message' => $paymentMethods));
         } else {
             Message::echoJsonError(__('incorrect_payment_type'));
         }
     }
     $this->performAjaxValidation($model);
     // Uncomment the following line if AJAX validation is needed
     if (isset($_POST['model']) && $_POST['model'] == 'pixelrates') {
         if (!isset($_POST['default'])) {
             if (!isset($_POST['aff_id']) || empty($_POST['aff_id'])) {
                 Message::echoJson('error', array('errors' => array('aff_id' => 'No empty')));
             }
         }
         $model->fillFromArray($_POST);
         $model->user_id_created = $this->user->user_id;
         $model->user_id_updated = $this->user->user_id;
         $model->updated = 'NOW():sql';
         $model->created = 'NOW():sql';
         $model->model_uset_id = $this->user->user_id;
         if ($model->save()) {
             Message::echoJsonSuccess();
         } else {
             Message::echoJsonError(__('pixelrate_not_created') . ' ' . $model->errors2string);
         }
         die;
     }
     $this->addToPageTitle('Create pixel rates');
     $this->render('create', array('model' => $model));
 }
Esempio n. 3
0
            </div>
        </div>

        <div class="control-group <?if(!$model->payment_method){?>hide<?}?>" id="div_order_order_payment_method">
            <label class="control-label"><?php 
echo __('payment_method');
?>
</label>
            <div class="controls">
                <select id="order_payment_method" name="payment_method" class="chosen-select select-xlarge" data-placeholder="<?php 
echo __('choose');
?>
">
                    <option value=""></option>
                    <?if($model->payment_method){?>
                    <? foreach(Payments::methods($model->payment_type) as $key => $value){?>
                    <option value="<?php 
echo $key;
?>
" <?if($key == $model->payment_method){?>selected="" <?}?>><?php 
echo $value;
?>
</option>
                    <? } ?>
                    <?}?>
                </select>
                <span class="help-inline"></span>
            </div>
        </div>

        <div class="control-group order-pmf pmf-gc-701 pmf-gc-702 pmf-gc-703 pmf-gc-709">