<div class="questionrow">
    <div class="question">Survey</div>
    <div class="answer">
        <input type="hidden" name="id" id="id" value="<?php echo $id; ?>"/>
		<?php
			if($survey_id == "")
				$survey_id = SURVY;
			
			if(SURVYFXD == 'Y')
			{
				echo '<input type="hidden" name="survey_id" id="survey_id" value="'.SURVY.'" />';
				echo SURVYTITLE;
			}
			else
			{
				$common->dropdown('sur_code', 'sur_title', 'custom_survey_master', 'sur_code IN (SELECT lab_mapng_sur_id FROM custom_lab_mapping)', 'sur_title', 'survey_id', $survey_id, 'class="required"');
			}
		?>
    </div>
</div>
<div class="clear_form">
</div>
<div class="questionrow">
    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; line-height: 40px;" id="dataTable" align="center">
            <tr>
            <td class="question_title" width="50%">Test</td>
            <td class="question_title">Specimen</td>
            <td class="question_title" align="center">
                    <a style="cursor: pointer;" onclick="addRow_dtl('dataTable');">
                            <img src="includes/images/add.png" />
                </a>
            </td>
        </tr>
        <?php
        for($i=0; $i<count($rec); $i++)
        {
            $lab_mstr = $rec[$i]['lab_mapng_mstr_id'];
            $spcmn_id = $rec[$i]['lab_mapng_spcmn_id'];
        ?>
        <tr>
            <td class="question">
				&nbsp;
				<?php
					$common->dropdown('lab_id', 'lab_test_name', 'custom_lab_master', 'status = "Y"', 'lab_test_name', 'lab_mstr[]', $lab_mstr, 'class="required" style="max-width: 310px;"');
				?>
            </td>
            <td class="question">
				&nbsp;
				<?php
					$common->dropdown('lab_spcmn_id', 'lab_spcmn_name', 'custom_lab_spceimen_master', 'status = "Y"', 'lab_spcmn_name', 'spcmn_id[]', $spcmn_id, 'class="required"');
				?>
            </td>
            <td class="question" align="center">
                    <a style="cursor: pointer;" onclick="whichRow('dataTable', this);">
                            <img src="includes/images/delete.png" />
                </a>
            </td>
        </tr>
        <?php
        }
        ?>
    </table>
</div>
<div class="clear_form">
</div>
<div class="questionrow">
    <div style="padding: 5px;" align="center">
        <input type="submit" name="Submit" value="Submit" />
    </div>
</div>
<script language="javascript">
	arr_id_change('lab_mstr[]');
	arr_id_change('spcmn_id[]');
</script>