}
    $result2 = $obj->store_printed_firms_X($_GET['id'], 'tender_rate_attachements', $finalName, $name, $_SESSION['pin_id'], $_SESSION['pin_table']);
    ?>
  <script type="text/javascript">
	window.location="tender_quot_new.php?id=<?php 
    echo $_GET['id'];
    ?>
&val=<?php 
    echo $_GET['val'];
    ?>
";
		</script>
  <?php 
}
if (isset($_POST['Status_Submit'])) {
    $changed_status_result = $obj->ChangeCommonStatus($_GET['id'], $_POST['status_button'], 'tender');
    if ($changed_status_result == 1) {
        if ($_POST['status_button'] == 0) {
            $message = "Status changed to Uploaded";
        } else {
            $message = "Status changed to Rate Given";
        }
        $obj->ALertMessage($message, $changed_status_result);
        $obj->redirect('tender_list.php');
    }
}
if (isset($_POST['save_firm_printed_rate_submit']) && $_POST['key45'] == $_SESSION['key45']) {
    $result_bid_in_printed = $obj->BidNumberPrintedForm($_GET['id'], $_POST['select_firms'], $_POST['text_box_bid_number'], $_SESSION['pin_id'], $_SESSION['pin_table']);
    $obj->redirect("tender_quot_new.php?id=" . $_GET['id'] . "&val=" . $_GET['val']);
}
if (isset($_POST['submit_mannual_firms']) && $_POST['key12'] == $_SESSION['key12']) {
    }
    $result2 = $obj->store_printed_firms_X($_GET['id'], 'tender_rate_attachements', $finalName, $name, $_SESSION['pin_id'], $_SESSION['pin_table']);
    ?>
  <script type="text/javascript">
	window.location="tender_quot_new.php?id=<?php 
    echo $_GET['id'];
    ?>
&val=<?php 
    echo $_GET['val'];
    ?>
";
		</script>
  <?php 
}
if (isset($_POST['Status_Submit'])) {
    $changed_status_result = $obj->ChangeCommonStatus($_GET['id'], $_POST['status_button'], 'tender', $tender_details['firm_status']);
    if ($changed_status_result == 1) {
        if ($_POST['status_button'] == 0) {
            $message = "Status changed to Uploaded";
        } else {
            $message = "Status changed to Rate Given";
        }
        $obj->ALertMessage($message, $changed_status_result);
        $obj->redirect('tender_list.php');
    } else {
        if ($changed_status_result == 1345) {
            $message = "Please add firms to change in Rate Given";
            $obj->ALertMessage($message, 1);
        } else {
            $message = 'There is some error';
            $obj->ALertMessage($message, $changed_status_result);
<?php

require_once "main_includes/main_class.php";
$obj = new main_front_class();
$id = $_GET['id'];
$status = $_GET['status'];
$display = $_GET['show'];
$table = $_GET['table'];
$result = $obj->ChangeCommonStatus($id, $status, $table);
if ($result == 1) {
    ?>
<div id="msg_after_status_error" style="color:#900;">
Status changed to <?php 
    echo $display;
    ?>
 
</div>
<?php 
} else {
    ?>
<div id="msg_after_status_error">
Status can't change to rate given, some error
</div>
<?php 
}