Created
June 18, 2021 19:10
-
-
Save rizkyramadhan21/306d5109d0992f31489a73cea9a58503 to your computer and use it in GitHub Desktop.
CI Controllers for Laporan Bot Telegram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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