<div id="warehouse-list">
    <div data-repeater-list="wpcsr_warehouses" class="warehouses-repeater-wrap">
        <?php if(!empty($warehouses)): ?>
			<?php foreach ($warehouses as $warehouse): ?>
				<section data-repeater-item class="warehouse-section one-third">
					<div class="section-content">
						<p><label><?php echo wpcsr_warehouse_name_label(); ?>:</label> <input type="text" name="name" value="<?php echo $warehouse['name']; ?>" placeholder="<?php echo wpcsr_warehouse_name_label(); ?>" required="required"></p>
						<p><label><?php echo wpcsr_phone_form_label(); ?>:</label> <input type="text" name="phone" value="<?php echo $warehouse['phone']; ?>" placeholder="<?php echo wpcsr_phone_form_label(); ?>"></p>
						<p><label><?php echo wpcsr_address1_label(); ?>:</label> <input type="text" name="address_1" value="<?php echo $warehouse['address_1']; ?>" placeholder="<?php echo wpcsr_address1_label(); ?>" required="required"></p>
						<p><label><?php echo wpcsr_address2_label(); ?>:</label> <input type="text" name="address_2" value="<?php echo $warehouse['address_2']; ?>" placeholder="<?php echo wpcsr_address2_label(); ?>"></p>
						<p><label><?php echo wpcsr_city_label(); ?>:</label> <input type="text" name="city" value="<?php echo $warehouse['city']; ?>" placeholder="<?php echo wpcsr_city_label(); ?>" required="required"></p>
						<p><label><?php echo wpcsr_postcode_zip_label(); ?>:</label> <input type="text" name="postcode" value="<?php echo $warehouse['postcode']; ?>" placeholder="<?php echo wpcsr_postcode_zip_label(); ?>"></p>
						<p>
							<label><?php echo wpcsr_country_label(); ?>:</label>
							<select name="country">
								<option value="">-- <?php echo wpcsr_select_country_label(); ?> --</option>
								<?php foreach( get_wpcargo_countries() as $country ): ?>
									<option value="<?php echo $country; ?>" <?php selected( $warehouse['country'], $country ); ?>><?php echo $country; ?></option>
								<?php endforeach; ?>
							</select>
						</p>
						<p><label><?php echo wpcsr_state_county_label(); ?>:</label> <input type="text" name="state" value="<?php echo $warehouse['state']; ?>" placeholder="<?php echo wpcsr_state_county_label(); ?>" ></p>
						<input data-repeater-delete class="button button-secondary button-small" type="button" value="<?php echo wpcsr_delete_label(); ?>"/>
					</div>         
				</section>
			<?php endforeach; ?>
		<?php else: ?>
			<section data-repeater-item class="warehouse-section one-third">
				<div class="section-content">
					<p><label><?php echo wpcsr_warehouse_name_label(); ?>:</label> <input type="text" name="name" value="" placeholder="<?php echo wpcsr_warehouse_name_label(); ?>" required="required"></p>
					<p><label><?php echo wpcsr_phone_form_label(); ?>:</label> <input type="text" name="phone" value="" placeholder="<?php echo wpcsr_phone_form_label(); ?>"></p>
					<p><label><?php echo wpcsr_address1_label(); ?>:</label> <input type="text" name="address_1" value="" placeholder="<?php echo wpcsr_address1_label(); ?>" required="required"></p>
					<p><label><?php echo wpcsr_address2_label(); ?>:</label> <input type="text" name="address_2" value="" placeholder="<?php echo wpcsr_address2_label(); ?>"></p>
					<p><label><?php echo wpcsr_city_label(); ?>:</label> <input type="text" name="city" value="" placeholder="<?php echo wpcsr_city_label(); ?>" required="required"></p>
					<p><label><?php echo wpcsr_postcode_zip_label(); ?>:</label> <input type="text" name="postcode" value="" placeholder="<?php echo wpcsr_postcode_zip_label(); ?>"></p>
					<p><label><?php echo wpcsr_country_label(); ?>:</label> <input type="text" name="country" value="" placeholder="<?php echo wpcsr_country_label(); ?>" required="required"></p>
					<p><label><?php echo wpcsr_state_county_label(); ?>:</label> <input type="text" name="state" value="" placeholder="<?php echo wpcsr_state_county_label(); ?>"></p>
					<input data-repeater-delete class="button button-secondary button-small" type="button" value="<?php echo wpcsr_delete_label(); ?>"/>
				</div>         
			</section>
        <?php endif; ?>
    </div>
    <input data-repeater-create class="button button-primary button-small" type="button" value="<?php echo wpcsr_add_new_label(); ?>"/>
</div>
<input class="button button-primary button-large" type="submit" value="<?php echo wpcsr_save_label(); ?>"/>