CasperSecurity

Current Path : /var/www/finance.uiet.co.in/UietFinance/app/Imports/
Upload File :
Current File : /var/www/finance.uiet.co.in/UietFinance/app/Imports/SalaryCalculationImport.php

<?php

namespace App\Imports;

use App\Models\SalaryCalculation;
use App\Models\EmployeeRegistration;
use App\Models\PayrollItems;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Carbon\Carbon;

class SalaryCalculationImport implements ToModel,WithHeadingRow
{
    /**
    * @param array $row
    *
    * @return \Illuminate\Database\Eloquent\Model|null
    */
    public function model(array $row)
    {

        //dd($row);
        $empid=$row['employee_id'];

        $empreginfo=EmployeeRegistration::where('employee_id',$empid)->latest()->first();

        $id=$empreginfo->id;
        $month=$row['month'];
        $year=$row['year'];



        $components=array_slice($row, 4);





        if(sizeof($components)>0){
            $check=SalaryCalculation::where('employee_id',$id)->where('month',$month)->where('year',$year)->get();
            if(sizeof($check)>0){

            }
            else{
                foreach($components as $key=> $component){
                   // dd($component);
                    $empsalary= SalaryCalculation::create([
                        'employee_id' => $empreginfo->id,
                        'month' => $month,
                        'year' => $year,
                        'payroll_item_name' => $key,
                        'amount' => $component
                    ]);
                }


            }
        }


    }
}
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY