<div class="wrap">
   <div id="smpush-icon-chanmanage" class="icon32"><br></div>
   <h2><?php echo esc_html__('Manage Channels', 'smio-push-notification')?><a href="javascript:" onclick="smpush_open_service(-1)" class="add-new-h2"><?php echo esc_html__('New Channel', 'smio-push-notification')?></a>
   <a href="<?php echo esc_url($pageurl);?>&update_counters=1&noheader=1" class="add-new-h2"><?php echo esc_html__('Update Counters', 'smio-push-notification')?></a>
   <img src="<?php echo smpush_imgpath.'/wpspin_light.gif';?>" alt="" class="smpush_service_-1_loading" style="display:none" />
   </h2>
   <div id="col-container">
      <div id="col-left" style="width: 55%;margin-top: 10px;">
         <div class="col-wrap">
             <table class="wp-list-table widefat fixed tags" cellspacing="0">
                <thead>
                   <tr>
                      <th scope="col" class="manage-column column-posts" style="width:25px"><span><?php echo esc_html__('ID', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column"><span><?php echo esc_html__('Title', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column"><span><?php echo esc_html__('Description', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column"><span><?php echo esc_html__('Privacy', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column" style="width:80px"><span><?php echo esc_html__('Subscribers', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column column-categories" style="width:75px"><span></span></th>
                   </tr>
                </thead>
                <tfoot>
                   <tr>
                      <th scope="col" class="manage-column column-posts"><span><?php echo esc_html__('ID', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column"><span><?php echo esc_html__('Title', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column"><span><?php echo esc_html__('Description', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column"><span><?php echo esc_html__('Privacy', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column"><span><?php echo esc_html__('Subscribers', 'smio-push-notification')?></span></th>
                      <th scope="col" class="manage-column column-categories"><span></span></th>
                   </tr>
                </tfoot>
                <tbody id="the-list" data-wp-lists="list:tag">
                <?php if($channels){$counter = 0;foreach($channels AS $channel){$counter++;?>
                   <tr id="smpush-service-tab-<?php echo esc_attr($channel->id);?>" class="smpush-service-tab <?php if($counter%2 == 0){echo 'alternate';}?>">
                      <td class="name column-name"><?php echo esc_attr($channel->id);?></td>
                      <td class="name column-name"><strong><?php if(esc_attr($channel->default) == 1)echo '*';?><?php echo esc_attr($channel->title);?></strong><br />
                      <div class="row-actions">
                      <?php if(esc_attr($channel->default) == 0){?>
                      <span class="edit"><a href="<?php echo esc_url($pageurl);?>&default=1&noheader=1&id=<?php echo esc_attr($channel->id);?>"><?php echo esc_html__('Default', 'smio-push-notification')?></a></span>
                      <span class="delete"> | <a class="smio-delete" href="<?php echo esc_url($pageurl);?>&delete=1&noheader=1&id=<?php echo esc_attr($channel->id);?>"><?php echo esc_html__('Delete', 'smio-push-notification')?></a></span>
                      <?php }?>
                      </div>
                      </td>
                      <td class="description column-description"><?php echo esc_attr($channel->description);?></td>
                      <td class="description column-description"><?php echo (esc_attr($channel->private) == 1)? esc_html__('Private', 'smio-push-notification') : esc_html__('Public', 'smio-push-notification');?></td>
                      <td class="description column-description"><?php echo esc_attr($channel->count);?></td>
                      <td class="description column-categories">
                      <input type="button" class="button action smpush-open-btn" value="<?php echo esc_html__('Edit', 'smio-push-notification')?>" onclick="smpush_open_service(<?php echo esc_attr($channel->id);?>)" />
                      <img src="<?php echo smpush_imgpath.'/wpspin_light.gif';?>" alt="" class="smpush_service_<?php echo esc_attr($channel->id);?>_loading" style="display:none" />
                      </td>
                   </tr>
                <?php }}else{?>
                <tr class="no-items"><td class="colspanchange" colspan="5"><?php echo esc_html__('No items found.', 'smio-push-notification')?></td></tr>
                <?php }?>
                </tbody>
             </table>
             <br class="clear">
            <div class="form-wrap">
            <p><strong><?php echo esc_html__('Note', 'smio-push-notification')?>:</strong><br><?php echo esc_html__('For how to subscribe,view or display push channels back to documentation page.', 'smio-push-notification')?></p>
            </div>
         </div>
      </div>
      <div id="col-right" class="smpush_form_ajax" style="width: 45%"></div>
   </div>
</div>
<script type="text/javascript">
var smpush_pageurl = '<?php echo esc_url($pageurl);?>';
jQuery(document).ready(function() {
    smpush_open_service(-1);
});
</script>
