public function deleteAction() { if (check_RequestMethod('GET')) { $user_apps_data = appsModel::getApps((int) $_GET['id_user']); if (is_array($user_apps_data)) { foreach ($user_apps_data as $v) { appsModel::deleteData($v['id_application']); appsModel::deleteApp2PlatformData($v['id_application']); appsModel::deleteLogData($v['id_application']); } } userModel::deleteData((int) $_GET['id_user']); header("Location: " . $this->makeURI(array('action' => 'list'))); die; } else { _404(); } }
/** * Get app list * @return string */ private function getAppsList() { $id_user = classModel::getCurrentUserId(); $apps_list = appsModel::getApps($id_user); $platforms = platformModel::getPlatforms(); $logs = logModel::getLastLogs(); foreach ($apps_list as $k => $v) { $apps_list[$k]['platforms'] = appsModel::getApp2PlatformData($v['id_application']); $apps_list[$k]['btn_edit'] = $this->render_common('btn_edit', array('url' => $this->makeURI(array('action' => 'edit', 'id_application' => $v['id_application'], 'id_user' => $v['id_user'])))); $apps_list[$k]['btn_delete'] = $this->render_common('btn_delete', array('url' => $this->makeURI(array('action' => 'delete', 'id_application' => $v['id_application'])), 'confirm_text' => 'Do you want to delete this application?')); } return $this->render('apps_list', array('apps_list' => $apps_list, 'platforms' => $platforms, 'curent_user' => $id_user, 'logs' => $logs, 'btn_add_platform' => $this->render_common('btn_add', array('url' => $this->makeURI(array('controller' => 'platforms', 'action' => 'add')))))); }