echo "<td><b>Main Task{$tstr}</b></td>"; $tmp = "<td><b>"; $tmp2 = "</b>"; fputs($csvfh, ",Main Task,"); } else { echo "<td align=right>Sub Task{$tstr}</td>"; $tmp = "<td>"; //$right $tmp2 = ""; fputs($csvfh, ", Sub Task,"); } $hourspermth = $hours / $nomths; if ($RptMthCtr == 1) { $hrsforpod = $hourspermth; } else { $mulmth = NoMthInPeriod($date_start, $date_end); $hrsforpod = $hourspermth * $mulmth; } $tasks = ereg_replace(",", "_", $tasks); $hrsforpod = number_format($hrsforpod, 2); $hrsforpod = ereg_replace(",", "", $hrsforpod); $hrstr = $hours; if ($m_stasks == "m") { if ($hrpod == 0) { $hrstr = " </td><td> "; } else { $hrstr .= "</td><td> "; } } else { if ($hrstr == 0) { $hrstr = " </td><td> ";
/* table: bgtfileidx. columns: bgtfileidx, projcode_id, description, client, begin_date, end_date, preparedby, uploaddate, active, */ /* table: bgtfiletasks. columns: taskidx, bgtfileidx, m_stasks, tasks, date_start, date_end, nomths, hours, */ $sql = "SELECT t2.hours as hours, t2.nomths as nomths,\n\t\t\t\t\tt2.date_start as date1, t2.date_end as date2\n \t \t\tFROM timesheet.bgtfileidx as t1, timesheet.bgtfiletasks as t2\n \t \t\tWHERE t1.projcode_id='{$projcode_id}' and t1.active='y' and \n \t\t\tt1.end_date>='{$datefrom}' and t1.begin_date<='{$dateto}' and\n \t\t\tt1.bgtfileidx=t2.bgtfileidx and t2.m_stasks='s' and\n \t\t\tt2.date_end>='{$datefrom}' and t2.date_start<='{$dateto}';"; $result = mysql_query($sql); include "err_msg.inc"; $oneprojbudget = 0; while (list($hours, $nomths, $date1, $date2) = mysql_fetch_array($result)) { if ($hours > 0) { $hourspermth = $hours / $nomths; //echo $sql."<br>"; if ($RptMthCtr == 1) { $oneprojbudget += $hourspermth; } else { $mulmth = NoMthInPeriod($date1, $date2); $oneprojbudget += $hourspermth * $mulmth; /* echo "Report period: $datefrom to $dateto ($RptMthCtr)<br>"; echo "Sub task period: $date1 to $date2 ($nomths). budget hours= $hours. $hourspermth hrs/month<br>"; echo "Months in report period: $mulmth<br>"; exit; //*/ } } } if ($oneprojactual || $oneprojbudget) { $noctr++; $allprojtotalactual += $oneprojactual; $allprojtotalbudget += $oneprojbudget; $no1 = sprintf("%01.2f", $oneprojactual / 60.0);