<!-- Form Start -->
<div class="block">
    <div class="title lightTextShadow"><?php echo "عضو جديد"; ?></div>
    <br />
    <a href="<?= base_url() ?>authorization/admin_users/overview" class="button sub inlineBlock rnd3 lightTextShadow">
        <span><?php echo $this->lang->line('button_users'); ?></span>
    </a>
    <a href="<?= base_url() ?>authorization/admin_groups/overview" class="button sub inlineBlock rnd3 lightTextShadow">
        <span><?php echo $this->lang->line('button_groups'); ?></span>
    </a>

    <div class="content">
        <?php echo form_open_multipart('authorization/admin_users/edit/' . $user->user_id, array('id' => 'user_new')) ?>
        <fieldset class="form boxStyle">                                

            <?php echo $this->template->flash_msg(); ?>

            <input type="hidden" id="user_id" name="user_id" value="<?= $user->user_id ?>" />
            <label for="user_name" class="label"><?php echo $this->lang->line('user_name'); ?></label>
            <input id="user_name" class="textBox med rnd5" name="user_name" value="<?= set_value('user_name', $user->user_username) ?>"  />
            <?php echo form_error('user_name'); ?>
            <br />
            
            <label for="user_pass" class="label"><?php echo $this->lang->line('user_pass'); ?></label>
            <input type="password" id="user_pass" class="textBox med rnd5" name="user_pass" value="<?= set_value('user_pass') ?>"  />
            <?php echo form_error('user_pass'); ?>
            <br />
            
            <label for="confirm_pass" class="label"><?php echo $this->lang->line('confirm_pass'); ?></label>
            <input type="password" id="confirm_pass" class="textBox med rnd5" name="confirm_pass" value="<?= set_value('confirm_pass') ?>"  />
            <?php echo form_error('confirm_pass'); ?>
            <br />
            
            <label for="name" class="label"><?php echo $this->lang->line('name'); ?></label>
            <input type="text" id="name" class="textBox med rnd5" name="name" value="<?= set_value('name', $user->user_full_name) ?>"  />
            <?php echo form_error('name'); ?>
            <br />
            
            <label for="email" class="label"><?php echo $this->lang->line('visitor_mail'); ?></label>
            <input type="text" id="email" class="textBox med rnd5" name="email" value="<?= set_value('email', $user->user_email) ?>"  />
            <?php echo form_error('email'); ?>
            <br />

            <label class="label"><?php echo lang('group'); ?></label>
            <select class="select rnd5" name="group_id">
                <?php foreach ($groups as $g): ?>
                    <option class="input-medium" value="<?= $g['gr_id'] ?>" <?= set_select('group_id', $g['gr_id'], ($g['gr_id'] == $user->user_group_id)? TRUE : FALSE) ?>><?php echo $g['gr_name'] ?></option>
                <?php endforeach; ?>
            </select>
            <br />

            <div class="center">
                <input id="submit" type="submit" value="تفريغ الحقول" class="button sub inlineBlock rnd3 lightTextShadow" />
                <input id="submit" type="submit" value="أدخل" class="button sml inlineBlock rnd5 drkTextShadow" />
            </div>
        </fieldset>
        <?php echo form_close(); ?>

    </div>
</div>