HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/heifetz/heifetz-app/models/LogsHelper.php
<?php

namespace Models;



class LogsHelper
{

    /**
     * Возвращает строку с выделением цветом и стралочкой между тем что было и что стало.
     *
     * @param mixed $from
     * @param mixed $to
     * @param bool $useZero Надо ли учитывать что значение может быть нулём
     *
     * @return string
     */
    public static function generateFromToString($from, $to, $useZero = false)
    {
        if ($useZero) {
            $from = is_null($from) ? Lang::__('not specified') : $from;
            $to = is_null($to) ? Lang::__('not specified') : $to;
        } else {
            $from = empty($from) ? Lang::__('not specified') : $from;
            $to = empty($to) ? Lang::__('not specified') : $to;
        }

        return '<span class="text-danger">' . $from . '</span> <i class="icon-arrow-right13"></i> <span class="text-success">' . $to . '</span>';
    }

    /**
     * Преобразует булевы значения к строке.
     *
     * @param $value
     *
     * @return string
     */
    public static function checkBoxToSting($value)
    {
        return $value ? '✔' : '✗';
    }

    public static function dateToString($date)
    {
        $string = '';
        if (empty($date)) {
            $string .= Lang::__('not specified');
        } else {
            $string .= date('d.m.Y', strtotime($date));
        }

        return $string;
    }

}