getVar("support_dep")) && $jakuser->getVar("support_dep") != 0) { if (isset($_SESSION["sortstatus"]) && is_numeric($_SESSION["sortstatus"])) { $where .= ' AND t1.status = '.$_SESSION["sortstatus"].' AND (t1.operatorid = '.$jakuser->getVar("id").' OR t1.depid = '.$jakuser->getVar("support_dep").')'; } else { $where .= ' AND (t1.operatorid = '.$jakuser->getVar("id").' OR t1.depid = '.$jakuser->getVar("support_dep").')'; } } elseif (!is_numeric($jakuser->getVar("support_dep")) && $jakuser->getVar("support_dep") != 0) { if (isset($_SESSION["sortstatus"]) && is_numeric($_SESSION["sortstatus"])) { $where .= ' AND t1.status = '.$_SESSION["sortstatus"].' AND (t1.operatorid = '.$jakuser->getVar("id").' OR t1.depid IN ('.$jakuser->getVar("support_dep").'))'; } else { $where .= ' AND (t1.operatorid = '.$jakuser->getVar("id").' OR t1.depid IN ('.$jakuser->getVar("support_dep").'))'; } } else { if (isset($_SESSION["sortstatus"]) && is_numeric($_SESSION["sortstatus"])) { $where .= ' AND t1.status = '.$_SESSION["sortstatus"]; } } // DB table to use $table = JAKDB_PREFIX.'support_tickets AS t1'; $table2 = ' LEFT JOIN '.JAKDB_PREFIX.'support_departments AS t2 ON (t1.depid = t2.id)'; $table3 = ''; // Table's primary key $primaryKey = 't1.id'; // Array of database columns which should be read and sent back to DataTables. // The `db` parameter represents the column name in the database, while the `dt` // parameter represents the DataTables column identifier. In this case simple // indexes $columns = array( array( 'db' => 't1.id', 'dbjoin' => 'id', 'dt' => 0 ), array( 'db' => 't1.id', 'dbjoin' => 'id', 'dt' => 1, 'formatter' => function( $d, $row ) { return ''; } ), array( 'db' => 't1.subject', 'dbjoin' => 'subject', 'dt' => 2, 'formatter' => function( $d, $row ) { return ''.$d.''.($row['mergeid'] ? ' ' : ''); } ), array( 'db' => 't2.title', 'dbjoin' => 'title', 'dt' => 3 ), array( 'db' => 't1.name', 'dbjoin' => 'name', 'dt' => 4 ), array( 'db' => 't1.private', 'dbjoin' => 'private', 'dt' => 5, 'formatter' => function( $d, $row ) { return (isset($d) && $d != 0 ? '' : ''); } ), array( 'db' => 't1.attachments', 'dbjoin' => 'attachments', 'dt' => 6, 'formatter' => function( $d, $row ) { return (isset($d) && $d != 0 ? '' : ''); } ), array( 'db' => 't1.reminder', 'dbjoin' => 'reminder', 'dt' => 7, 'formatter' => function( $d, $row ) { return (isset($d) && $d == 3 ? '' : ''); } ), array( 'db' => 't1.status', 'dbjoin' => 'status', 'dt' => 8, 'formatter' => function( $d, $row ) { if (isset($_SESSION['jak_lcp_lang']) && file_exists(APP_PATH.JAK_OPERATOR_LOC.'/lang/'.$_SESSION['jak_lcp_lang'].'.php')) { include (APP_PATH.JAK_OPERATOR_LOC.'/lang/'.$_SESSION['jak_lcp_lang'].'.php'); } else { include (APP_PATH.JAK_OPERATOR_LOC.'/lang/'.JAK_LANG.'.php'); } // Now include the stuff global $HD_SUPPORT_STATUS; $support_status = ''; if (isset($HD_SUPPORT_STATUS) && !empty($HD_SUPPORT_STATUS)) foreach ($HD_SUPPORT_STATUS as $v) { $support_status .= ''.$v["title"].($d == $v['id'] ? ' ' : '').''; } return '