public function helpdesk_ticket(){
if (isset($_POST['submit'])){
// Membuat nomor tiket baru dengan format tanggal dan nomor urutan 1
$no_tiket = "TK-" . date('YmdHis') . "001";
$data = array(
'no_tiket' => $no_tiket,
'nik_karyawan' => $this->input->post('a'),
'lokasi' => $this->input->post('lokasi'),
'type_asset' => $this->db->escape_str($this->input->post('ka2')),
'kode_asset' => $this->db->escape_str($this->input->post('kode')),
'tgl_helpdesk' => date('Y-m-d'),
'email_user' => $this->db->escape_str($this->input->post('c1')),
'keluhan_user' => $this->db->escape_str($this->input->post('f1'))
);
$this->model_app->insert('mst_helpdesk', $data);
// Menampilkan notifikasi dengan nomor tiket
echo "<script>
alert('Nomor Tiket: " . $no_tiket . "');
window.location.href = '" . base_url($this->uri->segment(1)) . "';
</script>";
} else {
$data['karyawan'] = $this->model_app->view_ordering('mst_karyawan', 'nik', 'DESC');
// Membuat nomor tiket baru dengan format tanggal dan nomor urutan 1
$data['no_tiket'] = "TK-" . date('YmdHis') . "001";
$this->load->helper('captcha');
$vals = array(
'img_path' => './captcha/',
'img_url' => base_url().'captcha/',
'font_path' => './asset/Tahoma.ttf',
'font_size' => 17,
'img_width' => '320',
'img_height' => 33,
'border' => 0,
'word_length' => 5,
'expiration' => 7200
);
$cap = create_captcha($vals);
$data['image'] = $cap['image'];
$this->session->set_userdata('mycaptcha', $cap['word']);
$this->template->load('desktop/desktop', 'desktop/helpdesk_ticket', $data);
}
}public function helpdesk_ticket(){
if (isset($_POST['submit'])){
// Membuat nomor tiket baru dengan format tanggal dan nomor urutan 1
$no_tiket = "TK-" . date('YmdHis') . "001";
$data = array(
'no_tiket' => $no_tiket,
'nik_karyawan' => $this->input->post('a'),
'lokasi' => $this->input->post('lokasi'),
'type_asset' => $this->db->escape_str($this->input->post('ka2')),
'kode_asset' => $this->db->escape_str($this->input->post('kode')),
'tgl_helpdesk' => date('Y-m-d'),
'email_user' => $this->db->escape_str($this->input->post('c1')),
'keluhan_user' => $this->db->escape_str($this->input->post('f1'))
);
$this->model_app->insert('mst_helpdesk', $data);
// Menampilkan notifikasi dengan nomor tiket
echo "<script>
alert('Nomor Tiket: " . $no_tiket . "');
window.location.href = '" . base_url($this->uri->segment(1)) . "';
</script>";
} else {
$data['karyawan'] = $this->model_app->view_ordering('mst_karyawan', 'nik', 'DESC');
// Membuat nomor tiket baru dengan format tanggal dan nomor urutan 1
$data['no_tiket'] = "TK-" . date('YmdHis') . "001";
$this->load->helper('captcha');
$vals = array(
'img_path' => './captcha/',
'img_url' => base_url().'captcha/',
'font_path' => './asset/Tahoma.ttf',
'font_size' => 17,
'img_width' => '320',
'img_height' => 33,
'border' => 0,
'word_length' => 5,
'expiration' => 7200
);
$cap = create_captcha($vals);
$data['image'] = $cap['image'];
$this->session->set_userdata('mycaptcha', $cap['word']);
$this->template->load('desktop/desktop', 'desktop/helpdesk_ticket', $data);
}
}