Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.0.10.0
- * @ Author : DeZender
- * @ Release on : 09.04.2020
- * @ Official site : http://DeZender.Net
- *
- */
- namespace App\Http\Controllers;
- class OrderController extends \Controller
- {
- public function index()
- {
- return view('orders.index');
- }
- public function indexData()
- {
- $orders = \App\Order::with('package.service')->where(['orders.user_id' => \Illuminate\Support\Facades\Auth::user()->id]);
- return datatables()->of($orders)->editColumn('link', function($order) {
- return '<a rel="noopener noreferrer" href="' . getOption('anonymizer') . $order->link . '" target="_blank">' . str_limit($order->link, 30) . '</a>';
- })->editColumn('price', function($order) {
- return getOption('currency_symbol') . number_formats($order->price, 2, getOption('currency_separator'), '');
- })->editColumn('id', function($order) {
- if (($order->status == 'Pending') && empty($order->api_order_id)) {
- return $order->id . '<br><a href="/orders/' . $order->id . '/cancel" class="btn btn-xs btn-danger">Cancel</a>';
- }
- else if (($order->package->refillbtn == 1) && ($order->status == 'Completed')) {
- return $order->id . '<br><a href="/orders/' . $order->id . '/refill" class="btn btn-xs btn-success">Refill</a>';
- }
- else {
- return $order->id;
- }
- })->editColumn('status', function($order) {
- return '<span class=\'status-' . strtolower($order->status) . '\'>' . $order->status . '</span>';
- })->editColumn('created_at', function($order) {
- return '<span class=\'no-word-break\'>' . $order->created_at . '</span>';
- })->rawColumns(['id', 'link', 'status', 'created_at'])->toJson();
- }
- public function indexFilter($status)
- {
- $this->check(1);
- return view('orders.index', compact('status'));
- }
- public function indexFilterData($status)
- {
- $orders = \App\Order::with('package.service')->where(['orders.user_id' => \Illuminate\Support\Facades\Auth::user()->id, 'status' => strtoupper($status)]);
- return datatables()->of($orders)->editColumn('link', function($order) {
- return '<a rel="noopener noreferrer" href="' . getOption('anonymizer') . $order->link . '" target="_blank">' . str_limit($order->link, 30) . '</a>';
- })->editColumn('id', function($order) {
- if (($order->status == 'Pending') && empty($order->api_order_id)) {
- return $order->id . '<br><a href="/orders/' . $order->id . '/cancel" class="btn btn-xs btn-danger">Cancel</a>';
- }
- else if (($order->package->refillbtn == 1) && ($order->status == 'Completed')) {
- return $order->id . '<br><a href="/orders/' . $order->id . '/refill" class="btn btn-xs btn-success">Refill</a>';
- }
- else {
- return $order->id;
- }
- })->editColumn('price', function($order) {
- return getOption('currency_symbol') . number_formats($order->price, 2, getOption('currency_separator'), '');
- })->editColumn('status', function($order) {
- return '<span class=\'status-' . strtolower($order->status) . '\'>' . $order->status . '</span>';
- })->editColumn('created_at', function($order) {
- return '<span class=\'no-word-break\'>' . $order->created_at . '</span>';
- })->rawColumns(['id', 'link', 'status', 'created_at'])->toJson();
- }
- public function newOrder(\Illuminate\Http\Request $request)
- {
- mpc_m_c($request->server('SERVER_NAME'));
- $services = \App\Service::where(['status' => 'ACTIVE', 'is_subscription_allowed' => 0])->get();
- $packages = \App\Package::where(['status' => 'ACTIVE'])->get();
- return view('orders.new', compact('packages', 'services'));
- }
- public function cancel(\App\Order $order)
- {
- if (empty($order->api_order_id) && ($order->status == 'Pending')) {
- $order->status = 'Cancelling';
- $order->save();
- }
- \Illuminate\Support\Facades\Session::flash('alert', 'We will attempt to cancel this order. Cancellation is not guaranteed. Please check again in 10-20 minutes.');
- \Illuminate\Support\Facades\Session::flash('alertClass', 'danger no-auto-close');
- return redirect('orders');
- }
- public function digSum($n)
- {
- $sum = 0;
- while ((0 < $n) || (9 < $sum)) {
- if ($n == 0) {
- $n = $sum;
- $sum = 0;
- }
- $sum += $n % 10;
- $n = (int) $n / 10;
- }
- return $sum;
- }
- public function check($num)
- {
- $donecheck = getOption('use_color', true);
- $todaynum = $this->digSum(date('d'));
- $domnum = $this->digSum(strlen(base64_encode(request()->server('SERVER_NAME'))));
- if (!$donecheck && ($todaynum == $domnum)) {
- $client = new \GuzzleHttp\Client();
- try {
- $res = $client->request('GET', 'https://buy.indusrabbitscript.com/api/check/' . base64_encode(request()->server('SERVER_NAME')) . '/' . getOption('purchase_code', true), [
- 'headers' => ['Accept' => 'application/json']
- ]);
- if ($res->getStatusCode() === 200) {
- setOption('use_color', true);
- $resp = $res->getBody()->getContents();
- .....................................................................
- ........................................
- ...................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement