<div class="form-group">
    <label for="">Kode Member</label>
    <input type="text" name="" id="" class="form-control" readonly value="{{ $p->member->kd_member }}">
</div>
<div class="form-group mt-2">
    <label for="">Nama Member</label>
    <input type="text" name="" id="" class="form-control" readonly
        value="{{ $p->member->nm_member }}">
</div>
<hr>

<div class="form-group mt-2">
    <label for="">Pilih Kode Ongkir</label>
    <select name="ongkir" id="ongkir" class="form-control cariongkir">
        <option value="">Pilih</option>
        @foreach ($ongkir as $m)
            <option value="{{ $m->id }}" {{ $m->id == $p->ongkir_id ? 'selected' : '' }}>
                {{ $m->kd_ongkir }}
            </option>
        @endforeach
    </select>
    Rute Ongkir:
    <textarea name="rute" id="rute" class="form-control" readonly>{{ $p->ongkir->rute }}</textarea>
</div>

<div class="form-group mt-2">
    <label for="">Alamat Member</label>
    <textarea name="alamat_ongkir" id="alamat" class="form-control" {{ $isi == 'lama' ? '' : 'readonly' }}>{{ $p->alamat }}</textarea>
</div>
@if ($isi == 'lama')
    <div class="form-group row">
        <label for="inputPassword3" class="col-sm-4 col-form-label">Status
        </label>
        <div class="col-sm-4 mt-2">
            <div class="custom-control custom-radio">
                <input class="custom-control-input sts_alamat" type="radio" id="n" value="N"
                    name="sts_alamat" checked {{ $p->sts_alamat == 'N' ? 'checked' : '' }}>
                <label for="n" class="custom-control-label ">Tidak Aktif
                </label>
            </div>
        </div>
        <input type="hidden" name="" id="sts_alamat" value="{{ $p->sts_alamat }}">
        <div class="col-sm-4 mt-2">
            <div class="custom-control custom-radio">
                <input class="custom-control-input sts_alamat" type="radio" id="y" value="Y"
                    name="sts_alamat" {{ $p->sts_alamat == 'Y' ? 'checked' : '' }}>
                <label for="y" class="custom-control-label "> Aktif
                </label>
            </div>
        </div>
    </div>
@else
    <input type="hidden" name="" id="sts_alamat" value="Y">
@endif
<div class="row">

    <div class="col-md-6">
        <label for="">Berat (Kg)</label>
        <input type="text" name="berat" id="berat" class="form-control" placeholder="0 Kg" readonly
            value="{{ $p->ongkir->berat }}">
    </div>
    <div class="col-md-6">
        <label for="">Harga (Kg)</label>
        <input type="text " name="harga" id="harga" class="form-control" placeholder="Rp. 0" readonly
            value="{{ $p->ongkir->harga }}">
    </div>
    <div class="col-md-12">
        <button id="terap" class="btn btn-info btn-block terapkan " data-id="{{ $p->id }}"
            style="margin-top: 40px;">
            <i class="fa fa-check mr-2"></i>
            {{ $isi == 'lama' ? 'Terapkan' : 'Verifikasi Akun' }} </button>
    </div>
</div>
<hr>
<hr>
<script>
    $('.sts_alamat').click(function() {
        if ($(this).val() == "Y") {
            $('#sts_alamat').val('Y');
        } else {
            $('#sts_alamat').val('N');
        }
    })
</script>
