Skip to content

Instantly share code, notes, and snippets.

@rizkyramadhan21
Created June 18, 2021 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rizkyramadhan21/306d5109d0992f31489a73cea9a58503 to your computer and use it in GitHub Desktop.
Save rizkyramadhan21/306d5109d0992f31489a73cea9a58503 to your computer and use it in GitHub Desktop.
CI Controllers for Laporan Bot Telegram
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Report extends CI_Controller {
function __construct(){
parent::__construct();
}
/*------------------
Form Input Laporan
------------------*/
function index()
{
$this->load->view('views_laporan_harian');
}
/*----------------------
Function Submit Laporan
---------------------- */
function submit_report(){
$tanggal = date("Y-m-d H:i:s");
$nama = $this->input->post('nama');
$penjualan = $this->input->post('sales');
$report_data = array(
'tanggal' => $tanggal,
'nama' => $nama,
'penjualan' => $penjualan
);
$this->db->insert('laporan_harian', $report_data);
$this->load->view('views_laporan_harian_result');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment