KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /var/www/navinclasses.studylms.in/app/Helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/navinclasses.studylms.in/app/Helpers/_Frontend.php
<?php

namespace App\Helpers;

use Illuminate\Support\Facades\DB;
use App\Models\Otpsession;
use Request;
// use App\Models\LogActivity as LogActivityModel;    
use carbon\carbon;
use Postal;


class Frontend
{

  public static function sendMailPostal($to, $subject, $html)
  {
    $client = new Postal\Client('https://mail.balancepost.in', 's5oRiiMdeMP34tsrZnADh5Qe');
    // Create a new message
    $message = new Postal\SendMessage($client);

    // Add some recipients
    $message->to($to);
    //$message->to('mail@globalexcell.co.in');
    //$message->cc('abhishek@globalexcell.co.in');
    //$message->bcc('secret@awesomeapp.com');

    // Specify who the message should be from. This must be from a verified domain
    // on your mail server.
    $message->from('info@navinclasses.com');

    // Set the subject
    $message->subject($subject);

    // Set the content for the e-mail
    //$message->plainBody('Hello world!');
    $message->htmlBody($html);

    // Add any custom headers
    //$message->header('X-PHP-Test', 'value');

    // Attach any files
    //$message->attach('textmessage.txt', 'text/plain', 'Hello world!');

    // Send the message and get the result
    $result = $message->send();

    return $result;
  }


  public static function getProductPrice($product_id, $mode)
  {

    $prices = DB::table('prices')
      ->where('product_id', $product_id)
      ->where('mode', $mode)
      ->first();



    return $prices;

    // return "hello";

  }


  public static function getGlobalSetting()
  {

    $global_settings = DB::table('global_settings')->first();



    return $global_settings;

    // return "hello";

  }


  public static function getTeacher($teacher_id)
  {

    $teacher = DB::table('admin_users')
      ->where('id', $teacher_id)
      ->first();

    return $teacher;
  }

  public static function getTotalProduct($admin_id = 2)
  {

    $products = DB::table('products as P')
      ->join('main_categories as MC', 'MC.id', '=', 'P.cat_id')
      ->where(['P.admin_id' => $admin_id, 'P.status' => '1'])
      ->select('P.*', 'MC.name as category')
      ->orderBy('sort_order', 'ASC')
      ->get()->count();

    return $products;
  }

  public static function getChapter($product_id)
  {

    $catetories = DB::table('categories')->where(['product_id' => $product_id])->get();

    return $catetories;
  }
}

Anon7 - 2021