hi..
i m getting parse error ......
can anyone help me how can i remove it...........
Parse error: parse error in c:\apache\htdocs\newhr\attendnce.php on line 21
<?php
mysql_connect("localhost","root","root");
mysql_select_db("master");
$dates = array();
$employee = array();
$attendance_record = array();
$getdates = "select * from mar10 order by Date" or die(mysql_error());
$dates_resultset = mysql_query($getdates);
while ($dates_data = mysql_fetch_assoc($dates_resultset))
{
$dates[] = $dates_data['Date'];
}
$get_employee = "select * from emp_company"or die(mysql_error());
$employee_resultset = mysql_query($get_employee);
while ($employee_data = mysql_fetch_assoc($employee_resultset))
{
$get_attendance = "select * from at0310 where ecode=".$employee_data['ecode']." and atdate in (".implode(",",$dates).") order by atdate" or die(mysql_error());
$employee[$employee_data['ecode']] = $employee_data['ename'];
$attendance_resultset = mysql_query($get_attendance);
// Now we build the data into a mutlidimensional array() of format $attendance_record[$empcode][$date]['attendance']
while ($attendance_data = mysql_fetch_assoc($attendance_resultset) or die(mysql_error());
{
// FOR SCENARIO 1
//$attendance_record[$employee_data['ecode']][$attendance_data['atdate']]['attendance'] = "P";
// FOR SCENARIO 2
if ($attendance_data['IO'] != "")
{
$attendance_record[$employee_data['ecode']][$attendance_data['atdate']]['attendance'] = "P";
}
else
{
$attendance_record[$employee_data['ecode']][$attendance_data['atdate']]['attendance'] = "A";
}
}
}
$tabledata = "";
$tabledata .= "Empcode Name \t";
foreach ($dates as $key => $value) {
$tabledata .= $value." \t";
}
$tabledata .= "\r\n";
foreach ( $employee as $emp_key => $emp_value )
{
$tabledata .= $emp_key."/".$emp_value;
foreach ( $dates as $dates_key => $dates_value )
{
$tabledata .= "\t";
if ( isset($attendance_record[$emp_key][$dates_value]['attendance']) ) {
$tabledata .= $attendance_record[$emp_key][$dates_value]['attendance'];
} else {
$tabledata .= "A";
}
}
$tabledata .= "\r\n";
}
$file_resource = fopen("att.txt","w+");
fwrite($file_resource,$tabledata);
mysql_close();
?>