Browse Source

Merge pull request 'staging' (#166) from staging into master

Reviewed-on: ordo/adw-backend#166
pull/3/head
ibnu 1 year ago
parent
commit
597482e037
  1. 3
      Dockerfile
  2. 4
      app/Helpers/MasterFunctionsHelper.php
  3. 15
      app/Http/Controllers/MapMonitoringController.php
  4. 12
      app/Http/Controllers/ProjectController.php
  5. 9
      docker/nginx/conf.d/default.conf
  6. 1947
      docker/php/php.ini

3
Dockerfile

@ -29,6 +29,9 @@ RUN docker-php-ext-install \
pgsql \
tokenizer
# Copy php.ini to the container
COPY /docker/php/php.ini /usr/local/etc/php/
#Install Extensions
RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql

4
app/Helpers/MasterFunctionsHelper.php

@ -427,6 +427,8 @@ class MasterFunctionsHelper
$potential = $costDeviation == 0 ? "ON BUDGET" : "OVERRUN";
}
$lastReal = $tempPercentageReal[count($tempPercentageReal) - 1];
$totalBCWP = $lastReal * $totalBCWP;
$dataResponse = array(
"date" => $tempDate,
"percentage" => $tempPercentage,
@ -720,6 +722,8 @@ class MasterFunctionsHelper
$potential = $costDeviation == 0 ? "ON BUDGET" : "OVERRUN";
}
$lastReal = $tempPercentageReal[count($tempPercentageReal) - 1];
$totalBCWP = $lastReal * $totalBCWP;
$dataResponse = array(
"date" => $tempDate,
"percentage" => $tempPercentage,

15
app/Http/Controllers/MapMonitoringController.php

@ -37,15 +37,11 @@ class MapMonitoringController extends Controller
'tcio.clock_in_lng',
'tcio.clock_in_loc',
'tcio.clock_out_loc',
'tcio.date_presence',
'mw.lat',
'mw.lon',
'mw.wptime'
'tcio.date_presence'
)
->join('m_users as mu', 'mu.id', '=', 'tcio.user_id')
->join('m_waypoint as mw', 'mu.id', '=', 'mw.user_id')
->where('mu.id', $key->user_id)
->orderBy('mw.wptime', 'DESC')
->orderBy('tcio.clock_in', 'DESC')
->first();
$project = DB::table('assign_hr_to_proyek as ahtp')
->select('ahtp.proyek_id as id', 'mp.nama as project_name')
@ -55,11 +51,12 @@ class MapMonitoringController extends Controller
->get();
if ($presensi && isset($presensi->user_id)) {
$image = DB::table('m_image')->select('image')->where('category', 'presensi')->where('ref_id', $presensi->clock_in_out_id)->first();
$waypoint = DB::table('m_waypoint')->select('lat', 'lon', 'wptime')->where('user_id', $presensi->user_id)->orderBy('wptime', 'DESC')->first();
$tmp[] = array(
'user_id' => $presensi->user_id,
'wp_lat' => $presensi->lat,
'wp_lon' => $presensi->lon,
'wp_time' => $presensi->wptime,
'wp_lat' => isset($waypoint) ? $waypoint->lat : '-',
'wp_lon' => isset($waypoint) ? $waypoint->lon : '-',
'wp_time' => isset($waypoint) ? $waypoint->wptime : '-',
'clock_in' => $presensi->clock_in,
'clock_out' => $presensi->clock_out,
'clock_in_lat' => $presensi->clock_in_lat,

12
app/Http/Controllers/ProjectController.php

@ -445,6 +445,18 @@ class ProjectController extends Controller
$gantt = MasterFunctionsHelper::getLatestGantt($id);
$result->projectManager = User::where('id', $result->pm_id)->value('name');
$result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->where("version_gantt_id", $gantt['last_gantt_id'])->first();
// dd($result->header->start_date);
$ganttId = $gantt['last_gantt_id'];
$startDate = Activity::where('version_gantt_id', $ganttId)
->orderBy('start_date')
->value('start_date');
$endDate = Activity::where('version_gantt_id', $ganttId)
->orderByDesc('end_date')
->value('end_date');
$result->header->start_date = $startDate;
$result->header->end_date = $endDate;
return response()->json(['status'=>'success','code'=> 200,'data'=>$result, 'gantt'=>$gantt], 200);
}

9
docker/nginx/conf.d/default.conf

@ -15,6 +15,15 @@ server {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
client_max_body_size 100M;
client_body_buffer_size 5M;
fastcgi_read_timeout 900;
keepalive_timeout 900;
send_timeout 300;
proxy_read_timeout 900;
proxy_connect_timeout 900;
proxy_send_timeout 900;
}
location / {

1947
docker/php/php.ini

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save