Esempio n. 1
0
 protected function ajaxCallback()
 {
     // Transfere callback para métodos respectivos
     switch ($this->action) {
         case 'detail':
             $json = $this->ajaxCallbackForProductApproval();
             break;
         default:
             $json = parent::ajaxCallback();
             break;
     }
     header('Content-Type: application/json');
     exit(json_encode($json));
 }
Esempio n. 2
0
 protected function ajaxCallback()
 {
     // Transfere callback para métodos respectivos
     switch ($this->action) {
         case 'faqSearch':
             $json = $this->ajaxCallbackForSearch();
             break;
         case 'faqDetail':
             $json = $this->ajaxCallbackForDetail();
             break;
         case 'faqRemove':
             $json = $this->ajaxCallbackForRemove();
             break;
         default:
             $json = parent::ajaxCallback();
             break;
     }
     header('Content-Type: application/json');
     exit(json_encode($json));
 }
Esempio n. 3
0
 protected function ajaxCallback()
 {
     // Transfere callback para métodos respectivos
     switch ($this->action) {
         case 'typeSearch':
         case 'brandSearch':
         case 'messageSearch':
             $json = $this->ajaxCallbackForSearch();
             break;
         case 'detail':
             $json = $this->ajaxCallbackForProductApproval();
             break;
         case 'messageDetail':
             $json = $this->ajaxCallbackForMessageApproval();
             break;
         case 'typeDetail':
             $json = $this->ajaxCallbackForDetail();
             if ($json['newID']) {
                 $json['disable'] = ['parent'];
                 $json['hide'] = ['messageContainer'];
                 $json['show'] = ['featureContainer'];
             }
             break;
         case 'typeNewFeature':
             $json = $this->ajaxCallbackForNewFeature();
             break;
         case 'brandDetail':
             $json = $this->ajaxCallbackForPhoto();
             break;
         case 'typeRemove':
         case 'brandRemove':
         case 'messageRemove':
             $json = $this->ajaxCallbackForRemove();
             break;
         default:
             $json = parent::ajaxCallback();
             break;
     }
     header('Content-Type: application/json');
     exit(json_encode($json));
 }
Esempio n. 4
0
 protected function ajaxCallback()
 {
     // Transfere callback para métodos respectivos
     switch ($this->action) {
         case 'mySales':
         case 'myPurchases':
             $json = $this->ajaxCallbackForSearch();
             break;
         default:
             $json = parent::ajaxCallback();
             break;
     }
     header('Content-Type: application/json');
     exit(json_encode($json));
 }
Esempio n. 5
0
 protected function ajaxCallback()
 {
     // Inicializa variáveis do JSON
     $json['redirect'] = null;
     // Transfere callback para métodos respectivos
     switch ($this->action) {
         case 'web':
             switch ($this->authenticate($_POST)) {
                 case Config::read('authcode.error.userdata'):
                     // Dados inválidos
                     $json['message'] = Text::alertMessage("danger", Text::read('message.login.error.data'));
                     break;
                 case Config::read('authcode.error.blocked'):
                     // Usuário inativo
                     $json['message'] = Text::alertMessage("warning", Text::read('message.login.error.inactive'));
                     break;
                 case Config::read('authcode.error.mandatory'):
                     // Campos obrigatórios
                     $json['message'] = Text::alertMessage("danger", Text::read('message.login.error.mandatory'));
                     break;
                 default:
                     $json['redirect'] = Config::read('page.url.homepage');
                     break;
             }
             break;
         case 'myAccount':
         case 'newAccount':
             $json = $this->ajaxCallbackForDetail();
             if ($json['newID']) {
                 $json['redirect'] = Config::read('page.url.login.new-message');
             }
             break;
         case 'password':
             $json = $this->ajaxCallbackForPassword();
             if ($json['newID']) {
                 $json['redirect'] = Config::read('page.url.login.password-message');
             }
             break;
         default:
             $json = parent::ajaxCallback();
             break;
     }
     header('Content-Type: application/json');
     exit(json_encode($json));
 }