本文整理汇总了PHP中set_message_error函数的典型用法代码示例。如果您正苦于以下问题:PHP set_message_error函数的具体用法?PHP set_message_error怎么用?PHP set_message_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_message_error函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: create
public function create()
{
$this->form_validation->set_rules('name', 'Nama', 'required');
if ($this->form_validation->run() == FALSE) {
keepValidationErrors();
redirect('forum/category', 'refresh');
} else {
$name = $this->input->post('name');
$users = $this->input->post('tenagaahli', []);
$same = FALSE;
$categories = Model\Forum\Category::all();
foreach ($categories as $cat) {
if ($cat->category_name == $name) {
$same = TRUE;
}
}
if ($same == FALSE) {
$category = new Model\Forum\Category();
$category->name = $name;
$category->save();
$category->users()->attach($users);
set_message_success('Kategori forum berhasil ditambahkan.');
} else {
set_message_error('Kategori ' . $name . ' sudah ada.');
}
redirect('forum/category', 'refresh');
}
}
开发者ID:ruly1992,项目名称:elearning,代码行数:28,代码来源:Category.php
示例2: update
public function update($id)
{
$this->form_validation->set_rules('name', 'Name', 'trim|required');
if ($this->form_validation->run() == FALSE) {
$group = sentinel()->findRoleBySlug('edt');
$data['kategori'] = Model\Portal\Category::findOrFail($id);
$data['kategori_lists'] = $this->model->getLists($id);
$data['users'] = $group->users->pluck('email', 'id')->toArray();
$this->template->build('kategori_edit', $data);
} else {
$kategori['name'] = $this->input->post('name');
$kategori['description'] = $this->input->post('description');
$kategori['parent'] = $this->input->post('parent');
$editor = set_value('editor', []);
$category = Model\Portal\Category::findOrFail($id);
$category->update($kategori);
$category->editors()->sync($editor);
if ($res == TRUE) {
set_message_success('Kategori berhasil diperbarui.');
redirect('kategori');
} else {
set_message_error('Kategori gagal diperbarui.');
redirect('kategori/update');
}
}
}
开发者ID:singgihsap,项目名称:elearning,代码行数:26,代码来源:Kategori.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: check
public function check()
{
if (!sentinel()->check()) {
redirect(login_url(), 'refresh');
}
if (!sentinel()->inRole($this->roles)) {
set_message_error('Anda tidak mempunyai hak akses.');
redirect(login_url(), 'refresh');
}
}
开发者ID:fajarekos,项目名称:elearning,代码行数:10,代码来源:MY_Controller.php
示例5: keepValidationErrors
function keepValidationErrors()
{
if (FALSE === ($OBJ =& _get_validation_object())) {
// No action
} else {
$errors = $OBJ->error_array();
foreach ($errors as $error) {
set_message_error($error);
}
}
}
开发者ID:singgihsap,项目名称:elearning,代码行数:11,代码来源:messages_helper.php
示例6: 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
示例7: 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
示例8: index
public function index()
{
$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
$this->form_validation->set_rules('password', 'Password', 'required');
if ($this->form_validation->run() == FALSE) {
keepValidationErrors();
$this->template->set_layout('login');
$this->template->build('login');
} else {
$credentials = ['email' => set_value('email'), 'password' => set_value('password')];
if (sentinel()->authenticate($credentials)) {
$redirect_url = dashboard_url();
redirect($redirect_url, 'refresh');
} else {
set_message_error('Email atau password Anda salah.');
redirect(login_url(), 'refresh');
}
}
}
开发者ID:nurmanhabib,项目名称:elearning,代码行数:19,代码来源:Login.php
示例9: index
public function index()
{
$this->form_validation->set_rules('email', 'Email', 'trim|valid_email|required');
$this->form_validation->set_rules('password', 'Password', 'required');
if ($this->form_validation->run() == FALSE) {
$this->template->set_layout('login');
$this->template->build('login');
} else {
$email = set_value('email');
$password = set_value('password');
$credentials = compact('email', 'password');
if (sentinel()->authenticate($credentials)) {
redirect('/', 'refresh');
} else {
set_message_error('Username atau password salah.');
redirect('login', 'refresh');
}
}
}
开发者ID:singgihsap,项目名称:elearning,代码行数:19,代码来源:Login.php
示例10: updateKategori
public function updateKategori($id_kategori)
{
$this->form_validation->set_rules('name', 'Name', 'trim|required');
if ($this->form_validation->run() == FALSE) {
$param = $this->model->getByIdKategori($id_kategori);
$data['kategori'] = $param->row();
$this->template->build('kons_kategori_update', $data);
} else {
$konsKategori['name'] = $this->input->post('name');
$konsKategori['description'] = $this->input->post('description');
$res = $this->model->updateKategori($id_kategori, $konsKategori);
if ($res == TRUE) {
set_message_success('Kategori berhasil diperbarui.');
redirect('konsultasi/kategori');
} else {
set_message_error('Kategori gagal diperbarui.');
redirect('konsultas/updateKategori');
}
}
}
开发者ID:singgihsap,项目名称:elearning,代码行数:20,代码来源:Konsultasi.php
示例11: 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
示例12: 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
示例13: changepassword
public function changepassword($user_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');
if ($this->form_validation->run() == FALSE) {
$data['user'] = auth()->findById($user_id);
$this->template->build('formChangePass', $data);
} else {
$hasher = sentinel()->getHasher();
$password = set_value('password');
$password_old = set_value('password_old');
$password_confirmation = set_value('password_confirmation');
$user = sentinel()->getUser($user_id);
if (!$hasher->check($password_old, $user->password) || $password != $password_confirmation) {
set_message_error('Password lama tidak sesuai.');
redirect('user/changepassword/' . $user_id, 'refresh');
} else {
sentinel()->update($user, array('password' => $password));
set_message_success('Password berhasil diperbarui.');
redirect('user/updateProfile/' . $user_id, 'refresh');
}
}
}
开发者ID:fajarekos,项目名称:elearning,代码行数:24,代码来源:User.php
示例14: delete
public function delete($media_id)
{
try {
$user = sentinel()->getUser();
$media = Model\Elib\Media::withDrafts()->userId($user->id)->findOrFail($media_id);
$this->medialib->setMedia($media);
$category = $media->category;
$this->medialib->deleteMedia($media_id);
redirect('media/show/' . $category->id, 'refresh');
} catch (\Exception $e) {
set_message_error('Media tidak tersedia.');
redirect('media', 'refresh');
}
}
开发者ID:singgihsap,项目名称:elearning,代码行数:14,代码来源:Media.php
示例15: reset_password
public function reset_password($user_id, $code)
{
$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]');
if ($this->form_validation->run() == FALSE) {
set_message_error(validation_errors());
$data['id'] = $user_id;
$data['code'] = $code;
$this->template->set_layout('form_reset');
$this->template->build('form_reset', $data);
} else {
$user = sentinel()->findUserById($user_id);
$password = set_value('password');
$completed = (new Reminder())->complete($user, $code, $password);
if ($completed) {
set_message_success('Password anda berhasil diubah, silahkan login kembali');
redirect(home_url('auth/login'), 'refresh');
} else {
set_message_error('Gagal memperbaharui password anda, silahkan dicoba lagi');
$this->template->set_layout('form_reset');
redirect('reset', 'refresh');
}
}
}
开发者ID:fajarekos,项目名称:elearning,代码行数:24,代码来源:Reset.php
示例16: deleteReply
public function deleteReply($idReply, $id_konsultasi, $path)
{
$delete = $this->M_konsultasi->deleteReply($idReply);
if ($delete) {
$attachment = $this->deleteAttachmentReply($idReply, $path, $id_konsultasi);
set_message_success('Reply berhasil dihapus.');
} else {
set_message_error('Reply gagal dihapus.');
}
redirect('/konsultasi/detail/' . $id_konsultasi);
}
开发者ID:fajarekos,项目名称:elearning,代码行数:11,代码来源:Konsultasi.php
示例17: unchoice
public function unchoice($id)
{
try {
$article = Model\Portal\Article::withPrivate()->findOrFail($id);
$article->removeEditorChoice();
set_message_success('Artikel berhasil diperbarui.');
redirect('article/edit/' . $article->id, 'refresh');
} catch (ModelNotFoundException $e) {
set_message_error('Artikel tidak dapat diperbarui.');
redirect('article/edit/' . $article->id, 'refresh');
}
}
开发者ID:fajarekos,项目名称:elearning,代码行数:12,代码来源:Article.php
示例18: pengampu_tambah
public function pengampu_tambah()
{
$this->form_validation->set_rules('user_id', 'Tenaga Ahli', 'required');
if ($this->form_validation->run() == FALSE) {
keepValidationErrors();
} else {
$users = $this->input->post('user_id');
$kategori_list = $this->input->post('id_kategori');
$temp = FALSE;
$data = $this->model->getPengampu();
foreach ($data as $row) {
if ($row->user_id == $users && $row->id_kategori == $kategori_list) {
$temp = TRUE;
}
}
if ($temp == FALSE) {
$data = array('user_id' => $users, 'id_kategori' => $kategori_list);
$save = $this->model->addPengampu($data);
set_message_success('data berhasil ditambahkan.');
} else {
set_message_error('Data sudah ada.');
}
redirect('konsultasi/pengampu', 'refresh');
}
}
开发者ID:ruly1992,项目名称:elearning,代码行数:25,代码来源:Konsultasi.php
示例19: updateReply
public function updateReply($idReply, $id_konsultasi)
{
$this->form_validation->set_rules('isi', 'Isi', 'required');
if ($this->form_validation->run() == FALSE) {
redirect('/dashboard/detail/' . $id_konsultasi, 'refresh');
} else {
$config['upload_path'] = PATH_KONSULTASI_ATTACHMENT;
$config['allowed_types'] = 'gif|jpg|jpeg|png|pdf|doc|xls|xlsx|docx|zip|txt|ppt|pptx';
$config['max_size'] = '10000';
$this->load->library('upload', $config);
if (!$this->upload->do_upload('reply')) {
$data = array('isi' => set_value('isi', '', FALSE), 'updated_at' => date('Y-m-d H:i:s'));
} else {
$file_data = $this->upload->data();
$data = array('attachment' => $file_data['file_name'], 'isi' => set_value('isi', '', FALSE), 'updated_at' => date('Y-m-d H:i:s'));
}
$update = $this->M_konsultasi->updateReply($idReply, $data);
if ($update == FALSE) {
set_message_error('Reply berhasil diperbarui.');
redirect('/dashboard/detail/' . $id_konsultasi, 'refresh');
} else {
set_message_error('Reply gagal diperbarui.');
redirect('/dashboard/detail/' . $id_konsultasi, 'refresh');
}
}
}
开发者ID:fajarekos,项目名称:elearning,代码行数:26,代码来源:Dashboard.php
示例20: delete
public function delete($id)
{
$delete = $this->Mod_artikel->delete($id);
if ($delete) {
set_message_success('Artikel berhasil dihapus.');
} else {
set_message_error('Artikel gagal dihapus.');
}
redirect('article', 'refresh');
}
开发者ID:singgihsap,项目名称:elearning,代码行数:10,代码来源:Article.php
注:本文中的set_message_error函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论