
@using Microsoft.AspNetCore.Identity ;
@model PatientModel ;

@inject SignInManager<User> SignInManager
@inject UserManager<User> UserManager
@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

*@
@{
    var userName = UserManager.GetUserName(User);
    ViewData["title"] = "Home - " + userName;

    ViewData["userName"] = Model.User.FirstName + " " + Model.User.LastName;
    ViewBag.Avatar = Model.User.Avatar;

    ViewBag.owner = Model;
    var DummyModel = new MedicalState { StateName="state name" , StateDescription="Description" , PrescriptionTime=DateTime.Now};

}

<!-- Masthead -->
<header class="masthead bg-primary text-white text-center">
    <div class="container d-flex align-items-center flex-column">

        <!-- Masthead Avatar Image -->
        <img class="masthead-avatar mb-5" src="/img/@Model.User.Avatar" style="border-radius:50%" alt="">

        <!-- Masthead Heading -->
        <h1 class="masthead-heading text-uppercase mb-0">@(Model.User.FirstName +" "+ Model.User.LastName)</h1>

        <!-- Icon Divider -->
        <div class="divider-custom divider-light">
            <div class="divider-custom-line"></div>
            <div class="divider-custom-icon">
                <i class="fas fa-star"></i>
            </div>
            <div class="divider-custom-line"></div>
        </div>

        <!-- Masthead Subheading -->
        <p class="masthead-subheading font-weight-light mb-0">@Model.BIO</p>

    </div>
</header>

<section id="services" class=" services ">
    <div class="container">

        <div class="section-title">
            <h2>Your medical State  </h2>
            <p>Here you can create new medical state <a asp-controller="MedicalState" asp-action="Create" >Create</a>.</p>
        </div>

        <div class="row">

            <div class="col-lg-4 col-md-6 d-flex align-items-stretch mb-5">
                <div class="icon-box">
                    <div class="icon"><i class="fas fa-heartbeat"></i></div>
                    <h4> New Medical State</h4>
                    <p>Click on the Create Button to Create a new Medical State</p>
                    <a asp-controller="Medicalstate" asp-action="Create" class="btn btn-primary">
                        Create
                    </a>
                </div>

            </div>
               @foreach (var item in Model.MedicalStates)
                {


                    <div class="col-lg-4 col-md-6 d-flex flex-column align-items-stretch mb-5">
                        <div class="icon-box">
                            <div class="icon"><i class="fas fa-heartbeat"></i></div>
                            <h4>@item.StateName</h4>
                            
                            <p class="text-start">Diagonistic : @item.StateDescription<br /> Prescriped at : @(item.PrescriptionTime) </p>
                            <a data-toggle="modal" data-target="#item-@(item.Id)" class="btn btn-primary" style="color:white!important">
                                Details
                            </a>
                        </div>

                    </div>
                }

        </div>

    </div>
</section><!-- End Services Section -->

<!--<section class="page-section ">
    <div class="container-fluid">-->

        <!-- Portfolio Grid Items -->
        <!--<div class="row d-flex flex-wrap justify-content-sm-center">
            @if (Model.MedicalStates.Count() == 0)
            {
                <h2 class="text-center">You dont have any  MedicalState</h2>
                <img src="~/img/portfolio/noData.jpg" class="figure-img" />
            }
            else
                @foreach (var item in Model.MedicalStates)
                {

                    <div class="col-lg-4 col-md-6 d-flex align-items-stretch">
                        <div class="icon-box">
                            <div class="icon"><i class="fas fa-heartbeat"></i></div>
                            <h4><a href="">@item.StateName</a></h4>
                            <p>@item.StateDescription</p>
                            <a href="#" class="btn btn-primary" data-toggle="modal" data-target="#item-@(item.Id)">go to descriptiuon </a>

                        </div>
                    </div>
                    <div class="col-lg-4">
                            <div class="card m-3">
                                <img src="/img/portfolio/flappy.png"
                                     class="card-img-top img-fluid" style="max-height:250px "
                                     alt="Waterfall" />
                                <div class="card-body">
                                    <h5 class="card-title">@item.StateName</h5>
                                    <p class="card-text">
                                        @item.StateDescription
                                        <br />
                                        Date : @item.PrescriptionTime <br />

                                        Medicines : @item.Medicines.Count()

                                    </p>
                                    <a href="#" class="btn btn-primary" data-toggle="modal" data-target="#item-@(item.Id)">go to descriptiuon </a>
                                </div>
                            </div>
                        </div>
                }
        </div>-->
        <!-- /.row -->

    <!--</div>
</section>-->
<section class="page-section bg-primary  text-white mb-0" id="topThree">
    <div class="container-fluid">
        <!-- Portfolio Section Heading -->
        <h2 class="  text-center text-uppercase text-secondary mb-0">For more Profile Details </h2><br />
        <h2 class="  text-center  text-secondary   mb-0" style="color :white!important ;"><a asp-action="Details" asp-controller="Home">Go to Your profile</a> </h2>
        <!-- Icon Divider -->

    </div>

</section>

<!-- Contact Section -->
<section class="page-section" id="Create">
    <div class="container">

        <!-- Contact Section Heading -->
        <h2 class="page-section-heading text-center text-uppercase text-secondary mb-0">Create New Medical State</h2>

        <!-- Icon Divider -->
        <div class="divider-custom">
            <div class="divider-custom-line"></div>
            <div class="divider-custom-icon">
                <i class="fas fa-star"></i>
            </div>
            <div class="divider-custom-line"></div>
        </div>

        <!-- Contact Section Form -->
        <div class="row">
            <div class="col-lg-8 mx-auto">
                <!-- To configure the contact form email address, go to mail/contact_me.php and update the email address in the PHP file on line 19. -->
                <form name="sentMessage" id="contactForm" novalidate="novalidate"
                      method="post" asp-controller="MedicalState" asp-action="Create">
                    <div class="control-group">
                        <div class="form-group floating-label-form-group controls mb-0 pb-2">
                            <label asp-for="@DummyModel.StateName"></label>
                            <input class="form-control" asp-for="@DummyModel.StateName" data-validation-required-message="Please enter your name.">
                            <p class="help-block text-danger"></p>
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="form-group floating-label-form-group controls mb-0 pb-2">
                            <label asp-for="@DummyModel.PrescriptionTime" ></label>
                            <input class="form-control" asp-for="@DummyModel.PrescriptionTime" placeholder="Phone Number" required="required" data-validation-required-message="Please enter your phone number.">
                            <p class="help-block text-danger"></p>
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="form-group floating-label-form-group controls mb-0 pb-2">
                            <label asp-for="@DummyModel.StateDescription"></label>
                            <textarea class="form-control" id="message" rows="5" asp-for="@DummyModel.StateDescription"data-validation-required-message="Please enter a message."></textarea>
                            <p class="help-block text-danger"></p>
                        </div>
                    </div>
                    <br>
                    <div id="success"></div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary btn-xl" id="sendMessageButton">Create</button>
                    </div>
                </form>
            </div>
        </div>

    </div>
</section>

<!-- Modals -->
@foreach (var item in Model.MedicalStates)
{
    <!-- Portfolio Modal  -->
    <div class="portfolio-modal modal fade" id="item-@(item.Id)" tabindex="-1" role="dialog" aria-labelledby="label-@item.Id" aria-hidden="true">

        <div class="modal-dialog modal-xl" role="document">
            <div class="modal-content">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">
                        <i class="fas fa-times"></i>
                    </span>
                </button>
                <div class="modal-body text-center">
                    <div class="container">
                        <div class="row justify-content-center">
                            <div class="col-lg-8">
                                <!-- Portfolio Modal - Title -->
                                <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0">@item.StateName </h2>
                                <!-- Icon Divider -->
                                <div class="divider-custom">
                                    <div class="divider-custom-line"></div>
                                    <div class="divider-custom-icon">
                                        <i class="fas fa-star"></i>
                                    </div>
                                    <div class="divider-custom-line"></div>
                                </div>
                                <!-- Portfolio Modal - Image -->
                                <div class="icon-box">
                                    <div class="icon " style="color: #5e54b3"><i class="fas fa-heartbeat  fa-10x "></i></div>
                                </div>

                                <!-- Portfolio Modal - Text -->
                                <p class="mb-5">State Description : @item.StateDescription</p>
                                <p class="mb-5">State Name : @item.StateName</p>
                                <p class="mb-5">State Time : @item.PrescriptionTime</p>

                                <a asp-action="Details" role="button" class="btn btn-primary" asp-controller="MedicalState" asp-route-id="@item.Id">View More </a>
                                <button class="btn btn-primary" href="#" data-dismiss="modal">
                                    <i class="fas fa-times fa-fw"></i>
                                    Close Window
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

}
