function get_qc_data_yearly($equipment_name, $yymm) { $yy = round($yymm / 100, 0); //echo $yy; $mm = $yymm % 100; //echo '-'.$mm; for ($i = $mm; $i > 0; $i--) { $j = $yy * 100 + $i; get_qc_data($equipment_name, $j); } }
} } /* while($array_qc=mysql_fetch_assoc($result_qc)) { echo '<tr><td>'.$array_qc['code'].'</td><td>'.$array_qc['SD_100'].'</td><td>'.$array_qc['Target_100'].'</td><td>'.$array_qc['CV'].'</td></tr>'; }*/ } echo '<table>'; echo '<th><h1>Monthly QC data Biochemistry, NCHSLS, NCH, Surat</h1></th>'; echo '<form method=post action=get_monthly_qc_data.php>'; echo '<tr><td>Write YYMM</td></tr>'; echo '<tr><td><input type=text name=YYMM_selected></td></tr>'; echo '<tr><td>'; mk_select_from_sql('select equipment_name from qc_equipment', 'equipment_name', '', ''); echo '</td></tr>'; echo '<tr><td><input type=submit value=OK name=submit></td></tr>'; echo '</form>'; echo '</table>'; echo '<h2 style="page-break-before: always;"></h2>'; if (isset($_POST['YYMM_selected'])) { echo '<table border="1" bgcolor=lightgreen> <tr bgcolor=lightblue><td colspan=2>' . $_POST['equipment_name'] . '</td><td colspan=2>YYMM=' . $_POST['YYMM_selected'] . '</td></tr>'; get_qc_data($_POST['equipment_name'], $_POST['YYMM_selected']); echo '<tr><th colspan=7 bgcolor=lightblue>Yearly Data</th></tr>'; get_qc_data_yearly($_POST['equipment_name'], $_POST['YYMM_selected']); echo '</table>'; } //echo '<pre>'; //print_r($GLOBALS); //echo '</pre>';