<?php defined('ABSPATH') or die('No script kiddies please!'); ?>
<div class="wpwab-content-wrap">
    <div class="wpwab-display setting">
        <div class="wpwab-field-wrap">
            <label><?php _e('Template Layout', wpwab_TD); ?></label>
            <div class="wpwab-field">
                <select name="wpwab_settings[wpwab_button_template_menu]" id="wpwab-button-template-menu" >

                    <?php for ($k = 1; $k <= 5; $k ++) { ?>
                        <option id="wpwab-temp-<?php echo $k; ?>" value="template-<?php echo $k; ?>" <?php echo isset($wpwab_settings['wpwab_button_template_menu']) && $wpwab_settings['wpwab_button_template_menu'] == 'template-' . $k ? "selected='selected'" :''; ?>>
                            <?php _e('Template ', wpwab_TD) ?><?php echo $k; ?>
                        </option>
                    <?php } ?>    

                </select>
                <div class="wpwab-grid-demo wpwab-preview-image">
                    <?php
                    for ($cnt = 1; $cnt <= 5; $cnt ++) {
                        if (isset($wpwab_settings['wpwab_button_template_menu'])) {
                            $option_value = $wpwab_settings['wpwab_button_template_menu'];
                            $exploed_array = explode('-', $option_value);
                            $cnt_num = $exploed_array[1];
                            if ($cnt != $cnt_num) {
                                $style = "style='display:none;'";
                            } else {
                                $style = '';
                            }
                        }
                        ?>
                        <div class="wpwab-grid-common-menu" id="wpwab-grid-demo-menu-<?php echo $cnt; ?>" <?php if (isset($style)) echo $style; ?>>
                            <div class="wpwab-border-design">
                                <img src="<?php echo wpwab_IMG_DIR . '/button/' . 'template-' . $cnt . '.jpg' ?>"/>
                            </div>

                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>
</div>
