ok

Mini Shell

Direktori : /home2/selectio/public_html/wedding-info/php old code/
Upload File :
Current File : //home2/selectio/public_html/wedding-info/php old code/order-bulk-upload.php

<?php include 'header.php';
/*Client DropDown Details Start*/
    $conditions = '';
    
    if($_SESSION['speed_connect']['id'] && $_SESSION['sc_user_type']==2){
        $id = $_SESSION['speed_connect']['id'];
        $conditions.='and id='.$id;  
    }else if($_SESSION['speed_connect']['id'] && $_SESSION['sc_user_type']==1){
        $id = $_SESSION['speed_connect']['id'];
        $conditions.='';   
    }

    $statement = $pdo->prepare("SELECT * FROM `client` WHERE status='Active' $conditions");
    $statement->execute();
    $client_dropdown = $statement->fetchAll(PDO::FETCH_ASSOC);
/*Client DropDown End*/
?>
<div class="page-wrapper">
	<div class="page-content">
	    <div class=" card card-body">
	    <div class="row">
		        <center>
			    	<h6 class="app_theme"><i class="fadeIn animated bx bx-upload"></i> Bulk Update New Orders via CSV</h6>
			 	</center>  
			 	
			 	<div class="col-md-6">
			 	    <center><img src="assets/fa-icons/download.svg" style="width: 20px;margin-top: -5px;"> <a href="api/csv/shipment-bulk-upload-sample.php" download>Download Sample CSV File</a></center><br>
			 	   <b style="font-size:17px;"><img src="assets/fa-icons/info.png" style="width: 20px;margin-top: -5px;"> Bulk Update New Orders via CSV</b><br>
			 	    <div style="padding-left:25px;">
			 	    <b >
			    	    1.Pincode - <span style="color:red;">Only Number Allowed,* Required</span><br>
			    	    2.City - <span style="color:green;"> Optional</span><br>
			    	    3.State - <span style="color:green;"> Optional</span><br>
			    	    4.Service - <span style="color:black;"> Yes or No</span><br>
			    	    5.Air - <span style="color:black;"> Yes or No</span><br>
			    	    6.Road - <span style="color:black;"> Yes or No</span><br>
			    	    7.TAT - <span style="color:green;"> Optional</span><br>
			    	    8.Area Code - <span style="color:green;"> Optional</span><br>
			    	</b>
			    	</div>
		        </div>
		        <div class="col-md-6">
		          <form id="bulk_upload_form" method="post" enctype="multipart/form-data">
		            <div class="row">
		                
		                <div class="row g-3 mr-bottom-10" <?php if($_SESSION['speed_connect']['id'] && $_SESSION['sc_user_type']==2){ echo "hidden"; }?>>  
									    <h6 class="mb-1 " >Select Client Information Details</h6>
									      	<div class="col-12 col-lg-8">
												<label for="FisrtName" class="form-label required">Select Client Name</label>
												<select name="client_id" id="client_id" class="form-select valid font-size12" aria-invalid="false" required>
                            					<?php 
                            					foreach($client_dropdown as $client){ 
                            					    echo "<option value='".$client['id']."'>".$client['company_name']."</option>";
                            					}
                            					?>
                            					</select>
											</div>
						</div> 
		                <div class="col-12 col-lg-8">
        					<label for="Company Name" class="form-label required">Upload Updated CSV File</label>
        					<input type="file" name="upload_file" class="form-control" accept=".csv" placeholder="Upload Logo">
                    	</div>
                    	<div class="col-8 text-right">
                    	    <br>
                    	    <button class="btn btn-sm btn-success" type="submit" name="upload_submit"><i class="fadeIn animated bx bx-upload"></i> Upload Data</button>
                    	</div>
		            </div>
		      </form>
		        </div>
		</div>
	    </div>
	</div>
</div>
<script>
    $(document).ready(function(){
		        $( "#bulk_upload_form" ).validate( {
		            rules: {
    					upload_file: {
    						required: true,
    					},
		            },
	            	messages: {
					upload_file: {
						required: "<img src='assets/fa-icons/error.png' style='width: 20px;margin-top: 5px;'> Browse Shipment Update CSV File is Required",
					},
	            	},
					submitHandler: function(form) {
					    $('#loader').show();
					    var formData = new FormData(form);
                        $.ajax({
                            url: 'api/bulk-upload/shipment-upload-api.php',
                            type: 'post',
                            method: 'POST',
                          /*  dataType: 'json',*/
                            cache: false,
                            contentType: false,
                            processData: false,
                            cache: false,
                            enctype: 'multipart/form-data',
                            data: formData,
                            success: function (response) {
                                console.log(response);
                                $('#loader').hide();
                            }
                        });
                    }
		        });
    });
</script>

<?php include 'footer.php'; ?>

Zerion Mini Shell 1.0