<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Admin</title>
        <link
            href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
            rel="stylesheet"
            integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
            crossorigin="anonymous"
        />
    </head>

    <body>
        <!-- -----HEADER INCLUDING LOGO AND NAVBAR----- -->
        <header class="header-glass active">
            <div>
                <img src="images/xpecto-logo-header.png" alt="" />
                <span>XPECTO'22</span>
            </div>
            <nav>
                <a class="close" id="" href="/">Home</a>
                <a class="close" id="" href="/registrations">Registrations</a>
                <a class="close" id="" href="/regcodecount"
                    >Registrations Via Code</a
                >
            </nav>
            <div class="hamburger">
                <img class="toggle" src="images/menu_open.svg" alt="" />
            </div>
        </header>

        <!-- -----HEADER END----- -->

        <div class="container justify-content-center text-center">
            <h1>GENERATE REFERRAL CODE</h1>
            <div class="mb-3 w-50 mx-lg-auto my-5">
                <form action="/xyzgeneratecodeabc" method="POST">
                    <div class="mb-3">
                        <label for="name" class="form-label"
                            >Campus Ambassador Name</label
                        >
                        <input
                            type="text"
                            class="form-control"
                            id="name"
                            name="campus_ambassador_name"
                            required
                        />
                    </div>
                    <div class="mb-3">
                        <label for="name" class="form-label">
                            Campus Ambassador for which college/place</label
                        >
                        <input
                            type="text"
                            class="form-control"
                            id="place"
                            name="place"
                            placeholder="Enter"
                            required
                        />
                    </div>

                    <button type="submit" class="btn btn-primary">
                        Generate Referral Code
                    </button>
                </form>
                <br />
                <% if (get_call==="false" && success==="true" &&
                codeinfo.code.length>0) {%>
                <table>
                    <tr>
                        <td>Referral Code</td>
                        <td><%= codeinfo.code %></td>
                    </tr>
                    <tr>
                        <td>Campus Ambassador Name</td>
                        <td><%= codeinfo.campus_ambassador_name %></td>
                    </tr>
                    <tr>
                        <td>Place of Campus Ambassador</td>
                        <td><%= codeinfo.place %></td>
                    </tr>
                </table>
                <br />
                <hr />
                <% } %>
            </div>
        </div>

        <script
            src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
            integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
            crossorigin="anonymous"
        ></script>
        <script src="scripts/ejs.js"></script>
    </body>
</html>
