root 4 years ago
parent
commit
595b865b98
1 changed files with 17 additions and 5 deletions
  1. 17
    5
      app/Http/Controllers/Api/RestfulapiController.php

+ 17
- 5
app/Http/Controllers/Api/RestfulapiController.php View File

// $faulty = Faulty::where('_id',$c->seksyen_kesalahan)->first(); // $faulty = Faulty::where('_id',$c->seksyen_kesalahan)->first();
// $akta = DeedLaw::where('_id',$faulty->deed_law_id)->first(); // $akta = DeedLaw::where('_id',$faulty->deed_law_id)->first();
$cpn_date = ''; $cpn_time = '';
if (!empty($c->cpn_created))
{
$cpn_date = Carbon::parse($c->cpn_created)->format("D, d M, 'y");
$cpn_time = Carbon::parse($c->cpn_created)->format("g:i A");
}
if($c->jenis == 'Pelbagai_KT'){ if($c->jenis == 'Pelbagai_KT'){
array_push($data,array( array_push($data,array(
"_id" => $c->_id, "_id" => $c->_id,
"updated_at" => $c->updated_at->toDateTimeString(), "updated_at" => $c->updated_at->toDateTimeString(),
"created_at" => $c->created_at->toDateTimeString(), "created_at" => $c->created_at->toDateTimeString(),
"notice_created" => $c->notice_created, "notice_created" => $c->notice_created,
"compound_created" => $c->cpn_created,
"cpn_ctreted_date" => $cpn_date,
"cpn_ctreted_time" => $cpn_time,
)); ));
}else if($c->jenis == 'Pelbagai_JPB'){ }else if($c->jenis == 'Pelbagai_JPB'){
array_push($data,array( array_push($data,array(
"updated_at" => $c->updated_at->toDateTimeString(), "updated_at" => $c->updated_at->toDateTimeString(),
"created_at" => $c->created_at->toDateTimeString(), "created_at" => $c->created_at->toDateTimeString(),
"notice_created" => $c->notice_created, "notice_created" => $c->notice_created,
"compound_created" => $c->cpn_created,
"compound_created" => $cpn_date,
"cpn_ctreted_time" => $cpn_time,
)); ));
}else if($c->jenis == 'Pelbagai_LESEN'){ }else if($c->jenis == 'Pelbagai_LESEN'){
array_push($data,array( array_push($data,array(
"updated_at" => $c->updated_at->toDateTimeString(), "updated_at" => $c->updated_at->toDateTimeString(),
"created_at" => $c->created_at->toDateTimeString(), "created_at" => $c->created_at->toDateTimeString(),
"notice_created" => $c->notice_created, "notice_created" => $c->notice_created,
"compound_created" => $c->cpn_created,
"compound_created" => $cpn_date,
"cpn_ctreted_time" => $cpn_time,
)); ));
}else if($c->jenis == 'Pelbagai_PA'){ }else if($c->jenis == 'Pelbagai_PA'){
array_push($data,array( array_push($data,array(
"updated_at" => $c->updated_at->toDateTimeString(), "updated_at" => $c->updated_at->toDateTimeString(),
"created_at" => $c->created_at->toDateTimeString(), "created_at" => $c->created_at->toDateTimeString(),
"notice_created" => $c->notice_created, "notice_created" => $c->notice_created,
"compound_created" => $c->cpn_created,
"compound_created" => $cpn_date,
"cpn_ctreted_time" => $cpn_time,
)); ));
}else if($c->jenis == 'Parkir'){ }else if($c->jenis == 'Parkir'){
array_push($data,array( array_push($data,array(
"updated_at" => $c->updated_at->toDateTimeString(), "updated_at" => $c->updated_at->toDateTimeString(),
"created_at" => $c->created_at->toDateTimeString(), "created_at" => $c->created_at->toDateTimeString(),
"notice_created" => $c->notice_created, "notice_created" => $c->notice_created,
"compound_created" => $c->cpn_created,
"compound_created" => $cpn_date,
"cpn_ctreted_time" => $cpn_time,
)); ));
} }

Loading…
Cancel
Save