Sindbad~EG File Manager

Current Path : /home/numerotech/public_html/livemt2023.aios-scientificcommittee.org/app/models/
Upload File :
Current File : //home/numerotech/public_html/livemt2023.aios-scientificcommittee.org/app/models/DateConfig.php

<?php


class DateConfig extends Eloquent {

	protected $primaryKey = 'date_config_id';
	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'date_config';

  public Static function getDateConfig($abs)
  {
      try
      {
         $dt =  DateConfig::where('abstract',$abs)->first();

         return $dt;

      } catch (Exception $e)
      {
          Log::error('Models: DateConfig  -> getDateConfig '.$e->getMessage());
          return false;
      }
  }

	public Static function IsDateOpen1($abs)
    {
        try
        {
           $dt =  DateConfig::where('abstract',$abs)->first();

           if(date('Y-m-d H:i:s', strtotime($dt->start_date)) <= date('Y-m-d H:i:s') &&  date('Y-m-d H:i:s', strtotime($dt->end_date)) >= date('Y-m-d H:i:s') )
           {
           		return true;
           }
           else
           {
           		return false;
           }

        } catch (Exception $e)
        {
            Log::error('Models: DateConfig  -> IsDateOpen '.$e->getMessage());
            return false;
        }
    }

public Static function IsDateOpen($abs)
    {
        try
        {

           $user_id = CustomClass::getUserId();
           $is_custom = false;

           //Check User is custom date config 
           $dt_custom =  DateConfig::where('abstract',$abs.'CUSTOM')->where('user_id',$user_id)->first();
           if($dt_custom !=null)
           {
             if(date('Y-m-d H:i:s', strtotime($dt_custom->start_date)) <= date('Y-m-d H:i:s') &&  date('Y-m-d H:i:s', strtotime($dt_custom->end_date)) >= date('Y-m-d H:i:s') )
             {
                $is_custom = true;
             } 
           }           

           //is custom is false then check without custom 
           if(!$is_custom)
           {
             $dt =  DateConfig::where('abstract',$abs)->first();

             if(date('Y-m-d H:i:s', strtotime($dt->start_date)) <= date('Y-m-d H:i:s') &&  date('Y-m-d H:i:s', strtotime($dt->end_date)) >= date('Y-m-d H:i:s') )
             {
                return true;
             }
             else
             {
                return false;
             }
           }
           else
           {
            return true;
           }

        } catch (Exception $e)
        {
            Log::error('Models: DateConfig  -> IsDateOpen '.$e->getMessage());
            return false;
        }
    }


    public Static function GetBetweenDates($abs)
    {
      $days = [];
        try
        {
           $dt =  DateConfig::where('abstract',$abs)->first();

           $days= Helper::betweenDates($dt->start_date,$dt->end_date);

         

        } catch (Exception $e)
        {
            Log::error('Models: DateConfig  -> GetDates '.$e->getMessage());            
        }
          return $days;
    }
       
	
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists