@model MedicineModel

@{
    ViewData["Title"] = "Medicine Details ";

    Layout = "_AdminLayout";
    var a = 0;
}
<section class="page-section">
    <div class="container py-5 h-100">
        <div class="row d-flex justify-content-center align-items-center h-100">
            <div class="col col-lg-8 mb-4 mb-lg-0">
                <div class="card mb-3" style="border-radius: .5rem;">
                    <div class="row g-0">
                        <div class="col-md-4 gradient-custom text-center text-black"
                             style="border-top-left-radius: .5rem; border-bottom-left-radius: .5rem;">
                            <img src="~/img/portfolio/@Model.Image"
                                 alt="Avatar" class="img-fluid my-5" style="width: 80px;" />
                            <h5>@Model.TradeName</h5>
                            <p>For: @(Model.Category is null ? "":Model.Category.Name)</p>
                            <a asp-action="Edit" asp-route-id="@Model.Id">
                                <i class="far fa-edit mb-5"></i>
                            </a>

                            <a asp-action="Index">

                                <i class="far fa-backward">

                                </i>
                                Go Back
                            </a>
                        </div>
                        <div class="col-md-8">
                            <div class="card-body p-4">
                                <h6>Information</h6>
                                <hr class="mt-0 mb-4">
                                <div class="row pt-1">
                                    <div class="col-6 mb-3">
                                        <h6>Description</h6>
                                        <p class="text-muted">@Model.Description</p>
                                    </div>
                                    <div class="col-6 mb-3">
                                        <h6>Medicine Type:@Model.MedicineType?.TypeName</h6>
                                        <p class="text-muted">Dosage : @Model.Dosage</p>
                                        <p class="text-muted">Price : @Model.Price</p>
                                    </div>
                                </div>
                                <h6>Ingredients : </h6>
                                <hr class="mt-0 mb-4">
                                <div class="row pt-1">
                                    <table class="table table-bordered">
                                        <thead>
                                            <tr>
                                                <td>#</td>
                                                <td>Name</td>
                                                <td>Description</td>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @foreach (var ing in Model.Ingredients)
                                            {
                                                <tr class=" mb-3">
                                                    <td>@(a+=1)</td>
                                                    <td>@ing.Name</td>
                                                    <td>@ing.Description</td>
                                                </tr>
                                            }
                                        </tbody>
                                    </table>
                                </div>
                                <div class="row pt-1">
                                    <div class="col-6 mb-3">
                                        <h6>Go To list </h6>
                                        <a asp-action="Index">Back to List</a>

                                    </div>
                                    <div class="col-6 mb-3">
                                        <h6>Add Ingredient </h6>
                                        <a asp-action="AddIngredints" asp-controller="Medicine" asp-route-id="@Model.Id">Add </a>

                                    </div>


                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>