<%-# Fedena
#Copyright 2010 Foradian Technologies Private Limited
#
#This product includes software developed at
#Project Fedena - http://www.projectfedena.org/
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing,
#software distributed under the License is distributed on an
#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
#KIND, either express or implied.  See the License for the
#specific language governing permissions and limitations
#under the License. -%>

<div id="content-header">
  <%= image_tag("/images/student_details/student_details_logo.jpg") %>
  <h1><%= t('student_info') %></h1>
  <h3><%= t('student_profile') %></h3>
  <div id="app-back-button">
    <%= link_to_function image_tag("/images/buttons/back.png",:border => 0), "history.back()" %>
  </div>
</div>

<div id="inner-tab-menu">
  <ul>

    <li><%= link_to "#{t('reports_text')}", :controller => 'archived_student',
        :action => 'reports', :id => @archived_student %></li>


    <li><%= link_to "#{t('guardians_text')}", :controller => "archived_student",
        :action => "guardians", :id => @archived_student.id %></li>


<%#*<li><%= link_to "Delete", :controller => 'archived_student',%>
<%#*:action => 'delete', :id => @archived_student.id %><%#</li>%>
    <li><%= link_to "#{t('generate_tc')}",
        {:controller => "student", :action => "generate_tc_pdf", :id => @archived_student.admission_no},:target => '_blank' %></li>

  </ul>
</div>

<div id="page-yield">

  <% unless flash[:notice].nil? %> <p class="flash-msg"> <%= flash[:notice] %> </p> <% end %>

  <div id="student_profile_heading">

    <div id="profile_picture_display">
      <% if @archived_student.photo.file? %>
        <%= image_tag @archived_student.photo.url %>
      <% else %>
        <%= image_tag "master_student/profile/default_student.png" %>
      <% end %>
    </div>

    <div id ="student_main_info">
      <h3> <%= @archived_student.full_name %>  </h3>
      <h4> <%= t('course_and_batch') %> : <%= @archived_student.batch.course_name %> </h4>
      <h4> <%= t('adm_no') %>: <%= @archived_student.admission_no %> </h4>
    </div>

    <div class="extender"> </div>

  </div>

  <div id="new_profile_info_top">
    <div class="profile_top_banner">
      <span class="profile"><%= t('details') %></span>
      <div class="profile-topbanner"></div>
    </div>
    <table width="700">
      <tr class="odd left"><td><%= t('admission_date') %></td><td class="right"><%= I18n.l(@archived_student.admission_date,:format=>"%d %b, %Y") unless @archived_student.admission_date.nil? %></td></tr>
      <tr class="even left"><td><%= t('date_of_birth') %></td><td class="right"><%= I18n.l(@archived_student.date_of_birth,:format=>"%d %b, %Y") unless @archived_student.date_of_birth.nil? %></td></tr>
      <tr class="odd left"><td><%= t('blood_group') %></td><td class="right"><%= @archived_student.blood_group %></td></tr>
      <tr class="even left"><td><%= t('gender') %></td><td class="right"><%= t("#{@archived_student.gender_as_text.downcase}") %></td></tr>
      <tr class="odd left"><td><%= t('nationality') %></td><td class="right"><%= @archived_student.nationality.name unless @archived_student.nationality_id.nil? %></td></tr>
      <tr class="even left"><td><%= t('language') %></td><td class="right"><%= @archived_student.language %></td></tr>
      <tr class="odd left"><td><%= t('category') %></td><td class="right"><%= @archived_student.student_category.name unless @archived_student.student_category.nil? %></td></tr>
      <tr class="even left"><td><%= t('religion') %></td><td class="right"><%= @archived_student.religion %></td></tr>
      <tr class="odd left"><td><%= t('address') %></td><td class="right"><%= @archived_student.address_line1%>, <%=  @archived_student.address_line2 %></td></tr>
      <tr class="even left"><td><%= t('city') %></td><td class="right"><%= @archived_student.city %></td></tr>
      <tr class="odd left"><td><%= t('state') %></td><td class="right"><%= @archived_student.state %></td></tr>
      <tr class="even left"><td><%= t('country') %></td><td class="right"><%= @archived_student.country.name unless @archived_student.country_id.nil? %></td></tr>
      <tr class="odd left"><td><%= t('phone') %></td><td class="right"><%= @archived_student.phone1 %></td></tr>
      <tr class="even left"><td><%= t('mobile') %></td><td class="right"><%= @archived_student.phone2 %></td></tr>
      <tr class="odd left"><td><%= t('email') %></td><td class="right"><%= @archived_student.email %></td></tr>
      <% unless  @additional_fields.empty? %>
        <% @additional_fields.each do |field| %>
          <% p =cycle('2',' ') %>
          <tr class="odd left">
            <td><%= field.name %></td>
            <td class="right">
              <% detail = @archived_student.additional_detail(field.id) %>
              <%= detail.additional_info unless detail.nil? %>
            <% end %>
          </td>
        </tr>
      <% end %>
      <tr class="even left"><td><%= t('reason_for_leaving') %></td><td class="right"><%= @archived_student.status_description %></td></tr>
    </table>
    <div class="extender"></div>
  </div>
</div>
