예제 #1
0
function search_form($filename)
{
    $link = start_nchsls();
    $sql = 'desc sample';
    if (!($result = mysql_query($sql, $link))) {
        echo mysql_error();
    }
    $tr = 1;
    echo '<table border=1><form action=\'' . $filename . '\' method=post>';
    echo '	<tr>
				<td colspan=5 title=\'1) Tickmark to include the field for search. 2) Use % as wildcard. e.g. [%esh = Mahesh,Jignesh] [Mahesh%=Mahesh,Maheshbhai, Maheshkumar]\'><input type=submit name=submit value=search_and_autoverify></td></tr>';
    while ($ar = mysql_fetch_assoc($result)) {
        if ($tr % 3 == 1) {
            echo '<tr>';
        }
        if ($ar['Field'] == 'sample_id') {
            echo '<td><input type=checkbox checked name=\'chk_from_' . $ar['Field'] . '\' ></td><td>from_' . $ar['Field'] . '</td>';
            echo '<td><input type=text name=\'from_' . $ar['Field'] . '\' ></td>';
            echo '<td><input type=checkbox name=\'chk_to_' . $ar['Field'] . '\' ></td><td>to_' . $ar['Field'] . '</td>';
            echo '<td><input type=text name=\'to_' . $ar['Field'] . '\' >';
            $tr++;
        } else {
            echo '<td><input type=checkbox name=\'chk_' . $ar['Field'] . '\' ></td><td>' . $ar['Field'] . '</td><td>';
            if (!mk_select_from_table($ar['Field'], '', '')) {
                echo '<input type=text name=\'' . $ar['Field'] . '\' >';
            }
        }
        echo '</td>';
        if ($tr % 3 == 0) {
            echo '</tr>';
        }
        $tr++;
    }
    echo '</form></table>';
}
function search_form($list_of_sample)
{
    echo '<form method=post>';
    echo '<table border=1 style="background:lightblue;">';
    echo '<tr>';
    echo '<th>';
    echo 'Enter Sample ID to be printed' . '<br>' . 'one in each line and submit';
    echo '</th>';
    echo '</tr>';
    echo '<tr>';
    echo '<td>';
    echo '<input autofocus type=number name=sample_id>';
    echo '<textarea hidden readonly name=list_of_sample>' . $list_of_sample . '</textarea>';
    echo '</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td>';
    echo '<button type=submit name=submit value=add style="font:200% bold black;">Add/Remove Sample</button></td><td>';
    echo 'Remove<input type=checkbox name=remove value=yes style="font:200% bold black;">';
    echo '</td>';
    echo '</tr>';
    echo '</form>';
    echo '</table>';
    echo '<table  style="background:lightpink;">';
    echo '<form method=post target=_blank>';
    echo '<tr>';
    echo '<td>';
    echo '<textarea readonly rows=15  name=list_of_sample>' . $list_of_sample . '</textarea>';
    echo '</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td>';
    mk_select_from_table('authorized_signatory', '', '');
    echo '</td></tr><tr><td>';
    echo '<button type=submit name=submit value=print style="font:200% bold black;">Print</button>';
    echo '</td>';
    echo '</tr>';
    echo '</table>';
    echo '</form>';
}
예제 #3
0
function edit_sample_barcode($sample_array, $filename)
{
    $link = start_nchsls();
    $counter = 1;
    echo '<form method=post action=\'' . $filename . '\'>';
    echo '	<table  border=1 bgcolor=lightyellow CELLPADDING=0 CELLSPACING=0>	
			<tr>
			<td>
				<button type=submit name=action value=save_sample>save sample</button>
			</td>
				<th colspan=8 align=left>Sample Entry Form</th></tr>';
    /*
    year is 14
    MRD is 12345678
    name is Chagan M Patel
    dor is 2014-04-17
    age_year is 34
    age_month is 
    age_day is 
    dob is 
    id_type is 
    id is 
    contact is 
    department is DENT
    unit is 5
    location is G0MICU
    visit is 1
    dov is 2014-04-17
    
    <td></td><td><input type=text name= value=\''.$sample_array[''].'\'></td>
    */
    echo '	<tr>
				<td>sample_id</td><td><input type=text name=sample_id></td>
				<td>patient_id</td><td><input type=text name=patient_id value=\'' . $sample_array['MRD'] . '\'></td>
				<td>patient_name</td><td><input type=text name=patient_name value=\'' . $sample_array['name'] . '\'></td>
				<td>clinician</td><td>';
    mk_select_from_table('clinician', '', get_clinician_from_hmis_code($sample_array['department']));
    echo '</td>
			</tr>';
    echo '	<tr>
				<td>unit</td><td><input type=text 			name=unit 				value=\'' . $sample_array['unit'] . '\'></td>
				<td>location</td><td><input type=text 		name=location 			value=\'' . $sample_array['location'] . '\'></td>';
    echo '</td>
			</tr>';
    echo '</form></table>';
    return TRUE;
}
예제 #4
0
function insert_reagent()
{
    $link = start_nchsls();
    $sql = 'desc reagent';
    if (!($result = mysql_query($sql, $link))) {
        echo mysql_error();
    }
    $tr = 1;
    echo '<table border=1 bgcolor=lightblue><form method=post>';
    echo '	<tr>
				<td bgcolor=yellow><input type=submit name=submit value=insert></td></tr>';
    while ($ar = mysql_fetch_assoc($result)) {
        if ($tr % 3 == 1) {
            echo '<tr>';
        }
        echo '<td>' . $ar['Field'] . '</td><td>';
        if (!mk_select_from_table($ar['Field'], '', '') && $ar['Field'] != 'id') {
            if ($ar['Field'] != 'serial_number') {
                echo '<input type=text name=\'' . $ar['Field'] . '\' >';
            } else {
                echo 'from:<input type=text name=\'' . $ar['Field'] . '_from\' >';
                echo 'to:<input type=text name=\'' . $ar['Field'] . '_to\' >';
            }
        }
        echo '</td>';
        if ($tr % 3 == 0) {
            echo '</tr>';
        }
        $tr++;
    }
    echo '</form></table>';
}
예제 #5
0
function edit_sample($sample_id, $filename, $disabled, $type_preservative_section_change)
{
    $link = start_nchsls();
    $counter = 1;
    $sql_sample_data = 'select * from sample where sample_id=' . $sample_id;
    if (mysql_num_rows($result_sample_data = mysql_query($sql_sample_data, $link)) != 1) {
        echo 'No such Sample';
        return FALSE;
    }
    $sample_array = mysql_fetch_assoc($result_sample_data);
    echo '<form method=post action=\'' . $filename . '\'>';
    echo '	<table  border=1 bgcolor=lightyellow CELLPADDING=0 CELLSPACING=0>	
			<tr>
			<td>
				<button type=submit name=action ' . $disabled . ' value=save_sample>save sample</button>
			</td>
				<th colspan=8 align=left>Sample Entry Form</th></tr>';
    foreach ($sample_array as $key => $value) {
        if ($counter % 4 == 1) {
            echo '<tr>';
        }
        if ($key == 'sample_id') {
            echo '<td>' . $key . '</td><td><input type=text  readonly value=\'' . $value . '\' name=' . $key . '></td>';
        } elseif (($key == 'sample_type' || $key == 'preservative' || $key == 'section') && $type_preservative_section_change == 'no') {
            echo '<td>' . $key . '</td><td><input type=text  readonly value=\'' . $value . '\' name=' . $key . '></td>';
        } else {
            echo '<td>' . $key . '</td><td>';
            if (!mk_select_from_table($key, $disabled, $value)) {
                echo '<input type=text  ' . $disabled . ' value=\'' . $value . '\' name=' . $key . '>';
            }
            echo '</td>';
        }
        if ($counter % 4 == 0) {
            echo '<tr>';
        }
        $counter++;
    }
    echo '</form></table>';
    return TRUE;
}