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

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

if ($_REQUEST["ctr"]) {
    $ctr = $_REQUEST["ctr"];
    $mctr = $ctr;
    $mctr++;

    Echo "<tr>";
    Echo "<td><i class='fa fa-close remove'></i></td>";
    Echo "<td><input type='text' class='form-control form text-right srno' name='srno_$ctr' value='$mctr'></td>";
    Echo "<td>";
//    Echo "<select class='form-control form select2 size' name='size_$ctr' style='width:100%' required>";
    Echo "<select class='form-control form size select2' name='size_$ctr' style='width:100%' required>";
    Echo "<option value=''></option>";
    $gttype = mysqli_query($conn, "SELECT * FROM `size` WHERE code !='' ")or die(mysqli_error($conn));
    while ($ttype = mysqli_fetch_array($gttype)) {
        Echo "<option value='$ttype[code]'>$ttype[name]</option>";
    }
    Echo "</select>";
    Echo "</td>";
    Echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
