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

$zdb = $_SESSION["zdbyear_" . $dbname];

$formname = "Price List";
$action = "pricelist_fr.php";
mysqli_select_db($conn, $zdb);

include("includes/files.php");
include("includes/combo.php");
?>

<form class="form-horizontal" action='<?= $action ?>' method='POST'>
    <div class="row">
        <div class="col-lg-12">
            <div class="box">
                <header>
                    <div class="icons">
                        <i class="fa fa-edit"></i>
                    </div>
                    <h5><?= $formname ?></h5>
                    <div class="toolbar">
                        <ul class="nav pull-right">
                            <li>
                            <li><input id="submit" type='submit' name='view' value='View' class="btn btn-primary"></li>
                            <li>
                                <a class="minimize-box" data-toggle="collapse" href="#div-4">
                                    <i class="fa fa-chevron-up"></i>
                                </a>
                            </li>
                        </ul>
                    </div><!-- /.toolbar -->
                </header>
                <div id="div-4" class="accordion-body collapse in body">
                    <div class="form-group">
                        <label class="control-label col-lg-3">Item Name</label>
                        <div class="col-lg-5">
                            <div class="input-group">
                                <select class='form-control' name='name' class="item" style="width:297px;height:33px;">
                                    <option value=""></option>
                                    <?php
                                    $getitem = mysqli_query($conn, "SELECT code, `name` FROM `item` ORDER BY `name`") or die(mysqli_error($conn));
                                    while ($iget = mysqli_fetch_array($getitem)) {
                                        echo "<option value='$iget[code]'>$iget[name]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-lg-3">Item Group</label>
                        <div class="col-lg-5">
                            <div class="input-group">
                                <select class='form-control' name='cmbgrp' class="cmbgrp" style="width:297px;height:33px;">
                                    <option value=""></option>
                                    <?php
                                    $mown = mysqli_query($conn, "SELECT * FROM `itemgrp` ORDER BY `name`") or die(mysqli_error($conn));
                                    while ($trow = mysqli_fetch_array($mown)) {
                                        echo "<option value='$trow[code]'>$trow[name]</option>";
                                    }
                                    ?>
                                </select>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>