Exemplo n.º 1
0
 $status_line = guruModelguruProgram::find_status_line_for_program($my->id, $program->id);
 $status_button = guruModelguruProgram::find_link_text_for_day_resume_button($status_line->days, $status_line->tasks, $s);
 $status_button = explode('$$$$$', $status_button);
 $link_for_resume = $status_button[0];
 $text_for_resume = $status_button[1];
 //$link_for_resume = 'index.php?option=com_guru&view=guruTasks&task=view&cid='.$first_uncompl_task.'&pid='.$first_uncompl_day_id[0];
 //$text_for_resume = JText::_('GURU_MYPROGRAMS_ACTION_RESUME');
 $buy_now = '';
 $get_started = '<input type="submit" onclick="document.location.href=\'' . $link_for_resume . '\'" value="' . $text_for_resume . '" name="getstarted"/>';
 $status_line->days = substr($status_line->days, 0, strlen($status_line->days) - 1);
 // we remove the last ';'
 $status_line->days = explode(';', $status_line->days);
 foreach ($status_line->days as $one_day_obj) {
     $one_day_obj = explode(',', $one_day_obj);
     $day_id = $one_day_obj[0];
     $days = guruModelguruProgram::get_a_day_by_id($day_id);
     $task_array = explode(';', $status_line->tasks);
     $task_array = $task_array[$days->ordering - 1];
     $task_array = substr($task_array, 0, strlen($task_array) - 1);
     $task_array = explode('-', $task_array);
     $new_task_array = '';
     foreach ($task_array as $one_task) {
         $one_task_array = explode(',', $one_task);
         $new_task_array = $new_task_array . $one_task_array[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;