%PDF-1.4
Directory : /var/www/vhosts/lautnusantara.com/httpdocs/web/app/Controllers/ |
<?php namespace App\Controllers; use CodeIgniter\Controller; use App\Models\Wa_Model; use App\Models\Perusahaan_Model; class Wa_hits extends BaseController { protected $Wa_Model; protected $Perusahaan_Model; protected $session; protected $dt_perusahaan; public function __construct() { $this->session = session(); $this->Wa_Model = new Wa_Model(); $this->Perusahaan_Model = new Perusahaan_Model(); $this->dt_perusahaan = $this->Perusahaan_Model->get_data(1)->getResult(); } public function simpan($hits = 0) { $no_telp = $this->request->getVar('no_telp'); $cs = $this->request->getVar('cs'); $data = array( 'no_telp' => $no_telp, 'cs' => $cs, 'hits' => '1' ); $this->Wa_Model->save_hits($data); $hits = $this->dt_perusahaan[0]->hits; $hits2 = array( 'hits' => $hits + 1, ); $this->Wa_Model->update_hits($hits2); } } ?>