<?php
if ($user_type_id != 10) {
    $moduleData = $this->dashboardMenu()->getDashboardModule($user_type_id);
} else {
    $moduleData = $this->dashboardMenu()->getAllMasterModule();
}
?>
<section class="content">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabbable">
                <div class="tab-content no-border padding-24">
                    <div class="tab-pane fade in active" id="faq-tab-1">
                        <div class="space-8"></div>
                        <div class="panel-group accordion-style1 accordion-style2" id="faq-list-1">
                            <div class="panel panel-default">
                                <div class="panel-headingnew">Add Staff </div>
                                <?php
                                $form = $this->form;
                                $form->prepare();
                                //$form->setAttribute('action', $this->url('usermanagement', ['action' => 'add']));
                                $form->setAttribute('method', 'post');
                                $form->setAttribute('id', 'add-staff-form');
                                echo $this->form()->openTag($form);
                                ?>

                                <div class="left_panel col-sm-12 padding_margin0 pull-left bg-white">

                                    <div class="col-sm-12  " align="right">

                                        <div class="tool-bar margin">
                                            <div class="row">



                                                <a href="<?php echo $this->url('staff'); ?>" class="back_btn_link btn btn-primary"><i class="fa fa-chevron-left"></i> Back</a>
                                                <a href="javascript:void(0);" class="reset_btn btn btn-success"><i class="fa fa-retweet"></i> Reset</a>
                                                <?php echo $this->FormElement($form->get('submit')); ?>
                                            </div>
                                        </div>
                                    </div>


                                    <div class="tab-content tab_editprofile col-sm-12 padding-left0 margintop10px margin-bttom10px">
                                        <div id="home" class="tab-pane fade in tab_editprofile tab_editprofile1 active" style="min-height:auto !important;">

                                            <div class="change_password tab_editprofile">

                                                <div class="tab-content" id="myTabContent">
                                                    <div class="panel-body">
                                                        <div class="col-md-1" style="display:none">
                                                            <div class="form-group selDropMess">
                                                                <label for="is_agency">Is B2B</label>
                                                                <div class="col-md-12 no-padding">
                                                                    <input onclick="return false;" type="checkbox" name="is_btobagent" id="is_btobagent" value="1">

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


                                                        <div class="col-md-4">
                                                            <div class="form-group">
                                                                <?php echo $this->translate($this->formLabel($form->get('first_name'))); ?>
                                                                <?php echo $this->FormElement($form->get('first_name')); ?>
                                                                <span class="showerror"><?php echo $this->formElementErrors($form->get('first_name'), ['class' => 'error']); ?></span>
                                                            </div>

                                                        </div>

                                                        <div class="col-md-4">
                                                            <div class="form-group">
                                                                <?php echo $this->translate($this->formLabel($form->get('last_name'))); ?>
                                                                <?php echo $this->FormElement($form->get('last_name')); ?>
                                                                <span class="showerror"><?php echo $this->formElementErrors($form->get('last_name'), ['class' => 'error']); ?></span>
                                                            </div>

                                                        </div>

                                                        <div class="col-md-4">
                                                            <div class="form-group">
                                                                <?php echo $this->translate($this->formLabel($form->get('email'))); ?>
                                                                <?php echo $this->FormElement($form->get('email')); ?>
                                                                <span class="showerror"><?php echo $this->formElementErrors($form->get('email'), ['class' => 'error']); ?></span>
                                                            </div>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                        <div class="col-md-4">
                                                            <div class="form-group">
                                                                <label class="col-sm-12 no-padding"> <?php echo $this->translate($this->formLabel($form->get('contact_no'))); ?> </label>

                                                                <div class="col-sm-2 no-padding">

                                                                    <?php echo $this->formElement($form->get('prefix_contact_no')); ?>

                                                                </div>

                                                                <div class="col-sm-10 padding-r0">
                                                                    <?php echo $this->FormElement($form->get('contact_no')); ?>
                                                                    <span class="showerror"><?php echo $this->formElementErrors($form->get('contact_no'), ['class' => 'error']); ?></span>
                                                                </div>

                                                            </div>
                                                        </div>
                                                        <div class="col-md-4" style="display:block">
                                                            <div class="form-group selDropMess">
                                                                <label>Role<span class="red">*</span></label>
                                                                <?php echo $this->FormElement($form->get('user_role')); ?>
                                                                <span class="showerror"><?php echo $this->formElementErrors($form->get('user_role'), ['class' => 'error']); ?></span>
                                                            </div>
                                                        </div>

                                                        <div class="col-md-4" style="display:block">
                                                            <div class="form-group selDropMess">
                                                                <label>Gender<span class="red">*</span></label>
                                                                <?php echo $this->FormElement($form->get('gender')); ?>
                                                                <span class="showerror"><?php echo $this->formElementErrors($form->get('gender'), ['class' => 'error']); ?></span>
                                                            </div>
                                                        </div>


                                                        <div class="col-md-4">
                                                            <div class="form-group selDropMess">
                                                                <?php echo $this->translate($this->formLabel($form->get('department'))); ?>
                                                                <div class="col-md-12 no-padding">
                                                                    <div class="row-fluid">
                                                                        <?php echo $this->FormElement($form->get('department')); ?>
                                                                        <span class="showerror"><?php echo $this->formElementErrors($form->get('department'), ['class' => 'error']); ?></span>

                                                                    </div>

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

                                                        <div class="col-md-4">
                                                            <div class="form-group selDropMess">
                                                     <?php echo $this->translate($this->formLabel($form->get('nationality'))); ?>
                                                     <?php echo $this->formElement($form->get('nationality_value')); ?>
                                                                <div class="col-md-12 no-padding">
                                                                    <div class="row-fluid">
                                                                        <?php echo $this->FormElement($form->get('nationality')); ?>
                                                                        <span class="showerror"><?php echo $this->formElementErrors($form->get('nationality'), ['class' => 'error']); ?></span>

                                                                    </div>

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




                                                    </div>

                                                </div>

                                            </div>

                                            <div class="col-sm-12">

                                                <div class="panel panel-default">
                                                    <div class="panel-heading">
                                                        <h3 class="panel-title">Permission Control</h3>
                                                    </div>
                                                    <div class="panel-body">
                                                        <div class="col-md-4">
                                                            <ul>
                                                                <?php
                                                                foreach ($moduleData as $getModuleData) {

                                                                    $moduleName = $getModuleData['module_name'];
                                                                    $moduleId = $getModuleData['module_id'];
                                                                    ?>

                                                                    <li><label class="booking-check"><?php echo $moduleName; ?> <input type="checkbox"  name="modulenameid[]" value="<?php echo $moduleId; ?>" <?php if ($moduleName == "Dashboard") { ?>  checked="checked" onclick="return false" <?php } ?>>
                                                                            <span class="checkmark"></span>
                                                                        </label>

                                                                        <?php
                                                                        if (!empty($getModuleData['submenu'])) {
                                                                            foreach ($getModuleData['submenu'] as $submenu) {

                                                                                $submoduleName = $submenu['module_name'];
                                                                                $submoduleId = $submenu['module_id'];
                                                                                ?>
                                                                                <ul>
                                                                                    <li><label class="booking-check"><?php echo $submoduleName; ?>
                                                                                            <input type="checkbox" name="modulenameid[]" value="<?php echo $submoduleId; ?>" >

                                                                                            <span class="checkmark"></span>
                                                                                        </label>
                                                                                </ul>
                                                                            <?php }
                                                                        } ?>
                                                                    </li>
<?php } ?>

                                                            </ul>

                                                        </div>




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


                                        </div>



                                    </div>




                                    <div class="tool-bar margin text-right">


                                        <div class="row">

                                            <a href="<?php echo $this->url('staff'); ?>" class="back_btn_link btn btn-primary"><i class="fa fa-chevron-left"></i> Back</a>
                                            <a href="javascript:void(0);" class="reset_btn btn btn-success"><i class="fa fa-retweet"></i> Reset</a>
<?php echo $this->FormElement($form->get('submit')); ?>
                                        </div>




                                    </div>


                                </div>

<?php echo $this->form()->closeTag(); ?>

                            </div>



                        </div>



                    </div>

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

    <br>



</section>