Custom Backend OSPRO Surveyor Indonesia
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.4 KiB

<?php
namespace App\Http\Controllers;
use Log;
use Illuminate\Http\Request;
use App\Models\Presence;
use App\Models\Activity;
use App\Models\MapMonitoring;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Http;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
class MapMonitoringController extends Controller
{
// default map monitoring shows today's presence lat lon in the map
public function search(Request $request)
{
// $payload = $request->all();
// $dataBuilder = $this->setUpPayload($payload, 't_clock_in_out');
// $builder = $dataBuilder['builder'];
// $countBuilder = $dataBuilder['count'];
// $dataGet = $builder->get();
// $totalRecord = $countBuilder->count();
// return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
$monitoringData = MapMonitoring::getUsers($request->all());
var_dump($monitoringData);
}
public function list()
{
$data = Presence::all();
$countData = $data->count();
if($data){
return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200);
}else{
return response()->json(['status'=>'failed','message'=>'failed get list presence, please try again later!','code'=>400], 400);
}
}
}