Forums
This topic is locked
code display on findex page of my website
Posted 28 Jun 2012 11:25:59
1
has voted
28 Jun 2012 11:25:59 hina thakur posted:
'default' ORDER BY `category_name` ASC "; $resultarray = mysql_query($query); $j =0; while($row = mysql_fetch_array($resultarray)) { $cssquery = "SELECT count(*) as count FROM jos_categorycourse LEFT JOIN jos_course ON jos_categorycourse.fk_course_id = jos_course.id WHERE fk_category_id = ".$row['id']." AND jos_course.publish_status = 'publish'"; $countarray = mysql_query($cssquery); while($countrow = mysql_fetch_array($countarray)) { $cnt = $countrow['count']; } if($cnt > 0) { $acc[$j]['catid'] = $row['id']; $acc[$j]['acccc'] = $j; $j++; } } /*echo '';
print_r($acc);*/
$query = "SELECT jos_courseschedule.* , jos_course.id as courseid , jos_course.course_title , jos_category.id as catid , jos_category.upload_image as catimage FROM `jos_courseschedule`
LEFT JOIN jos_course ON jos_course.id = jos_courseschedule.fk_course_id
LEFT JOIN jos_categorycourse ON jos_course.id = jos_categorycourse.fk_course_id
LEFT join jos_category on jos_categorycourse.fk_category_id = jos_category.id
WHERE `start_date` like '".$year."-".$month_num."-%' order by start_date ";
$result = mysql_query($query); $day = array(); $j =1;
while($row = mysql_fetch_array($result))
{
$day[$j] = date('d',strtotime($row['start_date']));
$course_id[$j] = $row['courseid'];
$course_title[$j] = $row['course_title'];
$cat_id[$j] = $row['catid'];
$cat_image[$j] = $row['catimage'];
foreach($acc as $keys => $values) {
if($row['catid'] == $values[catid]){
$accordian[$j] = $values['acccc'];
break;
}
}
$j++;
}
// print_r($accordian);
$today = getdate();
$hours = $today['hours'];
$mins = $today['minutes'];
$secs = $today['seconds'];
if(strlen($hours)<2) $hours="0".$hours;
if(strlen($mins)<2) $mins="0".$mins;
if(strlen($secs)<2) $secs="0".$secs;
$days=date("t",mktime(0,0,0,$month,1,$year));
$start = $date['wday']+1;
$name = $date['month'];
$year2 = $date['year'];
$offset = $days + $start - 1;
if($month==12) {
$next=1;
$nexty=$year + 1;
} else {
$next=$month + 1;
$nexty=$year;
}
if($month==1) {
$prev=12;
$prevy=$year - 1;
} else {
$prev=$month - 1;
$prevy=$year;
}
if($offset <= 28) $weeks=28;
elseif($offset > 35) $weeks = 42;
else $weeks = 35;
$ouput = '';
$output .= "
Replies
Replied 27 Jul 2012 08:58:19
27 Jul 2012 08:58:19 Roddy Dairion replied:
Sound like you haven't got your php starting tags opened correctly. Or your php module isn't installed.