Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Profile extends Super_Admin_Controller {
- private $current_page = 'dashboard/profile';
- private $title_page_intro = 'Manajemen Pengantar';
- private $title_page_visi = 'Manajemen Visi';
- private $title_page_misi = 'Manajemen Misi';
- private $title_page_basic_operational = 'Manajemen Dasar Operational';
- public function __construct()
- {
- parent::__construct();
- $this->load->model(
- array(
- 'model_profile',
- )
- );
- $this->load->library(
- array(
- 'form_validation'
- )
- );
- }
- public function intro()
- {
- $data["content"] = $this->model_profile->getAbout();
- $this->form_validation->set_rules(
- 'content',
- 'Konten',
- 'required',
- array(
- 'required' => '*) Masukkan <b>Konten</b>'
- )
- );
- if ($this->input->post() != null) {
- if ($this->form_validation->run() === TRUE) {
- $input['content'] = $this->input->post('content');
- $update = $this->update($data["content"][0]->id, $input, "table_about");
- if ($update) {
- $this->session->set_flashdata('alert', $this->alert->set_alert_dialog(Alert::SUCCESS, "Konten Berhasil Diperbarui"));
- }
- }
- else {
- $this->session->set_flashdata('alert', $this->alert->set_alert_dialog(Alert::DANGER, "Konten Gagal Diperbarui"));
- }
- }
- $data["current_page"] = $this->current_page;
- $data["title_page"] = $this->title_page_intro;
- $data["header"] = "Masukkan Data Yang Valid";
- $data["title_page_sub"] = "Pengantar";
- $this->load->view('templates/header', $data);
- $this->load->view('templates/navbar', $data);
- $this->load->view('templates/_part_super_admin/sidebar', $data);
- $this->load->view('v_super_admin/profile/form', $data);
- $this->load->view('templates/footer', $data);
- }
- public function visi()
- {
- $data["content"] = $this->model_profile->getVisi();
- $this->form_validation->set_rules(
- 'content',
- 'Konten',
- 'required',
- array(
- 'required' => '*) Masukkan <b>Konten</b>'
- )
- );
- if ($this->input->post() != null) {
- if ($this->form_validation->run() === TRUE) {
- $input['content'] = $this->input->post('content');
- $update = $this->update($data["content"][0]->id, $input, "table_visi");
- if ($update) {
- $this->session->set_flashdata('alert', $this->alert->set_alert_dialog(Alert::SUCCESS, "Konten Berhasil Diperbarui"));
- }
- }
- else {
- $this->session->set_flashdata('alert', $this->alert->set_alert_dialog(Alert::DANGER, "Konten Gagal Diperbarui"));
- }
- }
- $data["current_page"] = $this->current_page;
- $data["title_page"] = $this->title_page_visi;
- $data["header"] = "Masukkan Data Yang Valid";
- $data["title_page_sub"] = "Visi";
- $this->load->view('templates/header', $data);
- $this->load->view('templates/navbar', $data);
- $this->load->view('templates/_part_super_admin/sidebar', $data);
- $this->load->view('v_super_admin/profile/form', $data);
- $this->load->view('templates/footer', $data);
- }
- public function misi()
- {
- $data["content"] = $this->model_profile->getMisi();
- $this->form_validation->set_rules(
- 'content',
- 'Konten',
- 'required',
- array(
- 'required' => '*) Masukkan <b>Konten</b>'
- )
- );
- if ($this->input->post() != null) {
- if ($this->form_validation->run() === TRUE) {
- $input['content'] = $this->input->post('content');
- $update = $this->update($data["content"][0]->id, $input, "table_misi");
- if ($update) {
- $this->session->set_flashdata('alert', $this->alert->set_alert_dialog(Alert::SUCCESS, "Konten Berhasil Diperbarui"));
- }
- }
- else {
- $this->session->set_flashdata('alert', $this->alert->set_alert_dialog(Alert::DANGER, "Konten Gagal Diperbarui"));
- }
- }
- $data["current_page"] = $this->current_page;
- $data["title_page"] = $this->title_page_misi;
- $data["header"] = "Masukkan Data Yang Valid";
- $data["title_page_sub"] = "Misi";
- $this->load->view('templates/header', $data);
- $this->load->view('templates/navbar', $data);
- $this->load->view('templates/_part_super_admin/sidebar', $data);
- $this->load->view('v_super_admin/profile/form', $data);
- $this->load->view('templates/footer', $data);
- }
- public function basic_operational()
- {
- $data["content"] = $this->model_profile->getOperational();
- $this->form_validation->set_rules(
- 'content',
- 'Konten',
- 'required',
- array(
- 'required' => '*) Masukkan <b>Konten</b>'
- )
- );
- if ($this->input->post() != null) {
- if ($this->form_validation->run() === TRUE) {
- $input['content'] = $this->input->post('content');
- $update = $this->update($data["content"][0]->id, $input, "table_operational");
- if ($update) {
- $this->session->set_flashdata('alert', $this->alert->set_alert_dialog(Alert::SUCCESS, "Konten Berhasil Diperbarui"));
- }
- }
- else {
- $this->session->set_flashdata('alert', $this->alert->set_alert_dialog(Alert::DANGER, "Konten Gagal Diperbarui"));
- }
- }
- $data["current_page"] = $this->current_page;
- $data["title_page"] = $this->title_page_basic_operational;
- $data["header"] = "Masukkan Data Yang Valid";
- $data["title_page_sub"] = "Dasar Operasional";
- $this->load->view('templates/header', $data);
- $this->load->view('templates/navbar', $data);
- $this->load->view('templates/_part_super_admin/sidebar', $data);
- $this->load->view('v_super_admin/profile/form', $data);
- $this->load->view('templates/footer', $data);
- }
- public function update($id, $data, $table) {
- $insert = $this->model_profile->edit($id, $data, $table);
- return $insert;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement