ok

Mini Shell

Direktori : /home2/selectio/www/lilyexpresslive/software/admin/
Upload File :
Current File : /home2/selectio/www/lilyexpresslive/software/admin/manifest-update-status.php

<?php require_once('header.php');
$statement = $pdo->prepare("SELECT * FROM manifest WHERE id=?");
							$statement->execute(array($_REQUEST['id']));
							$result1 = $statement->fetchAll(PDO::FETCH_ASSOC);

?>
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>-->
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>-->
<script>
$(document).ready(function(){
    $('#country').on('change', function(){
        var countryID = $(this).val();
       
        if(countryID){
            $.ajax({
                type:'POST',
                url:'get_branch_sunit.php',
                data:'country_id='+countryID,
                success:function(html){
                    $('#state').html(html);
                     $('#state1').html(html);
                    $('#city').html('<option value="">Select Franchise first</option>'); 
                     get_branchBase(countryID);
                }
            }); 
        }else{
            $('#state').html('<option value="">Select Branch first</option>');
             $('#city').html('<option value="">Select Franchise first</option>'); 
        }
    });
    $('#state').on('change', function(){
        var stateID = $(this).val();
        if(stateID){
            $.ajax({
                type:'POST',
                url:'get_branch_sunit.php',
                data:'state_id='+stateID,
                success:function(html){
                    $('#city').html(html);
                  
                }
            }); 
        }else{
            $('#city').html('<option value="">Select Franchise first</option>'); 
        }
    });
    $('#city').on('change', function(){
        var CityID = $(this).val();
         if(CityID){
        $(':input[id="btnadd"]').prop('disabled', false);
         }
    });
});
</script>
<script>
    $(document).ready(function(){
        $('#btnadd').click(function(){
            var checkValues = $('input[name=checkboxlist]:checked').map(function()
            {
                return $(this).val();
            }).get();
             if(checkValues!=""){
          $.ajax({
        url: 'assign_dealer.php',
        type: 'post',
        data: {search:checkValues},
        dataType: 'json',
        success: function(response)
        {
            if(response==1)
            {
           alert('Assigned To Dealer SuccessFully !!'); 
           location.reload();
            }
            else{
               alert('Failed To Assign !!');
               location.reload();
            }
        }

    });
        }
            else{
                alert('No Value Selected');
            }
        });
    });
</script>

<script>
    $(document).ready(function(){
       $('#status').on('change',function(){
           var status= $('#status').val();
         
         if(status=='Delivered'){
              $("#delivered").show();
              $("#undelivered").hide();
         }
         else if(status=='Undelivery'){
               $("#delivered").hide();
              $("#undelivered").show();
         }
         else
         {
               $("#delivered").hide();
              $("#undelivered").hide();
         }
        });
    });
</script>

<script type="text/javascript">
$(document).ready(function(){
    $('#select_all').on('click',function(){
        if(this.checked){
            $('.checkbox').each(function(){
                this.checked = true;
            });
        }else{
             $('.checkbox').each(function(){
                this.checked = false;
            });
        }
      });
    
    $('.checkbox').on('click',function(){
        if($('.checkbox:checked').length == $('.checkbox').length){
            $('#select_all').prop('checked',true);
        }else{
            $('#select_all').prop('checked',false);
        }
    });
});

    
 function updatestatusTo(){
      var status=$('#status').val();
      var r_name=$('#r_name').val();
      var r_mobile=$('#r_mobile').val();
      var r_relation=$('#r_relation').val();
      var r_delivery_date=$('#r_delivery_date').val();
      var reason=$('#reason').val();
      var remark=$('#remark').val();
       var destination=   $('#destination').val();
       var status_date=   $('#status_date').val();
      
       var checkValues = $('input[name=checkboxlist]:checked').map(function()
            {
                return $(this).val();
            }).get();
             if(checkValues!=""){
          $.ajax({
        url: 'delivery_status_update.php',
        type: 'post',
        data: {pickup_id:checkValues,status:status,r_name:r_name,r_mobile:r_mobile,r_relation:r_relation,r_delivery_date:r_delivery_date,reason:reason,remark:remark,destination:destination,status_date:status_date},
        dataType: 'json',
        success: function(response)
        {
           //alert(response);
            if(response==1)
            {
           alert('Status Updated SuccessFully !!'); 
           location.reload();
            }
            else{
               alert('Failed To Assign !!');
               location.reload();
            }
        }

    });
        }
            else{
                alert('No Value Selected');
            }

}
</script>
<section class="content-header">
	<div class="content-header-left">
		<h1>Manifest Update Status</h1>
	</div>
<!--Bulk Upload Code Start-->

<!--Bulk Upload Code End-->	
	
</section>

<section class="content">
	<div class="row">
	     <b><center><h4>MAINFEST</h4></center>
    <?php foreach ($result1 as $row) { 
        $mani_fest=$row['manifest_id'];
        ?>
    <table  style="width: 100%;line-height: 34px;">
         <tr>
			            <td style="text-align:left;padding-left: 2%;">ORIGIN :&emsp;<?php echo $row['origin']; ?> </td>
			            <td style="text-align:left;padding-left: 2%;">DATE :&emsp;  <?php $day=date_create($row['entry_date']); $new_date=date_format($day,'d-m-Y');  echo $new_date; ?></td>
			            <td style="text-align:left;padding-left: 2%;">SENDING THROUGH :&emsp;<?php if($row['sending_through']=='air'){ echo 'AIR';}if($row['sending_through']=='road'){ echo 'ROAD';} ?> </td>
		</tr>
		 <tr>
			            <td style="text-align:left;padding-left: 2%;">DESTINATION :&emsp; <?php $d_dest=$row['destination']; echo $row['destination']; ?>
			            <td style="text-align:left;padding-left: 2%;">MANIFEST NO :&emsp;<?php echo $row['manifest_id']; ?></td>
			            <td style="text-align:left;padding-left: 2%;">TRANSPORT NAME :&emsp;<?php echo $row['transport_name']; ?></td>
			            
		</tr>
        
    </table>
     <?php } ?>  
  
		<div class="col-md-12">
			<div class="box box-info">
				<div class="box-body table-responsive">
					<table id="example1" class="table table-bordered table-striped">
						<thead>
							<tr>
								<th width="30">SL</th>
								<th><i class="fa fa-check"></i><input type="checkbox" id="select_all" /></th>
								<th>AWB Number</th>
								<th>Ref Number</th>
								<th>Material</th>
								<th>Company Name</th>
								<th>Address</th>
								<th>Mobile Number</th>
								<th>Status</th>
								<th>Payment Mode</th>
								<th>Customer Name</th>
								
							</tr>
						</thead>
						
						   <tbody>
							<?php
							$i=0;
							$manifest_id=$_GET['manifest_id'];
						
							$statement = $pdo->prepare("SELECT pickup_entry.*,tbl_user.full_name as client_name,material_desc.full_desc as content,tbl_customer.cust_name as cust_name FROM pickup_entry INNER JOIN tbl_user INNER JOIN tbl_customer INNER JOIN material_desc on pickup_entry.client_id=tbl_user.id AND pickup_entry.content_desc=material_desc.id AND pickup_entry.customer_id=tbl_customer.cust_id and (pickup_entry.status='picked' or pickup_entry.status='manifest' or pickup_entry.status='In Transit' or pickup_entry.status='Received at destination' or pickup_entry.status='Out for delivery' or pickup_entry.status='Undelivery') and pickup_entry.manifest_id='$manifest_id'  order by pickup_entry.id DESC");
						 
							/*This Line Removed By Ganesan */
							/*and tbl_user.role='client'*/
							$statement->execute();
							$result = $statement->fetchAll(PDO::FETCH_ASSOC);
							foreach ($result as $row) {
								$i++;
								?>
								<tr>
									<td><?php echo $i; ?></td>
									<td><input type="checkbox" class="checkbox" name="checkboxlist" value="<?php echo $row['id']; ?>"/></td>
									<td><?php echo $row['ref_no']; ?></td>
									<td><?php echo $row['awb_no']; ?></td>
									<td><?php echo $row['content']; ?></td>
									<td><?php echo $row['client_name']; ?></td>
									<td><?php echo $row['address']; ?></td>
									<!--<td><?php echo $row['pincode']; ?></td>	-->
									<td><?php echo $row['phone']; ?></td>
									<td>
									    <?php 
									        if($row['status']=="manifest"){?> <p class="btn btn-success btn-xs"> Manifest</p> <?php } 
									        elseif($row['status']=="picked"){ ?><p class="btn btn-primary btn-xs"> Picked</p> <?php }
									        elseif($row['status']=="In Transit"){ ?><p class="btn btn-primary btn-xs" style="background-color: #59e005;"> In Transit</p> <?php }
									        elseif($row['status']=="Received at destination"){ ?><p class="btn btn-primary btn-xs" style="background-color: #e42cd6;"> Received at Destination</p> <?php }
									        elseif($row['status']=="Out for delivery"){ ?><p class="btn btn-primary btn-xs" style="background-color: #2913dc;"> Out for Delivery</p> <?php }
									        elseif($row['status']=="Undelivery"){ ?><p class="btn btn-primary btn-xs" style="background-color: #25f10c;"> Undelivery</p> <?php }
									        elseif($row['status']=="Undelivery"){ ?><p class="btn btn-primary btn-xs" style="background-color: #59e005;"> --</p> <?php }
									    ?> 
									
									</td>
									<td><?php echo $row['payment_mode']; ?></td>
									<td><?php echo $row['cust_name']; ?></td>
								</tr>
								<?php
							}
							?>							
						</tbody>
					
						
						
						
						
						
					</table>
				</div>
			</div>
		</div>
	</div>
	<div class="row">
	    <div class="col-md-12">
	        <div class="col-md-4">
	        	<div class="form-group">
					<label for="" class="col-sm-6 control-label text-right">Select Status <span>*</span></label>
							<div class="col-sm-6">
							    <select name="status" class="form-control" id='status'>
							        <option value="In Transit">In Transit</option> 
							        <option value="Received at destination">Received at Destination</option>
							        <option value="Out for delivery">Out for delivery</option>
							        <option value="Delivered">Delivered</option>
							        <option value="Undelivery">Undelivery</option>
							        ?>
							        
							    </select>
							</div>	
						</div>		
				</div>
				<div class="col-md-4">
		 <input type="date" autocomplete="off" class="form-control" name="status_date" value="<?php echo date("Y-m-d") ?>"  id="status_date" required>
		 </div>
		 <div class="col-md-4">
				        <div class="form-group">
				    	<label for="" class="col-sm-4 control-label text-right">Destination <span>*</span></label>
							<div class="col-sm-4">
							<input type="text" class="form-control" name="destinaton" id="destination" value="<?php echo $d_dest ?>">
							</div>
				</div>
				    </div>
				
				<div id='delivered' style="display:none;padding-top: 4%;" >
				    <div class="col-md-6">
				        <div class="form-group">
				    	<label for="" class="col-sm-6 control-label text-right">Receiver Name <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="r_name" id="r_name"  value="">
							</div>
				</div>
				    </div>
				    <div class="col-md-6">
				        <div class="form-group">
				    	<label for="" class="col-sm-6 control-label text-right">Receiver Mobile <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="r_mobile" id="r_mobile" value="">
							</div>
				</div>
				    </div>
				    
	     <div style="padding-top: 4%;">
				    <div class="col-md-6">
				        <div class="form-group">
				    	<label for="" class="col-sm-6 control-label text-right">Relation <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="r_relation" id="r_relation" value="">
							</div>
				</div>
				    </div>
				    <div class="col-md-6">
				        <div class="form-group">
				    	<label for="" class="col-sm-6 control-label text-right">Delivery Date <span>*</span></label>
							<div class="col-sm-6">
								<input type="date" autocomplete="off" class="form-control" name="r_delivery_date" id="r_delivery_date" value="">
							</div>
				</div>
				    </div>
				    </div>
				    
				</div>
				<div id='undelivered' style="display:none;padding-top: 4%;">
				    <div class="col-md-6">
				        <div class="form-group">
				    	<label for="" class="col-sm-6 control-label text-right">Reason <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="reason" id="reason" value="">
							</div>
				</div>
				    </div>
				    <div class="col-md-6">
				        <div class="form-group">
				    	<label for="" class="col-sm-6 control-label text-right">Remark <span>*</span></label>
							<div class="col-sm-6">
								<input type="text" autocomplete="off" class="form-control" name="remark" id="remark" value="">
							</div>
				</div>
				    </div>
				</div>
				<div class="col-md-4">
				<center><button class="btn btn-primary btn-sm" onclick="updatestatusTo();">Update Status</button></center>
					</div>
		<br>	<br>	<br>	<br>	<br>	<br>	<br>
	        
	    </div>
	</div>
</section>

<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Delete Confirmation</h4>
            </div>
            <div class="modal-body">
                <p>Are you sure want to delete this item?</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                <a class="btn btn-danger btn-ok">Delete</a>
            </div>
        </div>
    </div>
</div>


<?php require_once('footer.php'); ?>

Zerion Mini Shell 1.0