<?php
if (!defined( 'ABSPATH' )) exit;

?>
    <div class="div_mainpage1">

        <h2 class="background-color-e5e5e5 padding-7px">
			<?php _e('New Post List', 'woo2app'); ?>
        </h2>
            <table class="form-table width-600px">
                <tbody>
                <tr>
                    <th> <?php _e('Type' , 'woo2app');?> </th>
                    <td>
                        <select class="regular-text" id="select_item_option">
                            <option value="2001"> <?php _e('Horizontal - Simple', 'woo2app'); ?> </option>
                            <option value="2002"> <?php _e('Vertical - 2 columns', 'woo2app'); ?> </option>
                            <option value="2003"> <?php _e('Horizontal - Large Image', 'woo2app'); ?> </option>
                            <option value="2004"> <?php _e('Horizontal - 3 rows', 'woo2app'); ?> </option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th> <?php _e('Preview' , 'woo2app');?> </th>
                    <td>
                        <img class="img_post_list" id="demo_PostList_2001"       style="height: 400px" src="<?= WOO2APP_URL .'/files/img/MainPagePost/mp-post-1.jpg'?>">
                        <img class="img_post_list hide" id="demo_PostList_2002"  style="height: 400px" src="<?= WOO2APP_URL .'/files/img/MainPagePost/mp-post-2.jpg'?>">
                        <img class="img_post_list hide" id="demo_PostList_2003"  style="height: 400px" src="<?= WOO2APP_URL .'/files/img/MainPagePost/mp-post-3.jpg'?>">
                        <img class="img_post_list hide" id="demo_PostList_2004"  style="height: 400px" src="<?= WOO2APP_URL .'/files/img/MainPagePost/mp-post-4.jpg'?>">
                    </td>
                </tr>
                <tr class="div_mainpage div_list_horizontal ">
                    <th> <?php _e('Title' , 'woo2app');?>  </th>
                    <td>
                        <input placeholder="<?php _e('New Item Title', 'woo2app'); ?>" type="text"
                               class="regular-text" name="txt_title_hor_item" id="txt_title_hor_item">
                    </td>
                </tr>
                <tr class="div_mainpage div_list_horizontal ">
                    <th> <?php _e('Category' , 'woo2app');?> </th>
                    <td>
                        <select id="value_cat_items_hor" class="selectpicker regular-text" data-live-search="true"
                                title="<?php _e('Select ...', 'woo2app'); ?>">
                            <option class="<?= get_locale() == 'fa_IR' ? 'text-right' : '' ?>"
                                    value="0"><?php _e('Select Category', 'woo2app'); ?></option>
                            <option class="<?= get_locale() == 'fa_IR' ? 'text-right' : '' ?>"
                                    value="all"> <?php _e('All categories', 'woo2app'); ?></option>
							<?php
							$args = array('hide_empty' => 0 ,
							              'taxonomy' => 'category'
							);
							$cats = get_categories($args);
							foreach ($cats as $cat) {
								?>
                                <option class="<?= get_locale() == 'fa_IR' ? 'text-right' : '' ?>"
                                        value="<?= $cat->term_id; ?>"><?= $cat->name; ?></option>
								<?php
							}
							?>
                        </select>
                    </td>
                </tr>

                <tr>
                    <th>
                        <img id="img_load1" class="hide width-25px height-25px"
                             src="<?php echo WP_PLUGIN_URL . "/" . dirname(plugin_basename(__FILE__)) . '/../files/img/load.gif' ?>">
                    </th>
                    <td>
                        <button onclick="add_item_mainpage()" type="button"
                                class="button button-primary"><?php _e('+ Add To Page', 'woo2app'); ?></button>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <div class="green hide"  id="alert_item">
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
    </div>

<?php
wp_enqueue_script( 'sort.js'.WOO2APP_FILES_VER , WOO2APP_JS_URL.'sort.js?ver=1.1', array('jquery'));
wp_enqueue_media();
wp_enqueue_script( 'upload_item_banner.js'.WOO2APP_FILES_VER , WOO2APP_JS_URL.'upload_item_banner.js', array('jquery'));
?>