<?php

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');

$zdb = $_SESSION["zdbyear_$dbname"];
mysqli_select_db($conn, $zdb);

if ($_REQUEST["code"]) {
    $code = $_REQUEST["code"];

    if ($_REQUEST["para"] == "order") {
        $getcons1 = mysqli_query($conn, "SELECT `ordno` FROM `pordsacn` WHERE party = '$code'") or die(mysqli_error($conn));
        $pcons1 = mysqli_fetch_object($getcons1);
        
        echo "<option value=''>Please Select a Order</option>";
        while ($row = mysqli_fetch_array($getcons1)) {
            echo "<option value=$row[ordno]>$row[ordno]</option>";
        }
    }
}
?>
