33 lines
750 B
PHP
33 lines
750 B
PHP
<?php
|
|
use Carbon\Carbon;
|
|
$naks_welders = db("naks_welders")
|
|
/*
|
|
->select(
|
|
"welder_name_ru",
|
|
"welder_name_en",
|
|
"welder_id",
|
|
"year_of_birth",
|
|
"period_of_validity",
|
|
"company",
|
|
"status",
|
|
)
|
|
*/
|
|
->where("welder_id", get("welder_id"))
|
|
->get();
|
|
|
|
|
|
$expired_date = setting("WelderQualitificationStatusExpiredDate");
|
|
$today = Carbon::now();
|
|
|
|
foreach($naks_welders AS $q) {
|
|
$periodOfValidity = Carbon::parse($q->period_of_validity);
|
|
|
|
$q->remaining_days = $today->diffInDays($periodOfValidity, false);
|
|
/*
|
|
$q->expired_days = $today->diffInDays($periodOfValidity, false) + $expired_date;
|
|
$q->expired_date = $weldingDate->addDays($expired_date)->format("Y-m-d");
|
|
*/
|
|
}
|
|
|
|
echo json_encode_tr($naks_welders);
|
|
?>
|