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

$maindb = 'crm';
$formname = "CRM List";
$action = "crm_fr.php";
$file = "crm_sc.php";

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$zyear = right($zdb, 4);

$mfrdate = getzdates($zyear, 'S');
$mtodate = getzdates($zyear, 'E');
$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);

include("includes/linkshead.php");
?>
<script src="MyScript/item.js" type="text/javascript"></script>
</head>
<body>
    <form method='POST' action="<?= $action; ?>">
        <!-- Default box -->
        <div>
            <div class="col-lg-5 col-md-12 col-sm-12 col-xs-12  pad">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><?php Echo $formname; ?></h3>
                        <div class="actions pull-right">
                            <i class="fa fa-chevron-down"></i>
                            <i class="fa fa-times"></i>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="control-label marg">From Date</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-8 col-xs-8 pad">
                                <input type="date" size="80" name="frmdate" value="<?php echo "$mfrdate"; ?>" required class="form-control"/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="control-label marg">To Date</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-8 col-xs-8 pad">
                                <input type="date" size="80" name="todate" value="<?php echo "$mtodate"; ?>" required class="form-control"/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="control-label marg">Category</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-8 col-xs-8 pad">
                                <select id="category" name="category" class="form-control select2">
                                    <option></option>   
                                    <option>tailor</option>
                                    <option>driverhouse</option>
                                    <option>visahouse</option>
                                    <option>driver</option> 
                                    <option>saudi</option> 
                                    <option>returnhelper</option> 
                                    <option>MECHANICAL ENGINEER</option> 
                                    <option>light driver</option> 
                                    <option>helper ya paking</option> 
                                    <option>visaagent</option> 
                                    <option>digital marketing</option> 
                                    <option>Helper visa</option> 
                                </select>
                            </div>
                        </div>

                        <!--                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="control-label marg">Agent </label>
                            </div>-->
<!--                            <div class="col-lg-4 col-md-4 col-sm-8 col-xs-8 pad">
                                <select id="cmbtype" name="agent" class="form-control select2">
                                    <option></option>   -->
                                    <?php
                                    $atype = mysqli_query($conn, "SELECT `category` FROM `crm` group by category order by category") or die(mysqli_error($conn));
//                                    while ($getatype = mysqli_fetch_array($atype)) {
//                                        echo "<option value='$getatype[category]'>$getatype[category]</option>";
//                                    }
                                    ?>   
                                <!--</select>-->
                            </div>
                        </div>

                        <div class="panel-footer">
                            <?php include("includes/but_rep.php"); ?>
                            <script>
                                $("#subpdf").hide();
//                                $("#excel").hide();
                            </script>
                        </div>
                        <!--</div>-->
                    </div>
                </div>
            <!--</div>-->
        <!--</div>-->
    </form>
    <?php include("includes/linksfoot.php"); ?>
</body>
</html>
