当前位置: 首页>>代码示例>>PHP>>正文


PHP set_message_success函数代码示例

本文整理汇总了PHP中set_message_success函数的典型用法代码示例。如果您正苦于以下问题:PHP set_message_success函数的具体用法?PHP set_message_success怎么用?PHP set_message_success使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了set_message_success函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($id)
 {
     $category = Model\Kelas\Category::findOrFail($id);
     $category->delete();
     set_message_success('Kategori berhasil dihapus.');
     redirect('kelasonline/category', 'refresh');
 }
开发者ID:ruly1992,项目名称:elearning,代码行数:7,代码来源:Category.php

示例2: submit

 public function submit($category)
 {
     $media = $this->medialib;
     $category = $media->setCategory($category)->getCategory();
     $uploaded = [];
     $input_name = 'filemedia';
     if (is_array($_FILES[$input_name]['name'])) {
         foreach ($_FILES[$input_name]['name'] as $i => $name) {
             $filemedia['name'] = $_FILES[$input_name]['name'][$i];
             $filemedia['type'] = $_FILES[$input_name]['type'][$i];
             $filemedia['tmp_name'] = $_FILES[$input_name]['tmp_name'][$i];
             $filemedia['error'] = $_FILES[$input_name]['error'][$i];
             $filemedia['size'] = $_FILES[$input_name]['size'][$i];
             $uploaded[] = $this->submitSingle($category, $filemedia, $metadata);
         }
     } else {
         $uploaded[] = $this->submitSingle($category, $_FILES[$input_name], set_value('meta', []));
     }
     if ($this->input->is_ajax_request()) {
         echo json_encode($uploaded);
     } else {
         set_message_success('Media berhasil diunggah.');
         redirect('elibrary/show/' . $category->id, 'refresh');
     }
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:25,代码来源:Media.php

示例3: edit

 public function edit($id)
 {
     $ads = Model\Portal\Ads::where('code', $id)->first();
     if ($ads) {
         $this->form_validation->set_rules('show', 'Tampil', 'required');
         if ($this->form_validation->run() == FALSE) {
             $this->template->build('edit', compact('ads'));
         } else {
             if (isset($_FILES['image'])) {
                 $manager = new Intervention\Image\ImageManager();
                 $image = $manager->make($_FILES['image']['tmp_name']);
                 $image->resize($ads->width, $ads->height);
                 $image->save(PATH_ADS . '/ads_' . $ads->code . '.jpg');
                 $ads->image = 'ads_' . $ads->code . '.jpg';
             }
             $ads->show = $this->input->post('show');
             $ads->link = $this->input->post('link');
             $ads->save();
             set_message_success('Iklan berhasil diperbarui.');
             redirect('ads', 'refresh');
         }
     } else {
         set_message_error('Iklan tidak ada');
         redirect('ads', 'refresh');
     }
 }
开发者ID:amteknologi,项目名称:elearning,代码行数:26,代码来源:Ads.php

示例4: delete

 public function delete($page_id)
 {
     $page = Model\Page::findOrFail($page_id);
     $page->delete();
     set_message_success('Halaman berhasil dihapus.');
     redirect('pages', 'refresh');
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:7,代码来源:Pages.php

示例5: delete

 public function delete($category)
 {
     $media = new Library\Media\Media();
     $media->deleteCategory($category);
     set_message_success('Kategori berhasil dihapus.');
     redirect('media', 'refresh');
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:7,代码来源:Category.php

示例6: delete

 public function delete($id)
 {
     $category = Model\Forum\Category::findOrFail($id);
     $category->users()->detach();
     // $category->topics()->delete();
     $category->delete();
     set_message_success('Kategori forum berhasil dihapus.');
     redirect('forum/category', 'refresh');
 }
开发者ID:ruly1992,项目名称:elearning,代码行数:9,代码来源:Category.php

示例7: save

 public function save()
 {
     $data = $this->input->post();
     foreach ($data as $key => $value) {
         $this->Mod_settings->set($key, $value);
     }
     set_message_success('Setting berhasil disimpan.');
     redirect('settings', 'refresh');
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:9,代码来源:Settings.php

示例8: approve

 public function approve($media_id, $status = 'publish')
 {
     $media = $this->medialib->getMedia();
     $media = $media->withDrafts()->findOrFail($media_id);
     $media->status = $status;
     $media->save();
     if ($this->input->is_ajax_request()) {
         return $media->id;
     } else {
         set_message_success('Media berhasil diperbarui status menjadi ' . $status);
         redirect('elibrary/edit/' . $media_id, 'refresh');
     }
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:13,代码来源:Elibrary.php

示例9: delete

 public function delete($id)
 {
     $delete = $this->input->post('delete', 0);
     $category = Model\Portal\Category::findOrFail($id);
     if (!$delete) {
         $data['category'] = $category;
         $this->template->build('kategori_delete', $data);
     } else {
         $category->editors()->detach();
         $category->articles()->delete();
         $category->delete();
         set_message_success('Kategori berhasil dihapus.');
         redirect('kategori');
     }
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:15,代码来源:Kategori.php

示例10: update

 public function update($faq_id)
 {
     $this->form_validation->set_rules('pertanyaan', 'pertanyaan', 'trim|required');
     if ($this->form_validation->run() == FALSE) {
         $data['data'] = $this->Mod_faq->getById($faq_id);
         $this->template->build('update', $data);
     } else {
         $data = array('pertanyaan' => set_value('pertanyaan'), 'jawaban' => set_value('jawaban'));
         $links = $this->Mod_faq->update($faq_id, $data);
         if ($data == TRUE) {
             set_message_success('FAQ Berhasi di Ubah');
             redirect('faq');
         } else {
             set_message_error('FAQ Gagal di Ubah');
             redirect('faq/update');
         }
     }
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:18,代码来源:Faq.php

示例11: edit

 public function edit($comment_id)
 {
     $this->form_validation->set_rules('nama', 'Nama', 'trim|required');
     if ($this->form_validation->run() == FALSE) {
         $data['data'] = $this->Mod_comment->getById($comment_id);
         $this->template->build('update', $data);
     } else {
         $data = array('nama' => set_value('nama'), 'email' => set_value('email'), 'content' => set_value('content'));
         $comment = $this->Mod_comment->update($comment_id, $data);
         if ($data == TRUE) {
             set_message_success('Komentar Berhasi di Ubah');
             redirect('comment');
         } else {
             set_message_error('Kateogri Gagal di Ubah');
             redirect('comment/update');
         }
     }
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:18,代码来源:Comment.php

示例12: index

 public function index()
 {
     $data = array('links' => $this->Mod_link->read(), 'desa_lists' => ['Wilayah 1', 'Wilayah 2', 'Wilayah 3']);
     $this->form_validation->set_rules('nama', 'Nama Lengkap', 'required');
     $this->form_validation->set_rules('email', 'Alamat Email', 'required|valid_email');
     $this->form_validation->set_rules('title', 'Title', 'required');
     $this->form_validation->set_rules('content', 'Content', 'required');
     if ($this->form_validation->run() == FALSE) {
         keepValidationErrors();
         $this->template->build('create', $data);
     } else {
         $data = array('title' => set_value('title'), 'content' => set_value('content', '', FALSE));
         $article = new Library\Article\Article();
         $article->submit($data, set_value('nama'), set_value('email'), set_value('desa'), $this->input->post('featured'), $this->input->post('custom_avatar'));
         set_message_success('Artikel Anda sudah diterima dan akan dilakukan moderasi terlebih dahulu.');
         redirect('submitarticle', 'refresh');
     }
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:18,代码来源:Submitarticle.php

示例13: store

 public function store()
 {
     $article = Model\Portal\Article::withPrivate()->findOrFail(set_value('article_id'));
     $this->form_validation->set_rules('name', 'Name', 'required');
     $this->form_validation->set_rules('email', 'Email', 'required|valid_email');
     $this->form_validation->set_rules('content', 'Komentar', 'required');
     $this->form_validation->set_rules('article_id', 'Artikel', 'required');
     if ($this->form_validation->run() == FALSE) {
         if ($this->request->isXmlHttpRequest()) {
             $response = new Response();
             $response->setContent(json_encode(['status' => 'error', 'data' => $this->form_validation->error_array()]));
             $response->headers->set('Content-Type', 'application/json');
         } else {
             keepValidationErrors();
             redirect($article->link . '#comments', 'refresh');
         }
     } else {
         $data = array('content' => set_value('content'), 'nama' => set_value('name'), 'email' => set_value('email'), 'artikel_id' => set_value('article_id'), 'parent' => set_value('parent', 0), 'status' => 'draft', 'date' => Carbon::now());
         $comment = Model\Portal\Comment::create($data);
         if ($user = auth()->check()) {
             $comment->user()->associate($user->id);
             if ($user->inRole(['su', 'adm', 'edt', 'ins', 'mdr'])) {
                 $comment->status = 'publish';
             } else {
                 $comment->status = 'draft';
             }
             $comment->save();
         }
         if ($this->request->isXmlHttpRequest()) {
             $response = new Response();
             $response->setContent(json_encode(['status' => 'success', 'data' => $comment]));
             $response->headers->set('Content-Type', 'application/json');
         } else {
             if ($comment->status == 'publish') {
                 set_message_success('Komentar Anda sudah ditampilkan.');
                 redirect($article->link . '#comment-' . $comment->id, 'refresh');
             } else {
                 set_message_success('Komentar Anda akan tampil setelah dimoderasi.');
                 redirect($article->link . '#comments', 'refresh');
             }
         }
     }
 }
开发者ID:ruly1992,项目名称:elearning,代码行数:43,代码来源:Comment.php

示例14: update

 public function update($link_id)
 {
     $this->form_validation->set_rules('url', 'URL', 'trim|required|prep_url');
     $this->form_validation->set_rules('name', 'Nama', 'trim|required');
     $this->form_validation->set_rules('description', 'Deskripsi', 'required');
     if ($this->form_validation->run() == FALSE) {
         $data['data'] = $this->Mod_link->getById($link_id);
         $this->template->build('update', $data);
     } else {
         $data = array('url' => set_value('url'), 'name' => set_value('name'), 'description' => set_value('description'));
         $links = $this->Mod_link->update($link_id, $data);
         if ($data == TRUE) {
             set_message_success('Link Informasi Desa Berhasi di Ubah');
             redirect('link');
         } else {
             set_message_error('Link Informasi Desa Gagal di Ubah');
             redirect('link/update');
         }
     }
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:20,代码来源:Link.php

示例15: index

 public function index()
 {
     $data = array('links' => $this->Mod_link->read(), 'category_lists' => (new Model\Portal\Category())->generateCheckbox());
     $this->form_validation->set_rules('nama', 'Nama Lengkap', 'required', array('required' => '<div class="alert alert-danger">Nama Wajib diisi</div>'));
     $this->form_validation->set_rules('email', 'Alamat Email', 'required|valid_email', array('required' => '<div class="alert alert-danger">Email Wajib diisi</div>'));
     $this->form_validation->set_rules('title', 'Title', 'required', array('required' => '<div class="alert alert-danger">Judul Artikel Wajib diisi</div>'));
     $this->form_validation->set_rules('content', 'Content', 'required', array('required' => '<div class="alert alert-danger">Content Artikel Wajib diisi</div>'));
     if ($this->form_validation->run() == FALSE) {
         keepValidationErrors();
         $this->template->build('create', $data);
     } else {
         $data = array('title' => set_value('title'), 'content' => set_value('content', '', FALSE));
         $article = new Library\Article\Article();
         $article->submit($data, set_value('nama'), set_value('email'), set_value('desa'), set_value('categories[]'), null, $this->input->post('customavatar[src]'));
         if ($this->input->post('featured[src]')) {
             $article->setFeaturedImage($this->input->post('featured[src]'), $this->input->post('featured[description]'));
         }
         set_message_success('Artikel Anda sudah diterima dan akan dilakukan moderasi terlebih dahulu.');
         redirect('submitarticle', 'refresh');
     }
 }
开发者ID:fajarekos,项目名称:elearning,代码行数:21,代码来源:Submitarticle.php


注:本文中的set_message_success函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。