Ejemplo n.º 1
0
 public function execute()
 {
     if (wa()->getUser()->getRights('wacab', 'backend') >= 2) {
         $apps_model = new wacabAppsModel();
         $app = waRequest::get('apps');
         if ($app['parent'] === 'null') {
             $app['parent'] = null;
         }
         if (isset($app['id']) && $app['id'] > 0) {
             $old = $apps_model->getById($app['id']);
             if ($old['app_id'] != $app['app_id'] && $app['type'] == 'app') {
                 $apps_model->exec('UPDATE wacab_apps SET app_id = s:app_id WHERE app_id = s:old_app_id', array('app_id' => $app['app_id'], 'old_app_id' => $old['app_id']));
             }
             $apps_model->updateById($app['id'], $app);
         } else {
             unset($app['id']);
             $app['name'] = json_encode(array($app['name']));
             $apps_model->insert($app);
         }
         $view = self::getView();
         $apps = $apps_model->getAll();
         $types = $apps_model->getTypes();
         $parents = $apps_model->getParents();
         $view->assign('parents', $parents);
         $view->assign('types', $types);
         $view->assign('apps', $apps);
         $view->assign('edit', 0);
         $view->assign('app', array());
         $this->response = array('apps' => $view->fetch(wacabHelper::getAppPath() . '/templates/actions/apps/apps_table.html'), 'form' => $view->fetch(wacabHelper::getAppPath() . '/templates/actions/apps/apps_form.html'));
     } else {
         $this->setError(_wp('No permission to add the app'));
     }
 }
Ejemplo n.º 2
0
 public function execute()
 {
     $settings_model = new waAppSettingsModel();
     $settings = $settings_model->get('wacab');
     $this->view->assign('settings', $settings);
     $this->setTemplate(wacabHelper::getAppPath() . '/templates/actions/settings/Settings_page.html');
 }
Ejemplo n.º 3
0
 public function execute()
 {
     $model = new waModel();
     $payment_model = new wacabPaymentModel();
     $payments = $payment_model->getAll();
     $apps_model = new wacabAppsModel();
     $apps = $apps_model->getByField('stat', 1, true);
     $total = $model->query('SELECT SUM(pay) FROM wacab_payment WHERE `apps_id` is not null')->fetchAll();
     $plugins_stat = array();
     foreach ($apps as $app) {
         $app_total = $model->query('SELECT SUM(pay) FROM wacab_payment WHERE `apps_id` = ' . $app['id'])->fetch();
         $app_count = $model->query('SELECT COUNT(*) FROM wacab_payment WHERE `pay` >= 0 AND `apps_id` = ' . $app['id'])->fetch();
         $app_return = $model->query('SELECT COUNT(*) FROM wacab_payment WHERE `pay` < 0 AND `apps_id` = ' . $app['id'])->fetch();
         $names = json_decode($app['name'], true);
         if ($app['parent'] == 'no_parent' || $app['parent'] == '') {
             $pname = $names[0];
         } else {
             $pname = $names[0] . " (" . $app['parent'] . ")";
         }
         $plugins_stat[] = array('id' => $app['app_id'], 'total' => $app_total[0], 'name' => $pname, 'count' => $app_count[0], 'return' => $app_return[0]);
     }
     $this->view->assign('total', $total);
     $this->view->assign('apps', $plugins_stat);
     $this->setTemplate(wacabHelper::getAppPath() . '/templates/actions/statistic/stat_page.html');
 }
Ejemplo n.º 4
0
 public function execute()
 {
     $settings_model = new waAppSettingsModel();
     $settings = $settings_model->get('wacab');
     $model = new wacabPaymentModel();
     $reviews = $model->query('SELECT * FROM wacab_review ORDER BY date DESC')->fetchAll();
     $this->view->assign('reviews', $reviews);
     $this->setTemplate(wacabHelper::getAppPath() . '/templates/actions/reviews/reviews_page.html');
 }
Ejemplo n.º 5
0
 public function execute()
 {
     $apps_model = new wacabAppsModel();
     $apps = $apps_model->getAll();
     $types = $apps_model->getTypes();
     $this->view->assign('types', $types);
     $parents = $apps_model->getParents();
     $this->view->assign('parents', $parents);
     $this->view->assign('apps', $apps);
     $this->view->assign('edit', 0);
     $this->setTemplate(wacabHelper::getAppPath() . '/templates/actions/apps/apps_page.html');
 }
Ejemplo n.º 6
0
 public function execute()
 {
     $settings_model = new waAppSettingsModel();
     $settings = $settings_model->get('wacab');
     if (isset($settings['count'])) {
         $settings_model->set('wacab', 'new_count', 0);
     }
     $apps_count = wa()->getStorage()->read('apps-count');
     unset($apps_count['wacab']);
     wa()->getStorage()->set('apps-count', $apps_count);
     //        $new = new wacabGetpayment();
     //        $ps = $new->getPayment();
     $model = new wacabPaymentModel();
     $pays = $model->query('SELECT * FROM wacab_payment ORDER BY date DESC')->fetchAll();
     $this->view->assign('pays', $pays);
     $this->setTemplate(wacabHelper::getAppPath() . '/templates/actions/transactions/Transactions_page.html');
 }
 public function execute()
 {
     if (wa()->getUser()->getRights('wacab', 'backend') >= 2) {
         $apps_model = new wacabAppsModel();
         $id = waRequest::post('id', 0, 'int');
         $apps_model->deleteById($id);
         $view = self::getView();
         $apps = $apps_model->getAll();
         $types = $apps_model->getTypes();
         $parents = $apps_model->getParents();
         $view->assign('parents', $parents);
         $view->assign('types', $types);
         $view->assign('apps', $apps);
         $view->assign('edit', 0);
         $view->assign('app', array());
         $this->response = array('apps' => $view->fetch(wacabHelper::getAppPath() . '/templates/actions/apps/apps_table.html'), 'form' => $view->fetch(wacabHelper::getAppPath() . '/templates/actions/apps/apps_form.html'));
     } else {
         $this->setError(_wp('No permission to delete app'));
     }
 }
Ejemplo n.º 8
0
 public function execute()
 {
     $message = 'Приложение Webasyst Cabinet';
     $this->view->assign('message', $message);
     $this->setTemplate(wacabHelper::getAppPath() . '/templates/actions/backend/Backend_page.html');
 }