<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">&times;</button>
    <h4 class="modal-title">پمپ کی تبدیلی</h4>
</div>

<form id="update_pump_form">
    <div class="modal-body">
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label for="city_name">نام <span class="text-danger">*</span></label>
                    <input type="text" id="city_name" autofocus class="form-control" name="city_name"
                        value="{{ $pump->name }}">

                    <span class="text-danger u_error" id="u_city_name_error"></span>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label for="phone">فون </label>
                    <input type="text" id="phone" name="phone" value="{{ $pump->phone }}" class="form-control"
                        data-masked="" data-inputmask="'mask': '9999-9999999'">

                    <span class="text-danger u_error" id="u_phone_error"></span>
                </div>
            </div>
            <div class="col-md-12">
                <div class="form-group">
                    <label for="note">شہر</label>
                    <select name="city" id="u_city" class="form-control">
                        <option value="">----Select City----</option>
                        @forelse ($cities as $city)
                            <option value="{{ $city->id }}" {{ $pump->city_id == $city->id ? 'selected' : '' }}>
                                {{ $city->name }}</option>
                        @empty
                            <option value="">No City Available</option>
                        @endforelse
                    </select>
                    <span class="text-danger u_error" id="u_city_error"></span>
                </div>
            </div>
        </div>
        <div class="row mt-2">
            <div class="col-md-12">
                <div class="form-group">
                    <label for="note">Note</label>
                    <textarea id="note" name="note" class="form-control">{{ $pump->note }}</textarea>
                    <span class="text-danger u_error" id="u_note_error"></span>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        @csrf
        <button id="update_btn" class="btn btn-sm btn-info" type="submit">
            اپ ڈیٹ
        </button>
        <input type="hidden" name="update_id" value="{{ $pump->id }}">
    </div>
</form>
