<?php
ini_set('session.gc_maxlifetime', 30 * 60 * 60 * 60);
session_start();
$_SESSION["brand"] = "";
if ($_SESSION["dev"] == "") {
    echo "Invalid User Session";
    exit();
}
?>

<link rel="stylesheet" href="css/themes/redmond/jquery-ui-1.10.3.custom.css" />

<!-- Main content -->
<section class="content">

    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">Inquiry Center</h3>
        </div>

        <form role="form" name ="form1" class="form-horizontal">
            <div class="box-body">
                <br>               
                <div class="form-group">
                    <a onclick="new_inv();" class="btn btn-default">
                        <span class="fa fa-user-plus"></span> &nbsp; New

                    </a>
                    <a onclick="save_inv();" class="btn btn-primary">
                        <span class="fa fa-save"></span> &nbsp; Save
                    </a>
                    <a onclick="upcl_inv();" class="btn btn-warning">
                        <span class="fa fa-save"></span> &nbsp; Msg Update
                    </a>
                    <a onclick="NewWindow('inquiry_search.php', 'mywin', '800', '700', 'yes', 'center');
                            return false" class="btn btn-default active">
                        <span class="fa fa-search"></span> &nbsp; Find All
                    </a>
                    
                     <a onclick="NewWindow('inquiry_search_p.php', 'mywin', '800', '700', 'yes', 'center');
                            return false" class="btn btn-default active">
                        <span class="fa fa-search"></span> &nbsp; Find Pending
                    </a>
                   
                        <a onclick="cancel_inv();" class="btn btn-danger">
                            <span class="fa fa-print"></span> &nbsp; Cancel
                        </a>	
                  


                </div>
                <div id="msg_box"  class="span12 text-center"  ></div>
                <div class="col-sm-1">
                    <input type="text" placeholder="Uniq"  id="uniq" class="form-control hidden input-sm">
                </div>

                <div class="form-group"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="invno">Ref No</label>
                    <div class="col-sm-3">
                        <input type="text" disabled name="refno" id="refno" class="form-control   input-sm">  
                    </div>
                    <label class="col-sm-1 control-label" for="sdate">Date</label>
                    <div class="col-sm-3">
                        <input type="date" disabled value="<?php echo date('Y-m-d'); ?>" name="sdate" id="sdate" class="form-control   input-sm">  
                    </div>
                
                    <label class="col-sm-1 control-label" for="invno">Request By</label>
                    <div class="col-sm-3">
                        <select id="rep" class="form-control input-sm" >

                    <?php
                    require_once("connectioni.php");
                  
                    $sql = "select * from s_salrep where pactive='1' and SCODE='" . $_SESSION['company'] . "' order by REPCODE"; 
                    $result = mysqli_query($GLOBALS['dbinv'], $sql);
                    while ($row = mysqli_fetch_array($result)) {
                        echo "<option value='" . $row["REPCODE"] . "'>" . $row["REPCODE"] . " " . $row["Name"] . "</option>";
                    }
                    
                    ?>
                </select>
                    </div>

                </div>
                
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="invno">Name</label>
                    <div class="col-sm-3">
                        <input type="text"   name="name" id="name" class="form-control   input-sm">  
                    </div>
                     
                    <label class="col-sm-1 control-label" for="sdate">Vehicle No</label>
                    <div class="col-sm-3">
                        <input type="text"   name="vehicle" id="vehicle" class="form-control   input-sm">  
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="invno">Mobile 1</label>
                    <div class="col-sm-3">
                        <input type="number"   name="tel1" id="tel1" class="form-control   input-sm">  
                    </div>
                    <label class="col-sm-1 control-label" for="invno">Mobile 2</label>
                    <div class="col-sm-3">
                        <input type="number"   name="tel2" id="tel2" class="form-control   input-sm">  
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="invno">Size</label>
                    <div class="col-sm-3">
                        <input type="text"   name="size" id="size" class="form-control   input-sm">  
                    </div>
                    <label class="col-sm-1 control-label" for="invno">Brand</label>
                    <div class="col-sm-3">
                        <input type="text"   name="brand" id="brand" class="form-control   input-sm">  
                    </div>
                    <div class="col-sm-1">
                        <a href="" onclick="NewWindow('inquiry_item_search.php', 'mywin', '800', '700', 'yes', 'center');
                                        return false" onfocus="this.blur()">
                                        <input type="button" name="searchcusti" id="searchcusti" value="..." class="btn btn-primary btn-sm">
                                        </a>
                    </div>
                    
                   
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="invno">Address</label>
                    <div class="col-sm-7">
                        <input type="text"   name="address" id="address" class="form-control   input-sm">  
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="invno">Note</label>
                    <div class="col-sm-7">
                        <textarea placeholder="Note" style=" height: 50px;" id="note" class="form-control input-sm"></textarea> 
                    </div>
                </div>
                
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="invno">Remind</label>
                    <div class="col-sm-2">
                       <input type="text"  disabled name="remind1" id="remind1" class="form-control   input-sm">  
                    </div>
                    <div class="col-sm-2">
                       <input type="text"  disabled name="remind2" id="remind2" class="form-control   input-sm">  
                    </div>
                    <div class="col-sm-2">
                       <input type="text"  disabled name="remind3" id="remind3" class="form-control   input-sm">  
                    </div>
                    <div class="col-sm-2">
                       <input type="text"  disabled name="remind4" id="remind4" class="form-control   input-sm">  
                    </div>
                    <div class="col-sm-2">
                       <input type="text" disabled  name="remind5" id="remind5" class="form-control   input-sm">  
                    </div>
                    
                </div>
        </form>
    </div>

</section>

<script src="js/inquiry.js"></script>


<script>new_inv();</script>