Пример #1
0
    // we find how many days has a program
    $howManyDays = guruAdminModelguruProgram::getpdays($id);
    $categoryObj = "";
    if ($program->catid > 0) {
        $categoryObj = guruAdminModelguruProgram::getProgramCategory($program->catid);
        $linkcat = JRoute::_("index.php?option=com_guru&controller=guruPcategs&task=edit&cid[]=" . $categoryObj->id);
        $link_cat_for_program = '<a class="a_guru" href="' . $linkcat . '" >' . $categoryObj->name . '</a>';
    } else {
        $link_cat_for_program = JText::_('GURU_PR_CATEG_FIX');
    }
    if ($task == "selectCourse") {
        if ($categoryObj != "") {
            $link_cat_for_program = $categoryObj->name;
        }
    }
    $howManyStudCourse = guruAdminModelguruProgram::getStudentsNumber($id);
    $link_nb_stud = JRoute::_("index.php?option=com_guru&controller=guruPrograms&task=show&pid=" . $id);
    $link_stud_nb_of_course = '<a class="a_guru" href="' . $link_nb_stud . '" >' . $howManyStudCourse . '</a>';
    ?>
	<tr class="row<?php 
    echo $k;
    ?>
"> 	
    	<?php 
    if ($task != "selectCourse") {
        ?>
    	<td>
			<span class="sortable-handler active" style="cursor: move;">
                <i class="icon-menu"></i>
            </span>
            <input type="text" class="width-20 text-area-order " value="<?php 
Пример #2
0
/*------------------------------------------------------------------------
# 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/forum/index/
-------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.modal');
$doc = JFactory::getDocument();
$doc->addScript('components/com_guru/js/jquery-1.9.1.min.js');
$doc->addScript('components/com_guru/js/jquery.noconflict.js');
$guruAdminModelguruProgram = new guruAdminModelguruProgram();
$k = 0;
$customers = $this->customers;
$filter = $this->filters;
$n = count($customers);
//var_dump($customers);
$program = $this->programs;
$pid = intval(JRequest::getVar("pid", ""));
$course_name = $guruAdminModelguruProgram->getCourseName($pid);
$course_name = '"' . $course_name . '"';
$ads = $this->ads;
$db = JFactory::getDBO();
$sql = "Select datetype FROM #__guru_config where id=1 ";
$db->setQuery($sql);
$format_date = $db->loadColumn();
$format_date = $format_date[0];
Пример #3
0
		<tr>
			<td width="90%">
			<table border="1">
			<tr>
				<td width="10%"><strong><?php 
echo JText::_('GURU_PRODLACT');
?>
</strong></td>
				<td width="90%"><strong><?php 
echo JText::_('GURU_PRODLEMAIL');
?>
</strong></td>
			</tr>
			<?php 
$allemailList = guruAdminModelguruProgram::getallemails();
$emailList = guruAdminModelguruProgram::getpemails($program->id);
$email_id_array = "";
foreach ($emailList as $email) {
    $email_id_array = $email_id_array . ',' . $email->media_id;
}
$emailz = explode(',', $email_id_array);
foreach ($allemailList as $allemail) {
    ?>
			<tr>
				<td width="10%"><input type="checkbox" name="echbox[]" <?php 
    if (in_array($allemail->id, $emailz) || in_array($allemail->id, $_POST['echbox'])) {
        echo "checked";
    }
    ?>
 value="<?php 
    echo $allemail->id;
Пример #4
0
 function duplicate()
 {
     jimport('joomla.filesystem.folder');
     $cid = JRequest::getVar('cid', array(), 'post', 'array');
     $n = count($cid);
     if ($n == 0) {
         return JError::raiseWarning(500, JText::_('No items selected'));
     }
     foreach ($cid as $id) {
         $row = $this->getTable('guruPrograms');
         $db = JFactory::getDBO();
         // load the row from the db table
         $row->load((int) $id);
         $old_prog_id = $row->id;
         $sql = "SELECT imagesin FROM `#__guru_config` WHERE id = 1";
         $db->setQuery($sql);
         $configs = $db->loadResult();
         $row->name = JText::_('GURU_CS_COPY_TITLE') . ' ' . $row->name;
         $row->id = 0;
         $time_now = time();
         $min = $time_now / 60 % 60;
         $sec = $time_now % 60;
         $increment = $min . $sec;
         $row->alias = $row->alias . $increment;
         if (!$row->check()) {
             return JError::raiseWarning(500, $row->getError());
         }
         if (!$row->store()) {
             return JError::raiseWarning(500, $row->getError());
         }
         $row->checkin();
         unset($row);
         $sql = "SELECT max(id) FROM `#__guru_program` ";
         $db->setQuery($sql);
         $new_prog_id = $db->loadColumn();
         $new_prog_id = $new_prog_id[0];
         // we will duplicate now the days from the program - begin
         $sql = "SELECT id FROM `#__guru_days` WHERE pid = " . $old_prog_id;
         $db->setQuery($sql);
         $the_days_array = $db->loadColumn();
         // duplicate exercise files for course ----------------------------------
         $sql = "select * from #__guru_mediarel where `type`='pmed' and `type_id`=" . intval($old_prog_id);
         $db->setQuery($sql);
         $db->query();
         $old_exercises = $db->loadAssocList();
         if (isset($old_exercises) && count($old_exercises) > 0) {
             foreach ($old_exercises as $key => $mediarel_value) {
                 $type = "pmed";
                 $type_id = $new_prog_id;
                 $media_id = $mediarel_value["media_id"];
                 $sql = "insert into #__guru_mediarel (`type`, `type_id`, `media_id`) values ('" . $type . "', " . intval($type_id) . ", " . intval($media_id) . ")";
                 $db->setQuery($sql);
                 $db->query();
             }
         }
         // duplicate exercise files for course ----------------------------------
         foreach ($the_days_array as $one_day) {
             guruAdminModelguruProgram::duplicate_day($one_day, $new_prog_id, $old_prog_id);
         }
         guruAdminModelguruProgram::duplicate_plans($new_prog_id, $old_prog_id);
         // we will duplicate now the days from the program - end
     }
     return 1;
 }
Пример #5
0
                
                <?php 
$mmediam_preq = $this->mmediam_preq;
$table_display = "table";
if ($mmediam_preq == NULL || is_array($mmediam_preq) && count($mmediam_preq) <= 0) {
    $table_display = "none";
}
?>
                    <table id="table_courses_id" cellspacing="1" cellpadding="5" border="0" bgcolor="#cccccc" width="100%" style="display:<?php 
echo $table_display;
?>
;">
                         <?php 
$old_preq_ids = '';
if ($program->id != "" || $program->id != NULL) {
    $preq_existing_ids = guruAdminModelguruProgram::preq_existing_ids($program->id);
}
?>
	
                        <tbody id="rowspreq">			 
                            <tr>
                                <td width="8%"><strong><?php 
echo JText::_("GURU_ID");
?>
</strong></td>
                                <td width="56%"><strong><?php 
echo JText::_("GURU_NAME");
?>
</strong></td>
                                <td width="12%"><strong><?php 
echo JText::_("GURU_REMOVE");