Commit ca5b4019 by nurchamim

menyesuaikan pembaruan

parent 72891cb7
......@@ -32,8 +32,9 @@ $config['socket_dir'] = $config['base_url'].'/assets/plugins/node_ser
$config['dir_assets'] = $config['base_url'].'assets/';
$config['socket_server'] = $server_name.':'.$socket_port;
$config['socket_port'] = $socket_port;
$config['socket_namespace'] = 'absenku-apps';
// $config['base_image'] = 'https://apps.absenku.com/web/';
$config['socket_namespace'] = 'custom';
$config['socket_room_prefix'] = 'custom'; // tergantung subdomain
$config['user_agent'] = 'custom'; // disamakan socket room prefix
$config['base_image'] = $config['base_url'];
$config['base_upload'] = '../../../../uploads/biodata/';
$config['base_upload'] = $config['base_upload'].'master_custom/';
......
......@@ -250,6 +250,7 @@ class Data_reimburse extends MY_Controller {
$ch = curl_init();
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_POSTFIELDS,$post_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);
......
......@@ -757,7 +757,7 @@ class Pengajuan_izin extends MY_Controller
"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_CUSTOMREQUEST, 'PATCH');
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
......
......@@ -610,7 +610,7 @@ class Pengajuan_lembur extends MY_Controller
"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_CUSTOMREQUEST, 'PATCH');
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
......
......@@ -49,7 +49,7 @@ class Riwayat_pendidikan extends MY_Controller
public function save()
{
$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'));
$transkrip_lama = $this->input->post('transkrip_lama');
......@@ -104,17 +104,17 @@ class Riwayat_pendidikan extends MY_Controller
}
$data = array(
'nama_sekolah' => $this->input->post('nama_sekolah'),
'jenjang' => $this->input->post('jenjang'),
'jurusan' => $this->input->post('jurusan'),
'lulusan_asal' => $this->input->post('lulusan_asal'),
'gelar' => $this->input->post('gelar'),
'tahun_masuk' => $this->input->post('tahun_masuk'),
'tahun_lulus' => $this->input->post('tahun_lulus'),
'ijazah' => $ijazah,
'transkrip' => $transkrip,
'id_company' => $id_company,
'id_karyawan' => $id_karyawan
'nama_sekolah' => $this->input->post('nama_sekolah'),
'jenjang' => $this->input->post('jenjang'),
'jurusan' => $this->input->post('jurusan'),
'lulusan_asal' => $this->input->post('lulusan_asal'),
'gelar' => $this->input->post('gelar'),
'tahun_masuk' => $this->input->post('tahun_masuk'),
'tahun_lulus' => $this->input->post('tahun_lulus'),
'ijazah' => $ijazah,
'transkrip' => $transkrip,
'id_company' => $id_company,
'id_karyawan' => $id_karyawan
);
$this->Riwayat_pendidikan_m->save($data, $id);
}
......
......@@ -42,7 +42,7 @@ class Reminder_absensi extends CI_Controller {
'setelah_pulang_menit' => $row->absensi_pulang_setelah_menit,
'jam_mulai' => $jam_mulai,
'jam_selesai' => $jam_selesai,
'notif' => 'profesional'
'notif' => 'profesional'
]));
$output = curl_exec($ch);
......@@ -55,27 +55,27 @@ class Reminder_absensi extends CI_Controller {
}
public function testing() {
$this->load->database('payroll');
$this->load->database('payroll');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:3007/queue_reminder_absensi');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'id_company' => '202100001',
'sebelum_masuk' => '1',
'sebelum_masuk_menit' => 0,
'setelah_masuk' => '0',
'setelah_masuk_menit' => 0,
'setelah_pulang' => '0',
'setelah_pulang_menit' => 0,
'jam_mulai' => '14:30:00',
'jam_selesai' => '14:50:00',
'notif' => 'profesional'
]));
curl_setopt($ch, CURLOPT_USERAGENT, 'PROFESIONAL');
$output = curl_exec($ch);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:3007/queue_reminder_absensi');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'id_company' => '202100001',
'sebelum_masuk' => '1',
'sebelum_masuk_menit' => 0,
'setelah_masuk' => '0',
'setelah_masuk_menit' => 0,
'setelah_pulang' => '0',
'setelah_pulang_menit' => 0,
'jam_mulai' => '14:30:00',
'jam_selesai' => '14:50:00',
'notif' => 'profesional'
]));
curl_setopt($ch, CURLOPT_USERAGENT, 'PROFESIONAL');
$output = curl_exec($ch);
echo $row->id_company." : ".$output."\n";
curl_close($ch);
}
}
}
......@@ -151,60 +151,61 @@ class Draft_pkwt extends MY_Controller {
'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_HTTPHEADER, [
'authentication: absenku123**'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $this->config->item('user_agent'));
$output = curl_exec($ch);
curl_close($ch);
}
}
private function _konversi_romawi($angka){
switch ($angka) {
case 1 : return 'I';
break;
case 2 : return 'II';
break;
case 3 : return 'III';
break;
case 4 : return 'IV';
break;
case 5 : return 'V';
break;
case 6 : return 'VI';
break;
case 7 : return 'VII';
break;
case 8 : return 'VIII';
break;
case 9 : return 'IX';
break;
case 10 : return 'X';
break;
case 11 : return 'XI';
break;
case 12 : return 'XII';
break;
default : return '-';
break;
}
}
private function _konversi_romawi($angka){
switch ($angka) {
case 1 : return 'I';
break;
case 2 : return 'II';
break;
case 3 : return 'III';
break;
case 4 : return 'IV';
break;
case 5 : return 'V';
break;
case 6 : return 'VI';
break;
case 7 : return 'VII';
break;
case 8 : return 'VIII';
break;
case 9 : return 'IX';
break;
case 10 : return 'X';
break;
case 11 : return 'XI';
break;
case 12 : return 'XII';
break;
default : return '-';
break;
}
}
private function _get_no_urut($tahun="2024"){
$getId = $this->db->query("SELECT MAX(SUBSTRING_INDEX(SUBSTRING_INDEX(no_pkwt, '/', -3), '/', 1)) AS no_urut
FROM pkwt_data
WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(no_pkwt, '/', -1), '/', 1) = ?", array($tahun));
if ($getId->num_rows() > 0) {
$current_id = $getId->row()->no_urut;
$no_urut = $current_id + 1;
} else {
$no_urut = 1;
}
return sprintf("%03d", $no_urut);
}
private function _get_no_urut($tahun="2024"){
$getId = $this->db->query("SELECT MAX(SUBSTRING_INDEX(SUBSTRING_INDEX(no_pkwt, '/', -3), '/', 1)) AS no_urut
FROM pkwt_data
WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(no_pkwt, '/', -1), '/', 1) = ?", array($tahun));
if ($getId->num_rows() > 0) {
$current_id = $getId->row()->no_urut;
$no_urut = $current_id + 1;
} else {
$no_urut = 1;
}
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')) {
if (!function_exists('notif_approval')) {
function notif_approval($route, $id_karyawan, $judul, $content, $id_ref)
{
$CI =& get_instance();
$init = language_init();
$ch = curl_init();
$token_fcm = $init->db->get_where('users', ['id_karyawan' => $id_karyawan])->row()->token_fcm;
......@@ -60,6 +61,7 @@ if (!function_exists('notif_approval')) {
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'authentication: absenku123**'
]);
curl_setopt($ch, CURLOPT_USERAGENT, $CI->config->item('user_agent'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
......
......@@ -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_HTTPHEADER, ['authentication: absenku123**']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $this->config->item('user_agent'));
curl_exec($ch);
curl_close($ch);
}
......
......@@ -24,10 +24,7 @@
"ajax": {
"url": "<?= site_url('master/cabang/list_data') ?>",
"type": "GET",
"complete": function(data) {
reconfigure(data);
}
"type": "GET"
},
"aoColumnDefs": [{
......
......@@ -335,9 +335,6 @@
$(function() {
callmasktanggal();
reconfigure();
// checkpermission();
lightbox.option({
'imageFadeDuration': 100,
'resizeDuration': 100,
......@@ -628,7 +625,9 @@
// window.Pace.stop();
if (typeof request.responseJSON !== 'undefined') {
reconfigure(request);
if(request.responseJSON.csrf_token !== undefined) {
reconfigure(request);
}
}
var tabel = $('div.dataTables_scrollBody > table');
if (tabel.length > 0) {
......@@ -699,7 +698,7 @@
let doPromise = new Promise(function(resolve, reject) {
$.ajax({
url: hostname + ":2083",
url: hostname + ":" + <?= $this->config->item('socket_port') ?>,
headers: {
'X-Requested-With': 'XMLHttpRequest'
},
......@@ -739,7 +738,7 @@
socket.on('connect', function() {
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 @@
function refresh_token() {
if (socket !== undefined) {
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'),
'refresh': true
});
......
......@@ -12,7 +12,6 @@
},
"require": {
"php": ">=5.3.7",
"luthier/luthier": "^1.0",
"wisembly/elephant.io": "^3.3",
"mpdf/mpdf": "^8.0",
"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