{$title = "{t}Add IP reservation{/t}"}
<!DOCTYPE html>
<html lang="ja">
<head>
  <title>{$title}</title>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="css/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="css/bootstrap/css/bootstrap-theme.min.css">
  <link rel="stylesheet" href="css/style.css">
  <script src="css/bootstrap/js/bootstrap.min.js"></script>
  <script src="js/jquery-3.1.1.min.js"></script>
  {include file='./functions/br.tmpl' scope="root"}
  {include file='./configs/menu.tmpl' scope="root"}
  {include file='./configs/breadcrumb.tmpl' scope="root"}
  {include file='./functions/menumaker.tmpl' scope="root"}
  {include file='./functions/breadmaker.tmpl' scope="root"}
</head>

<body>
<header class="">
    <nav class="navbar navbar-default navbar-default-extend">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#patern07">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <div class="navbar-brand">KeaKeeper</div>
      </div>

      <div id="patern07" class="collapse navbar-collapse">
        {call menumaker list=$global id="dhcpv4" mode="ul" class="nav navbar-nav navbar-right"}
      </div>
    </nav>
</header>

<div class="container-fluid">
  <!-- Left grid  -->
  <div class="row">
    <!-- left navi -->
    <nav class="aside col-sm-2">
      <div class="panel panel-default">
        {call menumaker list=$side_noexpand4 id="searchsubnet" mode="ul" class="nav nav-pills nav-stacked abc"}
      </div>
      <div class="panel panel-default">
        {call menumaker list=$side_searchhost4 id="addhost4" mode="ul" class="nav nav-pills nav-stacked abc"}
      </div>
    </nav>

    <!-- Right grid  -->
    <div class="col-sm-10">
      <nav class="">
        {call breadmaker list=$bread_add_host4 id="addhost"}
      </nav>
      <!-- subnet -->
      <div class="Subnet">
        {t}Subnet{/t}: {$subnet_val.subnet}
        </br>
        {t}Pool{/t}:
        {foreach from=$pools item=info}
          {$info}
          </br>
        {/foreach}
      </div>

      <div class="panel panel-default">
        <!-- main -->
        <div class="container-fluid panel-body">
          <div class="row">
            <!-- error msg -->
            <div class="ErrorMessage">
              {$e_subnet}{call br var=$e_subnet}
              {$e_subnet_id}{call br var=$e_subnet_id}
              {$e_pool}{call br var=$e_pool}
              {$e_hostname}{call br var=$e_hostname}
              {$e_dhcp_identifier_type}{call br var=$e_dhcp_identifier_type}
              {$e_dhcp_identifier}{call br var=$e_dhcp_identifier}
              {$e_ipv4_address}{call br var=$e_ipv4_address}
              {$e_domain_name_servers}{call br var=$e_domain_name_servers}
              {$e_routers}{call br var=$e_routers}
              {$e_dhcp4_next_server}{call br var=$e_dhcp4_next_server}
              {$e_dhcp4_boot_file_name}{call br var=$e_dhcp4_boot_file_name}
              {$e_tftp_server_name}{call br var=$e_tftp_server_name}
              {$e_boot_file_name}{call br var=$e_boot_file_name}
              {$e_msg}{call br var=$e_msg}
              {$disp_msg}{call br var=$disp_msg}
              {$success}
            </div>

            <form class="form-horizontal" action="addhost4.php?subnet_id={$subnet_val.subnet_id|default}&subnet={$subnet_val.subnet|default}" method="post">
              <fieldset>
                <legend>{t}Reserve IP{/t}</legend>

                <!-- description -->
                <div class="col-sm-6 col-md-push-6">
                  <div class="table-bordered"> 
                    <ul>
                      <li>{t}Please specify the host name with FQDN.{/t}</li>
                      <li>{t}The host name can be empty.{/t}</li>
                      <li>{t}Please enter the identifier in the form of type.{/t}</li>
                    </ul>
                  </div>
                </div>


                <!-- Reserve IP -->
                <div class="col-sm-6 col-md-pull-6">
                  <div class="form-group">
                    <label class="col-sm-2 control-label text-nowrap" for="IPaddr">{t}hostname{/t}</label>
                    <div class="col-sm-10">
                      {if isset($exist.hostname)}
                        <input type="text" class="form-control" id="hostname" name="hostname" placeholder="example.com" value="{$exist.hostname}">
                      {else}
                        <input type="text" class="form-control" id="hostname" name="hostname" placeholder="example.com" value="{$pre.hostname|default}">
                      {/if}
                    </div>
                  </div>
                
                  <div class="form-group">
                    <label class="col-sm-2 control-label text-nowrap" for="type">{t}type{/t}</label>
                    <div class="col-sm-10">
                      <select class="form-control" id="type" name="type">
                        {if isset($exist.dhcp_identifier_type)}
                          {if $exist.dhcp_identifier_type eq 0}
                            <option value="0" selected>{t}MAC{/t}
                          {else}
                            <option value="0">{t}MAC{/t}
                          {/if}
  
                          {if $exist.dhcp_identifier_type eq 1}
                            <option value="1" selected>{t}DUID{/t}
                          {else}
                            <option value="1">{t}DUID{/t}
                          {/if}
  
                          {if $exist.dhcp_identifier_type eq 2}
                            <option value="2" selected>{t}Circuit-ID{/t}
                          {else}
                            <option value="2">{t}Circuit-ID{/t}
                          {/if}
                        {/if}

                        {if isset($pre.dhcp_identifier_type)}
                          {if $pre.dhcp_identifier_type eq 0}
                            <option value="0" selected>{t}MAC{/t}
                          {else}
                            <option value="0">{t}MAC{/t}
                          {/if}
  
                          {if $pre.dhcp_identifier_type eq 1}
                            <option value="1" selected>{t}DUID{/t}
                          {else}
                            <option value="1">{t}DUID{/t}
                          {/if}
  
                          {if $pre.dhcp_identifier_type eq 2}
                            <option value="2" selected>{t}Circuit-ID{/t}
                          {else}
                            <option value="2">{t}Circuit-ID{/t}
                          {/if}

                        {else}
                          <option value="0">{t}MAC{/t}
                          <option value="1">{t}DUID{/t}
                          <option value="2">{t}Circuit-ID{/t}
                        {/if}
                      </select>
                    </div>
                  </div>

                  <div class="form-group">
                    <label class="col-sm-2 control-label text-nowrap" for="identifier">{t}Identifier{/t}</label>
                    <div class="col-sm-10">
                      {if isset($exist.dhcp_identifier)}
                        <input type="text" class="form-control" id="Identifier" name="identifier" placeholder="08:00:27:c1:02:08" value="{$exist.dhcp_identifier}">
                      {else}
                        <input type="text" class="form-control" id="Identifier" name="identifier" placeholder="08:00:27:c1:02:08" value="{$pre.dhcp_identifier|default}">
                      {/if}
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label class="col-sm-2 control-label text-nowrap" for="ip">{t}IPv4 address{/t}</label>
                    <div class="col-sm-10">
                      {if isset($exist.ipv4_address)}
                        <input type="text" class="form-control" id="ip" name="ip" placeholder="192.168.0.10" value="{$exist.ipv4_address}">
                      {else}
                        <input type="text" class="form-control" id="ip" name="ip" placeholder="192.168.0.10" value="{$pre.ipv4_address|default}">
                      {/if}
                    </div>
                  </div>
                </div>
              </fieldset>

              <fieldset>
                <legend>{t}Option{/t}</legend>

                <!-- description -->
                <div class="col-sm-6 col-md-push-6">
                  <div class="table-bordered"> 
                    <ul>
                      <li>{t}For "domain-name-servers", specify the IP address of the DNS server to be distributed to the host.{/t}</li>
                      <li>{t}For "routers", specify the IP address of the default gateway to be distributed to the host.{/t}</li>
                      <li>{t}For "dhcp:next-server", specify the server IP address from which to obtain the boot image using the BOOTP protocol.{/t}</li>
                      <li>{t}For "dhcp:boot-file", specify the path of the boot file to be used with the BOOTP protocol.{/t}</li>
                      <li>{t}For "tftp-server-name", specify the server IP address from which to obtain the boot image using the DHCP protocol.{/t}</li>
                      <li>{t}For "boot-file-name", specify the path of the boot file to be used with the DHCP protocol.{/t}</li>
                    </ul>
                  </div>
                </div>


                <!-- option -->
                <div class="col-sm-6 col-md-pull-6">
                  <div class="form-group">
                    <label class="col-sm-4 control-label text-nowrap" for="domain-name-servers">{t}domain-name-servers{/t}</label>
                    <div class="col-sm-8">
                      {if isset($exist.domain_name_servers)}
                        <input type="text" class="form-control" id="domain-name-servers" name="domain-name-servers" placeholder="192.168.0.100,192.168.0.101" value="{$exist.domain_name_servers}">
                      {else}
                        <input type="text" class="form-control" id="domain-name-servers" name="domain-name-servers" placeholder="192.168.0.100,192.168.0.101" value="{$pre.domain_name_servers|default}">
                      {/if}
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label class="col-sm-4 control-label text-nowrap" for="routers">{t}routers{/t}</label>
                    <div class="col-sm-8">
                      {if isset($exist.routers)}
                        <input type="text" class="form-control" id="routers" name="routers" placeholder="192.168.0.1" value="{$exist.routers}">
                      {else}
                        <input type="text" class="form-control" id="routers" name="routers" placeholder="192.168.0.1" value="{$pre.routers|default}">
                      {/if}
                    </div>
                  </div>

                  <div class="form-group">
                    <label class="col-sm-4 control-label text-nowrap" for="dhcp-next-server">{t}dhcp:next-server{/t}</label>
                    <div class="col-sm-8">
                      {if isset($exist.dhcp4_next_server)}
                        <input type="text" class="form-control" id="dhcp-next-server" name="dhcp-next-server" placeholder="10.100.0.10" value="{$exist.dhcp4_next_server}">
                      {else}
                        <input type="text" class="form-control" id="dhcp-next-server" name="dhcp-next-server" placeholder="10.100.0.10" value="{$pre.dhcp4_next_server|default}">
                      {/if}
                    </div>
                  </div>
                
                  <div class="form-group">
                    <label class="col-sm-4 control-label text-nowrap" for="dhcp-boot-file">{t}dhcp:boot-file{/t}</label>
                    <div class="col-sm-8">
                      {if isset($exist.dhcp4_boot_file_name)}
                        <input type="text" class="form-control" id="dhcp-boot-file" name="dhcp-boot-file" placeholder="/path/bootfile" value="{$exist.dhcp4_boot_file_name}">
                      {else}
                        <input type="text" class="form-control" id="dhcp-boot-file" name="dhcp-boot-file" placeholder="/path/bootfile" value="{$pre.dhcp4_boot_file_name|default}">
                      {/if}
                    </div>
                  </div>

                  <div class="form-group">
                    <label class="col-sm-4 control-label text-nowrap" for="bootp-tftp-server-name">{t}tftp-server-name{/t}</label>
                    <div class="col-sm-8">
                      {if isset($exist.tftp_server_name)}
                        <input type="text" class="form-control" id="bootp-tftp-server-name" name="bootp-tftp-server-name" placeholder="192.168.0.1" value="{$exist.tftp_server_name}">
                      {else}
                        <input type="text" class="form-control" id="bootp-tftp-server-name" name="bootp-tftp-server-name" placeholder="192.168.0.1" value="{$pre.tftp_server_name}">
                      {/if}
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label class="col-sm-4 control-label text-nowrap" for="bootp-boot-file">{t}boot-file-name{/t}</label>
                    <div class="col-sm-8">
                      {if isset($exist.boot_file_name)}
                        <input type="text" class="form-control" id="bootp-boot-file" name="bootp-boot-file" placeholder="/path/bootfile" value="{$exist.boot_file_name}">
                      {else}
                        <input type="text" class="form-control" id="bootp-boot-file" name="bootp-boot-file" placeholder="/path/bootfile" value="{$pre.boot_file_name}">
                      {/if}
                    </div>
                  </div>

                </div>
                <!-- 検索ボタン -->
                <div class="form-group">
                  
                  <div class="col-sm-5">
                  </div>
                  <div class="col-sm-7">
                    <button type="submit" name="apply">{t}add{/t}</button>
                  </div>
                </div>
              </fieldset>

            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<footer class="footer  navbar navbar-default navbar-default-extend">
    <nav class="pull-right">
      <a href="https://www.designet.co.jp/" class="navbar-brand">Contributeted by DesigNET</a>
    </nav>
</footer>

</body>

</html>


