403Webshell
Server IP : 127.0.0.1  /  Your IP : 192.168.99.1
Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9
System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64
User : Administrator ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /wamp/www/sipapbd_2021_sekolah/application/modules/ssh/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /wamp/www/sipapbd_2021_sekolah/application/modules/ssh/controllers/ssh.php
<?php

class Ssh extends Userpage_Controller {

	public function __construct()
	{
		parent::__construct();
		
		$this->modul_name = 'ssh';
		$this->modul_display = 'SSH';
		$this->view_daftar = 'ssh_view';
		$this->report_daftar = 'Daftar SSH';
		$this->load->model('ssh_model', 'data_model');
	}

	public function index()
	{
		$data['title']='SIPAPBD - Daftar Standar Satuan Harga';
		$data['main_content']='ssh_view';
		$data['akses'] = $this->auth->get_level_akses($this->uri->slash_segment(1));
		$data['modul'] = 'ssh';
		$data['report_daftar'] = $this->report_daftar;
		$data['grid']['fields'] = $this->data_model->get_data_fields();
		$this->load->view('layout/template',$data);
	}

	public function entry()
	{
		$data['title']='SIPAPBD - Entri Standar Satuan Harga';
		$data['main_content']='ssh_form';
		//$data['akses'] = $this->auth->get_level_akses($this->uri->slash_segment(1));
		$this->load->view('layout/template',$data);
	}

	public function proses_form()
	{
		$id = $this->input->post('id');
		$oper = $this->input->post('oper');

		if($oper == 'del')
		{
			$this->hapus($id);
			return '';
		}
		
		$this->load->library('form_validation');
		$this->form_validation->set_rules('SATUAN','SATUAN','required|trim');
		$this->form_validation->set_rules('HARGA','HARGA','required|trim');

		$response = (object) NULL;
		if($this->form_validation->run() == TRUE)
		{ 
			$exist = $this->data_model->cek_exist();
			if($exist > 0)
			{ 
				$changed = $this->data_model->cek_changed();
				if($changed ==1 || $this->input->post('param')==1){
					if($oper == 'edit'){
						$this->data_model->update_data($id);
						$response->isSuccess = TRUE;
						$response->message = 'Data sudah di ubah';
						$response->id = $this->input->post('id');
						$response->last_changed = $this->data_model->last_changed;
					}
				}
				else{
					$response->isSuccess = FALSE;
					$response->message = 'Data sudah dirubah user lain';
					$response->error = 'changed';
					$response->id = $this->input->post('id');
					$response->last_changed = $this->data_model->last_changed;
					$response->selisih = timeAgo($changed);
				}
			}
			else{
				$response->isSuccess = FALSE;
				$response->message = 'Data sudah dihapus user lain';
				$response->error = 'hapus';
				$response->id = $this->input->post('id');
			}
		}
		else
		{
			$response->isSuccess = TRUE;
			$response->message = 'Data gagal di ubah';
		}
		$response->sql = $this->db->queries;
		//die(print_r($this->db->queries));
		echo json_encode($response);
	}

	public function form($id = '')
	{
		$binary ='';
		$data['user_data']['DATA_DASAR_LOGIN'] = $this->session->userdata('DATA_DASAR_LOGIN');
		$data['DATA_DASAR_LOGIN'] = $this->session->userdata('DATA_DASAR_LOGIN');
		$data['title']='Entri Standar Satuan Harga';
		$data['main_content']='ssh_form';
		$data['modul'] = $this->modul_name;
		$data['akses'] = $this->auth->get_level_akses($this->uri->slash_segment(1));
		if($id)
		{
			$rows=$this->data_model->get_data_by_id($id);
			$data['user_data'] = $this->data_model->get_data_by_id($id);
		}
		$this->load->view('layout/template',$data);
	}


  public function get_data_skpd()
  {
    $rows  = $this->data_model->get_data_skpd();
    $response->kode  = $rows['KODE_SKPD_LKP'];
    $response->nama  = $rows['NAMA_SKPD'];
    $response->id  = $rows['ID_SKPD'];
    echo json_encode($response);
  }
  
	protected function validasi_form()
	{
		$this->form_validation->set_rules('kd_rek', 'Kode Rekening', 'trim|required');
		$this->form_validation->set_rules('kat', 'Kategori', 'trim|required');

		$this->form_validation->set_message('required', '%s tidak boleh kosong.');
	}

	public function proses()
	{
		$response = (object) NULL;
		$this->load->model('auth/login_model', 'auth');
		$akses = $this->auth->get_level_akses($this->uri->slash_segment(1));
		if($akses == '3')
		{
			$this->load->library('form_validation');
			$this->validasi_form();
			if($this->form_validation->run() == TRUE)
			{
				$proses = $this->data_model->insert_data();
				if(!$proses)
				{
					$response->isSuccess = TRUE;
					$response->message = 'Data berhasil disimpan';
				}
				else
				{
					$response->isSuccess = FALSE;
					$response->message = 'Data gagal disimpan';
				}
			}
		}
		else
		{
			$response->isSuccess = FALSE;
			$response->message = 'Proses Gagal, Anda tidak memiliki hak akses';
		}
		
		echo json_encode($response);
	}

	private function update()
	{
		$id = $this->input->post('id');
		$update = $this->data_model->update_data($id);
		return $update;
	}

	public function get_daftar()
	{
		parent::get_daftar();
		$result = $this->data_model->get_data($this->search_param);

		$count = $this->data_model->get_data($req_param, TRUE);
		$response = (object) NULL;
		$response->sql = $this->db->queries;
		if($count == 0) // tidak ada data
		{
			echo json_encode($response);
			return '';
		}

		
		$page = $this->page;
		$limit = $this->limit;
		$total_pages = ceil($count/$limit);
		//$total_pages = ceil($count/$limit);

		if ($page > $total_pages) $page = $total_pages;
		$start = $limit * $page - $limit;
		if($start < 0) $start = 0;
		$this->search_param['limit'] = array(
			'start' => $start,
			'end' => $limit
		);

		$result = $this->data_model->get_data($this->search_param);

		$response->page = $page;
		$response->total = $total_pages;
		$response->records = $count;
		$response->sql = $this->db->queries;

		for($i=0; $i<count($result); $i++){
			$response->rows[$i]['id']  = $result[$i]['ID_SSH'];
			$response->rows[$i]['cell']  = array($result[$i]['ID_SSH'],
				$result[$i]['ID_REKENING'],
				$result[$i]['KODE_REKENING'],
				$result[$i]['NAMA_REKENING'],
				$result[$i]['KATEGORI'],
				$result[$i]['URAIAN'],
				$result[$i]['KODE_STANDAR'],
				$result[$i]['SATUAN'],
				$result[$i]['HARGA'],
				$result[$i]['LAST_CHANGED'],
				$result[$i]['PARAM']
			);
		}
		echo json_encode($response);
	}

  public function pilih_rekening()
  {
    $this->load->view('rek_pilih');
  }

  public function get_rek()
  {
    if(!isset($_POST['oper']))
    {
      $page = $_REQUEST['page']; // get the requested page
      $limit = $_REQUEST['rows']; // get how many rows we want to have into the grid
      $sidx = $_REQUEST['sidx']; // get index row - i.e. user click to sort
      $sord = $_REQUEST['sord']; // get the direction if(!$sidx) $sidx =1;

      $req_param = array (
          "sort_by" => $sidx,
          "sort_direction" => $sord,
          "limit" => null,
          "search" => $_REQUEST['_search'],
          "search_field" => isset($_REQUEST['searchField'])?$_REQUEST['searchField']:null,
          "search_operator" => isset($_REQUEST['searchOper'])?$_REQUEST['searchOper']:null,
          "search_str" => isset($_REQUEST['searchString'])?$_REQUEST['searchString']:null
      );
      $row = $this->data_model->get_pilih($req_param)->result_array();
      $count = count($row);
      if( $count >0 ) {
        $total_pages = ceil($count/$limit);
      } else {
        $total_pages = 0;
      }
      if ($page > $total_pages)
        $page=$total_pages;
      $start = $limit*$page - $limit; // do not put $limit*($page - 1)
      if($start <0) $start = 0;
      $req_param['limit'] = array(
            'start' => $start,
            'end' => $limit
      );

      $response = (object) NULL;
      $result = $this->data_model->get_pilih($req_param)->result_array();
      // sekarang format data dari dB sehingga sesuai yang diinginkan oleh jqGrid dalam hal ini pakai JSON format
      $response->page = $page;
      $response->total = $total_pages;
      $response->records = $count;

      for($i=0; $i<count($result); $i++)
      {
        $response->rows[$i]['id'] = $result[$i]['ID_REKENING'];
        $response->rows[$i]['cell'] = array($result[$i]['ID_REKENING'],
                        $result[$i]['ID_PARENT_REKENING'],
                        $result[$i]['KODE_REKENING'],
                        $result[$i]['NAMA_REKENING'],
                        $result[$i]['LEVEL_REKENING']
        );
      }
      echo json_encode($response);
    }
  }

  public function get_satuan()
  {
    $response = (object) NULL;
    $q = strtolower($_GET["term"]);
    $rows = $this->data_model->get_opt_satuan($q);
    for($i=0; $i<count($rows); $i++)
    {
      $response[$i]->label = $rows[$i]['NAMA_SATUAN'];
    }
    echo json_encode($response);
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit