
<div class="form-group row {{ $errors->has('tambons_id') ? 'has-error' : '' }}">
    <label for="tambons_id" class="col-md-2 control-label">ตำบล</label>
    <div class="col-md-4">
        <select class="form-control" id="tambons_id" name="tambons_id" required="true">
        	    <option value="" style="display: none;" {{ old('tambons_id', optional($mooban)->tambons_id ?: '') == '' ? 'selected' : '' }} disabled selected>ระบุ ตำบล</option>
        	@foreach ($tambons as $key => $tambon)
			    <option value="{{ $key }}" {{ old('tambons_id', optional($mooban)->tambons_id) == $key ? 'selected' : '' }}>
			    	{{ $tambon }}
			    </option>
			@endforeach
        </select>
        
        {!! $errors->first('tambons_id', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('name') ? 'has-error' : '' }}">
    <label for="name" class="col-md-2 control-label">ชื่อหมู่บ้าน</label>
    <div class="col-md-4">
        <input class="form-control" name="name" type="text" id="name" value="{{ old('name', optional($mooban)->name) }}" maxlength="100" placeholder="ระบุ ชื่อหมู่บ้าน">
        {!! $errors->first('name', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('moo') ? 'has-error' : '' }}">
    <label for="moo" class="col-md-2 control-label">หมู่ที่</label>
    <div class="col-md-4">
        <input class="form-control" name="moo" type="text" id="moo" value="{{ old('moo', optional($mooban)->moo) }}" maxlength="2" placeholder="ระบุ หมู่ที่">
        {!! $errors->first('moo', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('last_voter') ? 'has-error' : '' }}">
    <label for="last_voter" class="col-md-2 control-label">จำนวนผู้มาใช้สิทธิเลือกตั้งที่ผ่านมา</label>
    <div class="col-md-4">
        <input class="form-control" name="last_voter" type="text" id="last_voter" value="{{ old('last_voter', optional($mooban)->last_voter) }}" min="-32768" max="32767" placeholder="ระบุ จำนวนผู้มาใช้สิทธิเลือกตั้งที่ผ่านมา">
        {!! $errors->first('last_voter', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('voter_num') ? 'has-error' : '' }}">
    <label for="voter_num" class="col-md-2 control-label">จำนวนผู้มีสิทธิเลือกตั้ง</label>
    <div class="col-md-4">
        <input class="form-control" name="voter_num" type="text" id="voter_num" value="{{ old('voter_num', optional($mooban)->voter_num) }}" min="-32768" max="32767" placeholder="ระบุ จำนวนผู้มีสิทธิเลือกตั้ง">
        {!! $errors->first('voter_num', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('total_pop') ? 'has-error' : '' }}">
    <label for="total_pop" class="col-md-2 control-label">ประชากรรวม</label>
    <div class="col-md-4">
        <input class="form-control" name="total_pop" type="text" id="total_pop" value="{{ old('total_pop', optional($mooban)->total_pop) }}" min="-32768" max="32767" placeholder="ระบุ ประชากรรวม">
        {!! $errors->first('total_pop', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('total_house') ? 'has-error' : '' }}">
    <label for="total_house" class="col-md-2 control-label">จำนวนหลังคาเรือน</label>
    <div class="col-md-4">
        <input class="form-control" name="total_house" type="text" id="total_house" value="{{ old('total_house', optional($mooban)->total_house) }}" min="-32768" max="32767" placeholder="ระบุ จำนวนหลังคาเรือน">
        {!! $errors->first('total_house', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('latitude') ? 'has-error' : '' }}">
    <label for="latitude" class="col-md-2 control-label">ละติจูด</label>
    <div class="col-md-4">
        <input class="form-control" name="latitude" type="text" id="latitude" value="{{ old('latitude', optional($mooban)->latitude) }}" maxlength="25" placeholder="ระบุ ละติจูด">
        {!! $errors->first('latitude', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('longitude') ? 'has-error' : '' }}">
    <label for="longitude" class="col-md-2 control-label">ลองจิจูด</label>
    <div class="col-md-4">
        <input class="form-control" name="longitude" type="text" id="longitude" value="{{ old('longitude', optional($mooban)->longitude) }}" maxlength="25" placeholder="ระบุ ลองจิจูด">
        {!! $errors->first('longitude', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('detail') ? 'has-error' : '' }}">
    <label for="detail" class="col-md-2 control-label">เกี่ยวกับหมู่บ้านนี้</label>
    <div class="col-md-4">
        <textarea class="form-control" name="detail" cols="50" rows="10" id="detail" placeholder="ระบุ เกี่ยวกับหมู่บ้านนี้">{{ old('detail', optional($mooban)->detail) }}</textarea>
        {!! $errors->first('detail', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

<div class="form-group row {{ $errors->has('users_id') ? 'has-error' : '' }}">
    <label for="users_id" class="col-md-2 control-label">ผู้บันทึกข้อมูล</label>
    <div class="col-md-4">
        <select class="form-control" id="users_id" name="users_id">
        	    <option value="" style="display: none;" {{ old('users_id', optional($mooban)->users_id ?: '') == '' ? 'selected' : '' }} disabled selected>ระบุ ผู้บันทึกข้อมูล</option>
        	@foreach ($users as $key => $user)
			    <option value="{{ $key }}" {{ old('users_id', optional($mooban)->users_id) == $key ? 'selected' : '' }}>
			    	{{ $user }}
			    </option>
			@endforeach
        </select>
        
        {!! $errors->first('users_id', '<p class="form-text text-muted">:message</p>') !!}
    </div>
</div>

