{% extends "base.html"%}
{% load static %}
{% block extrajs %}
<script src="{% static '/js/view.js' %}"></script>
    {% endblock extrajs %}
{% block content %}
<div class="wrapper">
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row">
          <div class="col-sm-6">
            <h1>Edit Profile</h1>
          </div>
          <div class="col-sm-6 ">
              <div class="text-right">
            <a class="btn btn-md bg-gradient-primary" href="/logout/">Logout</a>
          </div></div>
        </div>
      </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <!-- left column -->
          <div class="col-md">
            <!-- general form elements -->
            <div class="card card-primary">
              <div class="card-header">
                <h3 class="card-title">Patient Profile</h3>
                <div class="d-flex justify-content-end">
                <h3 class="card-title">{{profile_add.0.name}}</h3>
                </div>
              </div>
              <!-- /.card-header -->
              <!-- form start -->
              <form class="form-inline pt-4 pb-4" role="form" id="patient_form" action="" method="POST" enctype="multipart/form-data">
                {% csrf_token %}
                <div class="container">
                  <div class="row">
                    <div class="col-lg-6">
                      <div class="row">
                        <div class="form-group col-lg-12 mb-3">
                          <label class="control-label col-lg-4 justify-content-start" for="name">
                            Name:</label>
                          <div class="col-lg-8">
                            <input type="text" class="form-control w-100" value="{{profile_add.0.name}}" id="name" name="name"
                              minlength="3" maxlength="50" placeholder="Enter Your Name" required>
                          </div>
                        </div>
                      
                        <div class="form-group col-lg-12 mb-3">
                          <label class="control-label col-lg-4 justify-content-start">Email:</label>
                          <div class="col-lg-8">
                            <input disabled type="email" class="form-control w-100" value="{{profile.0.email}}" id="email" name="email"
                              maxlength="100" placeholder="Enter your Email" required>
                          </div>
                        </div>

                        <div class="form-group col-lg-12 mb-3">
                            <label class="control-label col-lg-4 justify-content-start">Gender:</label>
                            <div class="col-lg-8">
                              <select id="gender" class="form-control w-100"  name="gender" required>
                                  {% if profile_add.0.gender %}
                                  {% if profile_add.0.gender == 'Male' %}
                                  <option value="Male" selected>Male</option>
                                  <option value="Female" >Female</option>
                                  {% else %}
                                  <option value="Male">Male</option>
                                  <option value="Female" selected >Female</option>
                                  {% endif %}
                                  {% else %}
                                  <option value="" selected disabled>Select Gender</option>
                                  <option value="Male">Male</option>
                                  <option value="Female">Female</option>
                                  {% endif %}
                              </select>
                            </div>
                          </div>

                        <div class="form-group col-lg-12 mb-3 ">
                          <label class="control-label col-lg-4 justify-content-start"
                            for="select_country">Country:</label>
                          <div class="col-lg-8">
                            <input type="text" class="form-control w-100" value="{{profile_add.0.country}}" id="country" name="country"
                            minlength="3" maxlength="50" placeholder="Country Name" required>
                          </div>
                        </div>

                
                      </div>
                    </div>
                    <div class="col-lg-6">
                      <div class="row">
                       
                        <div class="form-group col-lg-12 mb-3">
                          <label class="control-label col-lg-4 justify-content-start" for="speciality_tag">Age:</label>
                          <div class="col-lg-8">
                            <input type="number" class="form-control w-100" value="{{profile_add.0.age}}" id="age" name="age" min="0"
                              onKeyPress="if(this.value.length==3) return false;" placeholder="Enter Your Age"
                              required>
                          </div>
                        </div>
                        <div class="form-group col-lg-12 mb-3">
                          <label class="control-label col-lg-4 justify-content-start" for="hos_phone">Phone:</label>
                          <div class="col-lg-8">
                            <input type="number" class="form-control w-100" value="{{profile_add.0.phone}}" id="phone" name="phone" min="0"
                              onKeyPress="if(this.value.length==15) return false;" placeholder="Enter Phone No."
                              required>
                          </div>
                        </div>
                        <div class="form-group col-lg-12 mb-3">
                          <label for="facilities" class="control-label col-lg-4 justify-content-start">City:</label>
                          <div class="col-lg-8">
                            <input type="text" class="form-control w-100" value="{{profile_add.0.city}}" id="city" name="city" maxlength="40"
                              placeholder="City Name" required>
                              
                          </div>
                        </div>
                        <div class="form-group col-lg-12 mb-3">
                            <label for="facilities" class="control-label col-lg-4 justify-content-start">Address:</label>
                            <div class="col-lg-8">
                              <textarea type="text" class="form-control w-100" id="Address" name="address"
                                placeholder="Enter your city name" required>{{profile_add.0.address}}
                                </textarea>
                            </div>
                          </div>
                      </div>
                    </div>
                  </div>
                  <div class="form-group mb-3 pt-5">
                    <div class="col-lg-6 w-100">
                      <div>
                        <button class="btn btn-md bg-gradient-primary">Submit</button>
                      </div>
                    </div>
                  </div>
                </div>

            
                <!-- /.card-body -->
                
               

              </form>
            </div>
          </div>
          <!-- /.card -->
        </div>
        <!-- /.row -->
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  {% endblock %}