Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* -- new_ticket -- */
- public function new_ticket()
- {
- if (!$this->ion_auth->logged_in())
- {
- $this->session->set_flashdata('message', 'You must be an administrator to view this page.');
- redirect(''.base_url().'', 'refresh');
- }
- error_reporting(0);
- $Sample_Ticket = $_FILES['uploadedimages_ticket'];
- if ((is_uploaded_file($SampleTicket)) && (isset($_FILES['uploadedimages_ticket'])) && !empty($_FILES['uploadedimages_ticket']['name'])) {
- $this->form_validation->set_rules('uploadedimages_ticket[]','Upload Berkas','callback_fileupload_berkas');
- }
- $this->form_validation->set_rules('ticket_sla', 'Urgency', 'required');
- $this->form_validation->set_rules('ticket_subject', 'Subject', 'required');
- $this->form_validation->set_rules('ticket_assign_to', 'Assign Name', 'required');
- if ($this->form_validation->run() == true)
- {
- if ($this->_valid_csrf_nonce() === TRUE)
- {
- if ( !empty($this->input->post('uploadedimages_ticket[]'))) {
- $SampleTicket = $_FILES['uploadedimages_ticket']['name'];
- foreach ($SampleTicket as $key => $value) {
- $data_ticket = array(
- 'ticketnumber' => $this->input->post('ticket_no'),
- 'sla' => $this->input->post('ticket_sla'),
- 'reporteddate' => $this->input->post('ticket_date'),
- 'reportedduedate' => $this->input->post('ticket_due_date'),
- 'telp' => $this->input->post('ticket_tlp'),
- 'email' => $this->input->post('ticket_email'),
- 'image_from' => var_dump($_FILES['uploadedimages_ticket']),
- 'problemdetail' => $this->input->post('ticket_subject'),
- 'ticketstatus' => 'Assigned',
- 'assignee' => $this->input->post('ticket_assign_to'),
- );
- $this->m_ticket->m_new_ticket($data_ticket);
- $this->session->set_flashdata('message_success', 'Data berhasil ditambahkan');
- redirect("ListHD", 'refresh');
- }
- } else {
- $data_ticket = array(
- 'ticketnumber' => $this->input->post('ticket_no'),
- 'sla' => $this->input->post('ticket_sla'),
- 'reporteddate' => $this->input->post('ticket_date'),
- 'reportedduedate' => $this->input->post('ticket_due_date'),
- 'telp' => $this->input->post('ticket_tlp'),
- 'email' => $this->input->post('ticket_email'),
- 'image_from' => '',
- 'problemdetail' => $this->input->post('ticket_subject'),
- 'ticketstatus' => 'Assigned',
- 'assignee' => $this->input->post('ticket_assign_to'),
- );
- $this->m_ticket->m_new_ticket($data_ticket);
- $this->session->set_flashdata('message_success', 'Data berhasil ditambahkan');
- redirect("ListHD", 'refresh');
- }
- }
- } else {
- redirect("ChangePass", 'refresh');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement