<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="sur_mstr" id="sur_mstr" value="'.SURVY.'" />';
				echo SURVYTITLE;
			}
			else
			{
				$common->dropdown('sur_code', 'sur_title', 'custom_survey_master', 'sur_code IN (SELECT reimbrsmnt_survey_id FROM custom_reimbursement_mapping)', 'sur_title', 'sur_mstr', $sur_mstr, 'class="required"');
			}
		?>
    </div>
</div>
<div class="clear_form">
    <div>&nbsp;</div>
</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" style="width: 40%;">Reimbursement Head</td>
            <td class="question_title" style="width: 15%;">Is Fixed?</td>
            <td class="question_title" style="width: 40%;">Reimbursement Amount</td>
            <td class="question_title" style="width: 5%;" 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++)
        {
            $remimbst_mstr_id = $rec[$i]['reimbrsmnt_head_mstr_id'];
            $reimbrsmnt_type = $rec[$i]['reimbrsmnt_type'];
            $reimbrsmnt_amount = $rec[$i]['reimbrsmnt_amount'];
            
            if($reimbrsmnt_type == 1)
            {
                $attr = "checked";
                $attr_val = true;
            }
            else
            {
                $attr = "";
                $attr_val = false;
            }
        ?>
        <tr>
            <td class="question" style="width: 40%;">
				&nbsp;
				<?php
					$common->dropdown('reimbrsmnt_head_id', 'reimbrsmnt_head_name', 'custom_reimbursement_heads_master', '', 'reimbrsmnt_head_name', 'remimbst_mstr_id[]', $remimbst_mstr_id, 'class="required" style="max-width: 250px;"');
				?>
            </td>
            <td class="question_title" style="width: 15%;">
				<input type="checkbox" name="reimbrsmnt_type[]" id="reimbrsmnt_type_<?php echo $i; ?>" <?php echo $attr; ?> value="1" onclick="return amt_dis(this.checked, '<?php echo $i; ?>');" />
				<input type="hidden" name="reimbrsmnt_type_val[]" id="reimbrsmnt_type_val_<?php echo $i; ?>" value="1" />
            </td>
            <td class="question" style="width: 40%;">
				&nbsp;
				<input type="text" name="reimbrsmnt_amt[]" id="reimbrsmnt_amt_<?php echo $i; ?>" onkeyup="return acceptDecimal(this);" value="<?php echo $reimbrsmnt_amount; ?>" style="text-align: right;" />&nbsp;&nbsp;
            </td>
            <td class="question" style="width: 5%;" align="center">
				<a style="cursor: pointer;" onclick="whichRow('dataTable', this);">
					<img src="includes/images/delete.png" />
                </a>
            </td>
        </tr>
        <script language="javascript">
			amt_dis('<?php echo $attr_val; ?>', '<?php echo $i; ?>');
        </script>
        <?php
        }
        ?>
    </table>
    <script language="javascript">
		arr_id_change('remimbst_mstr_id[]');
    </script>
</div>
<div class="questionrow">
    <div style="padding: 5px;" align="center">
        <input type="submit" name="Submit" value="Submit" />
    </div>
</div>