<%@ page language="C#" autoeventwireup="true" inherits="PatientProfileView, App_Web_lstqojry" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>The Vet World</title>
    <link rel="stylesheet" href="assets/css/bootstrap.css">
    <link rel="stylesheet" href="assets/vendors/simple-datatables/style.css">
    <%--<link rel="stylesheet" href="assets/vendors/chartjs/Chart.min.css">--%>

    <link rel="stylesheet" href="assets/vendors/perfect-scrollbar/perfect-scrollbar.css">
    <link rel="stylesheet" href="assets/css/app.css">
        <link rel="stylesheet" href="assets/css/calenderTheme.css">
    <link rel="shortcut icon" href="Images/vetlogo.png" type="image/x-icon">
    <style>
        .bspace {
            margin-bottom: 10px;
        }

        .scroll {
            margin: 4px, 4px;
            padding: 4px;
            width: 500px;
            height: 110px;
            overflow-x: hidden;
            overflow-y: auto;
            text-align: justify;
        }

        .label {
            font-size: medium;
            font-weight: 300;
        }

        .main-content {
            overflow: hidden;
            min-height: 100vh;
            max-height: inherit;
            padding-bottom: 15px;
        }

        .hideLabel {
            display: none;
        }

        .hideGridColumn {
            display: none;
        }

        .full_screen {
            /*width: 100%;*/
            position: relative;
            height: 80%;
            /*top: 0;
            left: 0;*/
            z-index: 100;
            margin-bottom: 30px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>

        <div class="main-content container-fluid">
            <div class="page-title">
                <h3>Patient Profile</h3>
            </div>
            <section class="section">
                <div class="row bspace">
                    <div class="col-md-12">
                        <div class="divider">
                            <div class="divider-text">Patient Details</div>
                        </div>
                        <div class="row bspace">
                            <div class="col-md-8">
                                <div class="row">
                                    <div class="col-md-2" style="display: none">
                                        <label class="label">Patient Type</label>
                                        <asp:DropDownList ID="ddlPatientType" runat="server" CssClass="form-select">
                                            <asp:ListItem Text="Individual" Value="1"></asp:ListItem>
                                            <asp:ListItem Text="Farm" Value="2"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                    <div class="col-md-5">
                                        <label class="label">Owner Name</label>
                                        <asp:TextBox ID="txtOwnerName" runat="server" CssClass="form-control" AutoPostBack="true" OnTextChanged="txtOwnerName_TextChanged" placeholder="Owner Name" required AutoComplete="off"></asp:TextBox>
                                        <cc1:AutoCompleteExtender ID="txtOwnerName_AutoCompleteExtender" runat="server" BehaviorID="txtOwnerName_AutoCompleteExtender" CompletionListCssClass="completionList" CompletionListHighlightedItemCssClass="itemHighlighted" CompletionListItemCssClass="listItem" DelimiterCharacters="" ServicePath="AutoComplete.asmx" ServiceMethod="GetOwnerName" TargetControlID="txtOwnerName">
                                        </cc1:AutoCompleteExtender>
                                    </div>
                                    <div class="col-md-5">
                                        <asp:Label CssClass="label" ID="lblType" Text="Patient Name" runat="server"></asp:Label>
                                        <asp:TextBox ID="txtPatientName" runat="server" CssClass="form-select" list="PatientList" AutoPostBack="true" OnTextChanged="txtPatientName_TextChanged" />
                                        <datalist id="PatientList">
                                            <asp:Repeater ID="repeatList" runat="server">
                                                <ItemTemplate>
                                                    <option value='<%# Eval("PatientName") %>' itemid='<%# Eval("PatientID") %>'></option>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </datalist>
                                    </div>
                                </div>
                                <div class="row bspace">
                                    <div class="col-md-2">
                                        <label class="label">DOB</label>
                                        <asp:TextBox ID="txtDOB" runat="server" TextMode="Date" onchange="DateSelectionChanged()" CssClass="form-control" placeholder="dd/MM/yyyy"></asp:TextBox>
                                        <script type="text/javascript">
                                            function DateSelectionChanged() {
                                                var today = new Date();
                                                var dob = new Date(document.getElementById('<%=txtDOB.ClientID%>').value);
                                                var months = (today.getMonth() - dob.getMonth() + (12 * (today.getFullYear() - dob.getFullYear())));
                                                document.getElementById('<%=txtAge.ClientID%>').value = Math.round(months / 12);
                                            }
                                        </script>
                                    </div>
                                    <div class="col-md-2">
                                        <label class="label">Gender</label>
                                        <asp:DropDownList ID="ddlGender" runat="server" CssClass="form-select">
                                            <asp:ListItem Text="Male"></asp:ListItem>
                                            <asp:ListItem Text="Female"></asp:ListItem>
                                            <asp:ListItem Text="Neutered Male"></asp:ListItem>
                                            <asp:ListItem Text="Neutered Female"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                    <div class="col-md-1">
                                        <label class="label">Age</label>
                                        <asp:TextBox ID="txtAge" runat="server" CssClass="form-control" placeholder="Age"></asp:TextBox>
                                    </div>
                                    <div class="col-md-2">
                                        <label class="label">Weight</label>
                                        <asp:TextBox ID="txtWeight" runat="server" CssClass="form-control" placeholder="Weight"></asp:TextBox>
                                    </div>
                                    <%--    </div>
                                    <div class="row bspace">--%>
                                    <div class="col-md-2">
                                        <label class="label">Species</label>
                                        <asp:DropDownList ID="ddlSpeciesType" runat="server" CssClass="form-select" AppendDataBoundItems="true" OnSelectedIndexChanged="ddlSpeciesType_SelectedIndexChanged">
                                            <asp:ListItem Selected="True" Value="0" Text="Select"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                    <div class="col-md-2">
                                        <label class="label">Breed</label>
                                        <asp:DropDownList ID="ddlBreed" runat="server" CssClass="form-select" AppendDataBoundItems="true">
                                            <asp:ListItem Selected="True" Value="0" Text="Select"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                    <div class="col-md-1">
                                        <label class="label">Nos.</label>
                                        <asp:TextBox ID="txtNos" runat="server" CssClass="form-control" placeholder="Nos"></asp:TextBox>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="row">
                                    <asp:Repeater ID="ImageRepeater" runat="server">
                                        <ItemTemplate>
                                            <asp:Image ID="PatientImage" runat="server" />
                                        </ItemTemplate>
                                    </asp:Repeater>

                                </div>
                            </div>

                        </div>

                        <div class="row bspace" id="FirmEntry" runat="server" visible="false">
                            <table class="table table-hover mb-0">
                                <thead>
                                    <tr>
                                        <th>SrNo</th>
                                        <th>Species</th>
                                        <th>Breed</th>
                                        <th>CountOfAnimal</th>
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:Repeater ID="RepeaterPatientVisit" runat="server">
                                        <ItemTemplate>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblSrNo" Text='<%# Eval("SrNo") %>' runat="server"></asp:Label></td>

                                                <td><%# Eval("Species") %></td>
                                                <td class="text-bold-500"><%# Eval("Breed") %></td>
                                                <td><%# Eval("CountOfAnimal") %></td>
                                                <td>
                                                    <asp:Label ID="lblPatientEntryID" Text='<%#Eval("PatientEntryID") %>' runat="server" Visible="false"></asp:Label>
                                                    <asp:Label ID="lblSpeciesTypeID" Text='<%#Eval("SpeciesTypeID") %>' runat="server" Visible="false"></asp:Label>
                                                    <asp:Label ID="lblBreedID" Text='<%#Eval("BreedID") %>' runat="server" Visible="false"></asp:Label>
                                                    <asp:Label ID="lblStat" Text='<%#Eval("Stat") %>' runat="server" Visible="false"></asp:Label>
                                                    <div class="dropdown">
                                                        <a class="btn btn-link font-24 p-0 line-height-1 no-arrow dropdown-toggle" href="#" role="button" data-toggle="dropdown">
                                                            <i class="dw dw-more"></i>
                                                        </a>
                                                        <div class="dropdown-menu dropdown-menu-right dropdown-menu-icon-list">
                                                            <%--  <asp:Button CssClass="dropdown-item" runat="server" Text="View" ID="View" AutoPostBack="true" CommandArgument='<%#Eval("SrNo") %>' OnClick="View_Click"></asp:Button>
                                                                <asp:Button CssClass="dropdown-item" runat="server" Text="Delete" ID="btnDelete" AutoPostBack="true" CommandArgument='<%#Eval("SrNo") %>' OnClick="btnDelete_Click"></asp:Button>--%>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </tbody>
                            </table>
                            <asp:Label ID="lblPatientEntryID" runat="server" Visible="false"></asp:Label>
                        </div>
                        <div class="card-body">
                            <div class="row">
                                <ul class="nav nav-tabs" id="myTab" role="tablist">
                                    <li class="nav-item" role="presentation">
                                        <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home"
                                            aria-selected="true">Owner Info</a>
                                    </li>
                                    <li class="nav-item" role="presentation">
                                        <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile"
                                            aria-selected="false">Profile</a>
                                    </li>
                                    <li class="nav-item" role="presentation">
                                        <a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact"
                                            aria-selected="false">Previous Appointment</a>
                                    </li>
                                </ul>
                                <div class="tab-content" id="myTabContent">
                                    <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
                                        <p class='my-2'>
                                            <div class="row bspace">
                                                <div class="col-md-6">
                                                    <div class="row bspace">
                                                        <div class="col-md-4">
                                                            <label class="label">WA No</label>
                                                        </div>
                                                        <div class="col-md-8">
                                                            <asp:TextBox ID="txtWaNo" runat="server" CssClass="form-control" placeholder="WA No"></asp:TextBox>
                                                        </div>
                                                    </div>
                                                    <div class="row bspace">
                                                        <div class="col-md-4">
                                                            <label class="label">Alternate No</label>
                                                        </div>
                                                        <div class="col-md-8">
                                                            <asp:TextBox ID="txtAltNo" runat="server" CssClass="form-control" placeholder="Alternate No"></asp:TextBox>
                                                        </div>
                                                    </div>
                                                    <div class="row bspace">
                                                        <div class="col-md-4">
                                                            <label class="label">Email ID</label>
                                                        </div>
                                                        <div class="col-md-8">
                                                            <asp:TextBox ID="txtEmailID" runat="server" CssClass="form-control" placeholder="Email ID"></asp:TextBox>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-md-2">
                                                    <label class="label">Address</label>
                                                </div>
                                                <div class="col-md-4">
                                                    <asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine" CssClass="form-control" Height="100px" placeholder="Address"></asp:TextBox>
                                                </div>
                                            </div>
                                        </p>
                                    </div>
                                    <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
                                        <div class="row bspace">
                                            <div class="col-md-6">
                                                <label class="label">Allergies</label>
                                                <asp:TextBox ID="txtAllergies" runat="server" TextMode="MultiLine" CssClass="form-control" placeholder="Allergies"></asp:TextBox>
                                            </div>

                                            <div class="col-md-6">
                                                <label class="label">Prev History</label>
                                                <asp:TextBox ID="txtHistory" runat="server" TextMode="MultiLine" CssClass="form-control" placeholder="Prev History"></asp:TextBox>
                                            </div>
                                        </div>
                                        <div class="row bspace">
                                            <div class="col-md-6">
                                                <label class="label">Prev Treatment</label>
                                                <asp:TextBox ID="txtPrevTreat" runat="server" TextMode="MultiLine" CssClass="form-control" placeholder="Prev Treatment"></asp:TextBox>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="label">Remarks</label>
                                                <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine" CssClass="form-control" placeholder="Remarks"></asp:TextBox>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
                                        <table class="table table-hover mb-0">
                                            <thead>
                                                <tr>
                                                    <th>Visit Date</th>
                                                    <th>Department</th>
                                                    <th>Notes</th>
                                                    <th>Treatment</th>
                                                    <th>Advice</th>
                                                    <th>FollowUp</th>
                                                    <th>View</th>
                                                    <th>Invoice</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <asp:Repeater ID="PatientAppointment" runat="server">
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblVisitDate" Text='<%# Eval("VisitDate","{0:MM/dd/yyyy}") %>' runat="server"></asp:Label></td>

                                                            <td>
                                                                <asp:Label ID="lblComplaints" runat="server" Text='<%# Eval("DepartmentName") %>' /></td>
                                                            <td class="text-bold-500"><%# Eval("Notes") %></td>
                                                            <td><%# Eval("Treatment") %></td>
                                                            <td>
                                                                <%#Eval("Advice") %></td>
                                                            <td>
                                                                <%#Eval("FollowUpDate","{0:MM/dd/yyyy}") %></td>
                                                            <td>
                                                                <asp:Label ID="lblDepartment" Visible="false" runat="server" Text='<%# Eval("Department") %>' />
                                                                <%--<div class="dropdown">
                                                                        <a class="btn btn-link font-24 p-0 line-height-1 no-arrow dropdown-toggle" href="#" role="button" data-toggle="dropdown">
                                                                            <i class="dw dw-more"></i>
                                                                        </a>
                                                                        <div class="dropdown-menu dropdown-menu-right dropdown-menu-icon-list">--%>
                                                                <asp:Label ID="lblCharges" runat="server" Visible="false" Text='<%#Eval("TotalBill") %>'></asp:Label>
                                                                <asp:Button CssClass="btn btn-primary" runat="server" Text="View" ID="View" AutoPostBack="true" CommandArgument='<%#Eval("VisitID") %>' OnClick="View_Click"></asp:Button>

                                                                <%--  </div>
                                                                    </div>--%>
                                                            </td>
                                                            <td>
                                                                <asp:Button CssClass="btn btn-primary" runat="server" Text="Invoice" ID="btnInvoice" AutoPostBack="true" CommandArgument='<%#Eval("VisitID") %>' OnClick="btnInvoice_Click"></asp:Button>
                                                            </td>
                                                        </tr>
                                                    </ItemTemplate>
                                                </asp:Repeater>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row bspace" style="display: none">
                            <div class="col-md-2">
                                <label class="label">User Name</label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox ID="txtUserName" runat="server" CssClass="form-control" placeholder="User Name"></asp:TextBox>
                            </div>
                            <div class="col-md-2">
                                <label class="label">Password</label>
                            </div>
                            <div class="col-md-2">
                                <asp:TextBox ID="txtPassword" runat="server" CssClass="form-control" placeholder="Password" TextMode="Password"></asp:TextBox>
                            </div>
                        </div>
                        <div class="row form-group">
                            <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
                            <asp:Label ID="lblID" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lblSrNo" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lblUserID" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lblOwnerID" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lblMsg" runat="server" ForeColor="Green"></asp:Label>
                            <asp:Label runat="server" ID="lblImageID" Visible="false"></asp:Label>
                        </div>
                        <div class="row bspace">
                            <%--   <div class="col-md-4">
                                <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn btn-primary btn-block" OnClick="btnSave_Click" />
                            </div>
                                <div class="col-md-4">
                                <button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#exampleModalCenter">Show</button>
                            </div>--%>
                            <div class="col-md-4">
                                <asp:Button ID="btnReset" runat="server" Text="Reset" CssClass="btn btn-primary btn-block" UseSubmitBehavior="false" CausesValidation="false" OnClick="btnReset_Click" />
                            </div>
                            <div class="col-md-4">
                                <a href="javascript:history.back();" class="btn btn-primary btn-block">Go Back</a>
                            </div>
                        </div>
                    </div>
                </div>
                <%--  <div class="col-md-4">
                    <div class="divider">
                        <div class="divider-text">Doctor List</div>
                    </div>
                    <div class="row bspace">
                      <asp:GridView ID="GridDoctorMaster" runat="server" AutoGenerateColumns="false" CssClass="table table-responsive table-bordered" OnSelectedIndexChanged="GridDoctorMaster_SelectedIndexChanged">
                            <Columns>
                                <asp:CommandField ShowSelectButton="true" SelectText="<<" />
                                <asp:BoundField DataField="DoctorID" HeaderText="DoctorID" SortExpression="DoctorID" HeaderStyle-CssClass="hideGridColumn" ItemStyle-CssClass="hideGridColumn" />
                                <asp:BoundField DataField="DocName" HeaderText="DocName" SortExpression="DocName" />
                                <asp:BoundField DataField="DocAddress" HeaderText="DocAddress" SortExpression="DocAddress" />
                                <asp:BoundField DataField="DocMobileNo" HeaderText="DocMobileNo" SortExpression="DocMobileNo" />
                                <asp:BoundField DataField="DocImage" HeaderText="DocImage" SortExpression="DocImage" HeaderStyle-CssClass="hideGridColumn" ItemStyle-CssClass="hideGridColumn" />
                            </Columns>
                        </asp:GridView>
                    </div>
            </div>--%>
            </section>
        </div>
        <%-- </ContentTemplate>
    </asp:UpdatePanel>--%>
        <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog"
            aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-dialog-centered modal-dialog-scrollable"
                role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalCenterTitle">Patient List</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <i data-feather="x"></i>
                        </button>
                    </div>
                    <div class="modal-body">
                        <asp:GridView ID="GridPatientMaster" runat="server" AutoGenerateColumns="false" CssClass="table table-responsive table-bordered" OnSelectedIndexChanged="GridPatientMaster_SelectedIndexChanged">
                            <Columns>
                                <asp:CommandField SelectText="<<" ShowSelectButton="true" />
                                <asp:BoundField DataField="PatientID" HeaderText="PatientID" SortExpression="PatientID" HeaderStyle-CssClass="hideGridColumn" ItemStyle-CssClass="hideGridColumn" />
                                <asp:BoundField DataField="PatientName" HeaderText="PatientName" SortExpression="PatientName" />
                                <asp:BoundField DataField="OwnerName" HeaderText="OwnerName" SortExpression="OwnerName" />
                            </Columns>
                        </asp:GridView>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-light-secondary" data-dismiss="modal">
                            <i class="bx bx-x d-block d-sm-none"></i>
                            <span class="d-none d-sm-block">Close</span>
                        </button>
                        <%--    <button type="button" class="btn btn-primary ml-1" data-dismiss="modal">
                        <i class="bx bx-check d-block d-sm-none"></i>
                        <span class="d-none d-sm-block">Accept</span>
                    </button>--%>
                    </div>
                </div>
            </div>
        </div>
        <script src="assets/js/feather-icons/feather.min.js"></script>
        <script src="assets/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script>
        <script src="assets/js/app.js"></script>

        <script src="assets/vendors/chartjs/Chart.min.js"></script>
        <script src="assets/vendors/apexcharts/apexcharts.min.js"></script>
        <script src="assets/js/pages/dashboard.js"></script>
        <script src="assets/vendors/simple-datatables/simple-datatables.js"></script>
        <script src="assets/js/vendors.js"></script>
        <script src="assets/js/main.js"></script>
    </form>
</body>
</html>
