<?php

session_start();


if (!isset($_SESSION['admin_userName'])) {
    header('Location: login.php');
    }
    include('../Admin_modules/add_receipt.php');
?>

<?php include("header.php");?>


<style >
     .a {
        background-color: rgba(0,0,0,0.5);
    }
     #nav  .a1
    {
        color: #f9a825;
        font-weight: 600;
    }
       nav a:hover {
    background-color: #721418;
    color: #f9a825;
        font-weight: 600;
}

  @media print{
        .noprint{display: none;}
    }

   
</style>


<!--Section: Contact v.2-->
<body onload="showTable('1'); branch()">
     <p class="solid1" style="outline-style: solid; margin-top: 10px; margin-bottom: 10px; color: #00AC8B" />
<div id="row-data" class="row"  >

        <!--Grid column-->
    <div class="col-md-12 ">

    <form id="contact-form" name="contact-form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">


        <div class="gst_checkbox" style="float: right; margin-top: 5px ; text-align: center;">
                <span style="font-weight: bold;">With GST :</span>

                <input type="radio" name="type" id="with_gst" style="margin-right: 15px; zoom:1.5" value="gst" checked>

              <!--   <span style="font-weight: bold;">Without GST :</span>
                <input type="radio" name="type" id="no_gst" onClick="showTable('2'); branch()" style="margin-right: 25px; zoom:1.5" value="nogst"> -->
            </div>

            <fieldset style="margin: 5px 0 5px 0; border: 1px solid #095D92; width: 100%; background-color:#F0EEEE;border-radius: 6px">
          
            <div class="data" style=" padding: 10px">
                
                <!--Grid row-->
                <div class="row" style="margin-top: 10px; padding: 10px;">

                    <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light">
                            <input type="text" id="br_from" class="form-control mb-4" value="Mumbai" disabled="true">
                        </div>
                    </div>
                    <!--Grid column-->

                    <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light">
                             <select name="br_to" id="br_to" class="form-control mb-4" onchange="branch()" required>
                                <option value="">Select Branch</option>
                                <?php
                                    include '../Admin_modules/branch_call.php';

                                    foreach ($branch_fetch as $key => $value) {?>
                                        <option id="<?php echo $value['branch_id'];?>"><?php echo $value['branch_name'];?></option> 
                                    
                                    <?php 
                                    }
                                ?>
                            </select>
                        </div>
                    </div>
                    <!--Grid column-->

                     <!--Grid column-->
                    <div class="col-md-3">
                        <div class=" border-light ">
                             <input type="date" id="rc_date" name="rc_date" data-date-inline-picker="true" class="form-control mb-4" value="<?php echo date("Y-m-d");?>" max="<?php echo date("Y-m-d");?>">
                        </div>
                    </div>
                    <!--Grid column-->

                    <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light">
                            <input type="text" id="rc_no" name="rc_no" class="form-control mb-4" placeholder="Receipt No" readonly>
                        </div>
                    </div>
                    <!--Grid column-->
                     

                </div>
                    <!--Grid row-->
                <div class="row" style="padding: 10px;">

                    <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light">
                            <input id="rc_from" name="rc_from" class="form-control mb-4" placeholder="From Name" required>
                            <div id="nameList"></div>
                        </div>
                    </div>

            
                    <!--Grid column-->

                    <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light">
                            <input id="rc_to" name="rc_to" class="form-control mb-4" placeholder="To Name" required>
                        </div>
                    </div>
                    <!--Grid column-->
                        
                     <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light">
                              <input type="text" id="mob_no" name="mob_no" maxlength="10" class="form-control mb-4" placeholder="Mobile No" required>
                        </div>
                    </div>
                    <!--Grid column-->

                    <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light">
                             <input type="text" id="gst" name="gst" class="form-control mb-4" placeholder="GST No">
                        </div>
                    </div>
                    <!--Grid column-->
            
                </div>
                <!--Grid row-->
                

                <!--Grid row-->
                <div class="row" style="padding: 0px 10px 0px 10px;">

                    <!--Grid column-->
                    <div class="col-md-2">
                        <div class="border-light">
                            <select name="particulars" id="particulars" class="form-control mb-4" onchange="type_check(this); branch()">
                                <option value="br_parcel">Parcel</option>
                                <option value="br_docs">Documents</option>
                                <!-- <option value="other">Other</option> -->
                            </select>
                        </div>
                    </div>

                    <div class="col-md-2" id="enter_type" style="display: none;">
                        <div class="border-light">
                             <input type="text" id="other" class="form-control mb-4" placeholder="Enter Document Type">
                        </div>
                    </div>

                    <script type="text/javascript">
                        function type_check(that) {
                            if (that.value == "other") {
                                document.getElementById("enter_type").style.display = "block";
                            } else {
                                document.getElementById("enter_type").style.display = "none";
                            }
                        }
                    </script>
                    <!--Grid column-->

                     <!--Grid column-->
                    <!--Grid column-->
                    <div class="col-md-2">
                        <div class="border-light">
                             <input type="text" id="kg" name="kg" class="form-control mb-4" placeholder="Enter Kg" onfocusout="branch()">
                
                        </div>
                    </div>
                    <!--Grid column-->
                    <!--Grid column-->
                    <!--Grid column-->
                    <!--<div class="col-md-2">-->
                    <!--    <div class="border-light">-->
                    <!--        <input class="form-control mb-4"  value="VPP Payment" readonly>-->
                    <!--    </div>-->
                    <!--</div>-->
                    <!--<div class="col-md-2">-->
                    <!--    <div class="border-light">-->
                    <!--        <select name="pay_type" id="pay_type" class="form-control mb-4" onchange="branch()" required>-->
                    <!--            <option value="">select option</option>-->
                    <!--            <option value="paid">Paid</option>-->
                    <!--            <option value="toPay">To Pay</option>-->
                    <!--        </select>-->
                    <!--    </div>-->
                    <!--</div>-->

                    <!--<script type="text/javascript">-->
                    <!--    function pay_check(that) {-->
                    <!--        if (that.value == "toPay") {-->
                    <!--            document.getElementById("vvp_pay").style.display = "block";-->
                    <!--            document.getElementById("vvp_amt").innerHTML = " ";-->
                    <!--        } else {-->
                    <!--            document.getElementById("vvp_pay").style.display = "none";-->
                    <!--            document.getElementById("vvp_amt").innerHTML = "PAID";-->
                    <!--        }-->
                    <!--    }-->
                    <!--</script>-->
                    <!--Grid column-->
                    <div class="col-md-2" id="vvp_pay">
                        <div class="border-light">
                            <label for="vvp_amount">VPP Amount (&#x20B9)</label>
                            <input type="text" id="vvp_amount" name="vvp_amount" class="form-control mb-4" onchange="branch()">
                            
                        </div>
                    </div>
                     

                     <!--Grid column-->
                    <div class="col-md-2">
                        <div class="border-light">
                             <input type="text" id="name" name="no_par" class="form-control mb-4" placeholder="No of Parcels" >
                        </div>
                    </div>
                    <div class="col-md-2">
                        <div class="border-light">
                            <input class="form-control mb-4" type="text" name="to_mobile" placeholder="To mobile number" maxlength="10">
                        </div>
                    </div>
                    <!--Grid column-->

                     
                    <!--Grid column-->

                     
                    <!--Grid column-->

                </div>
                <!--Grid row-->     
            </div>
      </fieldset>


<!-- <div class="card" style="background-color: #F0EEEE; border-radius: 8px"> -->
    <fieldset style="margin: 5px 0 5px 0; border: 1px solid #095D92; width: 100%; background-color:#F0EEEE;border-radius: 6px">
    <div class="data1">


    <div id="row" style="margin-top: 10px">
        <div class="col-md-12">
            <div class="row">
                <div class="col-md-1"></div>
                
                <div class="col-md-3" >
                    <table class="table table-title">
                     <thead>
                     <tr>
                        <th colspan="3" style="background-color: #E4E2E2">Courier Charges</th>  
                     </tr>
                    </thead>
                        <tbody>
                        <tr>
                        <td colspan="2">Courier Charges</td>
                        <td colspan="1"><input type="text" id="cour_charg" name="cour_charg" onkeyup="makeEdit()" style="width:80%;text-align: center;" readonly><p  id="cc" hidden></p></td>
                        </tr>
                        <tr>
                        <td colspan="2">Courier VPP Charges</td>
                        <td colspan="1">   <input type="text" id="vpp_charge" name="vpp_charge" onkeyup="makeEdit()" style="width:80%;text-align: center;" readonly><p id="vvp_amt" hidden></p></td>
                        </tr>
                        <tr>
                        <td colspan="2" style="background-color: #E4E2E2">Total  : &#x20B9</td>
                        <td colspan="1" style="background-color: #E4E2E2"><p id="total_cc"></p></td>  
                        </tr>      
                        </tbody>
                    </table>           
                </div>
       
          
  <!--    ----------------------------------/ GST table2.-------------------------------------------/    -->


            <div class="col-md-3" style="text-align: -webkit-center;font-size: 18px;font-weight: bolder;align-self: end;margin-top:20px;">
                             <!--<input type="text" id="vpp_charge" name="vpp_charge">-->
                             <!--  <input type="text" id="cour_charg" name="cour_charg">-->
                            <!-- <table class="table " id="paymethod" style="display: none;">
                            <thead>
                                <tr>
                                    <th colspan="2" style="background-color: #E4E2E2">GST Charges</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>SGST  9%</td>
                                    <td><p id="sgst"></p></td>
                                </tr>
                                <tr>   
                                    <td>CGST  9%</td>
                                    <td><p id="cgst"></p></td>
                                </tr>
                                <tr>
                                    <td>IGST  9%</td>
                                    <td>-</td>
                                </tr>
                                <tr>
                                    <td colspan="1" style="background-color: #E4E2E2">Total GST : &#x20B9</td>
                                    <td style="background-color: #E4E2E2"><p id="gst_tot"></p></td>
                                </tr>      
            
                            </tbody>
                            </table>  -->
                        <!--<label class="radio-inline">-->
                        <!--    <input type="radio" name="optradio" value="paid" checked>Paid-->
                        <!--</label>-->
                       
                        <!--<label class="radio-inline">-->
                        <!--    <input type="radio" name="optradio" value="topay">To Pay-->
                        <!--</label>-->
                       
            </div>

                    <div class="col-md-3" style="font-weight: bolder;align-self: end;">
                        <div class="form-group shadow-textarea">
                            <label for="exampleFormControlTextarea6">Remarks :</label>
                            <textarea class="form-control z-depth-1" id="remarks" name="remarks" rows="3" placeholder="Write something here..."></textarea>
                        </div>
                    </div>

                    <div class="col-md-2" style="align-self: flex-end;text-align: -webkit-right;">  <a id="myButton"  value="update" onclick="editInput()" ><i class="material-icons">&#xE254;</i></a></div>
           </div>
       </div>
   </div>
</div>
</fieldset>



    <fieldset style="margin: 5px 0 5px 0; border: 1px solid #095D92; width: 100%; background-color:#F0EEEE;border-radius: 6px">

    <div id="row">
        <div class="col-md-12">
            <div class="row">
                
                <div class="col-md-2" style="vertical-align: middle; align-self: center;">
                    <!-- Title -->
                     <h4 class="card-title" style="float: left; font-weight: bold; margin: 0px;"><a>Grand Total (&#x20B9) : </a></h4>
                </div>
                
                <div class="col-md-3" style="vertical-align: middle; align-self: center;">
                    <!-- Text -->
                     <h4 class="card-title" style="float: left; font-weight: bold; margin: 0px;"><a><p id="grand_tot" ></p></a></h4>
                </div>
               
                <div class="col-md-2 " style="text-align: center;">
                    

                <input type="hidden" id="g_tot" name="g_tot">

                <button name="submit_rc" type="submit" style="background: transparent; border: none;" ><a class="btn" style="background-color: #00AC8B; border-radius: 4px; color: #fff">Print</a></button>                                                            
                </div>
            </div>

        </div>
    </div></fieldset>
 

        </div>
       
                
    </form>
       
        <!--Grid column-->

        </div>


<!--Section: Contact v.2-->
</body>
</html> 
