<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Usulan extends CI_Controller {
	
	public function __construct(){
		parent::__construct();	
		$this->load->model('model_usulan1','id_usulan','model_notifikasi');
		$this->load->helper('form','url');  
	}

	public function index()
	{
		$data['title'] = 'Notifikasi seperti difacebook CodeIgniter'; 
        $data['jlhnotif'] =$this->model_notifikasi->notif_count();  //menghitung jumlah post
        $data['notifikasi'] =$this->model_notifikasi->getnotifikasi(); //menampilkan isi postingan
		$data ['data']= $this->model_usulan->GetUser();
		$this->load->view('admin/tabel_usulan',$data);
		$tgldv=time();


        $que=$this->db->query("SELECT id_usulan,tgl, FROM_UNIXTIME(tgl,'%Y%m%d') AS tglbru , CURDATE()-4 AS newtgl FROM tb_usulan WHERE FROM_UNIXTIME(tgl,'%Y%m%d') < CURDATE()-2")->result();

        foreach($que as $newque){
            $id_usulan=$newque->id_usulan;
            $this->db->query("DELETE FROM tb_usulan WHERE id_usulan='$id_usulan'");
            //menghapus otomatis
		}
		
	}
	public function add_data(){
		$this->load->model('model_usulan');
		$this->load->helper('form_helper');
		$data = array(
		'jenisusulan' => $this->model_usulan1->jenisusulan(),
		'jenisusulan_selected' => $this->input->post('tb_jenisusulan') ? $this->input->post('tb_jenisusulan') : '',
		'kategori' => $this->model_usulan1->kategori(),
		'kategori_selected' => $this->input->post('tb_kategori') ? $this->input->post('tb_kategori') : '',
		'pejabatpengadaan' => $this->model_usulan1->pejabatpengadaan(),
		'pejabatpengadaan_selected' => $this->input->post('tb_pejabatpengadaan') ? $this->input->post('tb_pejabatpengadaan') : '',
	    );
		$data['id_usulan'] = $this->id_usulan->buat_id();
		$data['title'] = 'Notifikasi seperti difacebook CodeIgniter'; //judul title
        $data['jlhnotif'] =$this->model_notifikasi->notif_count();  //menghitung jumlah post<commit_msg>Update usulan.php<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Usulan extends CI_Controller {
	
	public function __construct(){
		parent::__construct();	
		$this->load->model('model_usulan1','id_usulan','model_notifikasi');
		$this->load->helper('form','url');  
	}

	public function index()
	{
		$data['title'] = 'Notifikasi seperti difacebook CodeIgniter'; 
        $data['jlhnotif'] =$this->model_notifikasi->notif_count();  //menghitung jumlah post
        $data['notifikasi'] =$this->model_notifikasi->getnotifikasi(); //menampilkan isi postingan
		$data ['data']= $this->model_usulan->GetUser();
		$this->load->view('admin/tabel_usulan',$data);
		$tgldv=time();


        $que=$this->db->query("SELECT id_usulan,tgl, FROM_UNIXTIME(tgl,'%Y%m%d') AS tglbru , CURDATE()-4 AS newtgl FROM tb_usulan WHERE FROM_UNIXTIME(tgl,'%Y%m%d') < CURDATE()-2")->result();

        foreach($que as $newque){
            $id_usulan=$newque->id_usulan;
            $this->db->query("DELETE FROM tb_usulan WHERE id_usulan='$id_usulan'");
            //menghapus otomatis
		}
		
	}
	public function add_data(){
		$this->load->model('model_usulan');
		$this->load->helper('form_helper');
		$data = array(
		'jenisusulan' => $this->model_usulan1->jenisusulan(),
		'jenisusulan_selected' => $this->input->post('tb_jenisusulan') ? $this->input->post('tb_jenisusulan') : '', //
		'kategori' => $this->model_usulan1->kategori(),
		'kategori_selected' => $this->input->post('tb_kategori') ? $this->input->post('tb_kategori') : '',
		'pejabatpengadaan' => $this->model_usulan1->pejabatpengadaan(),
		'pejabatpengadaan_selected' => $this->input->post('tb_pejabatpengadaan') ? $this->input->post('tb_pejabatpengadaan') : '',
	    );
		$data['id_usulan'] = $this->id_usulan->buat_id();
		$data['title'] = 'Notifikasi seperti difacebook CodeIgniter'; //judul title
        $data['jlhnotif'] =$this->model_notifikasi->notif_count();  //menghitung jumlah post
{'fraction_non_alphanumeric': 0.1966505962953565, 'fraction_numerical': 0.0030449124587668104, 'mean_word_length': 5.009146341463414, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 103, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1354792', 'n_tokens_mistral': 1585, 'n_tokens_neox': 1526, 'n_words': 202}