@extends('comm.template')

@section('content')

	<div style="color: #666;text-align:right;font-size:16px;margin-top:10px;margin-bottom:10px;margin-right:25px" ><< 住戶卡管理 >></div>
	<form  method="POST" action=" @if (isset($card)) {{ url('manager/card/save') }} @else {{ url('manager/card/create') }} @endif" class="basic_form" enctype="multipart/form-data" style="width:500px;margin-left:auto;margin-right:auto;">
        <p>&nbsp;</p>
        <table style="width:650px">
            <tr>
                <td class="col1" style="width:150px">
                    ETag卡號 <font color="red">*</font>
                </td>
                <td class="col2" style="height:40px">
                    <div style="margin-left:10px;">
                        <input type="text" name="card_code" @if (isset($card)) value="{{ $card->code }}" @endif>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="col1">
                    車牌號碼 <font color="red">*</font>
                </td>
                <td class="col2" style="height:40px">
                    <div style="margin-left:10px">
                        <input type="text" name="license" @if (isset($card)) value="{{ $card->license }}" @endif>
                    </div>
                </td>
            </tr>   
            <tr>
                <td class="col1">
                    鎖卡 <font color="red">*</font>
                </td>
                <td class="col2" style="height:40px">
                    <div style="margin-left:10px">
                         <input type="radio" name="locked" @if (isset($card) && $card->locked == 0) checked @endif value="0">否&nbsp;&nbsp;
						 <input type="radio" name="locked" @if (isset($card) && $card->locked == 1) checked @endif @if (!isset($card)) checked @endif value="1"> 是
                    </div>
                </td>
            </tr>
        </table>
        <p>&nbsp;</p>
        <p> 
            <input type="submit" name="button1" value="送出">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            @if (isset($card))
                <input type="button" name="button2" value="刪除" onclick="window.location.href='{{ url('manager/card/delete') }}/{{ $census_id }}/{{ $card->id }}';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            @endif 
            <input type="button" name="button3" value="回列表" onclick="go_list()">

        </p>
		<input type="hidden" name="census_id" value="{{ $census_id }}">
        @if (isset($card))
			<input type="hidden" name="id" value="{{ $card->id }}">
        @endif  
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
    </form>
    <p>&nbsp;</p>
    <p>&nbsp;</p>

@stop


@section('head')

@stop

@section('javascript')
    
    function go_list(){
        location="{{ url('manager/card') }}/{{ $census_id }}";
    }

@stop  