Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
sifaris /
app /
Helpers /
[ HOME SHELL ]
Name
Size
Permission
Action
Calendar.php
12.12
KB
-rw-rw-r--
ConfigHelper.php
617
B
-rw-rw-r--
Constant.php
446
B
-rw-rw-r--
DateHelper.php
15.22
KB
-rw-rw-r--
Helper.php
4.03
KB
-rw-rw-r--
NepaliDateHelper.php
19.86
KB
-rw-rw-r--
NepaliNumberHelper.php
5.15
KB
-rw-rw-r--
OTPHelper.php
2.34
KB
-rw-rw-r--
ProjectHelper.php
17.94
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : DateHelper.php
<?php use App\Helpers\NepaliDateHelper; use App\Models\FiscalYear; use Carbon\Carbon as Carbon; use function PHPUnit\Framework\isInstanceOf; if (!function_exists('today')) { //GET::CUURENT DATE WITHOUT TIME, THAT IS DATE PART ONLY function today($timezone = 'Kathmandu/Asia') { $now = Carbon::today($timezone); return $now; } } if (!function_exists('date')) { //GET::CUURENT DATE WITHOUT TIME, THAT IS DATE PART ONLY function date($timezone = null) { $now = Carbon::today($timezone); return $now; } } if (!function_exists('now')) { //GET::CUURENT DATE AND TIME function now($timezone = null) { $now = Carbon::now($timezone); return $now; } } if (!function_exists('nowKTM')) { //GET::CUURENT DATE AND TIME function nowKTM() { $now = Carbon::now("Asia/Kathmandu"); return $now; } } if (!function_exists('isNowExpired')) { function isNowExpired($start_date, $end_date, $timezone) { $now = now($timezone); // dd($start_date); $start_date_tz = Carbon::createFromFormat('Y-m-d H:i:s', $start_date, $timezone); $end_date_tz = Carbon::createFromFormat('Y-m-d H:i:s', $end_date, $timezone); if ($now >= $start_date_tz && $now <= $end_date_tz) return false; return true; } } if (!function_exists('ktm_isPastDate')) { function ktm_isPastDate($date, $format = "Y-m-d H:i:s") { $now = now(); $is_carbon = is_a($date, \Carbon\Carbon::class); if (!$is_carbon) $date = Carbon::createFromFormat($format, $date); if ($now < $date) return false; return true; } } if (!function_exists('ktm_isPastDateMinute')) { function ktm_isPastDateMinute($date, $format = "Y-m-d H:i:s") { $now = now(); $is_carbon = is_a($date, \Carbon\Carbon::class); if (!$is_carbon) $date = Carbon::createFromFormat($format, $date); $diff_in_min = $date->diffInMinutes($now, false); if ($diff_in_min <= 0) return false; return true; } } if (!function_exists('ktm_days')) { function ktm_days($from, $to = null) { if (!$to) $to = now(); $from_carbon = Carbon::createFromFormat('Y-m-d H:i:s', $from); $to_carbon = Carbon::createFromFormat('Y-m-d H:i:s', $to); $diff_in_days = $to_carbon->diffInDays($from_carbon, false); return $diff_in_days; } } if (!function_exists('ktm_months')) { function ktm_months($from, $to = null, $date_format = 'Y-m-d H:i:s') { // dd($date_format); if (!$to) $to_carbon = now(); else { $to_carbon = Carbon::createFromFormat($date_format, $to); } $from_carbon = Carbon::createFromFormat($date_format, $from); // dd($from_carbon); // dd($to_carbon); $diff_in_months = $to_carbon->diffInMonths($from_carbon, false); // dd($diff_in_months); return $diff_in_months; } } if (!function_exists('ktm_months_2')) { function ktm_months_2($from, $to = null, $from_date_format = 'Y-m-d H:i:s', $to_date_format = 'Y-m-d H:i:s') { // dd($from); // dd($from_date_format); if (!$to) $to_carbon = now(); else { $to_carbon = Carbon::createFromFormat($to_date_format, $to); } $from_carbon = Carbon::createFromFormat($from_date_format, $from); // dd($from_carbon); $diff_in_months = $to_carbon->diffInMonths($from_carbon, false); return $diff_in_months; } } if (!function_exists('ktm_years')) { function ktm_years($from, $to = null, $from_date_format = 'Y-m-d H:i:s', $to_date_format = 'Y-m-d H:i:s') { // dd($from); // dd($from_date_format); if (!$to) $to_carbon = now(); else { $to_carbon = Carbon::createFromFormat($to_date_format, $to); } $from_carbon = Carbon::createFromFormat($from_date_format, $from); // dd($from_carbon); $diff_in_years = $to_carbon->diffInYears($from_carbon, false); return $diff_in_years; } } if (!function_exists('ktm_diff_now')) { function ktm_diff_now($date, $type, $from_date = null, $from_format = 'Y-m-d H:i:s', $to_format = 'Y-m-d H:i:s') { if (!$from_date) $from_carbon = now(); else $from_carbon = Carbon::createFromFormat($from_format, $from_date); $to_carbon = Carbon::createFromFormat($to_format, $date); switch ($type) { case 'min': return $to_carbon->diffInMinutes($from_carbon, false); break; case 'sec': return $to_carbon->diffInSeconds($from_carbon, false); break; case 'hour': return $to_carbon->diffInHours($from_carbon, false); break; default: return -1; break; } } } if (!function_exists('dateFormat')) { function dateFormat($date, $format = 'Y-m-d h:i:s A', $timezone = null) { return Carbon::parse($date)->timezone($timezone)->format($format); } } if (!function_exists('dateFormatKTM')) { function dateFormatKTM($date, $format = 'Y-m-d h:i A', $timezone = 'Asia/Kathmandu') { if (!$date) return '-'; return Carbon::parse($date)->timezone($timezone)->format($format); } } if (!function_exists('dateOnlyPost')) { function dateOnlyPost($date) { return Carbon::parse($date)->format('F d, Y'); } } if (!function_exists('timeOnlyPost')) { function timeOnlyPost($date) { return Carbon::parse($date)->format('h:i A'); } } if (!function_exists('dateTimePost')) { function dateTimePost($date) { return Carbon::parse($date)->format('F d, Y h:i A'); } } if (!function_exists('dateTimeLocal')) { function dateTimeLocal($date) { $d = Carbon::parse($date); return str_replace(' ', 'T', $d); } } if (!function_exists('dateTimeEvent')) { function dateTimeEvent($start_date, $end_date = null) { if (!$end_date) { //l: Wednesday, D: Wed, d: 21, F: April, M: Apr $date = Carbon::parse($start_date)->format('D, M d, Y'); $time = Carbon::parse($start_date)->format('h:i A'); return $date . ' at ' . $time; } $first_date = Carbon::parse($start_date)->format('D, M d'); $first_time = Carbon::parse($start_date)->format('h:i A'); $second_date = Carbon::parse($end_date)->format('M d'); $second_time = Carbon::parse($end_date)->format('h:i A'); $begin = $first_date . ' at ' . $first_time; $end = $second_date . ', ' . $second_time; return $begin . ' - ' . $end; } } if (!function_exists('dateTimeEventBegin')) { function dateTimeEventBegin($start_date) { $first_date = Carbon::parse($start_date)->format('D, M d'); $first_time = Carbon::parse($start_date)->format('h:i A'); $begin = $first_date . ' at ' . $first_time; return $begin; } } if (!function_exists('dateTimeEventEnd')) { function dateTimeEventEnd($end_date) { $second_date = Carbon::parse($end_date)->format('M d'); $second_time = Carbon::parse($end_date)->format('h:i A'); $end = $second_date . ', ' . $second_time; return $end; } } if (!function_exists('dayOnly')) { function dayOnly($date) { return Carbon::parse($date)->format('d'); } } if (!function_exists('monthOnly')) { function monthOnly($date) { return Carbon::parse($date)->format('M'); } } if (!function_exists('getNepaliDate')) { //GET::ENGLISH TO NEPALI DATE CONVERTER function getNepaliDate($date, $seperator = '-') { try { $date = dateFormat($date, 'Y/m/d'); $query = \DB::table('date_conversion')->where('ad_date', $date) ->select('bs_date') ->first(); $result = str_replace('/', $seperator, $query->bs_date); return $result; } catch (\Throwable $e) { return response()->json($e->getMessage()); } } } if (!function_exists('getEnglishDate')) { //GET::NEPALI TO ENGLISH DATE CONVERTER function getEnglishDate($date, $seperator = '-') { try { $date = dateFormat($date, 'Y/m/d'); $query = \DB::table('date_conversion')->where('bs_date', $date) ->select('ad_date') ->first(); $result = str_replace('/', $seperator, $query->ad_date); return $result; } catch (\Throwable $e) { return response()->json($e->getMessage()); } } } if (!function_exists('createYearsAD')) { function createYearsAD($backYears) { $end_year = now()->year; $start_year = $end_year - $backYears; $arr = []; for ($i = $start_year; $i <= $end_year; $i++) { $arr[$i] = $i; } return array_reverse($arr, true); } } if (!function_exists('createYearsBS')) { function createYearsBS($backYears) { $helper = new NepaliDateHelper(); $end_year = $helper->getCurrentYearBS(); // dd($end_year); $start_year = $end_year - $backYears; // dd($end_year); $bs_years = $helper->getYearsLimit($start_year, $end_year); $bs_years = array_reverse($bs_years); $arr = []; foreach ($bs_years as $item) { $v = $item[0]; $arr[$v] = $v; } return $arr; } if (!function_exists('time_elapsed_string')) { function time_elapsed_string($datetime, $full = false, $locale = 'en') { $now = new DateTime; $ago = new DateTime($datetime); // dd($ago); $diff = $now->diff($ago); // dd($diff); // $diff->w = floor($diff->d / 7); // $diff->d -= $diff->w * 7; if ($locale === 'np') { $string = array( 'y' => 'वर्ष', 'm' => 'महिना', // 'w' => 'हप्ता', 'd' => 'दिन', 'h' => 'घण्टा', 'i' => 'मिनेट' ); } else { $string = array( 'y' => 'year', 'm' => 'month', // 'w' => 'week', 'd' => 'day', 'h' => 'hour', 'i' => 'minute' ); } foreach ($string as $k => &$v) { if ($diff->$k) { $plural = ''; if ($locale !== 'np') $plural = $diff->$k > 1 ? 's' : ''; $v = $diff->$k . ' ' . $v . $plural; } else { unset($string[$k]); } } if (!$full) $string = array_slice($string, 0, 1); //return $string ? implode(', ', $string) . ' ago' : 'just now'; return $string ? implode(', ', $string) . ($locale === 'np' ? ' पहिले' : ' ago') : ($locale === 'np' ? ' पहिले' : ' just now'); } } if (!function_exists('time_elapsed_string_new')) { function time_elapsed_string_new($datetime, $full = false, $locale = 'np') { $now = new DateTime; $ago = new DateTime($datetime); $diff = $now->diff($ago); // Formulate the Difference between two dates // $diff = abs($$now - $ago); // To get the year divide the resultant date into // total seconds in a year (365*60*60*24) $years = floor($diff / (365 * 60 * 60 * 24)); // To get the month, subtract it with years and // divide the resultant date into // total seconds in a month (30*60*60*24) $months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24)); // To get the day, subtract it with years and // months and divide the resultant date into // total seconds in a days (60*60*24) $days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24)); // To get the hour, subtract it with years, // months & seconds and divide the resultant // date into total seconds in a hours (60*60) $hours = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24) / (60 * 60)); // To get the minutes, subtract it with years, // months, seconds and hours and divide the // resultant date into total seconds i.e. 60 $minutes = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24 - $hours * 60 * 60) / 60); // To get the minutes, subtract it with years, // months, seconds, hours and minutes $seconds = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24 - $hours * 60 * 60 - $minutes * 60)); $str = []; if ($years > 0) $str['y'] = $years; if ($months > 0) $str['m'] = $months; if ($days > 0) $str['d'] = $days; if ($hours > 0) $str['h'] = $hours; if ($minutes > 0) $str['i'] = $minutes; if ($seconds > 0) $str['m'] = $seconds; dd($str); } } if (!function_exists('getBSMonth')) { function getBSMonth($bsDate) { $helper = new NepaliDateHelper(); $parts = $helper->getNepaliDateParts($bsDate); return $parts[1]; } } if (!function_exists('bsDate')) { function bsDate($englishDate = null) { $helper = new NepaliDateHelper(); $parts = $helper->getEnglishDateParts($englishDate ?? now()); $date = $helper->eng_to_nep($parts[0], $parts[1], $parts[2]); return $date['year'] . '-' . str_pad($date['month'], 2, '0', STR_PAD_LEFT) . '-' . str_pad($date['date'], 2, '0', STR_PAD_LEFT); } } if (!function_exists('bsMonth')) { function bsMonth($englishDate = null) { $helper = new NepaliDateHelper(); $parts = $helper->getEnglishDateParts($englishDate ?? now()); $date = $helper->eng_to_nep($parts[0], $parts[1], $parts[2]); return $date['year'] . '-' . str_pad($date['month'], 2, '0', STR_PAD_LEFT) . '-' . str_pad($date['date'], 2, '0', STR_PAD_LEFT); } } if (!function_exists('adDate')) { function adDate($nepaliDate = null) { $helper = new NepaliDateHelper(); $date = $helper->nep_to_eng($nepaliDate ? $nepaliDate : bsDate()); return $date; } } if (!function_exists('dayAdd')) { function dayAdd($date, $no_of_days) { $date = Carbon::parse($date)->addDays($no_of_days); return $date; } } }
Close