<div class="wpcsr-search-box single-search">
	<form id="wpcsr-findrate" class="wpcsr-quote-book mb-0" action="<?php echo $result_page_url; ?>" method="post">
		<?php wp_nonce_field( 'quote_request_action', 'quote_request_nonce_field' ); ?>
		<input type="hidden" name="search-type" value="0">
		<div id="wpcsr-srequest-wrapper" class="wpcargo-container">
			<div id="rate-container">
				<div class="location-information-section wpcargo-row">
					<div class="wpcargo-col-lg-5 p-lg-0">
						<div class="collection-from-section">
							<section class="wpcsr-sc-label">
								<span class="request-label label-from"><?php echo wpcsr_collection_form_label(); ?>:</span>
							</section>
							<section class="wpcsr-sc-content">
								<div class="content-fields">
									<section class="field-section origin-location">
										<select id="wpcsr-origin" class="form-control browser-default custom-select" name="shipment-from" required="required">
											<?php if( !empty( get_wpcsr_location() ) ): ?>
												<option value=""><i><?php echo wpcsr_country_form_label(); ?></i></option>
												<?php foreach(get_wpcsr_location() as $location ): ?>
													<option value="<?php echo $location->location_id; ?>" <?php echo selected( $_location, $location->location_id ); ?>><?php echo $location->location;?></option>
												<?php endforeach; ?>
											<?php else: ?>
												<option disabled="disabled"><i><?php echo wpcsr_no_location_form_label(); ?></i></option>
											<?php endif; ?>
										</select>
									</section>
									<section class="field-section origin-postcode">
										<input id="origin_postcode" type="text" name="origin_postcode" value="<?php echo $origin_postcode; ?>" class="form-control" placeholder="<?php echo wpcsr_postcode_form_label(); ?>">
									</section>
								</div>
							</section>
						</div>
					</div>
					<div class="wpcargo-col-lg-2 p-lg-0 text-center" style="margin: auto">
						<i class="fa fa-chevron-circle-right"></i>
					</div>
					<div class="wpcargo-col-lg-5 p-lg-0">
						<div class="deliver-to-section">
							<section class="wpcsr-sc-label">
								<span class="request-label label-to"><?php echo wpcsr_delivery_to_form_label(); ?>:</span>
							</section>
							<section class="wpcsr-sc-content">
								<div class="content-fields">
									<section class="field-section destination-location">
										<select id="wpcsr-destination" class="form-control browser-default custom-select" name="shipment-to" required="required" <?php echo ( !empty( $_location ) ) ? '' : 'disabled="disabled"' ; ?>>
											<?php if( $destination ): ?>
												<?php foreach( get_wpcsr_location() as $location ): ?>
													<option value="<?php echo $location->location_id;?>" <?php echo selected( $destination, $location->location_id ); ?>><?php echo $location->location; ?></option>
												<?php endforeach; ?>
											<?php else: ?>
												<option class="default" value=""><i><?php echo wpcsr_country_form_label(); ?></i></option>
											<?php endif; ?>
										</select>
									</section>
									<section class="field-section destination-postcode">
										<input id="destination_postcode" type="text" name="destination_postcode" value="<?php echo $destination_postcode; ?>" class="form-control" placeholder="<?php echo wpcsr_postcode_form_label(); ?>">	
									</section>
								</div>
							</section>
						</div>
					</div>
				</div>
				<div id="parcel-dimension">
					<section class="wpcsr-sc-label">
						<span class="request-label"><?php echo wpcsr_package_type_form_label(); ?></span>
						<?php foreach( wpcargo_package_settings()->peice_types as $piece_type): ?>
							<?php $active = ( $package_type == $piece_type ) ? 'active' : ''; ?>
							<label for="package-type-<?php echo $piece_type; ?>" class="package-type-label <?php echo $active; ?>">
								<input type="radio" name="wpc-pm-piece-type" class="package-type" value="<?php echo $piece_type; ?>" id="package-type-<?php echo $piece_type; ?>" <?php echo checked( $package_type, $piece_type ); ?>>
								<?php echo $piece_type; ?>
							</label>
						<?php endforeach;?>
					</section>
					<section>
						<span class="request-label"><?php echo wpcsr_enter_parcel_form_label(); ?></span>
					</section>
					<section id="wpcsr-parcels">
						<div class="table-responsive">
							<table class="table wpcargo-table-wrapper wpcsr-parcel-wrapper wpcargo-container" data-repeater-list="wpc-multiple-package">
								<thead>
									<tr>
										<th><?php echo wpcsr_qty_label(); ?></th>
										<th><?php echo wpcsr_weight_label(); ?></th>
										<?php if( wpcargo_package_settings()->dim_unit_enable ): ?>
											<th><?php echo wpcsr_length_label(); ?></th>
											<th><?php echo wpcsr_width_label(); ?></th>
											<th><?php echo wpcsr_height_label(); ?></th>
										<?php endif; ?>
										<?php if( $param['switch'] == 1 ): ?>
											<th>&nbsp;</th>
										<?php endif; ?>
									</tr>
								</thead>
								<tbody>
									<?php if( !empty( $parcels ) ): ?>
										<?php foreach ( $parcels as $parcel ) : ?>
											<tr data-repeater-item>
												<td>
													<div class="wpcsr-package-input">
														<input type="number" class="form-control" name="wpc-pm-qty" value="<?php echo $parcel['wpc-pm-qty']; ?>" min="1">
													</div>
													<div class="wpcsr-unit">
														<span><?php echo wpcsr_pcs_label(); ?></span>
													</div>
												</td>
												<td>
													<div class="wpcsr-package-input">
														<input type="text" class="form-control" name="wpc-pm-weight" value="<?php echo $parcel['wpc-pm-weight']; ?>" required="required">
													</div>
													<div class="wpcsr-unit">
														<span><?php _e( wpcargo_package_settings()->weight_unit, 'wpcargo-shipment-rate' );?></span>
													</div>
												</td>
												<?php if( wpcargo_package_settings()->dim_unit_enable ): ?>
													<td>
														<div class="wpcsr-package-input">
															<input type="number" class="form-control" name="wpc-pm-length" value="<?php echo $parcel['wpc-pm-length']; ?>" min="1">
														</div>
														<div class="wpcsr-unit">
															<span><?php _e( wpcargo_package_settings()->dim_unit, 'wpcargo-shipment-rate' );?></span>
														</div>
													</td>
													<td>
														<div class="wpcsr-package-input">
															<input type="number" class="form-control" name="wpc-pm-width" value="<?php echo $parcel['wpc-pm-width']; ?>" min="1">
														</div>
														<div class="wpcsr-unit">
															<span><?php _e( wpcargo_package_settings()->dim_unit, 'wpcargo-shipment-rate' );?></span>
														</div>
													</td>
													<td>
														<div class="wpcsr-package-input">
															<input type="number" class="form-control" name="wpc-pm-height" value="<?php echo $parcel['wpc-pm-height']; ?>" min="1">
														</div>
														<div class="wpcsr-unit">
															<span><?php _e( wpcargo_package_settings()->dim_unit, 'wpcargo-shipment-rate' );?></span>
														</div>
													</td>
												<?php endif; ?>
												<?php if( $param['switch'] == 1 ): ?>
													<td>
														<span class="dashicons dashicons-plus repeater-add" alt="<?php echo wpcsr_add_label(); ?>" data-repeater-create></span>
														<span class="dashicons dashicons-minus repeater-delete" alt="<?php echo wpcsr_delete_label(); ?>" data-repeater-delete></span>
													</td>
												<?php endif; ?>
											</tr>
										<?php endforeach; ?>
									<?php else: ?>
										<tr data-repeater-item>
											<td>
												<div class="wpcsr-package-input">
													<input type="number" class="form-control" name="wpc-pm-qty" min="1">
												</div>
												<div class="wpcsr-unit">
													<span><?php echo wpcsr_pcs_label(); ?></span>
												</div>
											</td>
											<td>
												<div class="wpcsr-package-input">
													<input type="text" class="form-control" name="wpc-pm-weight" value="" required="required">
												</div>
												<div class="wpcsr-unit">
													<span><?php _e( wpcargo_package_settings()->weight_unit, 'wpcargo-shipment-rate' );?></span>
												</div>
											</td>
											<?php if( wpcargo_package_settings()->dim_unit_enable ): ?>
												<td>
													<div class="wpcsr-package-input">
														<input type="number" class="form-control" name="wpc-pm-length" value="" min="1">
													</div>
													<div class="wpcsr-unit">
														<span><?php _e( wpcargo_package_settings()->dim_unit, 'wpcargo-shipment-rate' );?></span>
													</div>
												</td>
												<td>
													<div class="wpcsr-package-input">
														<input type="number" class="form-control" name="wpc-pm-width" value="" min="1">
													</div>
													<div class="wpcsr-unit">
														<span><?php _e( wpcargo_package_settings()->dim_unit, 'wpcargo-shipment-rate' );?></span>
													</div>
												</td>
												<td>
													<div class="wpcsr-package-input">
														<input type="number" class="form-control" name="wpc-pm-height" value="" min="1">
													</div>
													<div class="wpcsr-unit">
														<span><?php _e( wpcargo_package_settings()->dim_unit, 'wpcargo-shipment-rate' );?></span>
													</div>
												</td>
											<?php endif; ?>
											<?php if( $param['switch'] == 1 ): ?>
											<td>
												<span class="dashicons dashicons-plus repeater-add" alt="<?php echo wpcsr_add_label(); ?>" data-repeater-create></span>
												<span class="dashicons dashicons-minus repeater-delete" alt="<?php echo wpcsr_delete_label(); ?>" data-repeater-delete></span>
											</td>
											<?php endif; ?>
										</tr>
									<?php endif; ?>   
								</tbody>
							</table>
						</div>
					</section>
					<div class="quote_book_wrap text-center">			
						<input type="submit" class="wpcargo-btn wpcargo-btn-primary quote_book" value="<?php echo wpcsr_quote_book_label(); ?>" />	
					</div>
				</div>
			</div>	
		</div>
	</form>
</div>