UPDATE 1405-01-29

This commit is contained in:
moTech
2026-04-18 06:17:01 +00:00
parent 107fe6f4d3
commit 4b2e1e296a
5 changed files with 62 additions and 50 deletions
@@ -219,9 +219,10 @@ class AttendanceController extends Controller
if (!empty($user)) {
setcookie('user_identity', $user->user_name ?? $user->id, time() + (60 * 60 * 24 * 365 * 5), "/");
$admin = $user->is_admin == 1 ? true : false;
if ($admin) {
if ($user->is_admin == 1) {
setcookie('ad', '1', time() + (60 * 60 * 24 * 365 * 5), "/");
}elseif ($user->is_admin == 2){
setcookie('ad', '2', time() + (60 * 60 * 24 * 365 * 5), "/");
}
return redirect(url(''))->with([
@@ -229,7 +230,7 @@ class AttendanceController extends Controller
'color' => '#00c300ff',
'text' => 'ورود موفق'
],
'admin' => $admin,
'admin' => $user->is_admin,
]);
}
@@ -687,7 +688,7 @@ function send_tel($user, $data, $status)
$message = "{$user} درخواست {$data} ثبت کرد.";
}
$admins = User::where('is_admin', '1')->whereNotNull('chatid')->select('chatid', 'bale', 'user_name')->get();
$admins = User::whereIn('is_admin', [1,2])->whereNotNull('chatid')->select('chatid', 'bale', 'user_name')->get();
if ($_COOKIE['user_identity'] !== 'test') {
foreach ($admins as $admin) {
if (!$admin->bale) {continue;}