https://t.me/RX1948
Server : Apache/2.4.18 (Ubuntu)
System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64
User : oppastar ( 1041)
PHP Version : 7.0.33-0ubuntu0.16.04.15
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Directory :  /var/www/indolok.id/application/controllers/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/indolok.id/application/controllers/admin/Penawaran.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Penawaran extends Admin_Controller {
		
	function __construct() {
		parent::__construct();	
	

		if (!in_array('penawaran', $this->data['allowed_module'])) {
			$this->data['allowed'] = false;
		} else {
			$this->data['allowed'] = true;
		}			 
	}
		
	//this is to list all orders
	function index() { 
		
		//pagination in action. 100 results per page
		$this->load->library('pagination');
		$config['base_url'] = base_url() . 'admin/penawaran/index';
		$config['per_page'] = 200;
		$config["uri_segment"] = 4; 

		//fetch all penawaran
		$config['total_rows'] = $this->db->get('penawaran_harga')->num_rows();
		$this->pagination->initialize($config);

		$this->db->select('*');
		$this->db->from('penawaran_harga');
		$this->db->order_by('time_added', 'desc');
		$this->db->limit($config["per_page"], $this->uri->segment($config["uri_segment"]));
		$this->data['penawaran'] = $this->db->get()->result();
	
		//load view
		$this->data['subview'] = 'admin/penawaran/index';
		$this->load->view('admin/templates/header', $this->data_header); 
		$this->load->view('admin/_layout_main', $this->data);
		$this->load->view('admin/templates/footer');	 
		
    }

    function generate_penawaran_harga($penawaran_id = NULL) {

		if($penawaran_id == NULL) {
			redirect('admin/penawaran');
		}

		//add PDF attachment DOMPDF 	  
		$data['title'] = 'Surat Penawaran Harga'; 

		//get all penawaran details
		$this->db->select('*')->from('penawaran_harga')->where('id', $penawaran_id);
		$pdf_data['penawaran'] = $this->db->get()->row();

		if(count($pdf_data['penawaran']) > 0) {

			//get customer detail
			$this->db->select('*')->from('customers')->where('id_customers', $pdf_data['penawaran']->customer_id);
			$pdf_data['customer'] = $this->db->get()->row();

			//get sales name and hp
			$this->db->select('sales_name, handphone, email')->from('sales_list')->where('employee_id', $pdf_data['penawaran']->employee_id);
			$pdf_data['sales'] = $this->db->get()->row();

			$this->load->helper('shipping');

			//get current month ij roman
			$pdf_data['current_month'] = integerToRoman(date('n'));
			//get current year 2 digits
			$pdf_data['current_year'] = date('y');

			$this->load->library('dompdf_gen');
			$html = $this->load->view('account/penawaran_pdf', $pdf_data ,true); 
			/*tambahan*/
			$html = preg_replace('/>\s+</', '><', $html);
			/*tambahan*/
			$this->dompdf->load_html($html);
			$this->dompdf->set_paper('A4', 'portrait');
			$this->dompdf->render(); 
			$this->dompdf->stream('penawaran_harga.pdf', array("Attachment" => 0));
			$output = $this->dompdf->output(); 
			$file_to_save = 'uploads/pdf/penawaran_harga.pdf'; 
			file_put_contents($file_to_save, $output); 

		} else {
			redirect('admin/penawaran');
		}
	}

	function cancel($penawaran_id = NULL) {

		if($penawaran_id == NULL) {
			redirect('admin/penawaran');
		}

		$data = array(
			'status' => 'cancel'
		);
		$this->db->where('id', $penawaran_id);
		$this->db->update('penawaran_harga', $data);

		$this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:5px; font-weight:bold;">Penawaran berhasil dirubah status menjadi Batal.</p>');

		redirect('admin/penawaran');
	}

}

https://t.me/RX1948 - 2025