56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
<?php
|
|
|
|
if (!function_exists('pre')) {
|
|
function pre($data)
|
|
{
|
|
echo "<pre>";
|
|
print_r($data);
|
|
echo "</pre>";
|
|
}
|
|
}
|
|
|
|
if (!function_exists('getHashedPassword')) {
|
|
function getHashedPassword($plainPassword)
|
|
{
|
|
return password_hash($plainPassword, PASSWORD_DEFAULT);
|
|
}
|
|
}
|
|
|
|
if (!function_exists('verifyHashedPassword')) {
|
|
function verifyHashedPassword($plainPassword, $hashedPassword)
|
|
{
|
|
return password_verify($plainPassword, $hashedPassword) ? true : false;
|
|
}
|
|
}
|
|
|
|
if (!function_exists('get_fav')) {
|
|
function get_fav($user)
|
|
{
|
|
$db = db_connect();
|
|
$user = (int)$user;
|
|
$query = $db->table('t_fav_add')->where('Created_BY', $user)->where('Status', 1)->get();
|
|
return $query->getResult();
|
|
}
|
|
}
|
|
|
|
if (!function_exists('reOrderListing')) {
|
|
function reOrderListing()
|
|
{
|
|
$db = db_connect();
|
|
$subQuery = 'SELECT * FROM t_materialmaster WHERE Current_stock < reorder?';
|
|
$query = $db->query($subQuery);
|
|
return $query->getResult();
|
|
}
|
|
}
|
|
|
|
if (!function_exists('generateCopyrightNotice')) {
|
|
function generateCopyrightNotice()
|
|
{
|
|
$current_year = date('Y');
|
|
if ($current_year > 2024) {
|
|
return " Copyright © 2024 - $current_year ";
|
|
} else {
|
|
return " Copyright © $current_year ";
|
|
}
|
|
}
|
|
} |