Ejemplo n.º 1
0
<?php

/*------------------------------------------------------------------------
# com_guru
# ------------------------------------------------------------------------
# author    iJoomla
# copyright Copyright (C) 2013 ijoomla.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.ijoomla.com
# Technical Support:  Forum - http://www.ijoomla.com.com/forum/index/
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access');
$k = 0;
$guruModelguruProgram = new guruModelguruProgram();
// --------------------------- unload ijseo_plugin
jimport('joomla.plugin.helper');
class iJoomlaPlugin extends JPluginHelper
{
    function unloadFromPlugin($type, $name)
    {
        $plugins = JPluginHelper::getPlugin("content");
        $plugins = JPluginHelper::$plugins;
        if (isset($plugins) && count($plugins) > 0) {
            foreach ($plugins as $key => $value) {
                if ($value->name == $name && $value->type == $type) {
                    unset($plugins[$key]);
                    JPluginHelper::$plugins = $plugins;
                    break;
                }
            }
        }
Ejemplo n.º 2
0
 function find_link_text_for_day_resume_button($day_array, $task_array, $status)
 {
     //$day_array = $status_line->days;
     $day_array = explode(';', $day_array);
     $how_many_days = count($day_array) - 1;
     $day_id_to_get_started_array = explode(',', $day_array[0]);
     //$task_array = $status_line->tasks;
     $task_array = explode(';', $task_array);
     $task_id_array = explode('-', $task_array[0]);
     $task_id_to_get_started_array = explode(',', $task_id_array[0]);
     // we find the id for the first day who isn't completed
     if ($status == '1') {
         $first_day_uncompleted = guruModelguruProgram::find_id_for_first_uncompleted_day($day_array);
         $first_day_uncompleted = explode(',', $first_day_uncompleted);
         $id_for_first_day_uncompleted = $first_day_uncompleted[0];
         $ordering_for_first_day_uncompleted = $first_day_uncompleted[1];
         $first_task_uncompleted = guruModelguruProgram::find_id_for_first_uncompleted_task(explode('-', $task_array[$ordering_for_first_day_uncompleted - 1]));
         $first_task_uncompleted = explode(',', $first_task_uncompleted);
         $id_for_first_task_uncompleted = $first_task_uncompleted[0];
         $ordering_for_first_task_uncompleted = $first_task_uncompleted[1];
     }
     if ($status == '0' && isset($task_id_to_get_started_array[0]) && $task_id_to_get_started_array[0] > 0 && isset($day_id_to_get_started_array[0]) && $day_id_to_get_started_array[0] > 0) {
         $link_for_resume = 'index.php?option=com_guru&view=guruTasks&task=view&cid=1&pid=' . $day_id_to_get_started_array[0];
         $text_for_resume = JText::_('GURU_MYPROGRAMS_ACTION_GETSTARTED');
     }
     if ($status == '1' && isset($id_for_first_task_uncompleted) && $id_for_first_task_uncompleted > 0 && isset($id_for_first_day_uncompleted) && $id_for_first_day_uncompleted > 0) {
         $link_for_resume = 'index.php?option=com_guru&view=guruTasks&task=view&cid=' . $ordering_for_first_task_uncompleted . '&pid=' . $id_for_first_day_uncompleted;
         $text_for_resume = JText::_('GURU_DAYS_RESUME_BUTTON');
     }
     if ($status == '2' && isset($task_id_to_get_started_array[0]) && $task_id_to_get_started_array[0] > 0 && isset($day_id_to_get_started_array[0]) && $day_id_to_get_started_array[0] > 0) {
         $link_for_resume = 'index.php?option=com_guru&view=guruTasks&task=view&cid=1&pid=' . $day_id_to_get_started_array[0] . '&s=0';
         $text_for_resume = JText::_('GURU_MYPROGRAMS_ACTION_STARTAGAIN');
     }
     if ($status == '-1') {
         $the_day_id = $day_id_to_get_started_array[0];
         $db = JFactory::getDBO();
         $sql = "SELECT pid FROM #__guru_days \r\n\t\t\t\tWHERE id = " . $the_day_id;
         $db->setQuery($sql);
         $result = $db->loadResult();
         $link_for_resume = 'index.php?option=com_guru&view=guruProfile&task=buy&cid=' . $result;
         $text_for_resume = JText::_('GURU_MYPROGRAMS_ACTION_BUYAGAIN');
     }
     return $link_for_resume . '$$$$$' . $text_for_resume;
 }
Ejemplo n.º 3
0
 $day_array = explode(';', $day_array);
 $how_many_days = count($day_array) - 1;
 $day_id_to_get_started_array = explode(',', $day_array[0]);
 //if($s=='0') $p_days = JText::_('GURU_PROGRAM_DETAILS_DAY').' 0 '.JText::_('GURU_MYPROGRAMS_DAYS_OF').' '.$how_many_days;
 $task_array = $prog->tasks;
 $task_array = explode(';', $task_array);
 $task_id_array = explode('-', $task_array[0]);
 $task_id_to_get_started_array = explode(',', $task_id_array[0]);
 // we find the id for the first day who isn't completed
 if ($s == '1') {
     $first_day_uncompleted = guruModelguruProgram::find_id_for_first_uncompleted_day($day_array);
     $first_day_uncompleted = explode(',', $first_day_uncompleted);
     $id_for_first_day_uncompleted = $first_day_uncompleted[0];
     $ordering_for_first_day_uncompleted = $first_day_uncompleted[1];
     $p_days = JText::_('GURU_PROGRAM_DETAILS_DAY') . ' ' . $ordering_for_first_day_uncompleted . ' ' . JText::_('GURU_MYPROGRAMS_DAYS_OF') . ' ' . $how_many_days;
     $first_task_uncompleted = guruModelguruProgram::find_id_for_first_uncompleted_task(explode('-', $task_array[$ordering_for_first_day_uncompleted - 1]));
     $first_task_uncompleted = explode(',', $first_task_uncompleted);
     $id_for_first_task_uncompleted = $first_task_uncompleted[0];
     $ordering_for_first_task_uncompleted = $first_task_uncompleted[1];
     $how_many_tasks = count(explode('-', $task_array[$ordering_for_first_day_uncompleted - 1])) - 1;
     $p_tasks = JText::_('GURU_DAYS_TASK') . ' ' . $ordering_for_first_task_uncompleted . ' ' . JText::_('GURU_MYPROGRAMS_DAYS_OF') . ' ' . $how_many_tasks;
     $p_start_date = date($config[0]->datetype, strtotime($prog->startdate));
 }
 if ($s == '2') {
     $p_days = JText::_('GURU_MYPROGRAMS_COMPLETED');
     $p_tasks = JText::_('GURU_MYPROGRAMS_COMPLETED');
     $p_start_date = date($config[0]->datetype, strtotime($prog->startdate));
     $p_end_date = date($config[0]->datetype, strtotime($prog->enddate));
     //$p_start_date = $prog->startdate;
     //$p_end_date = $prog->enddate;
 }
Ejemplo n.º 4
0
                                                    	<input type="hidden" name="option" value="com_guru" />
                                                        <input type="hidden" name="pid" value="<?php 
    echo $step->pid;
    ?>
" />
                                                        <input type="hidden" name="task" value="quizz_fe_submit" />
                                                        <input type="hidden" id="autosubmit" name="autosubmit" value="0" />
                                                    </form>                                              
                                            	</div><!-- end quizz/final exam content -->                                      
                                       		</div><!--end g_cell-->
                                        </div><!--end g_row-->
                                   </div><!-- end  quizz div with form  -->
                                </div><!-- end quizz/final exam layout -->
                                <?php 
}
$coursetype_details = guruModelguruProgram::getCourseTypeDetails($step->pid);
$sql = "SELECT step_access_courses  FROM `#__guru_program` where id = " . intval($step->pid);
$db->setQuery($sql);
$db->query();
$step_access_coursesjump = $db->loadResult();
$sql = "SELECT chb_free_courses  FROM `#__guru_program` where id = " . intval($step->pid);
$db->setQuery($sql);
$db->query();
$chb_free_coursesjump = $db->loadResult();
if ($chb_free_coursesjump == 1 && $step_access_coursesjump == 2) {
    $accessJumpB = 1;
}
?>
   
                                <?php 
if (count($step->layout_jump) > 0) {
Ejemplo n.º 5
0
Archivo: tabs.php Proyecto: JozefAB/qk
function tab3($program, $config)
{
    $k = 0;
    $prices = guruModelguruProgram::getPrices($program->id);
    $chb_free_courses = $program->chb_free_courses;
    $step_access_courses = $program->step_access_courses;
    $selected_course = $program->selected_course;
    if ($chb_free_courses == 1) {
        if ($step_access_courses == "2") {
            echo JText::_("GURU_FREE_GUESTS");
        } elseif ($step_access_courses == "1") {
            echo JText::_("GURU_FREE_MEMBERS");
        } elseif ($step_access_courses == "0") {
            if (trim($selected_course) == "" || trim($selected_course) == "-1") {
                echo JText::_("GURU_FREE_ALL_STUDENTS");
            } else {
                $courses = explode("|", $selected_course);
                if (isset($courses) && count($courses) > 0) {
                    foreach ($courses as $key => $value) {
                        if (intval($value) == 0) {
                            unset($courses[$key]);
                        }
                    }
                }
                if (count($courses) == 0) {
                    $courses = array("0");
                }
                $db = JFactory::getDBO();
                $sql = "select `name` from #__guru_program where `id` in (" . implode(", ", $courses) . ")";
                $db->setQuery($sql);
                $db->query();
                $names = $db->loadColumn();
                echo JText::_("GURU_FREE_STUDENTS_SOME_COURSES") . ' "' . implode('", "', $names) . '"';
            }
        }
    } elseif (isset($prices) && $prices != NULL) {
        ?>
   <div class="clearfix">
    <div class="g_table_wrap"> 
        <table class="table table-striped">
             <tr class="g_table_header">
                <th class="g_cell_1"><?php 
        echo JText::_("GURU_SUBS_PLAN_NAME");
        ?>
</th>
                <th class="g_cell_2"><?php 
        echo JText::_("GURU_PROGRAM_DETAILS_PRICE");
        ?>
</th>
            </tr>
    <?php 
        foreach ($prices as $key => $value) {
            $class = "odd";
            if ($k % 2 != 0) {
                $class = "even";
            }
            if (trim($value["name"]) != "" || trim($value["price"]) != "") {
                ?>
                    <tr class="<?php 
                echo $class;
                ?>
"> 
                        <td class="g_cell_1"><b><?php 
                echo $value["name"];
                ?>
:</b></td>
                        <td  class="g_cell_2">
                            <?php 
                $currency = $config->currency;
                $currencypos = $config->currencypos;
                if ($currencypos == 0) {
                    echo JText::_("GURU_CURRENCY_" . $currency) . " " . $value["price"];
                } else {
                    echo $value["price"] . " " . JText::_("GURU_CURRENCY_" . $currency);
                }
                ?>
                        </td>
                    </tr>
            <?php 
            }
            $k++;
        }
        ?>
        </table>
      </div>
    </div>    
    <?php 
    }
}
Ejemplo n.º 6
0
Archivo: view.php Proyecto: JozefAB/qk
    }
    $all_title = implode(", ", $all_title);
}
$sql = "select certificate_term from #__guru_program  where id = " . intval($program->id);
$db->setQuery($sql);
$db->query();
$certificate_term = $db->loadResult();
$sql = "select avg_certc from #__guru_program where id = " . intval($program->id);
$db->setQuery($sql);
$db->query();
$avg_cert = $db->loadResult();
$sql = "SELECT max_score FROM #__guru_quiz WHERE is_final= 1 LIMIT 1";
$db->setQuery($sql);
$result_maxs = $db->loadResult();
if ($config->display_media == 1) {
    $guruModelguruProgram = new guruModelguruProgram();
    $the_media = $guruModelguruProgram->find_intro_media($program->id);
    $no_plugin_for_code = 0;
    $aheight = 0;
    $awidth = 0;
    $vheight = 0;
    $vwidth = 0;
    if (isset($the_media)) {
        $the_media->code = stripslashes($the_media->code);
        if ($the_media->type == 'video') {
            if ($the_media->source == 'url' || $the_media->source == 'local') {
                if ($the_media->width == 0 || $the_media->height == 0) {
                    $vheight = 300;
                    $vwidth = 400;
                } else {
                    $vheight = $the_media->height;
Ejemplo n.º 7
0
function tab5($authors, $course, $config, $course_config)
{
    $authors_config = json_decode($config->st_authorspage);
    $detect = new Mobile_Detect();
    $deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer';
    if ($deviceType == "phone") {
        $class_th_links = "class='teacher_links2'";
    } else {
        $class_th_links = "class='well teacher_links'";
    }
    ?>
<div class="course_view_teacher">
    <div id="teacherdetail" class="clearfix com-cont-wrap">
    <?php 
    if (isset($authors) && count($authors) > 0) {
        foreach ($authors as $key => $author) {
            ?>
    
            <!-- Author Name -->
            <div class="name_guru page_title">
                <h2 class="gru-page-title"><?php 
            echo $author->name;
            ?>
</h2>
            </div>
             <div class="teacher_row_guru">
                <div class="teacher_cell_guru">
                    <?php 
            if (trim($author->show_email) == "" || $author->show_email == 0 && trim($author->show_website) == "http://" || $author->show_website == 0 && trim($author->show_blog) == "" || $author->show_blog == 0 && trim($author->show_twitter) == "" || $author->show_twitter == 0 && trim($author->show_facebook) == "http://" || $author->show_facebook == 0) {
                // do nothing
            } else {
                ?>
                            <div class = 'weblinks'>
                                <div>
                                    <div class="teacher_links clearfix g_toolbar">
                                        <?php 
                if (trim($author->show_email) != "" && $author->show_email == 1) {
                    ?>
                                            <div class="teacher_links-item">
                                                <span class="teacher_email_guru">
                                                    <a href="mailto:<?php 
                    echo $author->email;
                    ?>
">
                                                        <i class="fa fa-envelope"></i>
                                                        <?php 
                    echo JText::_('GURU_EMAIL');
                    ?>
                                                    </a>
                                                </span>
                                            </div>
                                            <?php 
                }
                if (trim($author->show_website) != "http://" && $author->show_website == 1) {
                    ?>
                                            <div class="teacher_links-item">	
                                                <span class="guru_teacher_site">
                                                    <a href="<?php 
                    echo $author->website;
                    ?>
" target="_blank">
                                                        <i class="fa fa-globe"></i>
                                                        <?php 
                    echo JText::_('GURU_SITE');
                    ?>
                                                    </a>
                                                </span>
                                            </div>
                                            <?php 
                }
                if (trim($author->show_blog) != "http://" && $author->show_blog == 1) {
                    ?>
                                            <div class="teacher_links-item">
                                                <span class="guru_teacher_blog">
                                                    <a href="<?php 
                    echo $author->blog;
                    ?>
" target="_blank">
                                                        <i class="fa fa-pencil"></i>
                                                        <?php 
                    echo JText::_('GURU_BLOG');
                    ?>
                                                    </a>
                                                </span>
                                            </div>
                                        <?php 
                }
                if (trim($author->show_twitter) != "" && $author->show_twitter == 1) {
                    ?>
                                            <div class="teacher_links-item">
                                                <span class="guru_teacher_twitter">
                                                    <a href="http://www.twitter.com/<?php 
                    echo $author->twitter;
                    ?>
" target="_blank">
                                                        <i class="fa fa-twitter"></i>
                                                        <?php 
                    echo JText::_('GURU_TWITTER');
                    ?>
                                                    </a>
                                                </span>
                                            </div>
                                        <?php 
                }
                if (trim($author->show_facebook) != "http://" && $author->show_facebook == 1) {
                    ?>
                                            <div class="teacher_links-item">
                                                <span class="guru_teacher_facebook">
                                                    <a href="<?php 
                    echo $author->facebook;
                    ?>
" target="_blank">
                                                        <i class="fa fa-facebook"></i>
                                                        <?php 
                    echo JText::_('GURU_FACEBOOK');
                    ?>
                                                    </a>
                                                </span>
                                            </div>
                                        <?php 
                }
                ?>
                                    </div>
                                </div>
                            </div>
						<?php 
            }
            ?>
                     <div>
                        <div>
                        <div class="description_guru uk-grid" style="text-align:left">
                            <div class='uk-width-2-10'>
                                <?php 
            $config_author = json_decode($config->authorpage);
            $img_align = $config_author->author_image_alignment;
            //0-left, 1-right
            if ($img_align == 0) {
                $align = "left";
            } else {
                $align = "right";
            }
            $guruHelper = new guruHelper();
            if (trim($author->images) != "") {
                $type = $course_config->course_image_size_type == "0" ? "w" : "h";
                $guruHelper->createThumb(@$author->imageName, $config->imagesin . "/authors", $course_config->course_image_size, $type);
                ?>
                                    <a href="<?php 
                echo JRoute::_('index.php?option=com_guru&view=guruauthor&layout=view&task=author&cid=' . $author->id . "-" . JFilterOutput::stringURLSafe($author->name));
                ?>
">
                                        
                                        <img class="thumbnail pull-left" src='<?php 
                echo JURI::root() . $author->images;
                ?>
' alt='author image' align='<?php 
                echo $align;
                ?>
' /></a>
                                    <?php 
            }
            ?>
                            </div>
                            <div class='uk-width-8-10 padding-left-10'>
                            	<?php 
            echo $author->full_bio;
            ?>
                            </div>
                        </div>
                            <div class="teacher_info">
                             <h4 class="gru-page-subtitle"><?php 
            echo JText::_("GURU_TAB_AUTHOR_COURSES");
            ?>
</h4>
                               <div class="clearfix">
                                <div class="g_table_wrap"> 
                                    <div class="table_container columns">
                                        <table class="uk-table uk-table-striped">
                                            <tr>
                                                <th class="" ><?php 
            echo JText::_("GURU_TAB_AUTHOR_COURSES_NAME");
            ?>
</th>
                                                <th class="uk-text-center"><?php 
            echo JText::_("GURU_TAB_AUTHOR_COURSES_LEVEL");
            ?>
</th>
                                                <th class="uk-text-center"><?php 
            echo JText::_("GURU_TAB_AUTHOR_COURSES_RELEASE");
            ?>
</th>
                                            </tr>
                                            <?php 
            $k = 0;
            $guruModelguruProgram = new guruModelguruProgram();
            $course = $guruModelguruProgram->getAuthorCoursesById($author);
            if (count($course) > 0) {
                $itemid = JRequest::getVar("Itemid", "0");
                for ($i = 0; $i < count($course); $i++) {
                    $class = "odd";
                    if ($k % 2 != 0) {
                        $class = "even";
                    }
                    ?>
                                                <tr class="<?php 
                    echo $class;
                    ?>
">          
                                                    <td>
                                                        <?php 
                    /***$alias = trim($course[$i]->alias) == "" ? JFilterOutput::stringURLSafe($course[$i]->name) : trim($course[$i]->alias);
                       $courseLink = JRoute::_('index.php?option=com_guru&view=guruPrograms&layout=view&cid='.$course[$i]->id."-".$alias."&Itemid=".$itemid);***/
                    if (isset($course[$i]->alias)) {
                        if (trim($course[$i]->alias) == "") {
                            $alias = JFilterOutput::stringURLSafe($course[$i]->name);
                        } else {
                            $alis = trim($course[$i]->alias);
                        }
                        $courseLink = JRoute::_('index.php?option=com_guru&view=guruPrograms&layout=view&cid=' . $course[$i]->id . "-" . $alias . "&Itemid=" . $itemid);
                    } else {
                        $courseLink = JRoute::_('index.php?option=com_guru&view=guruPrograms&layout=view&cid=' . $course[$i]->id . "&Itemid=" . $itemid);
                    }
                    ?>
                                                        <a href='<?php 
                    echo $courseLink;
                    ?>
'>
                                                            <?php 
                    echo $course[$i]->name;
                    ?>
                                                        </a>
                                                    </td>
                                                    <td class="uk-text-center"><img src='<?php 
                    echo JURI::root() . "components/com_guru/images/" . $course[$i]->level . ".png";
                    ?>
'/></td>
                                                    <?php 
                    $int_date = strtotime($course[$i]->startpublish);
                    $date = date($config->datetype, $int_date);
                    ?>
                                                    <td class="uk-text-center"><?php 
                    echo $date;
                    ?>
</td>
                                                </tr>
                                            <?php 
                    $k++;
                }
            }
            ?>
                                    </table>
                                    </div>
                                </div>
                              </div>  
                        </div>
                       </div>
                     </div>
</div>
</div>
	<?php 
        }
    }
    ?>
</div>
</div>
<?php 
}
Ejemplo n.º 8
0
# ------------------------------------------------------------------------
# author    iJoomla
# copyright Copyright (C) 2013 ijoomla.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.ijoomla.com
# Technical Support:  Forum - http://www.ijoomla.com.com/forum/index/
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.controller');
JHTML::_('behavior.modal', 'a.modal');
$program = $this->program;
$programContent = $this->programContent;
$user = JFactory::getUser();
echo "<h1 class='guru_course_name'>" . $program->name . "</h1>";
foreach ($programContent as $key => $array) {
    $subcat = guruModelguruProgram::getSubCategory($array['id']);
    ?>
	<tr style="">
		<td colspan='2'>
			<table style='width:100%;'>
				<tr>
					<td style="border-bottom: 2px solid #F7F7F7;">
						<div class="day" onClick="javascript:show_hidde('<?php 
    echo $array['id'];
    ?>
','<?php 
    echo JUri::root() . "components/com_guru/images/";
    ?>
')">
							<?php 
    if (count($subcat) > 0) {
Ejemplo n.º 9
0
   $new_task_array = substr($new_task_array, 0, strlen($new_task_array) - 1);
   $total_for_a_day = guruModelguruProgram::getsum_points_and_time_for_a_day2($new_task_array);
   if ($total_for_a_day[0]->s_points) {
       $total_points_for_a_day = $total_for_a_day[0]->s_points;
   } else {
       $total_points_for_a_day = 0;
   }
   if ($total_for_a_day[0]->s_time) {
       $total_time_for_a_day = $total_for_a_day[0]->s_time;
   } else {
       $total_time_for_a_day = 0;
   }
   $status_color = "white";
   // we find the DAY STATUS for the days and we change the COLOR accordingly
   //if($k<$program->freetrial) {
   $day_status = guruModelguruProgram::find_day_status($my->id, $program->id, $day_id);
   if ($day_status == 2) {
       $status_color = "green";
   }
   if ($day_status == 1) {
       $status_color = "yellow";
   }
   // }
   ?>
 <tr bgcolor="<?php 
   if ($k % 2 == 0) {
       echo "#f7f7f7";
   } else {
       echo "#eeeeee";
   }
   ?>