<?php

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

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

if ($_REQUEST["ctr"]) {
    $ctr = $_REQUEST["ctr"];
    $hide = $_REQUEST["hide"];
    $hide_var = "";
    if ($hide == 0) {
        $hide_var = 'style="display:none;"';
    }
    $mctr = $ctr;
    $mctr++;
    Echo "<tr>";
    Echo "<td><i class='fa fa-close remove' style='display:none;'></i></td>";
    Echo "<td><input type='text' class='form-control form text-right srno3'    name='srno3_$ctr'      value='$mctr'></td>";
    echo "<td>";
    echo "<select class='form-control form select2 fetchpart_$ctr' name='pdcode_$ctr' style='width:100%'>";
    echo "<option value=''></option>";
    $getpc = mysqli_query($conn, "SELECT prodcode FROM `product` ORDER BY `prodcode`")or die(mysqli_error($conn));
    while ($fetpc = mysqli_fetch_array($getpc)) {
        echo "<option value='$fetpc[prodcode]'>$fetpc[prodcode]</option>";
    }
    echo "</select>";
    echo "</td>";
    Echo "<td><input type='text' class='form-control form text-right qty'    name='qtyo_$ctr'      value='1'></td>";


    Echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 