[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: PlanController.php
<?php namespace App\Http\Controllers; use Illuminate\Support\Facades\Auth; use Illuminate\Http\Request; use App\Models\Shop; use App\Models\Income; use App\Models\Package; use App\Models\Method; use shurjopayv2\ShurjopayLaravelPackage8\Http\Controllers\ShurjopayController; use Brian2694\Toastr\Facades\Toastr; use Yajra\DataTables\DataTables; class PlanController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); } public function history(Request $request) { if ($request->ajax()) { $data = Income::select('*')->where('shop_id', Auth::user()->shop_id); return Datatables::of($data) ->addIndexColumn() ->addColumn('package', function($row){ $data = Package::where('id', $row->package_id)->first(); if($data != null){ return $data->name; } }) ->addColumn('stats', function($row){ if($row->status == 1){ return '<span class="badge bg-success">Approved</span>'; } else { return '<span class="badge bg-info">Pending</span>'; } }) ->addColumn('method', function($row){ return Method::where('id', $row->method_id)->first()->name; }) ->rawColumns(['stats']) ->addIndexColumn() ->make(true); } return view('plan.history'); } public function renew(Request $request) { $plan = Package::where('trial', '!=', 1)->get(); if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; } $oid = 'AYA'.uniqid(); $oprice = Package::find($request->package_id); if ($request->isMethod('post')) { $amt = ($oprice->price*$request->duration); if(Auth::user()->shop->status != 1){ $amt += $request->setup_fee; } $income = new Income(); $income->duration = $request->duration; $income->date = date('Y-m-d'); $income->method_id = 6; $income->user_id = Auth::user()->id; $income->package_id = $request->package_id; $income->shop_id = Auth::user()->shop_id; $income->amount = $amt; if($income->save()){ $info = array( 'prefix' => "AYA",'currency' => "BDT", 'amount' => $amt, 'order_id' => $oid, 'discsount_amount' => 0, 'disc_percent' => 0, 'client_ip' => $ip, 'customer_name' => Auth::user()->name, 'customer_phone' => Auth::user()->shop->phone, 'email' => Auth::user()->email, 'customer_address' => Auth::user()->shop->address, 'customer_city' => "Dhaka", 'customer_state' => "Dhaka", 'customer_country' => "Bangladesh", ); $shurjopay_service = new ShurjopayController(); return $shurjopay_service->checkout($info); } } return view('plan.add', compact('plan')); } public function index(Request $request) { $plan = Shop::where('id', Auth::user()->shop_id)->first(); return view('plan.list', compact('plan')); } }
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