<?php

if (!class_exists('AHACHAT_WP_SHORTCODE')): /****/
    class AHACHAT_WP_SHORTCODE {
        public function __construct() {
        ?>

<div id="ahachat_cartback_shortcode_wrapper_outer" class="ahachat___popup">

	<div id="ahachat_popup_dashboard_wrapper" class="ahachat_popup_dashboard">

		<div class="clearfix"></div>

		<div id="ahachat_popup_dashboard_navigation">

				<ul>

				</ul>

		</div>

		<div id="ahachat_popup_dashboard_content" class="current_tab_ahachat_popup_dashboard_tab_content_header_home">

			<div class="ahachat_popup_dashboard_tab_content ahachat_popup_dashboard_tab_content_header_home ahachat_popup_dashboard_header_option et_tab_selected">

				<div class="ahachat_popup_dashboard_row ahachat_popup_dashboard_new_optin">

					<h1><?php _e("Shortcodes",AHACHAT_WP); ?></h1>

					<!--<button class="ahachat_popup_dashboard_icon btn_click_newoption">New Shortcode</button>-->

					<button type="button" class="btn btn-primary ahachat_click_create_shortcode" data-toggle="modal" data-target=".bd-example-modal-lg">+ New Shortcode</button>

				</div>	

				

				<div class="ahachat_popup_dashboard_home_tab_content">

						<div class="ahachat_popup_dashboard_optins_list ahachat_list_shortcode">

								<ul class="ahachat_shortcode_template_show">

									<li>

										<div style="padding-left: 0px;" class="ahachat_popup_dashboard_table_name ahachat_popup_dashboard_table_column"><?php _e("Name",AHACHAT_WP); ?>

										</div>

										<div style="padding-left: 0px;" class="ahachat_popup_dashboard_table_name ahachat_popup_dashboard_table_column"><?php _e("",AHACHAT_WP); ?>

										</div>

										<div style="padding-left: 0px; text-align: left; padding-left: 20px" class="ahachat_popup_dashboard_table_name ahachat_popup_dashboard_table_column"><?php _e("Shortcode",AHACHAT_WP); ?>

										</div>

										<div style="padding-left: 0px;" class="ahachat_popup_dashboard_table_name ahachat_popup_dashboard_table_column"><?php _e("",AHACHAT_WP); ?>

										</div>

										

										<div class="ahachat_popup_dashboard_table_actions ahachat_popup_dashboard_table_column">

										</div>

										<div style="clear: both;"></div>

									</li>

									<?php 

										global $wpdb; // use query table

										$table_shortcode = AHACHAT_SHORTCODES_TABLE;

										$list_shortcode=$wpdb->get_results("SELECT * from $table_shortcode");

									foreach ($list_shortcode as $key => $shortcode) {

									

									?>

								

									<li class="ahachat_popup_dashboard_optins_item ahachat_popup_dashboard_parent_item ahachat_shortcode_show_<?php echo $shortcode->id;?>" data-shortcode="<?php echo $shortcode->id;?>">

										<div class="ahachat_popup_dashboard_table_name ahachat_popup_dashboard_table_column"><img style="float: left;margin-right: 5px;" src=''>Shortcode <?php echo $shortcode->id;?>

										</div>

										<div class="ahachat_popup_dashboard_table_impressions ahachat_popup_dashboard_table_column ahachat_popup_dashboard_refreshed">

										</div>

										<div class="ahachat_popup_dashboard_table_conversions ahachat_popup_dashboard_table_column ahachat_popup_dashboard_refreshed">

												<input readonly="readonly" onclick="select();" id="ahachat_popup_shortcode_<?php echo $shortcode->id;?>" style="width: 300px;background: transparent;" type="text" value='[cartback id="<?php echo $shortcode->id; ?>"]'/>

										</div>

										<div class="ahachat_popup_dashboard_table_rate ahachat_popup_dashboard_table_column ahachat_popup_dashboard_refreshed">

										</div>

										<div class="ahachat_popup_dashboard_table_actions ahachat_popup_dashboard_table_column">

										<span class="ahachat_tool_action" tooltip="Delete" flow="up">

											<span style="position: relative;top: 2px" class="et_optin_button icon-trash ahachat_shortcode_delete" title="Delete Shortcode">	

												<span class="ahachat_popup_dashboard_confirmation">Delete this optin?

													<span class="ahachat_popup_dashboard_confirm_delete" data-shortcdoe_delete="<?php echo $shortcode->id; ?>">Yes

													</span>

													<span class="ahachat_popup_dashboard_cancel_delete">No

													</span>

												</span>

											</span>

										</span>

										

										<span class="ahachat_tool_action" tooltip="Edit" flow="up">

											<span style="position: relative;top: 2px" class="et_optin_button icon-settings ahachat_edit_shortcode" title="Edit Shortcode" data-shortcode_edit="<?php echo $shortcode->id; ?>"></span>

											<span class="spinner"></span>

										</span>



										<span class="ahachat_tool_action" tooltip="Copy" flow="up">

											<span style="position: relative;top: 2px" class="et_optin_button ahachat_copy_shortcode ahachat_popup_dashboard_form_optin_duplicate icon-doc" title="Duplicate" data-shortcode_id="<?php echo $shortcode->id;?>">

												<span class="spinner"></span>

											</span>

										</span>

															

										</div>

										<div style="clear: both;"></div>

									</li>

									<?php } ?>

								</ul>

						</div>

				</div>

			</div>

		</div>

	</div>

</div>


<?php
           }
       }
   endif;
   new AHACHAT_WP_SHORTCODE();
?>


