my-idlers/app/Process.php
cp6 bb901ca703 Removed old YABS add/store method & functions
Removed old YABS store method & functions
2022-09-22 12:24:47 +10:00

48 lines
1.0 KiB
PHP

<?php
namespace App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Storage;
class Process
{
public string $start_time;
public string $end_time;
public function startTimer(): void
{
$this->start_time = microtime(true);
}
public function stopTimer(): void
{
$this->end_time = microtime(true);
}
public function getTimeTaken(): float
{//In seconds
return ($this->end_time - $this->start_time) * 100;
}
public static function paymentTermIntToString(int $term): string
{
if ($term === 1) {
return "p/m";
} elseif ($term === 2) {
return "p/qtr";
} elseif ($term === 3) {
return "p/hy";
} elseif ($term === 4) {
return "p/y";
} elseif ($term === 5) {
return "p/2y";
} elseif ($term === 6) {
return "p/3y";
} else {
return "unknown";
}
}
}