<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 loc_mapng_sur_id FROM custom_location_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: 60%; line-height: 40px;" id="dataTable" align="center">
            <tr>
            <td class="question_title" width="50%">Location</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++)
        {
            $loc_mstr = $rec[$i]['loc_mapng_mstr_id'];
        ?>
        <tr>
            <td class="question">
				&nbsp;
				<?php
					$common->dropdown('loc_code', array('loc_name', 'loc_code'), 'custom_location', '', 'loc_name', 'loc_mstr[]', $loc_mstr, 'class="required" style="max-width: 310px;"');
				?>
            </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('loc_mstr[]');
</script>