/**
     * Widget Backend
     * @param $instance
     */
    public function form($instance)
    {
        //widget title
        if (isset($instance['title'])) {
            $title = $instance['title'];
        } else {
            $title = __('');
        }
        $address = isset($instance['address']) ? $instance['address'] : '';
        //location
        $width = isset($instance['width']) ? $instance['width'] : '';
        //width
        $height = isset($instance['height']) ? $instance['height'] : '';
        //height
        $show_searchbox = isset($instance['show_searchbox']) && $instance['show_searchbox'] ? 1 : 0;
        //show search iinput box
        ?>
        <p>
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:');
        ?>
</label><br/>
            <input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
" />
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('address');
        ?>
"><?php 
        _e('Vị trí:');
        ?>
</label><br/>
            <input type="text" name="<?php 
        echo $this->get_field_name('address');
        ?>
" id="<?php 
        echo $this->get_field_id('address');
        ?>
" value="<?php 
        echo $address;
        ?>
"/><br/>
            (<em>Để trống lấy mặc định bởi cài đặt module Map.</em>)<br/>
            <a href="<?php 
        echo HW_Module_Settings_page::get_module_setting_page('map');
        ?>
" target="_blank">Cấu hình gmap</a>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('width');
        ?>
"><?php 
        _e('Width (px/%):');
        ?>
</label><br/>
            <input type="text" name="<?php 
        echo $this->get_field_name('width');
        ?>
" id="<?php 
        echo $this->get_field_id('width');
        ?>
" value="<?php 
        echo $width;
        ?>
"/>(mặc định px)<br/>
            (<em>Để trống lấy mặc định bởi cài đặt module Map.</em>)
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('height');
        ?>
"><?php 
        _e('Height (px/%):');
        ?>
</label><br/>
            <input type="text" name="<?php 
        echo $this->get_field_name('height');
        ?>
" id="<?php 
        echo $this->get_field_id('height');
        ?>
" value="<?php 
        echo $height;
        ?>
"/>(mặc định px)<br/>
            (<em>Để trống lấy mặc định bởi cài đặt module Map.</em>)
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('show_searchbox');
        ?>
"><?php 
        _e('Hiển thị tìm kiếm:');
        ?>
</label><br/>
            <input type="checkbox" name="<?php 
        echo $this->get_field_name('show_searchbox');
        ?>
" id="<?php 
        echo $this->get_field_id('show_searchbox');
        ?>
" <?php 
        checked($show_searchbox);
        ?>
/><br/>
            (<em>Để trống lấy mặc định bởi cài đặt module Map.</em>)
        </p>
    <?php 
    }
    /**
     * @param array $instance
     * @return string|void
     */
    public function form($instance)
    {
        $instance = wp_parse_args((array) $instance, array('title' => ''));
        $title = $instance['title'];
        ?>
        <p>
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
">Tiêu đề: <input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo attribute_escape($title);
        ?>
" /></label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('font_color');
        ?>
">Mã mầu chữ: <input class="widefat" id="<?php 
        echo $this->get_field_id('font_color');
        ?>
" name="<?php 
        echo $this->get_field_name('font_color');
        ?>
" type="text" value="<?php 
        echo $instance['font_color'];
        ?>
" /></label>
        </p>

        <!-- UPDATE PLAN -->
        <p>
            <label for="<?php 
        echo $this->get_field_id('count_start');
        ?>
">Thêm lượt truy cập ảo: <input class="widefat" id="<?php 
        echo $this->get_field_id('count_start');
        ?>
" name="<?php 
        echo $this->get_field_name('count_start');
        ?>
" type="text" value="<?php 
        echo $instance['count_start'];
        ?>
" /></label>
        </p>

        <p>
            <label for="<?php 
        echo $this->get_field_id('hits_start');
        ?>
">Bắt đầu từ Hits: <input class="widefat" id="<?php 
        echo $this->get_field_id('hits_start');
        ?>
" name="<?php 
        echo $this->get_field_name('hits_start');
        ?>
" type="text" value="<?php 
        echo $instance['hits_start'];
        ?>
" /></label>
        </p>
        <p><font size='2'>Nhập một con số cộng vào lượt hits hiện tại (mặc định bắt đầu từ 1)</font></p>
        <!-- END UPDATE -->
        <p><font size='3'><b>Tùy chọn hiển thị</b></font></p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('today_view');
        ?>
"><?php 
        _e('Truy cập hôm nay? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['today_view'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('today_view');
        ?>
" name="<?php 
        echo $this->get_field_name('today_view');
        ?>
" /></label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('yesterday_view');
        ?>
"><?php 
        _e('Truy cập hôm qua? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['yesterday_view'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('yesterday_view');
        ?>
" name="<?php 
        echo $this->get_field_name('yesterday_view');
        ?>
" /></label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('month_view');
        ?>
"><?php 
        _e('Theo tháng? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['month_view'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('month_view');
        ?>
" name="<?php 
        echo $this->get_field_name('month_view');
        ?>
" /></label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('year_view');
        ?>
"><?php 
        _e('Theo năm? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['year_view'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('year_view');
        ?>
" name="<?php 
        echo $this->get_field_name('year_view');
        ?>
" /></label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('total_view');
        ?>
"><?php 
        _e('Tổng views? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['total_view'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('total_view');
        ?>
" name="<?php 
        echo $this->get_field_name('total_view');
        ?>
" /></label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('hits_view');
        ?>
"><?php 
        _e('Hits hôm nay? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['hits_view'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('hits_view');
        ?>
" name="<?php 
        echo $this->get_field_name('hits_view');
        ?>
" /></label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('totalhits_view');
        ?>
"><?php 
        _e('Tổng Hits? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['totalhits_view'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('totalhits_view');
        ?>
" name="<?php 
        echo $this->get_field_name('totalhits_view');
        ?>
" /></label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('online_view');
        ?>
"><?php 
        _e('Số online? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['online_view'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('online_view');
        ?>
" name="<?php 
        echo $this->get_field_name('online_view');
        ?>
" /></label>
        </p>

        <p>
            <label for="<?php 
        echo $this->get_field_id('ip_display');
        ?>
"><?php 
        _e('Hiển thị IP? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['ip_display'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('ip_display');
        ?>
" name="<?php 
        echo $this->get_field_name('ip_display');
        ?>
" /></label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('server_time');
        ?>
"><?php 
        _e('Thời gian? ');
        ?>
<input type="checkbox" class="checkbox" <?php 
        checked($instance['server_time'], 'on');
        ?>
 id="<?php 
        echo $this->get_field_id('server_time');
        ?>
" name="<?php 
        echo $this->get_field_name('server_time');
        ?>
" /></label>
        </p>

        <p>Chú ý: cấu hình hình ảnh bộ đếm <a href="<?php 
        echo HW_Module_Settings_page::get_module_setting_page('counter');
        ?>
">tại đây</a></p>

    <?php 
    }