<!-- Wappler include head-page="layouts/newmain" fontawesome_5="cdn" bootstrap5="local" is="dmx-app" id="cnfrm" appconnect="local" components="{dmxValidator:{},dmxNotifications:{},dmxFormatter:{},dmxBootstrap5TableGenerator:{}}" -->
<dmx-serverconnect id="conn_addrolls" url="/api/roles/cnfrm_addroles" dmx-param:userid="whoami.data.identity" noload="true"></dmx-serverconnect>
<dmx-serverconnect id="whoami" url="/api/security/whoami"></dmx-serverconnect>
<dmx-serverconnect id="conn_getuserinfo" url="/api/security/isauthenticated" noload="true"></dmx-serverconnect>
<dmx-serverconnect id="conn_postuser" url="/api/Users/insert" dmx-param:firstname="" dmx-param:lastname="" dmx-param:email="" dmx-on:success="run([{run:{outputType:'text',action:`conn_addrolls.load({userid: whoami.data.identity})`}},{run:{outputType:'text',action:`browser1.goto(\'/partinfo\')`}}])" noload="true"></dmx-serverconnect>
<dmx-serverconnect id="conn_addroles" url="/api/Users/addtorole" noload="true"></dmx-serverconnect>
<dmx-notifications id="notifies1"></dmx-notifications>
<meta name="ac:route" content="/cnfrm">
<header>
    <h1>Confirm your account:</h1>
    <p>Check your email for a confirmation code</p>
</header>
<div class="container">
    <div class="row">
        <div class="col">
            <form id="frm_cnfrm" is="dmx-serverconnect-form" method="post" action="/api/security/confirm" dmx-on:success="conn_postuser.load({firstname: firstname.value, lastname: lastname1.value, email: email.value})">
                <p><input id="id" name="id" value="" dmx-bind:value="whoami.data.identity" type="hidden"></p>
                <p><label for="confirmation">Confirmation:</label><input id="confirmation" name="confirmation" type="text" value="" required=""></p>
                <p><label for="firstname">Firstname:</label><input id="firstname" name="firstname" type="text" value="" required=""></p>
                <p><label for="lastname1">Lastname:</label><input id="lastname1" name="lastname1" type="text" value="" required=""></p>
                <p><label for="email">Email:</label><input id="email" name="email" type="text" value="" dmx-bind:value="whoami.data.query.email" required=""></p>
                <p><label for="password">Password:</label><input id="password" name="password" type="password" value="" required=""></p>
                <p><label for="pwd2">Confirm Password:</label><input id="pwd2" name="pwd2" type="password" value="" required="" data-rule-equalto="password"></p>
                <p class="text-end">
                    <button id="btn_submit" class="btn btn-primary" type="submit">Confirm</button>
                </p>
            </form>
        </div>
    </div>
    <div class="row">
        <div class="col">
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover table-sm">
                    <thead>
                        <tr>
                            <th>Userid</th>
                            <th>Roleid</th>
                        </tr>
                    </thead>
                    <tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="conn_getuserinfo.data.xuserroles" id="tableRepeat1">
                        <tr>
                            <td dmx-text="userid"></td>
                            <td dmx-text="roleid"></td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>
</div>