<?php

session_start();


if (!isset($_SESSION['admin_userName'])) {
    header('Location: login.php');
    }
?>
<?php 
error_reporting(0);
include '../Admin_controllers/receipt.php';

include '../Admin_modules/receipt_edit.php';
//print_r($_POST);
include("header.php");

?>

<style type="text/css"> 
input{background-color: #F0EEEE;}


     .e {
        background-color: rgba(0,0,0,0.5);
    }
     #nav  .e1
    {
        color: #f9a825;
        font-weight: 600;
    }
         nav a:hover {
    background-color: #721418;
    color: #f9a825;
        font-weight: 600;
}


</style>
<body>

<div>
    <div class="row" style="margin: 10px 5px 5px 5px"> 
        <div class="col-md-12" >
            <div class="col-md-4" style="float: left;"></div>
            <div class="col-md-4.5" style="float: left;">
                <div id="search">
                    <form class="form-inline mr-auto" method="post" action="editReceipt.php">
                        <label style="margin-right: 10px; font-family: sans-serif; font-size: 20px">Enter Receipt No :</label>
                        <input class="form-control mr-sm-2" type="text" placeholder="Search" id="receiptno" name="rc_edit" aria-label="Search">
                        <button class="btn  btn-rounded btn-sm my-0" name="submit" type="submit" style="background-color: #00AC8B;font-size: 14px">Search</button>
                    </form>
                </div>
            </div>
            <div class="col-md-3" style="float: left;"></div>
        </div>
    </div>

    <p class="solid1" style="outline-style: solid; margin-top: 10px;  color: #00AC8B"></p>
   
        <!--Grid column-->
    <div class="col-md-12 ">

     <!--   <div style="float: right; margin-top: 5px ; text-align: center;">
          <span style="font-weight: bold;">Type :<?php echo strtoupper($receipt_fetch['rc_type']);?></span>
        </div>-->

      <form action="../Admin_modules/aditReceipt.php" method="post">
      <fieldset style="margin: 30px 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;">

                    <div class="col-md-3">
                        <div class="border-light">
                            <span><b>From Branch :</b> </span>
                            <input type="text" name="" class="form-control mb-4" value="MUMBAI" readonly>
                        </div>
                    </div>

                    <div class="col-md-3">
                        <div class="border-light">
                             <span><b>To Branch :</b> <b>
                            <select name="br_to" id="br_to" class="form-control mb-4" onchange="edit_receipt()">
                                <?php
                                    include '../Admin_modules/branch_call.php';
                                    foreach ($branch_fetch as $key => $value) {?>
                                        <option id="<?php echo $value['branch_id'];?>"
                                            <?php
                                                if (($receipt_fetch['rc_toBranch'])==$value['branch_name']) {
                                                   echo "Selected";
                                                }
                                            ?>>
                                            <?php echo $value['branch_name'];?>
                                        </option> 
                                    
                                    <?php 
                                    }
                                ?>
                            </select>

                             </b></span>
                        </div>
                    </div>

                    <div class="col-md-3">
                        <div class=" border-light ">
                             <span><b>Date :</b> </span>
                               <input type="text" name="" class="form-control mb-4" value="<?php echo $receipt_fetch['rc_date'];?>" readonly>
                        </div>
                    </div>

                    <div class="col-md-3">
                        <div class="border-light">
                            <span><b>Receipt Number :</b> </span>
                                  <input type="text" name="receipt_no" class="form-control mb-4"  value="<?php echo $receipt_fetch['rc_number'];?>"  readonly>
                              
                        </div>
                    </div>

                </div>

                <div class="row" style="padding: 10px;">

                    <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light" >
                            <span><b>From :</b> </span>
                            <input type="text" name="" class="form-control mb-4" value="<?php echo strtoupper($receipt_fetch['rc_from']);?>" readonly>
                        </div>
                    </div>

                    <div class="col-md-3" >
                        <div class="border-light" >
                            <span><b>To:</b> </span>
                             <input type="text" name="" class="form-control mb-4" value="<?php echo strtoupper($receipt_fetch['rc_to']);?>" readonly>
                        </div>
                    </div>

                    <div class="col-md-3" >
                        <div class="border-light" >
                              <span><b>Mobile Number :</b> </span>
                               <input type="text" name="" class="form-control mb-4" value="<?php echo $receipt_fetch['rc_mob'];?>" readonly>
                        </div>
                    </div>

                    <div class="col-md-3">
                        <div class="border-light" >
                             <span><b>GST No :</b> </span>
                             <input type="text" name="" class="form-control mb-4" value="<?php echo $receipt_fetch['rc_gst'];?>" readonly>
                        </div>
                    </div>
                    <!--Grid column-->
            
                </div>

                <div class="row" style="padding: 10px;">

                    <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light">
                           <b> Courier Type :</b> <span><b>
                                <?php 

                                    $des=$receipt_fetch['rc_particulars'];
                                    $ex=explode('_', $des);
                                    $new = strtoupper(end($ex));
                                    //echo $new;
                                ?>
                               <!--  <input type="hidden" id="particulars" value="<?php echo $des;?>"> -->
                                  <input type="text" name="" id="particulars" class="form-control mb-4" value="<?php echo $new;?>" readonly>
                                </b></span>
                        </div>
                    </div>

                    <div class="col-md-3">
                        <div class="border-light">
                            <span><b>VPP <?php echo "(&#8377;) : "; ?></b></span>
                              <input type="text" name="editvvp"id="editvvp" class="form-control mb-4" value="<?php echo $receipt_fetch['rc_vvp'];?>" >
                           <!--  <input type="text" id="editvvp" name="editvvp" value="<?php echo $receipt_fetch['rc_vvp'];?>" onchange="edit_receipt()"> -->
                        </div>
                    </div>

                    <div class="col-md-3">
                        <div class="border-light">
                             <span><b>Weight  <?php  echo " (KG) : " ?></b></span>
                                <input type="text" name="editWeight" id="editWeight" class="form-control mb-4" value="<?php echo $receipt_fetch['rc_kg'];?>" >
                                <!-- <input type="text" id="editWeight" name="editWeight" value="<?php echo $receipt_fetch['rc_kg'];?>" onfocusout="edit_receipt()"> -->
                        </div>
                    </div>

                    <div class="col-md-3">
                        <div class="border-light">
                             <span><b>No of Parcels :</b> </span>
                                 <input type="text" name="editParcelNo" id="editWeight" class="form-control mb-4" value="<?php echo $receipt_fetch['rc_parcels'];?>" >
                               <!--  <b><input type="text" name="editParcelNo" value="<?php echo $receipt_fetch['rc_parcels'];?>"></b></span> -->
                        </div>
                    </div>

                </div>

                <div class="row" style="padding: 10px;">

                    <!--Grid column-->
                    <div class="col-md-3">
                        <div class="border-light">
                          <b>Remarks : </b>
                                 <input type="text" name="remarks" id="editWeight" class="form-control mb-4" value="<?php if(!empty( $receipt_fetch['rc_remarks'])){ echo $receipt_fetch['rc_remarks'];}else{echo "-----";}?>" readonly>
                               <!--  <b contenteditable="true"><?php echo $receipt_fetch['rc_remarks'];?></b></span> -->
                        </div>
                    </div>

                    <div class="col-md-3">
                        <div class="border-light">
                            <b>Courier Charges <?php echo "(&#8377;) : "; ?></b><!-- <b id="newcc"><?php  echo $receipt_fetch['rc_cour_total'];?></b></span> -->
                            <input type="text" name="cc_charges" id="editWeight" class="form-control mb-4" value="<?php  echo $receipt_fetch['rc_cour_total'];?>" readonly>
                        </div>
                        <input type="hidden" name="newcc" id="new_cc">
                    </div>

                    <div class="col-md-3">
                        <div class="border-light">
                            <b>VPP Charges <?php echo "(&#8377;) :  " ?></b> <!-- <b id="newgst"><?php  echo $receipt_fetch['vpp_charges'];?></b></span> -->
                              <input type="text" name="vpp_charges" id="editWeight" class="form-control mb-4" value="<?php  echo $receipt_fetch['vpp_charges'];?>" readonly>
                        </div>
                        <input type="hidden" name="newgst" id="new_gst" value="">
                    </div>

                    <div class="col-md-3">
                        <div class="border-light">
                            <b>Grand Total <?php echo "(&#8377;) :  " ?></b>  <!-- <span><b id="newtot"><?php  echo $receipt_fetch['rc_total'];?></b></span> -->
                                 <input type="text" name="grd_total" id="editWeight" class="form-control mb-4" value="<?php  echo $receipt_fetch['rc_total'];?>" readonly>
                        </div>
                        <input type="hidden" name="newtot" id="new_tot" value="">
                    </div>

                </div>


    <div class="col-md-12" style="margin-top: 15px">
        <div class="col-md-3 f"> </div>
       
        <div class="col-md-2 f"> </div>
        
        <div class="col-md-2 f"> 
            <div>
                 <button class="btn  btn-rounded btn-sm my-0" name="editSubmit" type="submit" style="background-color: #00AC8B;font-size: 14px">Save Changes</button>
            </div>
        </div>
        
        <div class="col-md-2 f"></div>

        <div class="col-md-3 f"></div>
    </div>



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


      
      
</div>
</body>
</html> 
