Commit ca5b4019 by nurchamim

menyesuaikan pembaruan

parent 72891cb7
...@@ -32,8 +32,9 @@ $config['socket_dir'] = $config['base_url'].'/assets/plugins/node_ser ...@@ -32,8 +32,9 @@ $config['socket_dir'] = $config['base_url'].'/assets/plugins/node_ser
$config['dir_assets'] = $config['base_url'].'assets/'; $config['dir_assets'] = $config['base_url'].'assets/';
$config['socket_server'] = $server_name.':'.$socket_port; $config['socket_server'] = $server_name.':'.$socket_port;
$config['socket_port'] = $socket_port; $config['socket_port'] = $socket_port;
$config['socket_namespace'] = 'absenku-apps'; $config['socket_namespace'] = 'custom';
// $config['base_image'] = 'https://apps.absenku.com/web/'; $config['socket_room_prefix'] = 'custom'; // tergantung subdomain
$config['user_agent'] = 'custom'; // disamakan socket room prefix
$config['base_image'] = $config['base_url']; $config['base_image'] = $config['base_url'];
$config['base_upload'] = '../../../../uploads/biodata/'; $config['base_upload'] = '../../../../uploads/biodata/';
$config['base_upload'] = $config['base_upload'].'master_custom/'; $config['base_upload'] = $config['base_upload'].'master_custom/';
......
...@@ -250,6 +250,7 @@ class Data_reimburse extends MY_Controller { ...@@ -250,6 +250,7 @@ class Data_reimburse extends MY_Controller {
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$base."reimbursement/update-status"); curl_setopt($ch, CURLOPT_URL,$base."reimbursement/update-status");
curl_setopt($ch, CURLOPT_USERAGENT, $this->config->item('user_agent'));
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data); curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers); curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);
......
...@@ -757,7 +757,7 @@ class Pengajuan_izin extends MY_Controller ...@@ -757,7 +757,7 @@ class Pengajuan_izin extends MY_Controller
"api-key:absenku123**" "api-key:absenku123**"
); );
curl_setopt($curl, CURLOPT_USERAGENT, 'absenku_v3_250801_multi'); curl_setopt($ch, CURLOPT_USERAGENT, $this->config->item('user_agent'));
curl_setopt($curl, CURLOPT_URL, $url_act); curl_setopt($curl, CURLOPT_URL, $url_act);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH'); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
......
...@@ -610,7 +610,7 @@ class Pengajuan_lembur extends MY_Controller ...@@ -610,7 +610,7 @@ class Pengajuan_lembur extends MY_Controller
"api-key:absenku123**" "api-key:absenku123**"
); );
curl_setopt($curl, CURLOPT_USERAGENT, 'absenku_v3_250801_multi'); curl_setopt($ch, CURLOPT_USERAGENT, $this->config->item('user_agent'));
curl_setopt($curl, CURLOPT_URL, $url_act); curl_setopt($curl, CURLOPT_URL, $url_act);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH'); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
......
...@@ -49,7 +49,7 @@ class Riwayat_pendidikan extends MY_Controller ...@@ -49,7 +49,7 @@ class Riwayat_pendidikan extends MY_Controller
public function save() public function save()
{ {
$id = $this->input->post('id_pendidikan'); $id = $this->input->post('id_pendidikan');
$id_company = $this->session->userdata('id_company'); $id_company = $this->id_company;
$id_karyawan = $this->fungsi->decrypt_idkaryawan($this->input->post('id_karyawan')); $id_karyawan = $this->fungsi->decrypt_idkaryawan($this->input->post('id_karyawan'));
$transkrip_lama = $this->input->post('transkrip_lama'); $transkrip_lama = $this->input->post('transkrip_lama');
...@@ -104,17 +104,17 @@ class Riwayat_pendidikan extends MY_Controller ...@@ -104,17 +104,17 @@ class Riwayat_pendidikan extends MY_Controller
} }
$data = array( $data = array(
'nama_sekolah' => $this->input->post('nama_sekolah'), 'nama_sekolah' => $this->input->post('nama_sekolah'),
'jenjang' => $this->input->post('jenjang'), 'jenjang' => $this->input->post('jenjang'),
'jurusan' => $this->input->post('jurusan'), 'jurusan' => $this->input->post('jurusan'),
'lulusan_asal' => $this->input->post('lulusan_asal'), 'lulusan_asal' => $this->input->post('lulusan_asal'),
'gelar' => $this->input->post('gelar'), 'gelar' => $this->input->post('gelar'),
'tahun_masuk' => $this->input->post('tahun_masuk'), 'tahun_masuk' => $this->input->post('tahun_masuk'),
'tahun_lulus' => $this->input->post('tahun_lulus'), 'tahun_lulus' => $this->input->post('tahun_lulus'),
'ijazah' => $ijazah, 'ijazah' => $ijazah,
'transkrip' => $transkrip, 'transkrip' => $transkrip,
'id_company' => $id_company, 'id_company' => $id_company,
'id_karyawan' => $id_karyawan 'id_karyawan' => $id_karyawan
); );
$this->Riwayat_pendidikan_m->save($data, $id); $this->Riwayat_pendidikan_m->save($data, $id);
} }
......
...@@ -42,7 +42,7 @@ class Reminder_absensi extends CI_Controller { ...@@ -42,7 +42,7 @@ class Reminder_absensi extends CI_Controller {
'setelah_pulang_menit' => $row->absensi_pulang_setelah_menit, 'setelah_pulang_menit' => $row->absensi_pulang_setelah_menit,
'jam_mulai' => $jam_mulai, 'jam_mulai' => $jam_mulai,
'jam_selesai' => $jam_selesai, 'jam_selesai' => $jam_selesai,
'notif' => 'profesional' 'notif' => 'profesional'
])); ]));
$output = curl_exec($ch); $output = curl_exec($ch);
...@@ -55,27 +55,27 @@ class Reminder_absensi extends CI_Controller { ...@@ -55,27 +55,27 @@ class Reminder_absensi extends CI_Controller {
} }
public function testing() { public function testing() {
$this->load->database('payroll'); $this->load->database('payroll');
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:3007/queue_reminder_absensi'); curl_setopt($ch, CURLOPT_URL, 'http://localhost:3007/queue_reminder_absensi');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'id_company' => '202100001', 'id_company' => '202100001',
'sebelum_masuk' => '1', 'sebelum_masuk' => '1',
'sebelum_masuk_menit' => 0, 'sebelum_masuk_menit' => 0,
'setelah_masuk' => '0', 'setelah_masuk' => '0',
'setelah_masuk_menit' => 0, 'setelah_masuk_menit' => 0,
'setelah_pulang' => '0', 'setelah_pulang' => '0',
'setelah_pulang_menit' => 0, 'setelah_pulang_menit' => 0,
'jam_mulai' => '14:30:00', 'jam_mulai' => '14:30:00',
'jam_selesai' => '14:50:00', 'jam_selesai' => '14:50:00',
'notif' => 'profesional' 'notif' => 'profesional'
])); ]));
curl_setopt($ch, CURLOPT_USERAGENT, 'PROFESIONAL'); curl_setopt($ch, CURLOPT_USERAGENT, 'PROFESIONAL');
$output = curl_exec($ch); $output = curl_exec($ch);
echo $row->id_company." : ".$output."\n"; echo $row->id_company." : ".$output."\n";
curl_close($ch); curl_close($ch);
} }
} }
...@@ -151,60 +151,61 @@ class Draft_pkwt extends MY_Controller { ...@@ -151,60 +151,61 @@ class Draft_pkwt extends MY_Controller {
'nm_aplikasi' => 'fcm' 'nm_aplikasi' => 'fcm'
]; ];
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://mb-producer.absenku.com/fcm?".http_build_query($params)); curl_setopt($ch, CURLOPT_URL, "https://mb-producer.absenku.com/fcm?".http_build_query($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, [ curl_setopt($ch, CURLOPT_HTTPHEADER, [
'authentication: absenku123**' 'authentication: absenku123**'
]); ]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $this->config->item('user_agent'));
$output = curl_exec($ch); $output = curl_exec($ch);
curl_close($ch); curl_close($ch);
} }
private function _konversi_romawi($angka){ private function _konversi_romawi($angka){
switch ($angka) { switch ($angka) {
case 1 : return 'I'; case 1 : return 'I';
break; break;
case 2 : return 'II'; case 2 : return 'II';
break; break;
case 3 : return 'III'; case 3 : return 'III';
break; break;
case 4 : return 'IV'; case 4 : return 'IV';
break; break;
case 5 : return 'V'; case 5 : return 'V';
break; break;
case 6 : return 'VI'; case 6 : return 'VI';
break; break;
case 7 : return 'VII'; case 7 : return 'VII';
break; break;
case 8 : return 'VIII'; case 8 : return 'VIII';
break; break;
case 9 : return 'IX'; case 9 : return 'IX';
break; break;
case 10 : return 'X'; case 10 : return 'X';
break; break;
case 11 : return 'XI'; case 11 : return 'XI';
break; break;
case 12 : return 'XII'; case 12 : return 'XII';
break; break;
default : return '-'; default : return '-';
break; break;
} }
} }
private function _get_no_urut($tahun="2024"){ private function _get_no_urut($tahun="2024"){
$getId = $this->db->query("SELECT MAX(SUBSTRING_INDEX(SUBSTRING_INDEX(no_pkwt, '/', -3), '/', 1)) AS no_urut $getId = $this->db->query("SELECT MAX(SUBSTRING_INDEX(SUBSTRING_INDEX(no_pkwt, '/', -3), '/', 1)) AS no_urut
FROM pkwt_data FROM pkwt_data
WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(no_pkwt, '/', -1), '/', 1) = ?", array($tahun)); WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(no_pkwt, '/', -1), '/', 1) = ?", array($tahun));
if ($getId->num_rows() > 0) { if ($getId->num_rows() > 0) {
$current_id = $getId->row()->no_urut; $current_id = $getId->row()->no_urut;
$no_urut = $current_id + 1; $no_urut = $current_id + 1;
} else { } else {
$no_urut = 1; $no_urut = 1;
} }
return sprintf("%03d", $no_urut); return sprintf("%03d", $no_urut);
} }
} }
\ No newline at end of file
<?php
function redirect($uri = '', $method = 'auto', $code = NULL)
{
$uri = str_replace("/web/", "", $uri);
if ( ! preg_match('#^(\w+:)?//#i', $uri))
{
$uri = site_url($uri);
}
// IIS environment likely? Use 'refresh' for better compatibility
if ($method === 'auto' && isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE)
{
$method = 'refresh';
}
elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code)))
{
if (isset($_SERVER['SERVER_PROTOCOL'], $_SERVER['REQUEST_METHOD']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1')
{
$code = ($_SERVER['REQUEST_METHOD'] !== 'GET')
? 303 // reference: http://en.wikipedia.org/wiki/Post/Redirect/Get
: 307;
}
else
{
$code = 302;
}
}
switch ($method)
{
case 'refresh':
header('Refresh:0;url='.$uri);
break;
default:
header('Location: '.$uri, TRUE, $code);
break;
}
exit;
}
...@@ -40,6 +40,7 @@ if (!function_exists('data_diri_action')) { ...@@ -40,6 +40,7 @@ if (!function_exists('data_diri_action')) {
if (!function_exists('notif_approval')) { if (!function_exists('notif_approval')) {
function notif_approval($route, $id_karyawan, $judul, $content, $id_ref) function notif_approval($route, $id_karyawan, $judul, $content, $id_ref)
{ {
$CI =& get_instance();
$init = language_init(); $init = language_init();
$ch = curl_init(); $ch = curl_init();
$token_fcm = $init->db->get_where('users', ['id_karyawan' => $id_karyawan])->row()->token_fcm; $token_fcm = $init->db->get_where('users', ['id_karyawan' => $id_karyawan])->row()->token_fcm;
...@@ -60,6 +61,7 @@ if (!function_exists('notif_approval')) { ...@@ -60,6 +61,7 @@ if (!function_exists('notif_approval')) {
curl_setopt($ch, CURLOPT_HTTPHEADER, [ curl_setopt($ch, CURLOPT_HTTPHEADER, [
'authentication: absenku123**' 'authentication: absenku123**'
]); ]);
curl_setopt($ch, CURLOPT_USERAGENT, $CI->config->item('user_agent'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch); $output = curl_exec($ch);
......
...@@ -26,6 +26,7 @@ if(!function_exists('publishTarget')) { ...@@ -26,6 +26,7 @@ if(!function_exists('publishTarget')) {
curl_setopt($ch, CURLOPT_URL, "https://mb-producer.absenku.com/fcm?".http_build_query($params)); curl_setopt($ch, CURLOPT_URL, "https://mb-producer.absenku.com/fcm?".http_build_query($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['authentication: absenku123**']); curl_setopt($ch, CURLOPT_HTTPHEADER, ['authentication: absenku123**']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $this->config->item('user_agent'));
curl_exec($ch); curl_exec($ch);
curl_close($ch); curl_close($ch);
} }
......
...@@ -24,10 +24,7 @@ ...@@ -24,10 +24,7 @@
"ajax": { "ajax": {
"url": "<?= site_url('master/cabang/list_data') ?>", "url": "<?= site_url('master/cabang/list_data') ?>",
"type": "GET", "type": "GET"
"complete": function(data) {
reconfigure(data);
}
}, },
"aoColumnDefs": [{ "aoColumnDefs": [{
......
...@@ -335,9 +335,6 @@ ...@@ -335,9 +335,6 @@
$(function() { $(function() {
callmasktanggal(); callmasktanggal();
reconfigure();
// checkpermission();
lightbox.option({ lightbox.option({
'imageFadeDuration': 100, 'imageFadeDuration': 100,
'resizeDuration': 100, 'resizeDuration': 100,
...@@ -628,7 +625,9 @@ ...@@ -628,7 +625,9 @@
// window.Pace.stop(); // window.Pace.stop();
if (typeof request.responseJSON !== 'undefined') { if (typeof request.responseJSON !== 'undefined') {
reconfigure(request); if(request.responseJSON.csrf_token !== undefined) {
reconfigure(request);
}
} }
var tabel = $('div.dataTables_scrollBody > table'); var tabel = $('div.dataTables_scrollBody > table');
if (tabel.length > 0) { if (tabel.length > 0) {
...@@ -699,7 +698,7 @@ ...@@ -699,7 +698,7 @@
let doPromise = new Promise(function(resolve, reject) { let doPromise = new Promise(function(resolve, reject) {
$.ajax({ $.ajax({
url: hostname + ":2083", url: hostname + ":" + <?= $this->config->item('socket_port') ?>,
headers: { headers: {
'X-Requested-With': 'XMLHttpRequest' 'X-Requested-With': 'XMLHttpRequest'
}, },
...@@ -739,7 +738,7 @@ ...@@ -739,7 +738,7 @@
socket.on('connect', function() { socket.on('connect', function() {
socket.emit('connect_users', { socket.emit('connect_users', {
'id_karyawan': '<?= $this->session->userdata("id_karyawan") ?>' 'id_karyawan': '<?= $this->config->item("socket_room_prefix")."~".$this->session->userdata("id_karyawan") ?>'
}); });
}); });
...@@ -801,7 +800,7 @@ ...@@ -801,7 +800,7 @@
function refresh_token() { function refresh_token() {
if (socket !== undefined) { if (socket !== undefined) {
socket.emit('refresh-token', { socket.emit('refresh-token', {
'id_karyawan': '<?= $this->session->userdata("id_karyawan") ?>', 'id_karyawan': '<?= $this->config->item("socket_room_prefix")."~".$this->session->userdata("id_karyawan") ?>',
'_token': $('meta[name="csrf-token"]').attr('content'), '_token': $('meta[name="csrf-token"]').attr('content'),
'refresh': true 'refresh': true
}); });
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
}, },
"require": { "require": {
"php": ">=5.3.7", "php": ">=5.3.7",
"luthier/luthier": "^1.0",
"wisembly/elephant.io": "^3.3", "wisembly/elephant.io": "^3.3",
"mpdf/mpdf": "^8.0", "mpdf/mpdf": "^8.0",
"php-amqplib/php-amqplib": "^3.6", "php-amqplib/php-amqplib": "^3.6",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment