HEX
Server: Apache
System: Linux 162-240-236-42.bluehost.com 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: bt667 (1004)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/bt667/public_html/wp-content/plugins/wp_mvplayer/settings/admin_add_video.php
<?php
if ( ! defined( 'ABSPATH' ) ) exit;

if(isset($_GET['aweber-success']) && $_GET['aweber-success']==1){
?>
    <script>
        jQuery(document).ready(function($){
            $('.tab1').removeClass('active');
            $('div.tab1').hide();
            $('.tab2').addClass('active');
            $('div.tab2').show();
            $('.tab3').removeClass('active');
            $('div.tab3').hide();
            $('.tab4').removeClass('active');
            $('div.tab4').hide();
            $('.tab5').removeClass('active');
            $('div.tab5').hide();
            $('.tab6').removeClass('active');
            $('div.tab6').hide();
        });</script>
    <?php
}

$status = 'style="display: none"';

if(isset($_GET['id'])){
    global $wpdb;
    $status = "";
    $id = $_GET['id'];
    $videobuttons_table = $wpdb->prefix . "mvplayer_videobuttons";
    $videobtndata =  $wpdb->get_results("SELECT * FROM $videobuttons_table where VideoId= $id");

    if(!$videobtndata){
        $videobtndata='';
    }

    $video_table  =  $wpdb->prefix . "mvplayer_video";
    $video_detail =  $wpdb->get_row("SELECT * FROM $video_table where id= $id");

    if($video_detail){
        $v_id                           = $id;
        $v_Title                        = $video_detail->Title;
        $v_Video                        = $video_detail->Video;
        $v_VideoSource                  = $video_detail->VideoSource;
        $v_ImageLogo                    = $video_detail->ImageLogo;
        $v_VideoWidth                   = $video_detail->VideoWidth;
        $v_VideoHeight                  = $video_detail->VideoHeight;
        $v_AutoPlay                     = $video_detail->AutoPlay;
        $v_AllowPause                   = $video_detail->AllowPause;
        $v_AllowScroll                  = $video_detail->AllowScroll;
        $v_VideoControls                = $video_detail->VideoControls;
        $v_VideoAlign                   = $video_detail->VideoAlign;
        $v_ShowContentLoc               = $video_detail->ShowContentLocation;
        $v_ShowContentDur               = $video_detail->ShowContentDuration;
        $v_Content                      = $video_detail->VideoContent;
        $v_SocialBtnLoc                 = $video_detail->SocialButtonLocation;
        $v_SocialLockDuration           = $video_detail->SocialLockDuration;
        $v_SocialEnable                 = $video_detail->SocialEnable;
        $v_SocialTitle                  = $video_detail->SocialTitle;
        $v_SocialText                   = $video_detail->SocialText;
        $v_DefaultTweet                 = $video_detail->DefaultTweet;
        $v_HeadlineMsg                  = $video_detail->HeadlineMsg;
        $v_ShareUrl                     = $video_detail->ShareUrl;
        $v_CustomUrl                    = $video_detail->CustomUrl;
        $v_OptinBox                     = $video_detail->OptinBox;
        $v_OptinLocation                = $video_detail->OptinLocation;
        $v_OptinMidTime                 = $video_detail->OptinMidTime;
        $v_OptinHeadline                = $video_detail->OptinHeadline;
        $v_OptinText                    = $video_detail->OptinText;
        $v_OptinSubmitText              = $video_detail->OptinSubmitText;
        $v_ThankyouMessage              = $video_detail->ThankyouMessage;
        $v_OptinAllowSkip               = $video_detail->OptinAllowSkip;
        $v_SocialLockAllowSkip          = $video_detail->SocialLockAllowSkip;
        $v_Popup                        = $video_detail->Popup;
        $v_PopupContent                 = $video_detail->PopupContent;
        $v_PopupLink                    = $video_detail->PopupLink;
        $v_PopupLocation                = $video_detail->PopupLocation;
        $v_PopupMidTime                 = $video_detail->PopupMidTime;
        $v_VideoMailingList             = $video_detail->VideoMailingList;
        $custom_formcode                = $video_detail->custom_formcode;
        $v_MailChimpApiKey              = $video_detail->MailChimpApiKey;
        $v_MailChimpListId              = $video_detail->MailChimpListId;
        $v_GetResponseApiKey            = $video_detail->GetResponseApiKey;
        $v_GetResponseCampaignId        = $video_detail->GetResponseCampaignId;
        $v_AWeberListID                 = $video_detail->AWeberListID;
        $v_AWeberAccessTokens           = $video_detail->AWeberAccessTokens;
        $v_ConstCntctUserName           = $video_detail->ConstCntctUserName;
        $v_ConstCntctAPIKey             = $video_detail->ConstCntctAPIKey;
        $v_ConstCntctSecret             = $video_detail->ConstCntctSecret;
        $v_ConstCntctListID             = $video_detail->ConstCntctListID;
        $v_SendlaneApiKey           = $video_detail->SendlaneApiKey;
        $v_SendlaneApiHashKey       = $video_detail->SendlaneApiHashKey;
        $v_SendlaneApiUrl           = $video_detail->SendlaneApiUrl;
        $v_SendlaneSubDomain        = $video_detail->SendlaneSubDomain;
        $v_SendlaneListID           = $video_detail->SendlaneListID;
        $v_PlayerSkin                   = $video_detail->PlayerSkin;
        $v_cta_enable                 = $video_detail->cta_enable;
        $v_ctabtn_location            = $video_detail->ctabtn_location;
        $v_ctabtn_dur                 = $video_detail->ctabtn_dur;
        $v_cta_bg_color               = $video_detail->cta_bg_color;
        $v_cta_text_color             = $video_detail->cta_text_color;
        $v_cta_btn_text               = $video_detail->cta_btn_text;
        $v_cta_btn_border             = $video_detail->cta_btn_border;
        $v_cta_btn_radius             = $video_detail->cta_btn_radius;
        $v_cta_btn_border_color       = $video_detail->cta_btn_border_color;
        $v_cta_btn_height             = $video_detail->cta_btn_height;
        $v_cta_btn_width              = $video_detail->cta_btn_width;
        $v_ctabtn_allow_skip          = $video_detail->ctabtn_allow_skip;
        $v_cta_share_url              = $video_detail->cta_share_url;
        $v_cta_custom_url             = $video_detail->cta_custom_url;
    }
    else{
        $v_id                       = '';
        $v_Title                    = '';
        $v_Video                    = '';
        $v_VideoSource              = '';
        $v_ImageLogo                = '';
        $v_VideoWidth               = '';
        $v_VideoHeight              = '';
        $v_AutoPlay                 = '';
        $v_AllowPause               = '';
        $v_AllowScroll               = '';
        $v_VideoControls            = '';
        $v_VideoAlign               = '';
        $v_ShowRelatedVideos        = '';
        $v_AllRelatedVideos         = '';
        $v_ShowContentLoc           = '';
        $v_ShowContentDur           = '';
        $v_Content                  = '';
        $v_SocialBtnLoc             = '';
        $v_SocialLockDuration       = '';
        $v_SocialEnable             = '';
        $v_SocialTitle              = '';
        $v_SocialText               = '';
        $v_DefaultTweet             = '';
        $v_HeadlineMsg              = '';
        $v_OptinBox                 = '';
        $v_OptinLocation            = '';
        $v_OptinMidTime             = '';
        $v_OptinHeadline            = '';
        $v_OptinText                = '';
        $v_OptinSubmitText          = '';
        $v_ThankyouMessage          = '';
        $v_OptinAllowSkip           = '';
        $v_SocialLockAllowSkip      = '';
        $v_Popup                    = '';
        $v_PopupContent             = '';
        $v_PopupLink                = '';
        $v_PopupLocation            = '';
        $v_PopupMidTime             = '';
        $v_VideoMailingList         = '';
        $custom_formcode            = '';
        $v_MailChimpApiKey          = '';
        $v_MailChimpListId          = '';
        $v_GetResponseApiKey        = '';
        $v_GetResponseCampaignId    = '';
        $v_AWeberListID             = '';
        $v_AWeberAccessTokens       = '';
        $v_ConstCntctUserName       = '';
        $v_ConstCntctAPIKey         = '';
        $v_ConstCntctSecret         = '';
        $v_ConstCntctListID         = '';
        $v_SendlaneApiKey           = '';
        $v_SendlaneApiHashKey       = '';
        $v_SendlaneApiUrl           = '';
        $v_SendlaneSubDomain        = '';
        $v_SendlaneListID           = '';
        $v_PlayerSkin               = '';
        $v_cta_enable            = '';
        $v_ctabtn_location            = '';
        $v_ctabtn_dur                 = '';
        $v_cta_bg_color               = '';
        $v_cta_text_color             = '';
        $v_cta_btn_text               = '';
        $v_cta_btn_border             = '';
        $v_cta_btn_radius             = '';
        $v_cta_btn_border_color       = '';
        $v_cta_btn_height             = '';
        $v_cta_btn_width              = '';
        $v_ctabtn_allow_skip          = '';
        $v_cta_share_url              = '';
        $v_cta_custom_url             = '';
    }
}
else{
    $v_id                       = '';
    $v_Title                    = '';
    $v_Video                    = '';
    $v_VideoSource              = '';
    $v_ImageLogo                = '';
    $v_VideoWidth               = '';
    $v_VideoHeight              = '';
    $v_AutoPlay                 = '';
    $v_AllowPause               = '';
    $v_AllowScroll              = '';
    $v_VideoControls            = '';
    $v_VideoAlign               = '';
    $v_ShowRelatedVideos        = '';
    $v_AllRelatedVideos         = '';
    $v_ShowContentLoc           = '';
    $v_ShowContentDur           = '';
    $v_Content                  = '';
    $v_SocialBtnLoc             = '';
    $v_SocialLockDuration       = '';
    $v_SocialEnable             = '';
    $v_SocialTitle              = '';
    $v_SocialText               = '';
    $v_DefaultTweet             = '';
    $v_HeadlineMsg              = '';
    $v_OptinBox                 = '';
    $v_OptinLocation            = '';
    $v_OptinMidTime             = '';
    $v_OptinHeadline            = '';
    $v_OptinText                = '';
    $v_OptinSubmitText          = '';
    $v_ThankyouMessage          = '';
    $v_OptinAllowSkip           = '';
    $v_SocialLockAllowSkip      = '';
    $v_Popup                    = '';
    $v_PopupContent             = '';
    $v_PopupLink                = '';
    $v_PopupLocation            = '';
    $v_PopupMidTime             = '';
    $v_VideoMailingList         = '';
    $custom_formcode            = '';
    $v_MailChimpApiKey          = '';
    $v_MailChimpListId          = '';
    $v_GetResponseApiKey        = '';
    $v_GetResponseCampaignId    = '';
    $v_AWeberListID             = '';
    $v_AWeberAccessTokens       = '';
    $v_ConstCntctUserName       = '';
    $v_ConstCntctAPIKey         = '';
    $v_ConstCntctSecret         = '';
    $v_ConstCntctListID         = '';
    $v_SendlaneApiKey           = '';
    $v_SendlaneApiHashKey       = '';
    $v_SendlaneApiUrl           = '';
    $v_SendlaneSubDomain        = '';
    $v_SendlaneListID           = '';
    $v_PlayerSkin               = '';
    $v_cta_enable               = '';
    $v_ctabtn_location          = '';
    $v_ctabtn_dur               = '';
    $v_cta_bg_color             = '';
    $v_cta_text_color             = '';
    $v_cta_btn_text               = '';
    $v_cta_btn_border             = '';
    $v_cta_btn_radius             = '';
    $v_cta_btn_border_color       = '';
    $v_cta_btn_height             = '';
    $v_cta_btn_width              = '';
    $v_ctabtn_allow_skip          = '';
    $v_cta_share_url              = '';
    $v_cta_custom_url             = '';
}

?>

<div class="wrap">
    <div id="icon-edit" class="icon32"><br/></div>
    <?php if(@$v_id){ ?>
        <h2><?php echo esc_html_e('Update Video'); ?></h2>
    <?php }else { ?>
        <h2><?php echo esc_html_e('Add Video'); ?></h2>
    <?php } ?>
    <a href="<?php echo esc_url( admin_url('admin.php?page=mv_player_manage_video')) ;?>" class="backbtn videobutton1" style="justify-content: end;text-align: right;float: right;"><?php echo esc_html_e('Return to Back'); ?></a>
</div>

<div class="maindiv">
    <div class="tabs-div">
        <ul class="tabs" id="tabs">
            <li class="tab-link current" data-tab="tab-1"><?php echo esc_html_e('Video Settings'); ?></li>
            <li class="tab-link" <?php echo $status;?> data-tab="tab-2"><?php echo esc_html_e('Autoresponder'); ?></li>
            <li class="tab-link" <?php echo $status;?> data-tab="tab-3"><?php echo esc_html_e('Opt-In'); ?></li>
            <li class="tab-link" <?php echo $status;?> data-tab="tab-4"><?php echo esc_html_e('Buttons'); ?></li>
            <li class="tab-link" <?php echo $status;?> data-tab="tab-5"><?php echo esc_html_e('Skins'); ?></li>
            <li class="tab-link" <?php echo $status;?> data-tab="tab-6"><?php echo esc_html_e('Affiliate Marketing'); ?></li>
        </ul>

        <div id="tab-6" class="tab-content">
            <form action="" id="ajax-upload6" method="post" enctype="multipart/form-data" onsubmit="return checkmidTime();">
                <table>
                    <tr>
                        <td width="150px;"><?php echo esc_html_e('Include Popup:'); ?></td>
                        <td>
                            <?php
                            if(@$v_Popup)
                            {?>
                                <label for="inc_popup_radio1" <?php if($v_Popup=='yes'){echo 'class="inc_popup-enable selected"';}else{echo 'class="inc_popup-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="inc_popup_radio2" <?php if($v_Popup=='no'){echo 'class="inc_popup-disable selected"';}else{echo 'class="inc_popup-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="inc_popup_radio1" name="inc_popup" <?php if($v_Popup=='yes'){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="inc_popup_radio2" name="inc_popup" <?php if($v_Popup=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }
                            else
                            {?>
                                <label for="inc_popup_radio1" class="inc_popup-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="inc_popup_radio2" class="inc_popup-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="inc_popup_radio1" name="inc_popup" value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="inc_popup_radio2" name="inc_popup"  checked value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }?>
                        </td>
                    </tr>
                </table>
                <table class="popup_desc">
                    <tr>
                        <td><?php echo esc_html_e('Add Text or Image or Both:'); ?></td>
                        <td>
                            <div>
                                <?php $args = array("textarea_rows" => 5, "textarea_name" => "popup_content", "editor_class" => "my_editor_custom");
                                    wp_editor(@stripslashes($v_PopupContent), "my_editor_3", $args);
                                ?>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Add Popup Link:'); ?></td>
                        <td><input type="text" name="popup_link" style="width:100%;" value="<?php echo @$v_PopupLink;?>"></td>
                    </tr>
                    <tr>
                        <td width="150px;"><?php echo esc_html_e('Set Popup Reveal Timer:'); ?></td>
                        <td>
                            <?php
                            if(@$v_PopupLocation)
                            {?>
                                <div class="location-popup">
                                    <label for="popup_location_radio1" <?php if($v_PopupLocation=='beginning'){echo 'class="popup_location-enable selected"';}else{echo 'class="popup_location-enable"';}?>><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                    <label for="popup_location_radio2" <?php if($v_PopupLocation=='middle'){echo 'class="popup_location-disable2 selected"';}else{echo 'class="popup_location-disable2"';}?>><span><?php echo esc_html_e('Middle'); ?></span></label>
                                    <label for="popup_location_radio3" <?php if($v_PopupLocation=='end'){echo 'class="popup_location-disable selected"';}else{echo 'class="popup_location-disable"';}?>><span><?php echo esc_html_e('End'); ?></span></label>
                                    <input type="radio" id="popup_location_radio1" name="popup_location" <?php if($v_PopupLocation=='beginning'){echo 'checked';}?> value="<?php echo esc_html_e('beginning'); ?>"/>
                                    <input type="radio" id="popup_location_radio2" name="popup_location" <?php if($v_PopupLocation=='middle'){echo 'checked';}?> value="<?php echo esc_html_e('middle'); ?>"/>
                                    <input type="radio" id="popup_location_radio3" name="popup_location" <?php if($v_PopupLocation=='end'){echo 'checked';}?> value="<?php echo esc_html_e('end'); ?>"/>
                                </div>
                            <?php
                            }
                            else
                            {?>
                                <div class="location-popup">
                                    <label for="popup_location_radio1" class="popup_location-enable selected"><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                    <label for="popup_location_radio2" class="popup_location-disable2"><span><?php echo esc_html_e('Middle'); ?></span></label>
                                    <label for="popup_location_radio3" class="popup_location-disable"><span><?php echo esc_html_e('End'); ?></span></label>
                                    <input type="radio" id="popup_location_radio1" name="popup_location" checked value="<?php echo esc_html_e('beginning'); ?>"/>
                                    <input type="radio" id="popup_location_radio2" name="popup_location" value="<?php echo esc_html_e('middle'); ?>"/>
                                    <input type="radio" id="popup_location_radio3" name="popup_location" value="<?php echo esc_html_e('end'); ?>"/>
                                </div>
                                <?php
                            }?>
                            <span class="location-popup-span"><input type="text" name="popup_mid_time" value="<?php echo @$v_PopupMidTime;?>" style="width:60px;"><label class="popup-labeltime"><?php echo esc_html_e('Second'); ?></label></span>
                        </td>
                    </tr>
                </table>

                <input type="hidden" name="save_action" value ="<?php echo esc_html_e('tab-6-content'); ?>"/>
                <input type="hidden" name="row_id" id="row_id" class="row_id" value="<?php echo $v_id?>"/>
                <input type="submit" id="videobutton6" class="videobutton1" data-att="tab-6" value="<?php echo esc_html_e('Save'); ?>" name="submit"/>
            </form>
        </div>

        <div id="tab-3" class="tab-content">
            <form action="" id="ajax-upload3" method="post" enctype="multipart/form-data" onsubmit="return checkmidTime();">
                <table>
                    <tr>
                        <td width="150px;"><?php echo esc_html_e('Include Opt-In Box:'); ?></td>
                        <td>
                            <?php
                            if(@$v_OptinBox)
                            {?>
                                <label for="inc_optin_radio1" <?php if($v_OptinBox=='yes'){echo 'class="inc_optin-enable selected"';}else{echo 'class="inc_optin-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="inc_optin_radio2" <?php if($v_OptinBox=='no'){echo 'class="inc_optin-disable selected"';}else{echo 'class="inc_optin-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="inc_optin_radio1" name="inc_optin" <?php if($v_OptinBox=='yes'){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="inc_optin_radio2" name="inc_optin" <?php if($v_OptinBox=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }
                            else
                            {?>
                                <label for="inc_optin_radio1" class="inc_optin-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="inc_optin_radio2" class="inc_optin-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="inc_optin_radio1" name="inc_optin" value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="inc_optin_radio2" name="inc_optin"  checked value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }?>
                        </td>
                    </tr>
                </table>

                <div class="optin_desc">
                    <table>
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Select Autoresponder'); ?>:</td>
                            <td>
                                <select class="videomailinglist" id="videomailinglist" name="videomailinglist">
                                    <?php
                                    $selected='';$selected1='';$selected2='';$selected3='';$selected4='';$selected5='';$selected6='';$selected7='';
                                    if(@$v_VideoMailingList=='mailchimp'){$selected1 = 'selected';}
                                    else if(@$v_VideoMailingList=='getresponse'){$selected2 = 'selected';}
                                    else if(@$v_VideoMailingList=='aweber'){$selected3 = 'selected';}
                                    else if(@$v_VideoMailingList=='constantcontact'){$selected4 = 'selected';}
                                    else if(@$v_VideoMailingList=='sendlane'){$selected5 = 'selected';}
                                    else if(@$v_VideoMailingList=='infusionsoft'){$selected6 = 'selected';}
                                    else if(@$v_VideoMailingList=='form_optin'){$selected7 = 'selected';}
                                    ?>
                                    <option value="<?php echo esc_html_e('mailchimp'); ?>" <?php echo $selected1;?>><?php echo esc_html_e('MailChimp'); ?></option>
                                    <option value="<?php echo esc_html_e('getresponse'); ?>" <?php echo $selected2;?>><?php echo esc_html_e('GetResponse'); ?></option>
                                    <option value="<?php echo esc_html_e('aweber'); ?>" <?php echo $selected3;?>><?php echo esc_html_e('AWeber'); ?></option>
                                    <option value="<?php echo esc_html_e('sendlane'); ?>" <?php echo $selected5;?>><?php echo esc_html_e('SendLane'); ?></option>
                                    <option value="<?php echo esc_html_e('form_optin'); ?>" <?php echo @$selected7;?>><?php echo esc_html_e('Form code'); ?></option>
                                </select>
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Set Optin Reveal Timer:'); ?></td>
                            <td>
                                <?php
                                if(@$v_OptinLocation)
                                {?>
                                    <div class="location-optin">
                                        <label for="optin_location_radio1" <?php if($v_OptinLocation=='beginning'){echo 'class="optin_location-enable selected"';}else{echo 'class="optin_location-enable"';}?>><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                        <label for="optin_location_radio2" <?php if($v_OptinLocation=='middle'){echo 'class="optin_location-disable2 selected"';}else{echo 'class="optin_location-disable2"';}?>><span><?php echo esc_html_e('Middle'); ?></span></label>
                                        <label for="optin_location_radio3" <?php if($v_OptinLocation=='end'){echo 'class="optin_location-disable selected"';}else{echo 'class="optin_location-disable"';}?>><span><?php echo esc_html_e('End'); ?></span></label>
                                        <input type="radio" id="optin_location_radio1" name="optin_location" <?php if($v_OptinLocation=='beginning'){echo 'checked';}?> value="<?php echo esc_html_e('beginning'); ?>"/>
                                        <input type="radio" id="optin_location_radio2" name="optin_location" <?php if($v_OptinLocation=='middle'){echo 'checked';}?> value="<?php echo esc_html_e('middle'); ?>"/>
                                        <input type="radio" id="optin_location_radio3" name="optin_location" <?php if($v_OptinLocation=='end'){echo 'checked';}?> value="<?php echo esc_html_e('end'); ?>"/>
                                    </div>
                                <?php
                                }
                                else
                                {?>
                                    <div class="location-optin">
                                        <label for="optin_location_radio1" class="optin_location-enable selected"><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                        <label for="optin_location_radio2" class="optin_location-disable2"><span><?php echo esc_html_e('Middle'); ?></span></label>
                                        <label for="optin_location_radio3" class="optin_location-disable"><span><?php echo esc_html_e('End'); ?></span></label>
                                        <input type="radio" id="optin_location_radio1" name="optin_location" checked value="<?php echo esc_html_e('beginning'); ?>"/>
                                        <input type="radio" id="optin_location_radio2" name="optin_location" value="<?php echo esc_html_e('middle'); ?>"/>
                                        <input type="radio" id="optin_location_radio3" name="optin_location" value="<?php echo esc_html_e('end'); ?>"/>
                                    </div>
                                    <?php

                                }?>

                                <span class="location-optin-span"><input type="text" name="optin_mid_time" value="<?php echo @$v_OptinMidTime;?>" style="width:60px;"><label class="optin-labeltime"><?php echo esc_html_e('Second'); ?></label></span>
                                <span class="description"><?php echo esc_html_e('Define the time in the Video where you would like to show the Optin Form'); ?></span>
                            </td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Headline:'); ?></td>
                            <td><input type="text" name="optin_headline" value="<?php echo @$v_OptinHeadline;?>"></td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Text:'); ?></td>
                            <td><input type="text" name="optin_text" value="<?php echo @$v_OptinText;?>"></td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Submit Button Text:'); ?></td>
                            <td>
                                <input type="text" name="optin_submit_text" value="<?php echo @$v_OptinSubmitText;?>">
                                <span class="description"><?php echo esc_html_e('Choose what your submit button Should say.'); ?></span>
                            </td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Enter A Thank You Message:'); ?></td>
                            <td>
                                <textarea name="thankyou_message"><?php echo @$v_ThankyouMessage;?></textarea>
                                <span class="description"><?php echo esc_html_e('This is A pop up that will show once the visitor Opts in,Say something nice to thanks them .....'); ?></span>
                            </td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Allow Skipping:'); ?></td>
                            <td>
                                <?php
                                if(@$v_OptinAllowSkip)
                                {?>
                                    <label for="allow_skip_radio1" <?php if($v_OptinAllowSkip=='yes'){echo 'class="allow_skip-enable selected"';}else{echo 'class="allow_skip-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                    <label for="allow_skip_radio2" <?php if($v_OptinAllowSkip=='no'){echo 'class="allow_skip-disable selected"';}else{echo 'class="allow_skip-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                    <input type="radio" id="allow_skip_radio1" name="allow_skip" <?php if($v_OptinAllowSkip=='yes'){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                    <input type="radio" id="allow_skip_radio2" name="allow_skip" <?php if($v_OptinAllowSkip=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                                }
                                else
                                {?>
                                    <label for="allow_skip_radio1" class="allow_skip-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                    <label for="allow_skip_radio2" class="allow_skip-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                    <input type="radio" id="allow_skip_radio1" name="allow_skip" value="<?php echo esc_html_e('yes'); ?>"/>
                                    <input type="radio" id="allow_skip_radio2" name="allow_skip"  checked value="<?php echo esc_html_e('no'); ?>"/>
                                    <?php
                                }?>
                            </td>
                        </tr>
                    </table>
                </div>

                <input type="hidden" name="save_action" value ="<?php echo esc_html_e('tab-3-content'); ?>"/>
                <input type="hidden" name="row_id" id="row_id" class="row_id" value="<?php echo $v_id?>"/>
                <input type="submit" id="videobutton3" class="videobutton1" data-att="tab-3" value="<?php echo esc_html_e('Save'); ?>" name="submit"/>
            </form>
        </div>

        <div id="tab-1" class="tab-content current">
            <form action="" id="ajax-upload" method="post" enctype="multipart/form-data" onsubmit="return checkmidTime();">
                <table class="video-opt">
                    <tr>
                        <td width="250px;"><?php echo esc_html_e('Video Title:'); ?></td>
                        <td><input type="text" name="title" value="<?php echo @$v_Title;?>" required/></td>
                    </tr>
                    <tr>
                        <td width="250px;"><?php echo esc_html_e('Choose Your Video Source:'); ?></td>
                        <td>
                            <?php
                            if(@$v_VideoSource)
                            {?>
                                <div class="video_source">
                                    <label for="video_source_radio1" <?php if($v_VideoSource=='mp4_video'){echo 'class="video_source-enable selected"';}else{echo 'class="video_source-enable"';}?>><span><?php echo esc_html_e('Upload Video'); ?></span></label>
                                    <label for="video_source_radio2" <?php if($v_VideoSource=='youtube_video'){echo 'class="video_source-disable2 selected"';}else{echo 'class="video_source-disable2"';}?>><span><?php echo esc_html_e('YouTube Video'); ?></span></label>
                                    <label for="video_source_radio3" <?php if($v_VideoSource=='vimeo_video'){echo 'class="video_source-disable3 selected"';}else{echo 'class="video_source-disable3"';}?>><span><?php echo esc_html_e('Vimeo Video'); ?></span></label>
                                    <input type="radio" id="video_source_radio1" name="video_source" <?php if($v_VideoSource=='mp4_video'){echo 'checked';}?> value="<?php echo esc_html_e('mp4_video'); ?>"/>
                                    <input type="radio" id="video_source_radio2" name="video_source" <?php if($v_VideoSource=='youtube_video'){echo 'checked';}?> value="<?php echo esc_html_e('youtube_video'); ?>" />
                                    <input type="radio" id="video_source_radio3" name="video_source" <?php if($v_VideoSource=='vimeo_video'){echo 'checked';}?> value="<?php echo esc_html_e('vimeo_video'); ?>"/>
                                </div>
                            <?php
                            }
                            else
                            {?>
                                <div class="video_source">
                                    <label for="video_source_radio1" class="video_source-enable selected"><span><?php echo esc_html_e('Upload Video'); ?></span></label>
                                    <label for="video_source_radio2" class="video_source-disable2"><span><?php echo esc_html_e('YouTube Video'); ?></span></label>
                                    <label for="video_source_radio3" class="video_source-disable3"><span><?php echo esc_html_e('Vimeo Video'); ?></span></label>
                                    <input type="radio" id="video_source_radio1" name="video_source" checked value="<?php echo esc_html_e('mp4_video'); ?>"/>
                                    <input type="radio" id="video_source_radio2" name="video_source" value="<?php echo esc_html_e('youtube_video'); ?>"/>
                                    <input type="radio" id="video_source_radio3" name="video_source" value="<?php echo esc_html_e('vimeo_video'); ?>"/>
                                </div>
                                <?php
                            }?>
                            <span class="description"><?php echo esc_html_e('Choose your video source and click on the respective Button, You can upload your own, use YouTube Or Vimeo'); ?> </span>
                        </td>
                    </tr>
                    <tr>
                        <td width="250px;"><?php echo esc_html_e('Video Url/Link:'); ?></td>
                        <td>
                            <?php
                            if( $v_VideoSource == 'youtube_video' ){
                                $youtube_section = '';
                                $mp4_section = 'style="display:none"';
                                $vimeo_section = 'style="display:none"';
                            }else if( $v_VideoSource == 'mp4_video' ){
                                $youtube_section = 'style="display:none"';
                                $mp4_section = '';
                                $vimeo_section = 'style="display:none"';
                            }else{
                                $youtube_section = 'style="display:none"';
                                $mp4_section = 'style="display:none"';
                                $vimeo_section = '';
                            }

                            if($v_VideoSource)
                            {
                                ?>
                                <div class="nrmlvideo_show" <?php echo $mp4_section;?>>
                                    <input type="text" name="filename" id="filename" value="<?php if($v_VideoSource=='mp4_video'){ echo $v_Video;}?>"/>
                                    <input type="button" class="videobutton" id="custom_media_upload" value="<?php echo esc_html_e('Upload Video'); ?>">
                                </div>
                                <div class="youtubevideo_show" <?php echo $youtube_section;?>>
                                    <input type="text" name="filename2" value="<?php if($v_VideoSource=='youtube_video'){ echo $v_Video;}?>"/>
                                </div>
                                <div class="vimeovideo_show" <?php echo $vimeo_section;?>>
                                    <input type="text" name="filename3" value="<?php if($v_VideoSource=='vimeo_video'){ echo $v_Video;}?>"/>
                                </div>
                                <?php
                            }
                            else
                            {?>
                                <div class="nrmlvideo_show">
                                    <input type="text" name="filename" id="filename"/>
                                    <input type="button" class="videobutton" id="custom_media_upload" value="<?php echo esc_html_e('Upload Video'); ?>">
                                </div>
                                <div class="youtubevideo_show" style="display:none">
                                    <input type="text" name="filename2"/>
                                </div>
                                <div class="vimeovideo_show" style="display:none">
                                    <input type="text" name="filename3"/>
                                </div>
                                <?php
                            }
                            ?>
                            <span class="description"><?php echo esc_html_e('Once you have your video link simply copy and paste it on the Video URL Section.'); ?></span>
                        </td>

                        <script type="text/javascript">
                            var o_editor;

                            jQuery(document).ready(function() {
                                jQuery('#custom_media_upload').click(function() {
                                    o_editor = window.send_to_editor;
                                    formfield = jQuery('#filename').attr('name');
                                    window.send_to_editor = function(html) {
                                        url = jQuery(html).attr('href');
                                        jQuery('#filename').val(url);
                                        window.send_to_editor = o_editor;
                                        tb_remove();
                                    }

                                    tb_show('', 'media-upload.php?type=video&amp;TB_iframe=true');
                                    return false;
                                });
                            });
                        </script>
                    </tr>
                    <tr>
                        <td width="250px;"><?php echo esc_html_e('Choose Video Overlay Image:'); ?></td>
                        <td class="upload-button">
                            <?php if(@$v_ImageLogo){?>
                                <div style='display: flex; flex-direction: column;'>
                                    <input type="button" style='font-weight: bold;color: white;padding: 8px 9px;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;border: 0;background: #208ACA;margin-bottom: 7px;width: fit-content;' class='uploadNewEditImage' value="Upload Image">
                                    <input type="file" name="imagelogo" value="<?php echo $v_ImageLogo;?>" id="imagelogo" accept="image/gif, image/jpeg, image/jpg, image/png, image/gif, image/bmp " style='display: none;'/>
                                    <input type="hidden" name="alreadyimagelogo" value="<?php echo $v_ImageLogo;?>" id="alreadyimagelogo" accept="image/gif, image/jpeg, image/jpg, image/png, image/gif, image/bmp " style='display: none;'/>
                                </div>
                            <?php }else { ?>
                                <input type="file" name="imagelogo" value="<?php echo $v_ImageLogo;?>" id="imagelogo" accept="image/gif, image/jpeg, image/jpg, image/png, image/gif, image/bmp "/>
                            <?php } ?>
                            <?php if(@$v_ImageLogo){?>
                            <div id="displayimg">
                                <img class="profile-pic" src="<?php echo $v_ImageLogo;?>" height="50px" width="50px"/>
                                <span class="removeUnique"><i class="fa fa-trash"></i></span>
                                <span class="description"><?php echo esc_html_e('Make Sure The Image Size Matches the Dimension Of The Video'); ?></span>
                            </div>
                            <?php } ?>
                            <script>
                                jQuery(document).ready(function() {
                                    jQuery("input[type='file']").uniform();
                                });
                            </script>
                            <span class="description"><?php echo esc_html_e('This image will be displayed and Autoplay will not worked!'); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td width="250px;"><?php echo esc_html_e('Video Dimensions:'); ?></td>
                        <td>
                            <div class="pull-left">
                                <input type="number" name="videowidth" value="<?php echo @$v_VideoWidth;?>" style="width:60px;" min="300" max="1200" required/><label class="video-width"><?php echo esc_html_e('Width'); ?></label>
                                <input type="number" name="videoheight" value="<?php echo @$v_VideoHeight;?>" style="width:60px;" min="275" required/><label class="video-height"><?php echo esc_html_e('Height'); ?></label>
                            </div>
                            <span class="description"><?php echo esc_html_e('Make sure the size you choose fits the page template you would like to use the video on, for pages with side bar Avoid going over width of 500 unless you have a custom page '); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td width="250px;"><?php echo esc_html_e('Autoplay:'); ?></td>
                        <td>
                            <?php
                            if(@$v_AutoPlay)
                            {?>
                                <label for="autoplay_radio1" <?php if($v_AutoPlay=='yes'){echo 'class="autoplay-enable selected"';}else{ echo 'class="autoplay-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="autoplay_radio2" <?php if($v_AutoPlay=='no'){echo 'class="autoplay-disable selected"';}else{ echo 'class="autoplay-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="autoplay_radio1" name="autoplay" <?php if($v_AutoPlay=='yes'){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="autoplay_radio2" name="autoplay" <?php if($v_AutoPlay=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>" />
                                <?php
                            }
                            else
                            {?>
                                <label for="autoplay_radio1" class="autoplay-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="autoplay_radio2" class="autoplay-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="autoplay_radio1" name="autoplay" value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="autoplay_radio2" name="autoplay"  checked value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }?>

                            <span class="description"><?php echo esc_html_e('Choose Yes IF you would like your Video To start playing once the page loads.'); ?></span>
                        </td>
                    </tr>
                    <tr class="auto-pause">
                        <td width="250px;"><?php echo esc_html_e('Allow Pause:'); ?></td>
                        <td>
                            <?php
                            if(@$v_AllowPause)
                            {?>
                                <label for="allowpause_radio1" <?php if($v_AllowPause=='yes'){echo 'class="allowpause-enable selected"';}else{echo 'class="allowpause-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="allowpause_radio2" <?php if($v_AllowPause=='no'){echo 'class="allowpause-disable selected"';}else{echo 'class="allowpause-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="allowpause_radio1" name="allowpause" <?php if($v_AllowPause=='yes'){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="allowpause_radio2" name="allowpause" <?php if($v_AllowPause=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }
                            else
                            {?>
                                <label for="allowpause_radio1" class="allowpause-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="allowpause_radio2" class="allowpause-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="allowpause_radio1" name="allowpause" value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="allowpause_radio2" name="allowpause" checked value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }?>
                            <span class="description"><?php echo esc_html_e('Choose Yes IF you would like to allow your visitor to PAUSE the video.'); ?></span>
                        </td>
                    </tr>
                    <tr class='allow-control'>
                        <td><?php echo esc_html_e('Video Controls:'); ?></td>
                        <td>
                            <?php
                            if(@$v_VideoControls)
                            {?>
                                <label for="videocontrols_radio1" <?php if($v_VideoControls=='show'){echo 'class="videocontrols-enable selected"';}else{echo 'class="videocontrols-enable"';}?>><span><?php echo esc_html_e('Show'); ?></span></label>
                                <label for="videocontrols_radio2" <?php if($v_VideoControls=='hide'){echo 'class="videocontrols-disable selected"';}else{echo 'class="videocontrols-disable"';}?>><span><?php echo esc_html_e('Hide'); ?></span></label>
                                <input type="radio" id="videocontrols_radio1" name="videocontrols" <?php if($v_VideoControls=='show'){echo 'checked';}?> value="<?php echo esc_html_e('show'); ?>"/>
                                <input type="radio" id="videocontrols_radio2" name="videocontrols" <?php if($v_VideoControls=='hide'){echo 'checked';}?> value="<?php echo esc_html_e('hide'); ?>"/>
                                <?php
                            }
                            else
                            {?>
                                <label for="videocontrols_radio1" class="videocontrols-enable selected"><span><?php echo esc_html_e('Show'); ?></span></label>
                                <label for="videocontrols_radio2" class="videocontrols-disable"><span><?php echo esc_html_e('Hide'); ?></span></label>
                                <input type="radio" id="videocontrols_radio1" name="videocontrols" checked value="<?php echo esc_html_e('show'); ?>"/>
                                <input type="radio" id="videocontrols_radio2" name="videocontrols" value="<?php echo esc_html_e('hide'); ?>"/>
                                <?php
                            }?>

                            <span class="description"><?php echo esc_html_e('Choose Hide IF you do NOT want to give the visitor the ability to fast forward or control the Video, Choose YES and the video controls will be hidden.'); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td width="250px;"><?php echo esc_html_e('Do you want the video to scroll:'); ?></td>
                        <td>
                            <?php
                            if(@$v_AllowScroll || @$v_AllowScroll=='')
                            {?>
                                <label for="allowscroll_radio1" <?php if($v_AllowScroll=='yes' || $v_AllowScroll==''){echo 'class="allowscroll-enable selected"';}else{echo 'class="allowscroll-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="allowscroll_radio2" <?php if($v_AllowScroll=='no'){echo 'class="allowscroll-disable selected"';}else{echo 'class="allowscroll-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="allowscroll_radio1" name="allowscroll" <?php if($v_AllowScroll=='yes' || $v_AllowScroll==''){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="allowscroll_radio2" name="allowscroll" <?php if($v_AllowScroll=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }
                            else
                            {?>
                                <label for="allowscroll_radio1" class="allowscroll-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="allowscroll_radio2" class="allowscroll-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="allowscroll_radio1" name="allowscroll" value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="allowscroll_radio2" name="allowscroll" checked value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }?>
                            <span class="description"><?php echo esc_html_e('Choose Yes IF you would like to play your video in Picture in Picture mode when it gets out of view point.'); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Video Alignment:'); ?></td>
                        <td>
                            <?php
                            if(@$v_VideoAlign)
                            {?>
                                <div class="video-align">
                                    <label for="video_align_radio1" <?php if($v_VideoAlign=='left'){echo 'class="video_align-enable selected"';}else{echo 'class="video_align-enable"';}?>><span><?php echo esc_html_e('Left'); ?></span></label>
                                    <label for="video_align_radio2" <?php if($v_VideoAlign=='center'){echo 'class="video_align-disable2 selected"';}else{echo 'class="video_align-disable2"';}?>><span><?php echo esc_html_e('Center'); ?></span></label>
                                    <label for="video_align_radio3" <?php if($v_VideoAlign=='right'){echo 'class="video_align-disable selected"';}else{echo 'class="video_align-disable"';}?>><span><?php echo esc_html_e('Right'); ?></span></label>
                                    <input type="radio" id="video_align_radio1" name="video_align" <?php if($v_VideoAlign=='left'){echo 'checked';}?> value="<?php echo esc_html_e('left'); ?>"/>
                                    <input type="radio" id="video_align_radio2" name="video_align" <?php if($v_VideoAlign=='center'){echo 'checked';}?> value="<?php echo esc_html_e('center'); ?>"/>
                                    <input type="radio" id="video_align_radio3" name="video_align" <?php if($v_VideoAlign=='right'){echo 'checked';}?> value="<?php echo esc_html_e('right'); ?>"/>
                                </div>
                            <?php
                            }
                            else
                            {?>
                                <div class="video-align">
                                    <label for="video_align_radio1" class="video_align-enable selected"><span><?php echo esc_html_e('Left'); ?></span></label>
                                    <label for="video_align_radio2" class="video_align-disable2"><span><?php echo esc_html_e('Center'); ?></span></label>
                                    <label for="video_align_radio3" class="video_align-disable"><span><?php echo esc_html_e('Right'); ?></span></label>
                                    <input type="radio" id="video_align_radio1" name="video_align" checked value="<?php echo esc_html_e('left'); ?>"/>
                                    <input type="radio" id="video_align_radio2" name="video_align" value="<?php echo esc_html_e('center'); ?>"/>
                                    <input type="radio" id="video_align_radio3" name="video_align" value="<?php echo esc_html_e('right'); ?>"/>
                                </div>
                                <?php
                            }?>
                            <span class="description"><?php echo esc_html_e('Choose where you would like the video to be positioned.'); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Set Content reveal timer:'); ?></td>
                        <td>
                            <?php
                            if(@$v_ShowContentLoc)
                            {?>
                                <div class="content-location">
                                    <label for="content_location_radio1" <?php if($v_ShowContentLoc=='beginning'){echo 'class="content_location-enable selected"';}else{echo 'class="content_location-enable"';}?>><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                    <label for="content_location_radio2" <?php if($v_ShowContentLoc=='middle'){echo 'class="content_location-disable2 selected"';}else{echo 'class="content_location-disable2"';}?>><span><?php echo esc_html_e('Middle'); ?></span></label>
                                    <label for="content_location_radio3" <?php if($v_ShowContentLoc=='end'){echo 'class="content_location-disable selected"';}else{echo 'class="content_location-disable"';}?>><span><?php echo esc_html_e('End'); ?></span></label>
                                    <input type="radio" id="content_location_radio1" name="content_location" <?php if($v_ShowContentLoc=='beginning'){echo 'checked';}?> value="<?php echo esc_html_e('beginning'); ?>"/>
                                    <input type="radio" id="content_location_radio2" name="content_location" <?php if($v_ShowContentLoc=='middle'){echo 'checked';}?> value="<?php echo esc_html_e('middle'); ?>"/>
                                    <input type="radio" id="content_location_radio3" name="content_location" <?php if($v_ShowContentLoc=='end'){echo 'checked';}?> value="<?php echo esc_html_e('end'); ?>"/>
                                </div>
                            <?php
                            }
                            else
                            {?>
                                <div class="content-location">
                                    <label for="content_location_radio1" class="content_location-enable selected"><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                    <label for="content_location_radio2" class="content_location-disable2"><span><?php echo esc_html_e('Middle'); ?></span></label>
                                    <label for="content_location_radio3" class="content_location-disable"><span><?php echo esc_html_e('End'); ?></span></label>
                                    <input type="radio" id="content_location_radio1" name="content_location" checked value="<?php echo esc_html_e('beginning'); ?>"/>
                                    <input type="radio" id="content_location_radio2" name="content_location" value="<?php echo esc_html_e('middle'); ?>"/>
                                    <input type="radio" id="content_location_radio3" name="content_location" value="<?php echo esc_html_e('end'); ?>"/>
                                </div>
                                <?php
                            }?>
                            <script>
                                jQuery(document).ready(function($) {
                                    jQuery('.location-content-span').hide();
                                    if('<?php echo @$v_ShowContentLoc;?>'=='middle'){
                                        jQuery('.location-content-span').show();
                                    }
                                });
                            </script>
                            <span class="location-content-span"><input type="text" name="showcontent_dur" value="<?php echo @$v_ShowContentDur;?>" style="width:60px;"><label class="showcontent-labeltime"><?php echo esc_html_e('Second'); ?></label></span>
                            <span class="description"><?php echo esc_html_e('You can have any type of content to be displayed when you want them to be displayed based on the Videos Time...'); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Enter TEXT Or Upload Image or Both:'); ?></td>
                        <td>
                            <div style="width:550px;">
                                <?php $args = array("textarea_rows" => 5, "textarea_name" => "video_content", "editor_class" => "my_editor_custom");
                                // wp_enqueue_media();
                                    wp_editor(@$v_Content, "my_editor_1", $args);
                                ?>
                            </div>
                            <span class="description">
                            <?php echo esc_html_e('You can have TEXT and or IMAGE to be revealed when you want them to be revealed again based on the time of the Video. If the video is paused before the time you have set, this content will NOT be revealed.'); ?>
                            </span>
                            <span class="description">
                            <?php echo esc_html_e('Example:--If you set the timer at 15 seconds, this is 15th second of the video and if the video gets paused before the 15  second mark, no matter how long the content wont be revealed.'); ?>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Social Lock:'); ?></td>
                        <td>
                            <?php
                            if(@$v_SocialEnable)
                            {?>
                                <label for="social_enable_radio1" <?php if($v_SocialEnable=='yes'){echo 'class="social_enable-enable selected"';}else{echo 'class="social_enable-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="social_enable_radio2" <?php if($v_SocialEnable=='no'){echo 'class="social_enable-disable selected"';}else{echo 'class="social_enable-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="social_enable_radio1" name="social_enable" <?php if($v_SocialEnable=='yes'){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="social_enable_radio2" name="social_enable" <?php if($v_SocialEnable=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }
                            else
                            {?>
                                <label for="social_enable_radio1" class="social_enable-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="social_enable_radio2" class="social_enable-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="social_enable_radio1" name="social_enable" value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="social_enable_radio2" name="social_enable"  checked value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }?>
                        </td>
                    </tr>
                </table>
                <script>
                    jQuery(document).ready(function() {
                        jQuery('#social_fields').hide();

                        if('<?php echo @$v_SocialEnable;?>'=='yes'){
                            jQuery('#social_fields').show();
                        }
                    });
                </script>

                <table id="social_fields">
                    <tr>
                        <td width="250px"><?php echo esc_html_e('Set Social Lock Timer:'); ?></td>
                        <td>
                            <?php
                            if(@$v_SocialBtnLoc)
                            {?>
                                <div class="socialbtn-location">
                                    <label for="socialbtn_location_radio1" <?php if($v_SocialBtnLoc=='beginning'){echo 'class="socialbtn_location-enable selected"';}else{echo 'class="socialbtn_location-enable"';}?>><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                    <label for="socialbtn_location_radio2" <?php if($v_SocialBtnLoc=='middle'){echo 'class="socialbtn_location-disable2 selected"';}else{echo 'class="socialbtn_location-disable2"';}?>><span><?php echo esc_html_e('Middle'); ?></span></label>
                                    <label for="socialbtn_location_radio3" <?php if($v_SocialBtnLoc=='end'){echo 'class="socialbtn_location-disable selected"';}else{echo 'class="socialbtn_location-disable"';}?>><span><?php echo esc_html_e('End'); ?></span></label>
                                    <input type="radio" id="socialbtn_location_radio1" name="socialbtn_location" <?php if($v_SocialBtnLoc=='beginning'){echo 'checked';}?> value="<?php echo esc_html_e('beginning'); ?>"/>
                                    <input type="radio" id="socialbtn_location_radio2" name="socialbtn_location" <?php if($v_SocialBtnLoc=='middle'){echo 'checked';}?> value="<?php echo esc_html_e('middle'); ?>"/>
                                    <input type="radio" id="socialbtn_location_radio3" name="socialbtn_location" <?php if($v_SocialBtnLoc=='end'){echo 'checked';}?> value="<?php echo esc_html_e('end'); ?>"/>
                                </div>
                            <?php
                            }
                            else
                            {?>
                                <div class="socialbtn-location">
                                    <label for="socialbtn_location_radio1" class="socialbtn_location-enable selected"><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                    <label for="socialbtn_location_radio2" class="socialbtn_location-disable2"><span><?php echo esc_html_e('Middle'); ?></span></label>
                                    <label for="socialbtn_location_radio3" class="socialbtn_location-disable"><span><?php echo esc_html_e('End'); ?></span></label>
                                    <input type="radio" id="socialbtn_location_radio1" name="socialbtn_location" checked value="<?php echo esc_html_e('beginning'); ?>"/>
                                    <input type="radio" id="socialbtn_location_radio2" name="socialbtn_location" value="<?php echo esc_html_e('middle'); ?>"/>
                                    <input type="radio" id="socialbtn_location_radio3" name="socialbtn_location" value="<?php echo esc_html_e('end'); ?>"/>
                                </div>
                                <?php
                            }?>

                            <script>
                                jQuery(document).ready(function() {
                                    jQuery('.location-socialbtn-span').hide();

                                    if('<?php echo @$v_SocialBtnLoc;?>'=='middle'){
                                        jQuery('.location-socialbtn-span').show();
                                    }
                                });
                            </script>
                            <span class="location-socialbtn-span"><input type="text" name="sociallock_dur" value="<?php echo @$v_SocialLockDuration;?>" style="width:60px;"><label class="showsocialbtn-labeltime"><?php echo esc_html_e('Second'); ?></label></span>
                        </td>
                    </tr>
                    <tr>
                        <td width="150px;">
                            <?php echo esc_html_e('Headline Message:'); ?><!-- <?php echo esc_html_e('Social Share Title:'); ?> -->
                        </td>
                        <td><input type="text" name="socialtitle" value="<?php echo @$v_SocialTitle;?>" ></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Social Share Text:'); ?></td>
                        <td><input type="text" name="socialtext" value="<?php echo @$v_SocialText;?>" ></td>
                    </tr>
                    <tr>
                        <td width="150px;"><?php echo esc_html_e('Social Share:'); ?></td>
                        <td><input type="text" name="defaulttweet" value="<?php echo @$v_DefaultTweet;?>" ></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Allow Skipping:'); ?></td>
                        <td>
                            <?php
                            if(@$v_SocialLockAllowSkip)
                            {?>
                                <label for="social_allow_skip_radio1" <?php if($v_SocialLockAllowSkip=='yes'){echo 'class="allow_skip-enable selected"';}else{echo 'class="allow_skip-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="social_allow_skip_radio2" <?php if($v_SocialLockAllowSkip=='no'){echo 'class="allow_skip-disable selected"';}else{echo 'class="allow_skip-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="social_allow_skip_radio1" name="social_allow_skip" <?php if($v_SocialLockAllowSkip=='yes'){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="social_allow_skip_radio2" name="social_allow_skip" <?php if($v_SocialLockAllowSkip=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>"/>
                            <?php
                            }
                            else
                            {?>
                                <label for="social_allow_skip_radio1" class="allow_skip-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="social_allow_skip_radio2" class="allow_skip-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="social_allow_skip_radio1" name="social_allow_skip" value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="social_allow_skip_radio2" name="social_allow_skip"  checked value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }?>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('URL to Share:'); ?></td>
                        <td>
                            <?php
                            if(@$v_ShareUrl)
                            {?>
                                <div class="share_url">
                                    <label for="share_url_radio1" <?php if($v_ShareUrl=='page_post'){echo 'class="share_url-enable selected"';}else{echo 'class="share_url-enable"';}?>><span><?php echo esc_html_e('This page/post'); ?></span></label>
                                    <label for="share_url_radio2" <?php if($v_ShareUrl=='main_blog'){echo 'class="share_url-disable2 selected"';}else{echo 'class="share_url-disable2"';}?>><span><?php echo esc_html_e('Main blog'); ?></span></label>
                                    <label for="share_url_radio3" <?php if($v_ShareUrl=='custom'){echo 'class="share_url-disable selected"';}else{echo 'class="share_url-disable"';}?>><span><?php echo esc_html_e('Custom'); ?></span></label>
                                    <input type="radio" id="share_url_radio1" name="share_url" <?php if($v_ShareUrl=='page_post'){echo 'checked';}?> value="<?php echo esc_html_e('page_post'); ?>"/>
                                    <input type="radio" id="share_url_radio2" name="share_url" <?php if($v_ShareUrl=='main_blog'){echo 'checked';}?> value="<?php echo esc_html_e('main_blog'); ?>"/>
                                    <input type="radio" id="share_url_radio3" name="share_url" <?php if($v_ShareUrl=='custom'){echo 'checked';}?> value="<?php echo esc_html_e('custom'); ?>"/>
                                </div>
                            <?php
                            }
                            else
                            {?>
                                <div class="share_url">
                                    <label for="share_url_radio1" class="share_url-enable selected"><span><?php echo esc_html_e('This page/post'); ?></span></label>
                                    <label for="share_url_radio2" class="share_url-disable2"><span><?php echo esc_html_e('Main blog'); ?></span></label>
                                    <label for="share_url_radio3" class="share_url-disable"><span><?php echo esc_html_e('Custom'); ?></span></label>
                                    <input type="radio" id="share_url_radio1" name="share_url" checked value="<?php echo esc_html_e('page_post'); ?>"/>
                                    <input type="radio" id="share_url_radio2" name="share_url" value="<?php echo esc_html_e('main_blog'); ?>"/>
                                    <input type="radio" id="share_url_radio3" name="share_url" value="<?php echo esc_html_e('custom'); ?>"/>
                                </div>
                                <?php
                            }?>

                            <script>
                                jQuery(document).ready(function() {
                                    if('<?php echo @$v_ShareUrl;?>'=='custom'){
                                        jQuery('#custom_urltable').show();
                                    }
                                });
                            </script>
                        </td>
                    </tr>
                </table>

                <table id="custom_urltable">
                    <tr>
                        <td width="150px;"><?php echo esc_html_e('Enter Custom Url: '); ?></td>
                        <td><input type="text" name="custom_url" id="custom_url" value="<?php echo @$v_CustomUrl;?>"></td>
                    </tr>
                </table>

                <!-- new otpion to add CTA -->
                <table class="video-opt">
                    <tr>
                        <td width="250px"><?php echo esc_html_e('Add CTA button:'); ?></td>
                        <td>
                            <?php
                            if(@$v_cta_enable)
                            {?>
                                <label for="cta_social_enable_radio1" <?php if($v_cta_enable=='yes'){echo 'class="CTA_enable-enable selected"';}else{echo 'class="CTA_enable-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="cta_social_enable_radio2" <?php if($v_cta_enable=='no'){echo 'class="CTA_enable-disable selected"';}else{echo 'class="CTA_enable-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="cta_social_enable_radio1" name="cta_enable" <?php if($v_cta_enable=='yes'){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="cta_social_enable_radio2" name="cta_enable" <?php if($v_cta_enable=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }
                            else
                            {?>
                                <label for="cta_social_enable_radio1" class="CTA_enable-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="cta_social_enable_radio2" class="CTA_enable-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="cta_social_enable_radio1" name="cta_enable" value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="cta_social_enable_radio2" name="cta_enable"  checked value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }?>
                        </td>
                    </tr>
                </table>

                <script>
                    jQuery(document).ready(function() {
                        jQuery('#newCTAoption').hide();

                        if('<?php echo @$v_cta_enable;?>'=='yes'){
                            jQuery('#newCTAoption').show();
                        }
                    });
                </script>

                <table id="newCTAoption">
                    <tr>
                        <td width="150px;"><?php echo esc_html_e('Set CTA button Timer:'); ?></td>
                        <td>
                            <?php
                            if(@$v_ctabtn_location)
                            {?>
                                <div class="socialbtn-location">
                                    <label for="cta_socialbtn_location_radio1" <?php if($v_ctabtn_location=='beginning'){echo 'class="socialbtn_location-enable_for_CTA selected"';}else{echo 'class="socialbtn_location-enable_for_CTA"';}?>><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                    <label for="cta_socialbtn_location_radio2" <?php if($v_ctabtn_location=='middle'){echo 'class="socialbtn_location-disable2_for_CTA selected"';}else{echo 'class="socialbtn_location-disable2_for_CTA"';}?>><span><?php echo esc_html_e('Middle'); ?></span></label>
                                    <label for="cta_socialbtn_location_radio3" <?php if($v_ctabtn_location=='end'){echo 'class="socialbtn_location-disable_for_CTA selected"';}else{echo 'class="socialbtn_location-disable_for_CTA"';}?>><span><?php echo esc_html_e('End'); ?></span></label>
                                    <input type="radio" id="cta_socialbtn_location_radio1" name="ctabtn_location" <?php if($v_ctabtn_location=='beginning'){echo 'checked';}?> value="<?php echo esc_html_e('beginning'); ?>"/>
                                    <input type="radio" id="cta_socialbtn_location_radio2" name="ctabtn_location" <?php if($v_ctabtn_location=='middle'){echo 'checked';}?> value="<?php echo esc_html_e('middle'); ?>"/>
                                    <input type="radio" id="cta_socialbtn_location_radio3" name="ctabtn_location" <?php if($v_ctabtn_location=='end'){echo 'checked';}?> value="<?php echo esc_html_e('end'); ?>"/>
                                </div>
                            <?php
                            }
                            else
                            {?>
                                <div class="socialbtn-location">
                                    <label for="cta_socialbtn_location_radio1" class="socialbtn_location-enable_for_CTA selected"><span><?php echo esc_html_e('Beginning'); ?></span></label>
                                    <label for="cta_socialbtn_location_radio2" class="socialbtn_location-disable2_for_CTA"><span><?php echo esc_html_e('Middle'); ?></span></label>
                                    <label for="cta_socialbtn_location_radio3" class="socialbtn_location-disable_for_CTA"><span><?php echo esc_html_e('End'); ?></span></label>
                                    <input type="radio" id="cta_socialbtn_location_radio1" name="ctabtn_location" checked value="<?php echo esc_html_e('beginning'); ?>"/>
                                    <input type="radio" id="cta_socialbtn_location_radio2" name="ctabtn_location" value="<?php echo esc_html_e('middle'); ?>"/>
                                    <input type="radio" id="cta_socialbtn_location_radio3" name="ctabtn_location" value="<?php echo esc_html_e('end'); ?>"/>
                                </div>
                                <?php
                            }?>

                            <script>
                                jQuery(document).ready(function() {
                                    jQuery('.location-cta_btn-span').hide();

                                    if('<?php echo @$v_ctabtn_location;?>'=='middle'){
                                        jQuery('.location-cta_btn-span').show();
                                    }
                                });

                            </script>
                            <span class="location-cta_btn-span"><input type="text" name="ctabtn_dur" value="<?php echo @$v_ctabtn_dur;?>" style="width:60px;"><label class="showsocialbtn-labeltime"><?php echo esc_html_e('Second'); ?></label></span>
                        </td>
                    </tr>
                    <tr>
                        <td width="250px"><?php echo esc_html_e('Choose button background color:'); ?></td>
                        <td><input type="color" name="cta_bg_color" class="cta_bg_color" value="<?php echo @$v_cta_bg_color;?>" ></td>
                    </tr>
                    <tr>
                        <td width="250px"><?php echo esc_html_e('Choose text color:'); ?></td>
                        <td><input type="color" name="cta_text_color" class="cta_text_color" value="<?php echo @$v_cta_text_color;?>" ></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('CTA button Text:'); ?></td>
                        <td><input type="text" name="cta_btn_text" class="cta_btn_text" value="<?php echo @$v_cta_btn_text;?>" ></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('CTA button border:'); ?></td>
                        <td><input type="text" name="cta_btn_border" class="cta_btn_border" value="<?php echo @$v_cta_btn_border;?>" ></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('CTA button border radius:'); ?></td>
                        <td><input type="text" name="cta_btn_radius" class="cta_btn_radius" value="<?php echo @$v_cta_btn_radius;?>" ></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('CTA button border color:'); ?></td>
                        <td><input type="color" name="cta_btn_border_color" class="cta_btn_border_color" value="<?php echo @$v_cta_btn_border_color;?>" ></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('CTA button height:'); ?></td>
                        <td><input type="number" name="cta_btn_height" class="cta_btn_height" value="<?php echo @$v_cta_btn_height;?>" ></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('CTA button width:'); ?></td>
                        <td><input type="number" name="cta_btn_width" class="cta_btn_width"  value="<?php echo @$v_cta_btn_width;?>" ></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Preview:'); ?></td>
                        <td>
                            <button disabled class='preview-btn' style='min-width:fit-content;'>This is a preview button</button>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Allow Skipping:'); ?></td>
                        <td>
                            <?php
                            if(@$v_ctabtn_allow_skip)
                            {?>
                                <label for="cta_social_allow_skip_radio1" <?php if($v_ctabtn_allow_skip=='yes'){echo 'class="cta_allow_skip-enable selected"';}else{echo 'class="cta_allow_skip-enable"';}?>><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="cta_social_allow_skip_radio2" <?php if($v_ctabtn_allow_skip=='no'){echo 'class="cta_allow_skip-disable selected"';}else{echo 'class="cta_allow_skip-disable"';}?>><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="cta_social_allow_skip_radio1" name="ctabtn_allow_skip" <?php if($v_ctabtn_allow_skip=='yes'){echo 'checked';}?> value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="cta_social_allow_skip_radio2" name="ctabtn_allow_skip" <?php if($v_ctabtn_allow_skip=='no'){echo 'checked';}?> value="<?php echo esc_html_e('no'); ?>"/>
                            <?php
                            }
                            else
                            {?>
                                <label for="cta_social_allow_skip_radio1" class="cta_allow_skip-enable"><span><?php echo esc_html_e('YES'); ?></span></label>
                                <label for="cta_social_allow_skip_radio2" class="cta_allow_skip-disable selected"><span><?php echo esc_html_e('NO'); ?></span></label>
                                <input type="radio" id="cta_social_allow_skip_radio1" name="ctabtn_allow_skip" value="<?php echo esc_html_e('yes'); ?>"/>
                                <input type="radio" id="cta_social_allow_skip_radio2" name="ctabtn_allow_skip"  checked value="<?php echo esc_html_e('no'); ?>"/>
                                <?php
                            }?>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('URL to Share:'); ?></td>
                        <td>
                            <?php
                            if(@$v_cta_share_url)
                            {?>
                                <div class="share_url">
                                    <label for="cta_share_url_radio1" <?php if($v_cta_share_url=='page_post'){echo 'class="share_url-enable_for_CTA selected"';}else{echo 'class="share_url-enable_for_CTA"';}?>><span><?php echo esc_html_e('This page/post'); ?></span></label>
                                    <label for="cta_share_url_radio2" <?php if($v_cta_share_url=='main_blog'){echo 'class="share_url-disable2_for_CTA selected"';}else{echo 'class="share_url-disable2_for_CTA"';}?>><span><?php echo esc_html_e('Main blog'); ?></span></label>
                                    <label for="cta_share_url_radio3" <?php if($v_cta_share_url=='custom'){echo 'class="share_url-disable_for_CTA selected"';}else{echo 'class="share_url-disable_for_CTA"';}?>><span><?php echo esc_html_e('Custom'); ?></span></label>
                                    <input type="radio" id="cta_share_url_radio1" name="cta_share_url" <?php if($v_cta_share_url=='page_post'){echo 'checked';}?> value="<?php echo esc_html_e('page_post'); ?>"/>
                                    <input type="radio" id="cta_share_url_radio2" name="cta_share_url" <?php if($v_cta_share_url=='main_blog'){echo 'checked';}?> value="<?php echo esc_html_e('main_blog'); ?>"/>
                                    <input type="radio" id="cta_share_url_radio3" name="cta_share_url" <?php if($v_cta_share_url=='custom'){echo 'checked';}?> value="<?php echo esc_html_e('custom'); ?>"/>
                                </div>
                            <?php
                            }
                            else
                            {?>
                                <div class="share_url">
                                    <label for="cta_share_url_radio1" class="share_url-enable_for_CTA selected"><span><?php echo esc_html_e('This page/post'); ?></span></label>
                                    <label for="cta_share_url_radio2" class="share_url-disable2_for_CTA"><span><?php echo esc_html_e('Main blog'); ?></span></label>
                                    <label for="cta_share_url_radio3" class="share_url-disable_for_CTA"><span><?php echo esc_html_e('Custom'); ?></span></label>
                                    <input type="radio" id="cta_share_url_radio1" name="cta_share_url" checked value="<?php echo esc_html_e('page_post'); ?>"/>
                                    <input type="radio" id="cta_share_url_radio2" name="cta_share_url" value="<?php echo esc_html_e('main_blog'); ?>"/>
                                    <input type="radio" id="cta_share_url_radio3" name="cta_share_url" value="<?php echo esc_html_e('custom'); ?>"/>
                                </div>
                                <?php
                            }?>

                            <script>
                                jQuery(document).ready(function() {
                                    if('<?php echo @$v_cta_share_url;?>'=='custom'){
                                        jQuery('#custom_urltable_for_CTA').show();
                                    }
                                });
                            </script>
                        </td>
                    </tr>
                </table>

                <table id="custom_urltable_for_CTA">
                    <tr>
                        <td width="250px"><?php echo esc_html_e('Enter Custom Url: '); ?></td>
                        <td><input type="text" name="cta_custom_url" id="custom_url" value="<?php echo @$v_cta_custom_url;?>"></td>
                    </tr>
                </table>
                <input type="hidden" class="save_action" name="save_action" value ="<?php echo esc_html_e('tab-1-content'); ?>"/>
                <input type="hidden" name="row_id" id="row_id" class="row_id" value="<?php echo $v_id?>"/>
                <input type="submit" id="videobutton1" class="videobutton1" data-att="tab-1" value="<?php echo esc_html_e('Save'); ?>" name="submit"/>
            </form>
        </div>

        <div id="tab-2" class="tab-content">
            <form action="" id="ajax-upload2" method="post" enctype="multipart/form-data" onsubmit="return checkmidTime();">
                <div class="">
                    <h2><?php echo esc_html_e('Autoresponder List'); ?></h2>
                    <ul id="tabs-nav">
                        <li><a href="#mailchimp-tab"><img src="<?php echo MV_PLAYER_URL.'image/mailchimp.png';?>" /></a></li>
                        <li><a href="#getresponse-tab"><img src="<?php echo MV_PLAYER_URL.'image/getresponse.png';?>" /></a></li>
                        <li><a href="#aweber-tab"><img src="<?php echo MV_PLAYER_URL.'image/aweber.png';?>" /></a></li>
                        <li><a href="#sendlane-tab"><img src="<?php echo MV_PLAYER_URL.'image/sendlane.png';?>" /></a></li>
                        <li><a href="#formcode-tab"><img src="<?php echo MV_PLAYER_URL.'image/formcode.png';?>" /></a></li>
                    </ul> <!-- END tabs-nav -->
                    <div id="tabs-content">
                        <div id="mailchimp-tab" class="tab-contents">
                            <h2><?php echo esc_html_e('Add New Integration'); ?></h2>
                            <p><?php echo esc_html_e('Please fill out the following detail and save it.'); ?></p>
                            <table class="mailchimp-table">
                                <tr>
                                    <td width="150px;"><?php echo esc_html_e('Enter API Key:'); ?></td>
                                    <td>
                                        <input type="text" name="mailchimpapikey" value="<?php echo @$v_MailChimpApiKey; ?>"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo esc_html_e('Enter List ID:'); ?></td>
                                    <td>
                                        <input type="text" name="mailchimplistid" value="<?php echo @$v_MailChimpListId; ?>"/>
                                    </td>
                                </tr>
                            </table>
                        </div>

                        <div id="getresponse-tab" class="tab-contents">
                            <h2><?php echo esc_html_e('Add New Integration'); ?></h2>
                            <p><?php echo esc_html_e('Please fill out the following detail and save it.'); ?></p>
                            <table class="getresponse-table">
                                <tr>
                                    <td width="150px;"><?php echo esc_html_e('Enter API Key:'); ?></td>
                                    <td>
                                        <input type="text" name="getresponseapikey" value="<?php echo @$v_GetResponseApiKey; ?>"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo esc_html_e('Enter Campaign ID:'); ?></td>
                                    <td>
                                        <input type="text" name="getresponsecampaignid" value="<?php echo @$v_GetResponseCampaignId; ?>"/>
                                    </td>
                                </tr>
                            </table>
                        </div>

                        <div id="aweber-tab" class="tab-contents">
                            <h2><?php echo esc_html_e('Add New Integration'); ?></h2>
                            <p><?php echo esc_html_e('Please click the button to authorize & save it'); ?></p>
                            <table class="aweber-table">
                                <tr>
                                    <td width="150px;"><?php echo esc_html_e('Select List'); ?></td>
                                    <td>
                                        <?php
                                        /* Fetch available lists in user section. */
                                        if( !empty( $v_AWeberAccessTokens)){
                                            $AWeberAccessTokens = @unserialize($v_AWeberAccessTokens);
                                            $AWeberListID = @$v_AWeberListID;
                                            $aweber = new AWeberAPI($AWeberAccessTokens['consumerKey'], $AWeberAccessTokens['consumerSecret']);
                                            try
                                            {
                                                $account = $aweber->getAccount($AWeberAccessTokens['accessKey'], $AWeberAccessTokens['accessSecret']);
                                                $lists = $account->lists;
                                                ?>
                                                <select name="AWeberListID" id="AWeberListID">
                                                    <option value=""><?php echo esc_html_e('--Select Aweber List--'); ?></option>
                                                    <?php

                                                    if(count($lists->data['entries'])>0){
                                                        foreach($lists->data['entries'] as $list){
                                                            $selected='';
                                                            if($AWeberListID == $list['id'])
                                                                    $selected='selected="selected"';
                                                            printf('<option %s value="%s">%s</option>',$selected,$list['id'], $list['name']);
                                                        }
                                                    }
                                                    ?>
                                                </select>
                                                <?php
                                            }
                                            catch(Exception $e){
                                                echo esc_html_e('Something went wrong, Please reauthorize the application.');
                                            }
                                        }else{
                                            echo esc_html_e('Please authorize the application to select list.');
                                        }
                                        ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td>
                                        <a class="authbtn" href="<?php echo MV_PLAYER_URL.'includes/aweber_api/request-access.php?request-access=1&vid='.@$v_id;?>"><?php echo esc_html_e('Authorise Application'); ?></a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <!-- ********** Add New Autoresponder Sendlane :: Start ********** -->
                        <div id="sendlane-tab" class="tab-contents">
                            <h2><?php echo esc_html_e('Add New Integration'); ?></h2>
                            <p><?php echo esc_html_e('Please fill out the following detail and save it.'); ?></p>
                            <table class="sendlane-table">
                                <tr>
                                    <td width="150px;"><?php echo esc_html_e('Enter API Key:'); ?></td>
                                    <td>
                                        <input type="text" name="sendlaneapikey" value="<?php echo @$v_SendlaneApiKey; ?>"/>
                                    </td>
                                    <td><?php echo esc_html_e('Enter API Hash Key'); ?>:</td>
                                    <td>
                                        <input type="text" name="sendlaneapihashkey" value="<?php echo @$v_SendlaneApiHashKey; ?>">
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo esc_html_e('Enter API URL:'); ?></td>
                                    <td>
                                        <input type="text" name="sendlaneapiurl" value="<?php echo @$v_SendlaneApiUrl; ?>">
                                    </td>
                                    <td><?php echo esc_html_e('Enter Sendlane Subdomain'); ?></td>
                                    <td>
                                        <input type="text" name="sendlanesubdomain" value="<?php echo @$v_SendlaneSubDomain; ?>">
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo esc_html_e('Enter List ID:'); ?></td>
                                    <td>
                                        <input type="text" name="sendlanelistid" value="<?php echo @$v_SendlaneListID; ?>"/>
                                    </td>
                                </tr>
                            </table>
                        </div>

                        <!-- ********** Add New Autoresponder Sendlane :: End ********** -->
                        <div id="formcode-tab" class="tab-contents">
                            <h2><?php echo esc_html_e('Add New Integration'); ?></h2>
                            <p><?php echo esc_html_e('Please fill out the following detail and save it.'); ?></p>
                            <table class="formcode-table">
                                <tr>
                                    <td width="150px" valign="top"><?php echo esc_html_e('Enter Form code:'); ?></td>
                                    <td>
                                        <textarea name="custom_formcode"><?php echo @$custom_formcode; ?></textarea>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>

                <input type="hidden" name="save_action" value ="<?php echo esc_html_e('tab-2-content'); ?>"/>
                <input type="hidden" name="row_id" id="row_id" class="row_id" value="<?php echo $v_id?>"/>
                <input type="submit" id="videobutton2" class="videobutton1" data-att="tab-2" value="<?php echo esc_html_e('Save'); ?>" name="submit"/>
            </form>
        </div>

        <div id="tab-4" class="tab-content">
            <form action="" id="ajax-upload4" method="post" enctype="multipart/form-data" onsubmit="return checkmidTime();">
                <div class="add_new_btn">
                    <table class="newbtn_prop">
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Enter Button Label'); ?></td>
                            <td><input type="text" id="button_label" name="button_label"></td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Select Button Icon:'); ?></td>
                            <td>
                                <select id="ico_img_url" name="ico_img_url">
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/Arrow-Right.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/Arrow-Right.png"><?php echo esc_html_e('Arrow-Right'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/Cart.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/Cart.png"><?php echo esc_html_e('Cart'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/Mail-1.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/Mail-1.png"><?php echo esc_html_e('Mail-1'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/Map.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/Map.png"><?php echo esc_html_e('Map'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/cart2.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/cart2.png"><?php echo esc_html_e('cart2'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/click.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/click.png"><?php echo esc_html_e('click'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/coupon.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/coupon.png"><?php echo esc_html_e('coupon'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/download.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/download.png"><?php echo esc_html_e('download'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/download2.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/download2.png"><?php echo esc_html_e('download2'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/facebook.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/facebook.png"><?php echo esc_html_e('facebook'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/facebook2.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/facebook2.png"><?php echo esc_html_e('facebook2'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/faq.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/faq.png"><?php echo esc_html_e('faq'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/faq2.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/faq2.png"><?php echo esc_html_e('faq2'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/internet_icon.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/internet_icon.png"><?php echo esc_html_e('internet_icon'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/internet2.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/internet2.png"><?php echo esc_html_e('internet2'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/map2.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/map2.png"><?php echo esc_html_e('map2'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/sale.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/sale.png"><?php echo esc_html_e('sale'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/shopping_cart.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/shopping_cart.png"><?php echo esc_html_e('shopping_cart'); ?></option>
                                    <option value="<?php echo MV_PLAYER_URL;?>/image/btn_icon/webpage.png" data-imagesrc="<?php echo MV_PLAYER_URL;?>image/btn_icon/webpage.png"><?php echo esc_html_e('webpage'); ?></option>
                                    <option value="custom"><?php echo esc_html_e('Custom'); ?></option>
                                </select>

                                <script>
                                    jQuery(document).ready(function($){
                                        $('#ico_img_url').ddslick();
                                        $('#ico_img_url').click(function(){
                                            var current_img_btn1 = $('#ico_img_url a.dd-selected label').text();
                                            var current_img_btn2 = $('#ico_img_url a.dd-selected img').attr('src');

                                            if(current_img_btn1=='Custom'){
                                                $('.cstm_img_upload').show();
                                            }else{
                                                $('.cstm_img_upload').hide();
                                            }
                                        });
                                    });
                                </script>
                                <div class="cstm_img_upload">
                                    <input type="text" name="btn_icon" id="btn_icon"/>
                                    <input type="button" class="videobutton" id="custom_icon_upload" value="<?php echo esc_html_e('Upload Icon'); ?>">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Select Button Type:'); ?></td>
                            <td>
                                <select id="all_btn_types">
                                    <option value="<?php echo esc_html_e('map'); ?>"><?php echo esc_html_e('Map'); ?></option>
                                    <option value="<?php echo esc_html_e('htmlcode'); ?>"><?php echo esc_html_e('HTML code'); ?></option>
                                    <option value="<?php echo esc_html_e('post'); ?>"><?php echo esc_html_e('Post'); ?></option>
                                    <option value="<?php echo esc_html_e('page'); ?>"><?php echo esc_html_e('Page'); ?></option>
                                </select>
                            </td>
                        </tr>
                    </table>
                    <table id="related_video_prop" style="display:none;">
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Add Related Videos:'); ?></td>
                            <td>
                                <a id="add_related_video_url" class="button-secondary"><?php echo esc_html_e('Add Video Url'); ?></a>
                                <input type="hidden" name="current_rv_id" id="current_rv_id" value="0">
                            </td>
                        </tr>
                        <script>
                            jQuery(document).ready(function($){
                                $('#add_related_video_url').on('click',function(){
                                    var link_counter = $('#current_rv_id').val();
                                    $('#related_video_prop').append('<tr class="r_v_data'+link_counter+'"><td>Url:</td><td><input type="text" class="related_video_url" name="related_video_url[]"><a id="remove"><?php echo esc_html_e('Remove'); ?></a></td></tr><tr class="r_v_data'+link_counter+'s"><td><?php echo esc_html_e('Video Thumbnail:'); ?></td><td><a id="'+link_counter+'" class="add_thumb"><?php echo esc_html_e('Select Thumb'); ?></a></td></tr>');
                                    link_counter++;
                                    $('#current_rv_id').val(link_counter);
                                });

                                jQuery('.add_thumb').on('click',function(){
                                    var current_id = $(this).attr('id');
                                    window.send_to_editor = function(html) {
                                        image_url = $( 'img',html).attr('src');
                                        $(".r_v_data"+current_id+"s").find('td:eq(1) img').remove();
                                        $(".r_v_data"+current_id+"s").children('td:eq(1)').prepend('<img src="'+image_url+'" class="image-class"><input type="hidden"  class="related_video_thumb" name="related_video_thumb[]" value="'+image_url+'">');
                                        tb_remove();
                                    }

                                    tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
                                    return false;
                                });
                            });
                        </script>
                    </table>

                    <table id="page_prop" style="display:none;">
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Select Page:'); ?></td>
                            <td><?php $pages = get_pages(); ?>
                                <select id="all_pages">
                                    <option><?php echo esc_html_e('--Select Page--'); ?></option>
                                    <?php
                                        foreach($pages as $page){
                                            echo "<option value='".$page->ID."'>".$page->post_title."</option>";
                                        }
                                    ?>
                                </select>
                            </td>
                        </tr>
                    </table>
                    <table id="postcat_prop" style="display:none;">
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Select Post Category:'); ?></td>
                            <td><?php $categories = get_categories(); ?>
                                <select id="post_cat">
                                    <option><?php echo esc_html_e('--Select Category--'); ?></option>
                                    <?php
                                        foreach($categories as $cat){
                                            echo "<option value='".$cat->term_id."'>".$cat->name."</option>";
                                        }
                                    ?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Enter no. of post:'); ?></td>
                            <td><input type="text" name="post_no" id="post_no"></td>
                        </tr>
                    </table>
                    <table id="iframe_prop" style="display:none;">
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Enter Ifarme Url:'); ?></td>
                            <td><input type="text" id="iframe_url" name="iframe_url"></td>
                        </tr>
                    </table>
                    <table id="map_prop">
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Enter Map Address:'); ?></td>
                            <td><input type="text" name="map_address" id="map_address"></td>
                        </tr>
                    </table>
                    <table id="html_prop" style="display:none;">
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Enter HTML Code:'); ?></td>
                            <td><textarea name="html_code" id="html_code"></textarea></td>
                        </tr>
                    </table>
                    <table class="newbtn_prop">
                        <tr id="show1btn">
                            <td width="150px;"><a id="create_button" class="addbutton"><?php echo esc_html_e('Create Button'); ?></a></td>
                            <td></td>
                        </tr>
                        <tr id="show2btn">
                            <td width="150px;"><a id="update_button" class="addbutton"><?php echo esc_html_e('Update Button'); ?></a></td>
                            <td><a id="cancel_button" class="addbutton"><?php echo esc_html_e('Cancel'); ?></a></td>
                        </tr>
                    </table>
                </div>

                <div class="show_all_btn">
                    <div class="wrap"><h2><?php echo esc_html_e('All Created Buttons'); ?></h2></div>
                    <table class="showbtns" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <th><?php echo esc_html_e('Button Label'); ?></th>
                            <th><?php echo esc_html_e('Button Icon'); ?></th>
                            <th><?php echo esc_html_e('Button Type'); ?></th>
                            <th></th>
                        </tr>
                        <?php
                        $row_count = 1;
                        if(@$videobtndata){
                            foreach($videobtndata as $v_btn)
                            {?>
                                <tr id="<?php echo $row_count;?>">
                                    <td class="curent_label"><input type="hidden"  id="allbuttons_label" name="allbuttons_label[]" value="<?php echo $v_btn->Label;?>"><label><?php echo $v_btn->Label;?></label></td>
                                    <td class="curent_icon"><input type="hidden" id="allbuttons_icon" name="allbuttons_icon[]" value="<?php echo $v_btn->Icon;?>"><img src="<?php echo $v_btn->Icon;?>"></td>
                                    <td class="curent_type"><input type="hidden" id="allbuttons_type" name="allbuttons_type[]" value="<?php echo $v_btn->Type;?>"><label><?php echo $v_btn->Type;?></label></td>
                                    <td class="curent_allfields"><input type="hidden" id="allbuttons_iframe" name="allbuttons_iframe[]" value="<?php echo $v_btn->IframeUrl;?>">
                                    <input type="hidden" id="allbuttons_mapaddrs" name="allbuttons_mapaddrs[]" value="<?php echo $v_btn->MapLocation;?>"><input type="hidden" id="allbuttons_htmlcode" name="allbuttons_htmlcode[]" value='<?php echo $v_btn->HtmlCode;?>'>
                                    <input type="hidden" id="allbuttons_postcat" name="allbuttons_postcat[]" value="<?php echo $v_btn->PostCategory;?>">
                                    <input type="hidden" id="allbuttons_postno" name="allbuttons_postno[]" value="<?php echo $v_btn->PostNo;?>">
                                    <input type="hidden" id="allbuttons_page" name="allbuttons_page[]" value="<?php echo $v_btn->Page;?>">
                                    <input type="hidden" id="allbuttons_related_video_url" name="allbuttons_related_video_url[]" value="<?php echo $v_btn->RelatedVideoUrls;?>">
                                    <input type="hidden" id="allbuttons_related_video_thumb" name="allbuttons_related_video_thumb[]" value="<?php echo $v_btn->RelatedVideoThumbs;?>">
                                    <a class="editbtn"><?php echo esc_html_e('Edit'); ?></a><a class="deletebtn"><?php echo esc_html_e('Delete'); ?></a></td>
                                </tr>
                                <?php
                                $row_count++;
                            }
                        }?>
                    </table>
                </div>

                <br style="clear:both;">
                <input type="hidden" name="save_action" value ="<?php echo esc_html_e('tab-4-content'); ?>"/>
                <input type="hidden" name="row_id" id="row_id" class="row_id" value="<?php echo $v_id?>"/>
                <input type="submit" id="videobutton4" class="videobutton1" data-att="tab-4" value="<?php echo esc_html_e('Save'); ?>" name="submit"/>
            </form>

        </div>

        <div id="tab-5" class="tab-content">
            <form action="" id="ajax-upload5" method="post" enctype="multipart/form-data" onsubmit="return checkmidTime();">
                <?php
                    if(!isset($v_PlayerSkin)){ $checker_cd='checker'; $checker='checked';}else{$checker='unchecked';}
                    if(@$v_PlayerSkin=='none'){$checker_cn='checker'; $checked='checked';}else{$checked='unchecked';}
                    if(@$v_PlayerSkin=='skin1'){$checker_c1='checker';$checked1='checked';}else{$checked1='unchecked';}
                    if(@$v_PlayerSkin=='skin2'){$checker_c2='checker';$checked2='checked';}else{$checked2='unchecked';}
                    if(@$v_PlayerSkin=='skin3'){$checker_c3='checker';$checked3='checked';}else{$checked3='unchecked';}
                    if(@$v_PlayerSkin=='skin4'){$checker_c4='checker';$checked4='checked';}else{$checked4='unchecked';}
                    if(@$v_PlayerSkin=='skin5'){$checker_c5='checker';$checked5='checked';}else{$checked5='unchecked';}
                    if(@$v_PlayerSkin=='skin6'){$checker_c6='checker';$checked6='checked';}else{$checked6='unchecked';}
                    if(@$v_PlayerSkin=='skin7'){$checker_c7='checker';$checked7='checked';}else{$checked7='unchecked';}
                    if(@$v_PlayerSkin=='skin8'){$checker_c8='checker';$checked8='checked';}else{$checked8='unchecked';}
                    if(@$v_PlayerSkin=='skin9'){$checker_c9='checker';$checked9='checked';}else{$checked9='unchecked';}
                    if(@$v_PlayerSkin=='skin10'){$checker_c10='checker';$checked10='checked';}else{$checked10='unchecked';}
                    if(@$v_PlayerSkin=='skin11'){$checker_c11='checker';$checked11='checked';}else{$checked11='unchecked';}
                    if(@$v_PlayerSkin=='skin12'){$checker_c12='checker';$checked12='checked';}else{$checked12='unchecked';}
                    if(@$v_PlayerSkin=='skin13'){$checker_c13='checker';$checked13='checked';}else{$checked13='unchecked';}
                    if(@$v_PlayerSkin=='skin14'){$checker_c14='checker';$checked14='checked';}else{$checked14='unchecked';}
                    if(@$v_PlayerSkin=='skin15'){$checker_c15='checker';$checked15='checked';}else{$checked15='unchecked';}
                    if(@$v_PlayerSkin=='skin16'){$checker_c16='checker';$checked16='checked';}else{$checked16='unchecked';}
                    if(@$v_PlayerSkin=='skin17'){$checker_c17='checker';$checked17='checked';}else{$checked17='unchecked';}
                    if(@$v_PlayerSkin=='skin18'){$checker_c18='checker';$checked18='checked';}else{$checked18='unchecked';}
                    if(@$v_PlayerSkin=='skin19'){$checker_c19='checker';$checked19='checked';}else{$checked19='unchecked';}
                    if(@$v_PlayerSkin=='skin20'){$checker_c20='checker';$checked20='checked';}else{$checked20='unchecked';}
                    if(@$v_PlayerSkin=='skin21'){$checker_c21='checker';$checked21='checked';}else{$checked21='unchecked';}
                    if(@$v_PlayerSkin=='skin22'){$checker_c22='checker';$checked22='checked';}else{$checked22='unchecked';}
                    if(@$v_PlayerSkin=='skin23'){$checker_c23='checker';$checked23='checked';}else{$checked23='unchecked';}
                    if(@$v_PlayerSkin=='skin24'){$checker_c24='checker';$checked24='checked';}else{$checked24='unchecked';}
                    if(@$v_PlayerSkin=='skin25'){$checker_c25='checker';$checked25='checked';}else{$checked25='unchecked';}
                ?>

                <span class="skin_span <?php echo @$checker_cn;?> <?php echo @$checker;?>"><label for="none"><img src="<?php echo MV_PLAYER_URL;?>/image/none.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="none" class="player_skin" name="player_skin" value="<?php echo esc_html_e('none'); ?>" <?php echo $checked;?> <?php echo $checker;?>></span>
                <span class="skin_span <?php echo @$checker_c1;?>"><label for="skin1"><img src="<?php echo MV_PLAYER_URL;?>/image/skin6/skin6.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin1" class="player_skin" name="player_skin" <?php echo @$checked1;?> value="<?php echo esc_html_e('skin1'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c2;?>"><label for="skin2"><img src="<?php echo MV_PLAYER_URL;?>/image/skin3/skin3.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin2" class="player_skin" name="player_skin" <?php echo @$checked2;?> value="<?php echo esc_html_e('skin2'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c3;?>"><label for="skin3"><img src="<?php echo MV_PLAYER_URL;?>/image/skin15/skin15.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin3" class="player_skin" name="player_skin" <?php echo @$checked3;?> value="<?php echo esc_html_e('skin3'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c4;?>"><label for="skin4"><img src="<?php echo MV_PLAYER_URL;?>/image/skin1/skin1.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin4" class="player_skin" name="player_skin" <?php echo @$checked4;?> value="<?php echo esc_html_e('skin4'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c5;?>"><label for="skin5"><img src="<?php echo MV_PLAYER_URL;?>/image/skin23/skin23.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin5" class="player_skin" name="player_skin" <?php echo @$checked5;?> value="<?php echo esc_html_e('skin5'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c6;?>"><label for="skin6"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin1/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin6" class="player_skin" name="player_skin" <?php echo @$checked6;?> value="<?php echo esc_html_e('skin6'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c7;?>"><label for="skin7"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin2/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin7" class="player_skin" name="player_skin" <?php echo @$checked7;?> value="<?php echo esc_html_e('skin7'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c8;?>"><label for="skin8"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin3/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin8" class="player_skin" name="player_skin" <?php echo @$checked8;?> value="<?php echo esc_html_e('skin8'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c9;?>"><label for="skin9"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin4/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin9" class="player_skin" name="player_skin" <?php echo @$checked9;?> value="<?php echo esc_html_e('skin9'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c10;?>"><label for="skin10"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin5/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin10" class="player_skin" name="player_skin" <?php echo @$checked10;?> value="<?php echo esc_html_e('skin10'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c11;?>"><label for="skin11"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin6/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin11" class="player_skin" name="player_skin" <?php echo @$checked11;?> value="<?php echo esc_html_e('skin11'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c12;?>"><label for="skin12"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin7/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin12" class="player_skin" name="player_skin" <?php echo @$checked12;?> value="<?php echo esc_html_e('skin12'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c13;?>"><label for="skin13"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin8/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin13" class="player_skin" name="player_skin" <?php echo @$checked13;?> value="<?php echo esc_html_e('skin13'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c14;?>"><label for="skin14"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin9/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin14" class="player_skin" name="player_skin" <?php echo @$checked14;?> value="<?php echo esc_html_e('skin14'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c15;?>"><label for="skin15"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin10/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin15" class="player_skin" name="player_skin" <?php echo @$checked15;?> value="<?php echo esc_html_e('skin15'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c16;?>"><label for="skin16"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin11/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin16" class="player_skin" name="player_skin" <?php echo @$checked16;?> value="<?php echo esc_html_e('skin16'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c17;?>"><label for="skin17"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin12/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin17" class="player_skin" name="player_skin" <?php echo @$checked17;?> value="<?php echo esc_html_e('skin17'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c18;?>"><label for="skin18"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin13/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin18" class="player_skin" name="player_skin" <?php echo @$checked18;?> value="<?php echo esc_html_e('skin18'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c19;?>"><label for="skin19"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin14/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin19" class="player_skin" name="player_skin" <?php echo @$checked19;?> value="<?php echo esc_html_e('skin19'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c20;?>"><label for="skin20"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin15/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin20" class="player_skin" name="player_skin" <?php echo @$checked20;?> value="<?php echo esc_html_e('skin20'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c21;?>"><label for="skin21"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin16/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin21" class="player_skin" name="player_skin" <?php echo @$checked21;?> value="<?php echo esc_html_e('skin21'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c22;?>"><label for="skin22"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin17/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin22" class="player_skin" name="player_skin" <?php echo @$checked22;?> value="<?php echo esc_html_e('skin22'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c23;?>"><label for="skin23"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin18/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin23" class="player_skin" name="player_skin" <?php echo @$checked23;?> value="<?php echo esc_html_e('skin23'); ?>"></span>
                <span class="skin_span <?php echo @$checker_c24;?>"><label for="skin24"><img src="<?php echo MV_PLAYER_URL;?>/image/newskin19/demo.png" style="height:100px;width: 100px;"></label>
                <input type="radio" id="skin24" class="player_skin" name="player_skin" <?php echo @$checked24;?> value="<?php echo esc_html_e('skin24'); ?>"></span>
                <script>
                    jQuery(document).ready(function($){
                        $('.skin_span').bind('click',function(){
                            $('.skin_span').removeClass('checker');
                            $(this).addClass('checker');
                        });
                    });
                </script>

            <input type="hidden" name="save_action" value ="<?php echo esc_html_e('tab-5-content'); ?>"/>
            <input type="hidden" name="row_id" id="row_id" class="row_id" value="<?php echo $v_id?>"/>
            <input type="submit" id="videobutton5" class="videobutton1 tab-5-content" data-att="tab-5" value="<?php echo esc_html_e('Save'); ?>" name="submit"/>
        </form>
    </div>
</div>
</div>
<script>
    jQuery(document).ready(function() {
        if('<?php echo $v_VideoSource;?>'=='mp4_video'){
            jQuery('.nrmlvideo_show').show();
        }
        else if('<?php echo $v_VideoSource;?>'=='youtube_video'){
            jQuery('.nrmlvideo_show').hide();
            jQuery('.youtubevideo_show').show();
        }
        else if('<?php echo $v_VideoSource;?>'=='vimeo_video'){
            jQuery('.nrmlvideo_show').hide();
            jQuery('.youtubevideo_show').hide();
            jQuery('.vimeovideo_show').show();
        }
    });

    jQuery(document).ready(function() {
        if('<?php echo $v_OptinBox;?>'=='yes'){
            jQuery('.optin_desc').show();
        }

        if('<?php echo $v_Popup;?>'=='yes'){
            jQuery('.popup_desc').show();
        }

        if('<?php echo $v_OptinLocation;?>'=='middle'){
            jQuery('.location-optin-span').show();
        }

        if('<?php echo $v_PopupLocation;?>'=='middle'){
            jQuery('.location-popup-span').show();
        }
    });

    function checkmidTime(){
        var valid1 =false;
        var valid2 =false;
        var valid3 =false;
        var valid4 =false;

        if(jQuery('#content_location_radio2').attr('checked')){
            var contentTime = jQuery('.location-content-span input').val();

            if(!contentTime || contentTime==''){
                jQuery('.location-content-span').css('border','1px solid red');
                valid1 =true;
            }else if(contentTime){
                jQuery('.location-content-span').css('border','');
                valid1 =false;
            }
        }

        if(jQuery('#socialbtn_location_radio2').attr('checked')){
            var contentTime = jQuery('.location-socialbtn-span input').val();

            if(!contentTime || contentTime==''){
                jQuery('.location-socialbtn-span').css('border','1px solid red');
                valid2 =true;
            }
            else if(contentTime)
            {
                jQuery('.location-socialbtn-span').css('border','');
                valid2 =false;
            }
        }

        if(jQuery('#optin_location_radio2').attr('checked')){
            var contentTime = jQuery('.location-optin-span input').val();

            if(!contentTime || contentTime==''){
                jQuery('.location-optin-span').css('border','1px solid red');
                valid3 =true;
            }
            else if(contentTime){
                jQuery('.location-optin-span').css('border','');
                valid3 = false;
            }
        }

        if(jQuery('#popup_location_radio2').attr('checked')){
            var contentTime = jQuery('.location-popup-span input').val();

            if(!contentTime || contentTime==''){
                jQuery('.location-popup-span').css('border','1px solid red');
                valid4 =true;
            }
            else if(contentTime){
                jQuery('.location-popup-span').css('border','');
                valid4 =false;
            }
        }

        if(valid1 || valid2 || valid3 || valid4){ return false;}
        else{ return true;}
    }

    jQuery(document).ready(function($){
        if(jQuery("#AWeberListID option:selected").attr('selected')){
            $('.authbtn').hide();
        }else{
            $('.authbtn').show();
        }

        $('#custom_icon_upload').click(function() {
            formfield = $('#btn_icon').attr('name');
            window.send_to_editor = function(html) {
                image_url = jQuery( 'img',html).attr('src');
                $('#btn_icon').val(image_url);
                tb_remove();
            }

            tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
            return false;
        });

        var row_count = Number('<?php echo $row_count;?>');
        var update_row_id = false;

        //remove related link
        $('#remove').on('click',function(){
            var remove_id = $(this).parents('tr').attr('class');
            $('.'+remove_id).remove();
            $('.'+remove_id+'s').remove();
        });

        $('#cancel_button').on('click',function(){
            $('#related_video_prop tr:not(:first)').remove();
            $('#current_rv_id').val(0);
            $('#related_video_prop').hide();
            $('#show2btn').hide();
            $('#show1btn').show();
            $('#button_label').val('');
            $('#btn_icon').val('');
            $('#all_btn_types').val('map').change();
            $('#ico_img_url a.dd-selected img').attr('src','<?php echo MV_PLAYER_URL;?>/image/btn_icon/Arrow-Right.png');
            $('#ico_img_url a.dd-selected .dd-selected-text').html('Arrow-Right');
            $('.cstm_img_upload').hide();
            $('#map_prop').hide();
            $('#iframe_prop').hide();
            $('#html_prop').hide();
            $('#iframe_url').val('');
            $('#map_address').val('');
            $('#html_code').val('');
            $('#postcat_prop').hide();
            $('#post_cat').val('--Select Category--').change();
            $('#post_no').val('');
            $('#page_prop').hide();
            $('#all_pages').val('--Select Page--').change();
        });

        $('#update_button').on('click',function(){
            console.log("page id: "+$('#all_pages').val());
            var btn_label = $('#button_label').val();
            var btn_type = $('#all_btn_types').val();
            var current_img_btn1 = $('#ico_img_url a.dd-selected label').text();
            var current_img_btn2 = $('#ico_img_url a.dd-selected img').attr('src');

            if(current_img_btn1=='Custom'){
                var btn_icon = $('#btn_icon').val();
            }
            else{
                var btn_icon = current_img_btn2;
            }

            if(btn_icon=='custom'){
                btn_icon = $('#btn_icon').val();
            }

            if(btn_type=='map'){
                var btn_iframe ='';
                var btn_mapaddrs = $('#map_address').val();
                var btn_htmlcode ='';
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = '';
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='iframe'){
                var btn_iframe = $('#iframe_url').val();
                var btn_mapaddrs = '';
                var btn_htmlcode = '';
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = '';
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='htmlcode'){
                var btn_iframe = '';
                var btn_mapaddrs = '';
                var btn_htmlcode = $('#html_code').val();
                btn_htmlcode =btn_htmlcode.replace("\'",'\"');
                btn_htmlcode =btn_htmlcode.replace("\'",'\"');
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = '';
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='post'){
                var btn_iframe = '';
                var btn_mapaddrs = '';
                var btn_htmlcode = '';
                var btn_postcat = $('#post_cat').val();
                var btn_postno = $('#post_no').val();
                var btn_page = '';
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='page'){
                var btn_iframe = '';
                var btn_mapaddrs = '';
                var btn_htmlcode = '';
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = $('#all_pages').val();
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='related_video'){
                var btn_iframe = '';
                var btn_mapaddrs = '';
                var btn_htmlcode = '';
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = '';
                var i=0;
                var j=0;
                var btn_related_video_url = new Array();
                $('.related_video_url').each(function(){
                   btn_related_video_url[i] = $(this).val();
                   i++;
                });

                var btn_related_video_thumb = new Array();

                $('.related_video_thumb').each(function(){
                   btn_related_video_thumb[j] = $(this).val();
                   j++;
                });
            }

            if(btn_label && btn_icon && btn_type){
                $('.showbtns').find('#'+update_row_id).find('.curent_label').find('#allbuttons_label').val(btn_label);
                $('.showbtns').find('#'+update_row_id).find('.curent_label label').text(btn_label);
                $('.showbtns').find('#'+update_row_id).find('.curent_icon').find('#allbuttons_icon').val(btn_icon);
                $('.showbtns').find('#'+update_row_id).find('.curent_icon').find('img').attr('src',btn_icon);
                $('.showbtns').find('#'+update_row_id).find('.curent_type').find('#allbuttons_type').val(btn_type);
                $('.showbtns').find('#'+update_row_id).find('.curent_type label').text(btn_type);
                $('.showbtns').find('#'+update_row_id).find('.curent_allfields').find('#allbuttons_iframe').val(btn_iframe);
                $('.showbtns').find('#'+update_row_id).find('.curent_allfields').find('#allbuttons_mapaddrs').val(btn_mapaddrs);
                $('.showbtns').find('#'+update_row_id).find('.curent_allfields').find('#allbuttons_htmlcode').val(btn_htmlcode);
                $('.showbtns').find('#'+update_row_id).find('.curent_allfields').find('#allbuttons_postcat').val(btn_postcat);
                $('.showbtns').find('#'+update_row_id).find('.curent_allfields').find('#allbuttons_postno').val(btn_postno);
                $('.showbtns').find('#'+update_row_id).find('.curent_allfields').find('#allbuttons_page').val(btn_page);
                $('.showbtns').find('#'+update_row_id).find('.curent_allfields').find('#allbuttons_related_video_url').val(btn_related_video_url);
                $('.showbtns').find('#'+update_row_id).find('.curent_allfields').find('#allbuttons_related_video_thumb').val(btn_related_video_thumb);
                $('#button_label').val('');
                $('#btn_icon').val('');
                $('#all_btn_types').val('map').change();

                if(current_img_btn1=='Custom'){
                    $('#ico_img_url a.dd-selected label').remove();
                    $('#ico_img_url a.dd-selected').append('<img class="dd-selected-image" src="<?php echo MV_PLAYER_URL;?>/image/btn_icon/Arrow-Right.png"><label class="dd-selected-text" style="line-height: 30px;">Arrow-Right</label>');
                }
                else{
                    $('#ico_img_url a.dd-selected img').attr('src','<?php echo MV_PLAYER_URL;?>/image/btn_icon/Arrow-Right.png');
                    $('#ico_img_url a.dd-selected .dd-selected-text').html('Arrow-Right');
                }

                $('.cstm_img_upload').hide();
                $('#map_prop').hide();
                $('#iframe_prop').hide();
                $('#html_prop').hide();
                $('#iframe_url').val('');
                $('#map_address').val('');
                $('#html_code').val('');
                $('#show2btn').hide();
                $('#show1btn').show();
                $('#postcat_prop').hide();
                $('#post_cat').val('--Select Category--').change();
                $('#post_no').val('');
                $('#page_prop').hide();
                $('#all_pages').val('--Select Page--').change();
                $('#related_video_prop tr:not(:first)').remove();
                $('#current_rv_id').val(0);
                $('#related_video_prop').hide();
            }
        });

        $('#create_button').on('click',function(){
            var btn_label = $('#button_label').val();
            var btn_type = $('#all_btn_types').val();
            var current_img_btn1 = $('#ico_img_url a.dd-selected label').text();
            var current_img_btn2 = $('#ico_img_url a.dd-selected img').attr('src');

            if(current_img_btn1=='Custom'){
                var btn_icon = $('#btn_icon').val();
            }else{
                var btn_icon = current_img_btn2;
            }

            if(btn_type=='map'){
                var btn_iframe ='';
                var btn_mapaddrs = $('#map_address').val();
                var btn_htmlcode ='';
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = '';
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='iframe'){
                var btn_iframe = $('#iframe_url').val();
                var btn_mapaddrs = '';
                var btn_htmlcode = '';
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = '';
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='htmlcode'){
                var btn_iframe = '';
                var btn_mapaddrs = '';
                var btn_htmlcode = $('#html_code').val();
                var new_btn_htmlcode=false;

                for(var j=0;j<=btn_htmlcode.length;j++){
                    if(j==0){
                        new_btn_htmlcode =btn_htmlcode[j];
                    }
                    else if(btn_htmlcode[j]=="'"){
                        new_btn_htmlcode = new_btn_htmlcode+'"';
                    }
                    else if(btn_htmlcode[j]){
                        new_btn_htmlcode = new_btn_htmlcode+btn_htmlcode[j];
                    }
                }

                new_btn_htmlcode=new_btn_htmlcode;
                btn_htmlcode = new_btn_htmlcode;
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = '';
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='post'){
                var btn_iframe = '';
                var btn_mapaddrs = '';
                var btn_htmlcode = '';
                var btn_postcat = $('#post_cat').val();
                var btn_postno = $('#post_no').val();
                var btn_page = '';
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='page'){
                var btn_iframe = '';
                var btn_mapaddrs = '';
                var btn_htmlcode = '';
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = $('#all_pages').val();
                var btn_related_video_url = '';
                var btn_related_video_thumb = '';
            }
            else if(btn_type=='related_video'){
                var btn_iframe = '';
                var btn_mapaddrs = '';
                var btn_htmlcode = '';
                var btn_postcat = '';
                var btn_postno = '';
                var btn_page = '';
                var i=0;
                var j=0;
                var btn_related_video_url = new Array();

                $('.related_video_url').each(function(){
                   btn_related_video_url[i] = $(this).val();
                   i++;
                });

                var btn_related_video_thumb = new Array();

                $('.related_video_thumb').each(function(){
                   btn_related_video_thumb[j] = $(this).val();
                   j++;
                });
            }

            if(btn_label && btn_icon && btn_type){
                if(btn_type == "related_video" && (btn_related_video_url.length > 0 && btn_related_video_thumb.length == 0) ){
                    Swal.fire({
                        title: "Error",
                        text: "Thumbnail is required for related videos button",
                        icon: "error"
                    });
                }else{
                    $('.showbtns').append('<tr id="'+row_count+'"><td class="curent_label"><input type="hidden" id="allbuttons_label" name="allbuttons_label[]" value="'+btn_label+'"><label>'+btn_label+'</label></td><td class="curent_icon"><input type="hidden" name="allbuttons_icon[]" value="'+btn_icon+'"><img src="'+btn_icon+'"></td><td class="curent_type"><input type="hidden" id="allbuttons_type" name="allbuttons_type[]" value="'+btn_type+'"><label>'+btn_type+'</label></td><td class="curent_allfields"><input type="hidden" id="allbuttons_iframe" name="allbuttons_iframe[]" value="'+btn_iframe+'"><input type="hidden" id="allbuttons_mapaddrs" name="allbuttons_mapaddrs[]" value="'+btn_mapaddrs+'"><input type="hidden" id="allbuttons_htmlcode" name="allbuttons_htmlcode[]" value=""><input type="hidden" id="allbuttons_postcat" name="allbuttons_postcat[]" value="'+btn_postcat+'"><input type="hidden" id="allbuttons_postno" name="allbuttons_postno[]" value="'+btn_postno+'"><input type="hidden" id="allbuttons_page" name="allbuttons_page[]" value="'+btn_page+'"><input type="hidden" id="allbuttons_related_video_url" name="allbuttons_related_video_url[]" value="'+btn_related_video_url+'"><input type="hidden" id="allbuttons_related_video_thumb" name="allbuttons_related_video_thumb[]" value="'+btn_related_video_thumb+'"><a class="editbtn"><?php echo esc_html_e('Edit'); ?></a><a class="deletebtn"><?php echo esc_html_e('Delete'); ?></a></td></tr>');
                }
            }

            $('.showbtns').find('#'+row_count).find('.curent_allfields').find('#allbuttons_htmlcode').val(btn_htmlcode);
            $('#button_label').val('');
            $('#btn_icon').val('');
            $('#all_btn_types').val('map').change();

            if(current_img_btn1=='Custom'){
                $('#ico_img_url a.dd-selected label').remove();
                $('#ico_img_url a.dd-selected').append('<img class="dd-selected-image" src="<?php echo MV_PLAYER_URL;?>/image/btn_icon/Arrow-Right.png"><label class="dd-selected-text" style="line-height: 30px;">Arrow-Right</label>');
            }
            else{
                $('#ico_img_url a.dd-selected img').attr('src','<?php echo MV_PLAYER_URL;?>/image/btn_icon/Arrow-Right.png');
                $('#ico_img_url a.dd-selected .dd-selected-text').html('Arrow-Right');
            }

            $('.cstm_img_upload').hide();
            $('#map_prop').hide();
            $('#iframe_prop').hide();
            $('#html_prop').hide();
            $('#iframe_url').val('');
            $('#map_address').val('');
            $('#html_code').val('');
            $('#postcat_prop').hide();
            $('#post_cat').val('--Select Category--').change();
            $('#post_no').val('');
            $('#page_prop').hide();
            $('#all_pages').val('--Select Page--').change();
            $('#related_video_prop tr:not(:first)').remove();
            $('#current_rv_id').val(0);
            $('#related_video_prop').hide();
            row_count++;
        });

        $(document).on("click","#remove",function(event) {
            var remove_id = $(this).parents('tr').attr('class');
            $('.'+remove_id).remove();
            $('.'+remove_id+'s').remove();
        });

        $(document).on("click",".add_thumb",function(event) {
            var current_id = $(this).attr('id');
            window.send_to_editor = function(html) {
                var myRegex = /<img[^>]+src="?([^"\s]+)"?\s*/gi;
                image_url = myRegex.exec(String(html));
                console.log("html",String(html));
                console.log("image_url",image_url[1]);
                $(".r_v_data"+current_id+"s").find('td:eq(1) img').remove();
                $(".r_v_data"+current_id+"s").children('td:eq(1)').prepend('<img src="'+image_url[1]+'" class="image-class"><input type="hidden"  class="related_video_thumb" name="related_video_thumb[]" value="'+image_url[1]+'">');
                tb_remove();

            }

            tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
            return false;
        });

        $(document).on("click",".deletebtn",function(event) {
            event.preventDefault();
            $(this).parent('td').parent('tr').remove();
        });

        //delete script
        $('.deletebtn').on('click',function(event){
            event.preventDefault();
             $(this).parent('td').parent('tr').remove();
        });

        //edit script
        $(document).on("click",".editbtn",function(event) {
            var btn_label = $('#button_label').val();
            var btn_icon = $('#btn_icon').val();
            var btn_type = $('#all_btn_types').val();

            if(!btn_label && !btn_icon){
                update_row_id = $(this).parent('td.curent_allfields').parent('tr').attr('id');
                var curent_label = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_label').find('#allbuttons_label').val();
                var curent_icon = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_icon').find('img').attr('src');
                var curent_type = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_type').find('#allbuttons_type').val();
                var curent_iframe = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_allfields').find('#allbuttons_iframe').val();
                var curent_mapaddrs = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_allfields').find('#allbuttons_mapaddrs').val();
                var curent_htmlcode = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_allfields').find('#allbuttons_htmlcode').val();
                var curent_postcat = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_allfields').find('#allbuttons_postcat').val();
                var curent_postno = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_allfields').find('#allbuttons_postno').val();
                var curent_page = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_allfields').find('#allbuttons_page').val();
                var btn_related_video_url = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_allfields').find('#allbuttons_related_video_url').val();
                var btn_related_video_thumb = $(this).parent('td.curent_allfields').parent('tr#'+update_row_id).children('.curent_allfields').find('#allbuttons_related_video_thumb').val();

                $('#show1btn').hide();
                $('#show2btn').show();
                $('#button_label').val(curent_label);
                $('#all_btn_types').val(curent_type).change();
                var aaa=false;
                var aaa2=false;
                var btn_name_array = new Array();
                btn_name_array =['Arrow-Right','Cart','Mail-1','Map','YouTube2','cart2','click','coupon','download','download2','facebook','facebook2','faq','faq2','internet_icon','internet2','map2','sale','shopping_cart','webpage','youtube'];

                for(var i=0;i<btn_name_array.length;i++){
                    if(curent_icon=='<?php echo MV_PLAYER_URL;?>image/btn_icon/'+btn_name_array[i]+'.png'){
                        aaa=true;
                        aaa2=btn_name_array[i];
                    }
                }

                if(aaa){
                    $('#ico_img_url a.dd-selected img').attr('src',curent_icon);
                    $('#ico_img_url a.dd-selected .dd-selected-text').html(aaa2);
                }else{
                    $('.cstm_img_upload').show();
                    $('#btn_icon').val(curent_icon);
                    $('#ico_img_url a.dd-selected img').remove();
                    $('#ico_img_url a.dd-selected .dd-selected-text').html('Custom');
                }

                if(curent_type=='iframe'){
                    $('#page_prop').hide();
                    $('#postcat_prop').hide();
                    $('#related_video_prop').hide();
                    $('#map_prop').hide();
                    $('#html_prop').hide();
                    $('#iframe_prop').show();
                    $('#iframe_url').val(curent_iframe);
                }else if(curent_type=='map'){
                    $('#page_prop').hide();
                    $('#postcat_prop').hide();
                    $('#related_video_prop').hide();
                    $('#iframe_prop').hide();
                    $('#html_prop').hide();
                    $('#map_prop').show();
                    $('#map_address').val(curent_mapaddrs);
                }else if(curent_type=='htmlcode'){
                    $('#page_prop').hide();
                    $('#postcat_prop').hide();
                    $('#related_video_prop').hide();
                    $('#iframe_prop').hide();
                    $('#map_prop').hide();
                    $('#html_prop').show();
                    $('#html_code').val(curent_htmlcode);
                }else if(curent_type=='post'){
                    $('#page_prop').hide();
                    $('#html_prop').hide();
                    $('#related_video_prop').hide();
                    $('#iframe_prop').hide();
                    $('#map_prop').hide();
                    $('#postcat_prop').show();
                    $('#post_cat').val(curent_postcat).change();
                    $('#post_no').val(curent_postno);
                }else if(curent_type=='page'){
                    $('#html_prop').hide();
                    $('#related_video_prop').hide();
                    $('#iframe_prop').hide();
                    $('#map_prop').hide();
                    $('#postcat_prop').hide();
                    $('#page_prop').show();
                    $('#all_pages').val(curent_page).change();
                }else if(curent_type=='related_video'){
                    $('#html_prop').hide();
                    $('#page_prop').hide();
                    $('#iframe_prop').hide();
                    $('#map_prop').hide();
                    $('#postcat_prop').hide();
                    $('#related_video_prop').show();

                    var btn_related_video_urlarray = btn_related_video_url.split(",");
                    var btn_related_video_thumbarray = btn_related_video_thumb.split(",");

                    for(var a=0;a<btn_related_video_urlarray.length;a++){
                        var btn_related_video_thumb = '';

                        if(btn_related_video_thumbarray[a]){
                            btn_related_video_thumb = '<img src="'+btn_related_video_thumbarray[a]+'" class="image-class">';
                        }

                        $('#related_video_prop').append('<tr class="r_v_data'+a+'"><td>Url:</td><td><input type="text" class="related_video_url" name="related_video_url[]" value="'+btn_related_video_urlarray[a]+'"><a id="remove"><?php echo esc_html_e('Remove'); ?></a></td></tr><tr class="r_v_data'+a+'s"><td><?php echo esc_html_e('Video Thumbnail:'); ?></td><td>'+btn_related_video_thumb+'<input type="hidden"  class="related_video_thumb" name="related_video_thumb[]" value="'+btn_related_video_thumbarray[a]+'"><a id="'+a+'" class="add_thumb"><?php echo esc_html_e('Select Thumb'); ?></a></td></tr>');
                    }

                    $('#current_rv_id').val(a);
                }
            }else{
                var existing_button = '<?php echo __( 'Please Update or Cancel existing button.', 'mvp' ) ?>';
                Swal.fire(existing_button);
            }
        });
    });
</script>