= $limitfornext)
{
$next_year=$limitfornext;
}
if ($prev_month == 0 ) {
$prev_month = 12;
$prev_year = $year - 1;
}
if ($next_month == 13 ) {
$next_month = 1;
$next_year = $year + 1;
}
//Here we generate the first day of the month
$first_day = mktime(0,0,0,$month, 1, $year) ;
$title = date('F', $first_day) ;
switch($title){
case "January": $tamilmonth ='ஜனவரி'; break;
case "February":$tamilmonth = 'பிப்ரவரி'; break;
case "March": $tamilmonth = 'மார்ச்'; break;
case "April": $tamilmonth = 'ஏப்ரல்'; break;
case "May": $tamilmonth = 'மே'; break;
case "June": $tamilmonth = 'ஜூன்'; break;
case "July": $tamilmonth = 'ஜூலை'; break;
case "August": $tamilmonth = 'ஆகஸ்ட்'; break;
case "September": $tamilmonth = 'செப்டம்பர்'; break;
case "October": $tamilmonth = 'அக்டோபர்'; break;
case "November": $tamilmonth = 'நவம்பர்'; break;
case "December": $tamilmonth = 'டிசம்பர்'; break;
}
//tamilvarudam and month display
$fields = array('tamilmatham','varudam','tamildate');
$result1 = $DbCon->Select($sql_db_array["P_Thithi"], $fields, " WHERE year(englishdate)='".$year."' and month(englishdate)='".$month."' and Status=1 ");
//$query1 = "SELECT distinct tamilmatham,varudam,tamildate FROM table2 where year(englishdate)='$year' and month(englishdate)='$month'";
//$result1 = mysql_query ($query1);
$j=0;
while($row1 = mysql_fetch_array($result1))
{
$varudam = $row1[varudam];
$tamilmatham[$row1['tamilmatham']][] = $row1[tamildate];
$tamilmn[$j] = $row1[tamilmatham];
$j++;
}
$firsttamilmatham = array_shift(array_values($tamilmn));
$lasttamilmatham = array_pop(array_values($tamilmn));
$tamilmatham1 = array_shift(array_values($tamilmatham));
$tamilmathamfirstdate = array_shift(array_values($tamilmatham1));
$tamilmathamlast = array_pop(array_values($tamilmatham));
$tamilmathamlastdate = array_pop(array_values($tamilmathamlast));
?>
".$varudam." வருடம் ";
echo $firsttamilmatham." ".$tamilmathamfirstdate." - ".$lasttamilmatham." ".$tamilmathamlastdate;
}
?>
|
">இன்று
|
'calimages/egathesi.png',"கிருத்திகை" => 'calimages/Kruthigai.png',"சதுர்த்தி" => 'calimages/Sathurthi.png',"பிரதோஷம்" => 'calimages/Pradosham.png',"அமாவாசை" => 'calimages/ammavasai.png',"சிவராத்திரி" => 'calimages/Sivarathree.png',"சஷ்டி" => 'calimages/Sashti.png',"பௌர்ணமி" => 'calimages/Bowrnami.png');
//print_r($calimages);
$record3.= "";
$record3.= "ஞாயிறு | திங்கள் | செவ்வாய் | புதன் | வியாழன் | வெள்ளி | சனி |
";
//This counts the days in the week, up to 7
$day_count = 1;
$record3.="";
//first we take care of those blank days
while ($blank > 0 )
{
$record3.= " | ";
$blank = $blank-1;
$day_count++;
}
//sets the first day of the month to 1
$day_num = 1;
//count up the days, untill we've done all of them in the month
while ( $day_num <= $days_in_month )
{
if($day_num < 10)
{
$day_num ="0".$day_num;
}
$DayOfWeek = date(l,mktime(0,0,0,$month,$day_num,$year));
$today = mktime(0,0,0,date("m"),date("d"),date("Y"));
$caltoday = mktime(0,0,0,$month,$day_num,$year);
if($today==$caltoday)
{
$style='style="background-color:#DDDDDD;text-decoration:none;font-size:10px;"';
}
else
{
$style='style="color:#0066FF;text-decoration:none;font-size:10px;"';
}
if($DayOfWeek=='Sunday')
{
$stylefordays='style="text-decoration:none;color:red;font-weight:bold;font-size:19px;"';
}
else
{
$stylefordays='style="text-decoration:none;color:#144BFF;font-weight:bold;font-size:19px;"';
}
$selectd = $year."-".$month."-".$day_num;
$fields = array('tamildate','sakthi','natchatheram','santhrastamam','thethi','tamilmatham','virathankal');
$query = $DbCon->Select($sql_db_array["P_Thithi"], $fields, " WHERE englishdate='".$selectd."' and Status=1 ");
$row = mysql_fetch_array($query);
//$query = "SELECT distinct tamildate,sakthi,natchatheram,santhrastamam,thethi,tamilmatham,virathankal FROM table2 where englishdate='$selectd'";
//$result = mysql_query ($query);
$b = $row['virathankal'];
$virathamid = explode(",",$row[virathankal]);
$record3.= '
'.$day_num.'
|
'.$row[tamilmatham]." ".$row[tamildate].' | ';
$record3.= '';
if($row[sakthi]!=''){
$record3.= '';
}else{
$record3.= ' ';
}
foreach($virathamid as $virathamvalue)
{
foreach($calimages as $calimagesid => $calimagesvalues)
{
if($virathamvalue==$calimagesid)
{
$record3.= '';
}
}
}
$record3.= ' | ';
$record3.= ' ';
$day_num++;
$day_count++;
//Make sure we start a new row every week
if ($day_count > 7)
{
$record3.= " |
";
$day_count = 1;
}
}
//Finaly we finish out the table with some blank details if needed
while ( $day_count >1 && $day_count <=7 )
{
$record3.= " | ";
$day_count++;
}
$record3.= "
";
return $record3;
}
?>
ஏகாதசி |
கிருத்திகை |
சதுர்த்தி |
பிரதோஷம் |
அமாவாசை |
சிவராத்திரி |
சஷ்டி |