public function closeroom() { \User::onlyHas('chat-view'); $roomId = \Input::get('roomId'); $person_id = \Input::get('person_id'); FireChatSession::where(array('roomId' => $roomId, 'person_id' => $person_id))->update(array('active' => 0)); return []; }
public function editact($id) { \User::onlyHas('actelocale-view'); $data['act'] = ActeLocaleModel::find($id); if ($data['act']) { $this->layout->content = Template::moduleView($this->module_name, 'views.form', $data); return $this->layout; } else { throw new Exception("Record not found"); } }
public function getIndex() { User::onlyHas("settings-view"); $this->data['setts'] = SettingsModel::getAll(); $this->layout->content = View::make('sections.settings.edit', $this->data); }
public function getLanguages() { User::onlyHas('lang-view'); $this->layout->content = View::make('sections.language.list'); }
public function getDelete($id) { User::onlyHas("page-delete"); $trash_folder = 270; if ($id != $trash_folder) { PostLang::where('post_id', $id)->update(['enabled' => 0]); $page = Post::find($id); $page->parent = $trash_folder; $page->save(); } return Redirect::back(); }
public function edititem() { \User::onlyHas('socialc-view'); $jqgrid = new jQgrid('apl_complaint'); $jqgrid->operation(array('post_id' => Input::get('post_id'), 'username' => Input::get('username'), 'email' => Input::get('email'), 'address' => Input::get('address'), 'title' => Input::get('title'), 'text' => Input::get('text'), 'response' => Input::get('response'), 'date_created' => Input::get('date_created'), 'is_private' => Input::get('is_private') ? 1 : 0, 'enabled' => Input::get('enabled') ? 1 : 0)); }
public function edititem() { \User::onlyHas('jobrequest-view'); $jqgrid = new jQgrid(\JobRequestModel::getTableName()); $jqgrid->operation(array()); }
public function save_post_attach() { \User::onlyHas('calendar-view'); $page_id = Input::get('page_id'); $groups = Input::get('calendar_groups'); CalendarPostModel::where('post_id', $page_id)->delete(); if ($groups) { foreach ($groups as $group) { $item = new CalendarPostModel(); $item->post_id = $page_id; $item->calendar_group_id = $group; $item->save(); } } return array(); }
public function getExport() { \User::onlyHas('newsletter-view'); $emails = NewsletterModel::all(); $matrix = [['Email', 'Status', 'Date']]; foreach ($emails as $email) { $matrix[] = [$email->email, $email->enabled ? 'activ' : 'inactiv', $email->subscribe_date]; } $excel = new \ExcelFile('NewsLetterExport.xls'); $excel->convert($matrix); }
/** * Ajax delete file * @return array */ public function delete() { User::onlyHas('file-delete'); $id = Input::get('id'); $data = array('deleted' => 0); if ($id) { $data['deleted'] = Files::drop($id); } return $data; }
public function getIndex() { User::onlyHas('log-view'); $this->data['list'] = LogModel::leftJoin(User::getTableName(), User::getField('id'), '=', LogModel::getField('user_id'))->orderBy('event_date', 'desc')->get(); $this->layout->content = View::make('sections.log.list', $this->data); }
public function postDelete() { User::onlyHas('user-delete'); $id = Input::get('id'); $user = User::find($id); if ($user) { $user->delete(); UserRole::where('user_id', $id)->delete(); Log::info('Delete user #' . $id); return \Illuminate\Support\Facades\Redirect::to('user'); } else { throw new Exception("Undefined user #{$id}"); } }
public function postEdit() { User::onlyHas('var-edit'); $id = Input::get('id'); $value = Input::get('value'); $vlang = VarLangModel::find($id); $vlang->value = $value; $vlang->save(); return []; }
public function getZip() { User::onlyHas("modules-view"); global $_SERVER; $zip = new ZipArchive(); $result = $zip->open($_SERVER['DOCUMENT_ROOT'] . "/tmp/zipfile/file.zip"); if ($result === TRUE) { $zip->extractTo($_SERVER['DOCUMENT_ROOT'] . "/tmp/zipextract"); $zip->close(); echo "succes"; } else { echo "error"; } $this->layout = null; }
public function jqsave_answer() { \User::onlyHas('poll-edit'); $jqgrid = new jQgrid(\PollAnswerModel::getTableName()); $jqgrid->operation(array('ord' => Input::get('ord'))); }
public function postPostattach() { User::onlyHas('feedpost-edit'); $post = Post::find(Input::get('post_id')); $post->feed_id = Input::get('id'); $post->save(); }
public function getDelete($app, $template) { User::onlyHas('template-delete'); $templateDir = Files::fullDir('apps/' . $app . '/views/templates/' . $template . '/'); if (file_exists($templateDir)) { File::deleteDirectory($templateDir); $returnData['message'] = varlang('template-deleted'); $returnData['message_type'] = 'alert-success'; } else { $returnData['message'] = varlang('template-not-found-1'); $returnData['message_type'] = 'alert-danger'; } return Redirect::to('template')->with($returnData); }