<script src='https://www.google.com/recaptcha/api.js'></script>
<?php
$ApiMenu = $this->mainMenu()->getMenu('Api Menu');
$api_cms_pages = $ApiMenu['responsedata'];
//print_r($api_cms_pages); die;
?>
<section id="main-form" class="padding12top">
    <div class="container">
        <div class="" id="reg_form">

            <div class="col-sm-12" align="" id="login_detail">
                <div class="col-sm-6" style="margin-top: 10px;">



                    <?php if (count($api_cms_pages) > 0) { ?>
                        <ul>
                            <?php foreach ($api_cms_pages as $value) { ?>
                                <li><a href="<?php echo $this->url('api', array('action' => 'api-document'), array('query' => array('id' => $value['menu_id']))); ?>"><h4><?php echo $value['menu_name']; ?></h4></a></li>



                            <?php } ?>
                        </ul>
                    <?php } ?>






                </div>
                <div class="col-sm-6">
                    <div>
                        <?php if (isset($error_msg)) {
                            echo "<font color='red'><strong>$error_msg</strong></font>";
                        } ?>
                    </div>
                    <div class="row">



                        <div class="col-md-6 ">
                            <div class="panel panel-flat">
                                <div class="panel-heading">
                                    <h4 class="panel">API User Login</h4>

                                    <div class="login-box-body">

                                        <div class="col-lg-12 error_msg_class" style="color: red; padding:5px;"><?php echo $errorMsg; ?></div>

                                        <?php
                                        $form = $this->form;
                                        $form->prepare();
                                        $form->setAttribute('method', 'post');
                                        $form->setAttribute('id', 'login-form');
                                        echo $this->form()->openTag($form);
                                        ?>

                                        <!--<div class="form-group has-feedback">
                                        <?php echo $this->formElement($form->get('user_type_id')); ?>
                                            <span class="showerror">
<?php echo $this->formElementErrors($form->get('user_type_id'), ['class' => 'error']); ?>
                                            </span>
                                        </div>-->
                                        <div class="form-group has-feedback">
                                                <?php echo $this->formElement($form->get('user_name')); ?>
                                            <span class="showerror">
<?php echo $this->formElementErrors($form->get('user_name'), ['class' => 'error']); ?>
                                            </span>
                                        </div>
                                        <div class="form-group has-feedback">
                                                <?php echo $this->formElement($form->get('username')); ?>
                                            <span class="showerror">
<?php echo $this->formElementErrors($form->get('username'), ['class' => 'error']); ?>
                                            </span>
                                            <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
                                        </div>
                                        <div class="form-group has-feedback">
                                                <?php echo $this->formElement($form->get('password')); ?>
                                            <span class="showerror">
<?php echo $this->formElementErrors($form->get('password'), ['class' => 'error']); ?>
                                            </span>
                                            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                                        </div>


                                        <div class="form-group">
                                            <div class="g-recaptcha" data-sitekey="<?php echo $this->captchaKey; ?>"></div>
                                            <div class="error"><?php echo $this->error; ?></div>
                                        </div>


                                        <div class="row">
                                            <div class="col-xs-6">
<?php echo $this->FormElement($form->get('login_dashboard')); ?>

                                            </div>
                                            <div class="col-xs-6">
                                                <a href="<?php echo $this->url('api-user'); ?>" ><input type="button" name="NewUser" value="Sign Up" class="btn btn-danger btn-block btn-flat"></Button></a>
                                            </div>
                                            <!-- /.col -->

                                            <!-- /.col -->
                                        </div>

<?php echo $this->form()->closeTag(); ?>
                                        <a href="<?php echo $this->url('forgot-password'); ?>">I forgot my password</a><br>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
</section>
