if ($tender_details['tender_type'] == 3) {
    $status = 'SPL Limited';
}
if ($tender_details['tender_type'] == 4) {
    $status = 'Local Purchaser';
}
$product_details = $obj->attach_records_products_single($_GET['p'], 'tender_firm_product');
$list_firm = $obj->List_Drop_Down("consignee", "csign_short_name", "id");
if (isset($_GET['spl']) && $_GET['spl'] != '') {
    $record_update = $obj->All_Firm_Product_Data($_GET['spl']);
}
if (isset($_POST['submit']) && $_POST['key'] == $_SESSION['key']) {
    if (isset($_GET['spl']) && $_GET['spl'] != '') {
        $result = $obj->update_firms_under_tender($_POST, $product_details['id'], $_SESSION['pin_id'], $_SESSION['pin_table'], $_GET['spl']);
    } else {
        $result = $obj->store_firms_under_tender($_POST, $product_details['id'], $_SESSION['pin_id'], $_SESSION['pin_table']);
    }
    if ($result == 1) {
        ?>
        <script type="text/javascript">
		window.location="tender_quot_new.php?id=<?php 
        echo $_GET['id'];
        ?>
&val=<?php 
        echo $_GET['val'];
        ?>
";
		</script>
        <?php 
    }
}