• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP set_message_success函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: changepassword

 public function changepassword()
 {
     $user_id = auth()->getUser()->id;
     $this->form_validation->set_rules('password', 'New Password', 'required|min_length[6]');
     $this->form_validation->set_rules('password_confirmation', 'New Password Confirmation', 'required|min_length[6]|matches[password]');
     $this->form_validation->set_rules('password_old', 'Old Password', 'required|min_length[6]');
     if ($this->form_validation->run() == FALSE) {
         $data['profile'] = $this->model->getById($user_id);
         $this->template->build('changepassword', $data);
     } else {
         $password = set_value('password');
         $password_old = set_value('password_old');
         $changed = $this->model->changePassword($user_id, $password, $password_old);
         if ($changed) {
             set_message_success('Password berhasil diperbarui.');
             redirect('profile/changepassword/', 'refresh');
         } else {
             set_message_error('Password lama tidak sesuai.');
             redirect('profile/changepassword/', 'refresh');
         }
     }
 }
开发者ID:ruly1992,项目名称:elearning,代码行数:22,代码来源:Profile.php


示例17: index

 public function index()
 {
     $data = array('links' => $this->Mod_link->read());
     $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('nama' => set_value('nama'), 'email' => set_value('email'), 'title' => set_value('title'), 'content' => set_value('content', '', FALSE));
         if (isset($_FILES['featured']) && $_FILES['featured']['tmp_name']) {
             $featured_image = $_FILES['featured'];
         } else {
             $featured_image = null;
         }
         $id = $this->Mod_sendarticle->send($data, 'draft', 'public', $featured_image, []);
         // $this->Mod_sendarticle->send($data);
         set_message_success('Artikel Anda sudah diterima dan akan dilakukan review terlebih dahulu.');
         redirect('submitarticle', 'refresh');
     }
 }
开发者ID:nurmanhabib,项目名称:elearning,代码行数:23,代码来源:Submitarticle.php


示例18: storechapter

 public function storechapter()
 {
     $chapter = Model\Kelas\Chapter::findOrFail(set_value('chapter_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('chapter_id', '', '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('course/showchapter/' . $chapter->course->slug . '/chapter-' . $chapter->order . '#comment-' . $comment->id, 'refresh');
         }
     } else {
         $data = array('content' => set_value('content'), 'name' => set_value('name'), 'email' => set_value('email'), 'chapter_id' => set_value('chapter_id'), 'parent' => set_value('parent', 0), 'status' => 'draft');
         $comment = Model\Kelas\ChapterComment::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->input->is_ajax_request()) {
             $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('course/showchapter/' . $chapter->course->slug . '/chapter-' . $chapter->order . '#comment-' . $comment->id, 'refresh');
             } else {
                 set_message_success('Komentar Anda akan tampil setelah dimoderasi.');
                 redirect('course/showchapter/' . $chapter->course->slug . '/chapter-' . $chapter->order . '#form-comment', 'refresh');
             }
         }
     }
 }
开发者ID:amteknologi,项目名称:elearning,代码行数:43,代码来源:Comment.php


示例19: delete

 public function delete($id)
 {
     $this->repository->deleteCategory($id);
     set_message_success('Kategori berhasil dihapus.');
     redirect('kelasonline/category', 'refresh');
 }
开发者ID:fajarekos,项目名称:elearning,代码行数:6,代码来源:Category.php


示例20: update

 public function update($media)
 {
     $mediaLib = new Library\Media\Media();
     $media = $mediaLib->onlyUserId()->getMediaById($media);
     $request = Request::createFromGlobals();
     $metadata = $request->request->get('meta');
     $mediaLib->setMetadata($media->id, $metadata);
     set_message_success('Metadata berhasil diperbarui.');
     redirect('media/edit/' . $media->id, 'refresh');
 }
开发者ID:singgihsap,项目名称:elearning,代码行数:10,代码来源:Media.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP set_meta函数代码示例发布时间:2022-05-15
下一篇:
PHP set_message_error函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap