<?php
/*----------------------------------------------------------------------------------|  www.vdm.io  |----/
				Lmskaran 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.77
	@build			6th April, 2022
	@created		22nd July, 2020
	@package		Moojla
	@subpackage		default_singlesection.php
	@author			Lmskaran <http://Lmskaran.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____  _____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \(  _  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/ )(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__)  (_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

?>

<!--[JCBGUI.template.template.10.$$$$]-->
<div class="uk-container uk-container-center lmskaran_course_tab">
  <div>
    <div class="lmskaran_summary_course">
      <?php //echo $this->course->summary; ?>
    </div>
    <div class="lmskaran-file-course">
      <div class="single-section">
        <?php
        $module_value = $this->course->sections[0]->modules[0];
        $downloadurl = '#';
        $hasfile = false;
        if($module_value->availableflag == 0 && !empty($module_value->content))
        {
          if(property_exists($module_value->content[0], 'mimetype'))
          {
            $mimetype = substr($module_value->content[0]->mimetype, 0, 5);
            $downloadurl = $module_value->content[0]->fileurl;
            if($mimetype == 'video' && $this->course->videodownload == 1)
            {
              $downloadurl = '#';
              // $module_value->availableflag = 1;
              $module_value->availableclass = 'availablity-enroled-notvisible';
            }
            if($mimetype == 'audio' && $this->course->audiodownload == 1)
            {
              $downloadurl = '#';
              // $module_value->availableflag = 1;
              $module_value->availableclass = 'availablity-enroled-notvisible';
            }
            $hasfile = true;
          }
        }
        ?>
        <h3><?php echo $module_value->name ?></h3>
        <!-- <p>برای ورود به آزمون ابتدا داخل سایت <span><a href="#">ثبت نام کنید</a></span> و سپس بر روی <span>دکمه زیر کلیک کنید</span>.</p> -->
        <?php if(property_exists($this->course->sections[0], 'availableflag')):?>
          <?php if($this->course->sections[0]->availableflag == 0):?>
            <?php echo '';?>
          <?php elseif($this->course->sections[0]->availableflag == 1):?>
          	<?php echo property_exists($section_value, 'availabilityinfo')? $section_value->availabilityinfo : ''; ?>
          <?php elseif($this->course->sections[0]->availableflag == 2):?>
          	<?php echo JText::_('COM_MOOJLA_ENROLMENT_REQUIRED')?>
          <?php elseif($this->course->sections[0]->availableflag == 3):?>
          	<?php echo JText::_('COM_MOOJLA_ENROLMENT_REQUIRED') . '<br>';
  			echo property_exists($section_value, 'availabilityinfo')? $section_value->availabilityinfo : ''; ?>
          <?php endif;?>
        <?php endif;?>
        <?php if(isset($module_value->content[0]) && $module_value->content[0]->fileurl && $hasfile):?>
          <div class="lmskaran-download-course <?php echo $module_value->availableclass; ?>"><a href="<?php echo $downloadurl;?>"><i class="fas fa-download"></i></a>
          </div>
        <?php endif;?>
      </div>
    </div>	
  </div>
</div><!--[/JCBGUI$$$$]-->

