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/add_playlist.php
<?php
if (!defined('ABSPATH')) {
    exit;
}

global $wpdb;

// Define Playlist Table
$playlist_table = $wpdb->prefix . "playlist_video";

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['Playlist_Id'])) {
    global $wpdb;
    $status = "";
    $Playlist_Id = $_GET['Playlist_Id'];
    $videobuttons_table = $wpdb->prefix . "mvplayer_videobuttons";
    $videobtndata = $wpdb->get_results("SELECT * FROM $videobuttons_table where PlaylistId= $Playlist_Id");

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

    //  Get Playlist Detail
    $playlist_detail = $wpdb->get_results("SELECT * FROM $playlist_table where Playlist_Id = $Playlist_Id");

    if ($playlist_detail) {
        $v_ImageLogo = $playlist_detail[0]->ImageLogo;
        $v_VideoWidth = $playlist_detail[0]->VideoWidth;
        $v_VideoHeight = $playlist_detail[0]->VideoHeight;
        $v_AutoPlay = $playlist_detail[0]->AutoPlay;
        $v_AllowPause = $playlist_detail[0]->AllowPause;
        $v_VideoControls = $playlist_detail[0]->VideoControls;
        $v_VideoAlign = $playlist_detail[0]->VideoAlign;
        $v_ShowContentLoc = $playlist_detail[0]->ShowContentLocation;
        $v_ShowContentDur = $playlist_detail[0]->ShowContentDuration;
        $v_Content = $playlist_detail[0]->VideoContent;
        $v_SocialBtnLoc = $playlist_detail[0]->SocialButtonLocation;
        $v_SocialLockDuration = $playlist_detail[0]->SocialLockDuration;
        $v_SocialEnable = $playlist_detail[0]->SocialEnable;
        $v_SocialTitle = $playlist_detail[0]->SocialTitle;
        $v_SocialText = $playlist_detail[0]->SocialText;
        $v_DefaultTweet = $playlist_detail[0]->DefaultTweet;
        $v_HeadlineMsg = $playlist_detail[0]->HeadlineMsg;
        $v_ShareUrl = $playlist_detail[0]->ShareUrl;
        $v_CustomUrl = $playlist_detail[0]->CustomUrl;
        $v_OptinBox = $playlist_detail[0]->OptinBox;
        $v_OptinLocation = $playlist_detail[0]->OptinLocation;
        $v_OptinMidTime = $playlist_detail[0]->OptinMidTime;
        $v_OptinHeadline = $playlist_detail[0]->OptinHeadline;
        $v_OptinText = $playlist_detail[0]->OptinText;
        $v_OptinSubmitText = $playlist_detail[0]->OptinSubmitText;
        $v_ThankyouMessage = $playlist_detail[0]->ThankyouMessage;
        $v_OptinAllowSkip = $playlist_detail[0]->OptinAllowSkip;
        $v_SocialLockAllowSkip = $playlist_detail[0]->SocialLockAllowSkip;
        $v_Popup = $playlist_detail[0]->Popup;
        $v_PopupContent = $playlist_detail[0]->PopupContent;
        $v_PopupLink = $playlist_detail[0]->PopupLink;
        $v_PopupLocation = $playlist_detail[0]->PopupLocation;
        $v_PopupMidTime = $playlist_detail[0]->PopupMidTime;
        $v_VideoMailingList = $playlist_detail[0]->VideoMailingList;
        $custom_formcode = $playlist_detail[0]->custom_formcode;
        $v_MailChimpApiKey = $playlist_detail[0]->MailChimpApiKey;
        $v_MailChimpListId = $playlist_detail[0]->MailChimpListId;
        $v_GetResponseApiKey = $playlist_detail[0]->GetResponseApiKey;
        $v_GetResponseCampaignId = $playlist_detail[0]->GetResponseCampaignId;
        $v_AWeberListID = $playlist_detail[0]->AWeberListID;
        $v_AWeberAccessTokens = $playlist_detail[0]->AWeberAccessTokens;
        $v_ConstCntctUserName = $playlist_detail[0]->ConstCntctUserName;
        $v_ConstCntctAPIKey = $playlist_detail[0]->ConstCntctAPIKey;
        $v_ConstCntctSecret = $playlist_detail[0]->ConstCntctSecret;
        $v_ConstCntctListID = $playlist_detail[0]->ConstCntctListID;
        $v_SendlaneApiKey = $playlist_detail[0]->SendlaneApiKey;
        $v_SendlaneApiHashKey = $playlist_detail[0]->SendlaneApiHashKey;
        $v_SendlaneApiUrl = $playlist_detail[0]->SendlaneApiUrl;
        $v_SendlaneSubDomain = $playlist_detail[0]->SendlaneSubDomain;
        $v_SendlaneListID = $playlist_detail[0]->SendlaneListID;
        $v_PlayerSkin = $playlist_detail[0]->PlayerSkin;

        foreach ($playlist_detail as $playlist) {
            $v_id = $Playlist_Id;
            $v_Title = $playlist->Title;
            $v_Option = $playlist->VideoOption;
            $v_Video = json_decode($playlist->Video);
            $v_VideoSource = $playlist->VideoSource;
        }
    } else {
        $v_id = '';
        $v_Title = '';
        $v_Option = '';
        $v_Video = '';
        $v_VideoSource = '';
        $v_ImageLogo = '';
        $v_VideoWidth = '';
        $v_VideoHeight = '';
        $v_AutoPlay = '';
        $v_AllowPause = '';
        $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 = '';
    }?>

        <script>
            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();
                }
            });

        </script>
        <?php
} else {
    $v_id = '';
    $v_Title = '';
    $v_Option = '';
    $v_Video = '';
    $v_VideoSource = '';
    $v_ImageLogo = '';
    $v_VideoWidth = '';
    $v_VideoHeight = '';
    $v_AutoPlay = '';
    $v_AllowPause = '';
    $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_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 = '';
}

?>

<div class="wrap">
    <div id="icon-edit" class="icon32"><br/></div>
    <?php
if (@$v_id) {
    echo '<h2>' . __('Update Video', 'mvp') . '</h2>';
} else {
    echo '<h2>' . __('Add Video in Playlist', 'mvp') . '</h2>';
}
?>
</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', 'mvp'); ?></li>
            <li class="tab-link" <?php echo $status; ?> data-tab="tab-4"><?php echo esc_html_e('Buttons', 'mvp'); ?></li>
            <li class="tab-link" <?php echo $status; ?> data-tab="tab-5"><?php echo esc_html_e('Skins', 'mvp'); ?></li>
        </ul>

        <div id="tab-1" class="tab-content current">
            <form id="playlist-ajax-upload" method="post" enctype="multipart/form-data" onsubmit="return checkmidTime();">
                <table class="video-opt">
                    <tr>
                        <td width="150px;"><?php echo esc_html_e('Video Title:', 'mvp'); ?></td>
                        <td><input type="text" name="title" value="<?php echo @$v_Title; ?>" required/></td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Video option:', 'mvp'); ?></td>
                        <td>
                            <?php
if (@$v_Option) {?>
                                    <label for="video_option_radio1" <?php if ($v_Option == 'one_video') {echo 'class="video_option-enable selected"';} else {echo 'class="video_option-enable"';}?>><span><?php echo esc_html_e('One Video', 'mvp'); ?></span></label>
                                    <label for="video_option_radio2" <?php if ($v_Option == 'all_videos') {echo 'class="video_option-disable selected"';} else {echo 'class="video_option-disable"';}?>><span><?php echo esc_html_e('All Videos', 'mvp'); ?></span></label>
                                    <input type="radio" id="video_option_radio1" name="video_option" <?php if ($v_Option == 'one_video') {echo 'checked';}?> value="one_video"/>
                                    <input type="radio" id="video_option_radio2" name="video_option" <?php if ($v_Option == 'all_videos') {echo 'checked';}?> value="all_videos" />
                                    <?php
} else {?>
                                    <label for="video_option_radio1" class="video_option-enable"><span><?php echo esc_html_e('One Video', 'mvp'); ?></span></label>
                                    <label for="video_option_radio2" class="video_option-disable selected"><span><?php echo esc_html_e('All Videos', 'mvp'); ?></span></label>
                                    <input type="radio" id="video_option_radio1" name="video_option" value="one_video"/>
                                    <input type="radio" id="video_option_radio2" name="video_option"  checked value="all_videos"/>
                                <?php }
?>
                        </td>
                    </tr>

                    <tr class="repeater" <?php if ($v_Option == 'one_video') {?>style="display:none"<?php }?>>
                        <td colspan="2" data-repeater-list="category-group">
                            <input data-repeater-create type="button" class="add-more-videos" value="Add More Videos"/>
                                <?php
global $wpdb;
$playlist_table = $wpdb->prefix . "playlist_video";
$Playlist_Id = (isset($_GET['Playlist_Id'])) ? $_GET['Playlist_Id'] : 0;
$playlist_detail = $wpdb->get_results("SELECT * FROM $playlist_table where Playlist_Id = $Playlist_Id");

if ($playlist_detail) {
    foreach ($playlist_detail as $data) {
        $v_Videos = json_decode($data->Video);
        foreach ($v_Videos as $v_Video) {
            if ($v_Video->video_source == 'youtube_video') {
                $youtube_section = '';
                $mp4_section = 'style="display:none"';
                $vimeo_section = 'style="display:none"';
            } else if ($v_Video->video_source == '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 = '';
            }
            ?>

                                            <table data-repeater-item>
                                                <tr class="add-row-playlist">
                                                    <td width="150px;"><?php echo esc_html_e('Choose Your Video Source:', 'mvp'); ?></td>
                                                    <td>
                                                        <div class="video_source">
                                                            <label <?php if ($v_Video->video_source == 'youtube_video') {echo 'class="custom-control custom-radio custom-control-inline video_source-disable2"';} else {echo 'class="custom-control custom-radio custom-control-inline video_source-disable2"';}?> >
                                                                <input type="radio" name="video_source" <?php if ($v_Video->video_source == 'youtube_video') {echo 'checked';}?> class="custom-control-input" value="youtube_video">
                                                                <span class="custom-control-label"><?php echo esc_html_e('YouTube Video', 'mvp'); ?></span>
                                                            </label>
                                                            <label <?php if ($v_Video->video_source == 'mp4_video') {echo 'class="custom-control custom-radio custom-control-inline video_source-enable"';} else {echo 'class="custom-control custom-radio custom-control-inline video_source-enable"';}?> >
                                                                <input type="radio" name="video_source" <?php if ($v_Video->video_source == 'mp4_video') {echo 'checked';}?> class="custom-control-input" value="mp4_video">
                                                                <span class="custom-control-label"><?php echo esc_html_e('Upload Video', 'mvp'); ?></span>
                                                            </label>

                                                            <label <?php if ($v_Video->video_source == 'vimeo_video') {echo 'class="custom-control custom-radio custom-control-inline video_source-disable3"';} else {echo 'class="custom-control custom-radio custom-control-inline video_source-disable3"';}?> >
                                                                <input type="radio" name="video_source" <?php if ($v_Video->video_source == 'vimeo_video') {echo 'checked';}?> class="custom-control-input" value="vimeo_video">
                                                                <span class="custom-control-label"><?php echo esc_html_e('Vimeo Video', 'mvp'); ?></span>
                                                            </label>
                                                        </div>
                                                        <br><br><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', 'mvp'); ?></span>
                                                    </td>
                                                </tr>
                                                <tr class="add-row-playlist">
                                                    <td><?php echo esc_html_e('Video Url/Link:', 'mvp'); ?></td>
                                                    <td>
                                                        <div class="youtubevideo_show" <?php echo $youtube_section; ?>>
                                                            <input type="text" name="filename2" value="<?php if ($v_Video->video_source == 'youtube_video') {echo $v_Video->filename2;}?>"/>
                                                        </div>

                                                        <div class="nrmlvideo_show" <?php echo $mp4_section; ?>>
                                                            <input type="text" name="filename" class="filename" value="<?php if ($v_Video->video_source == 'mp4_video') {echo $v_Video->filename;}?>"/>
                                                            <input type="button" class="videobutton custom_media_upload" value="Upload Video">
                                                        </div>

                                                        <div class="vimeovideo_show" <?php echo $vimeo_section; ?>>
                                                            <input type="text" name="filename3" value="<?php if ($v_Video->video_source == 'vimeo_video') {echo $v_Video->filename3;}?>"/>
                                                        </div>

                                                        <br><span class="description"><?php echo esc_html_e('Once you have your video link simply copy and paste it on the Video URL Section.', 'mvp'); ?></span>
                                                    </td>
                                                </tr>
                                            </table>
                                        <?php
}
    }
    ?>

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

                                        jQuery(document).ready(function() {
                                            jQuery('.custom_media_upload').click(function() {
                                                var customthis = jQuery(this);
                                                o_editor = window.send_to_editor;
                                                formfield = jQuery(this).prev('.filename').attr('name');

                                                window.send_to_editor = function(html) {
                                                    url = jQuery(html).attr('href');
                                                    jQuery(customthis).prev('input').val(url);
                                                    window.send_to_editor = o_editor;
                                                    tb_remove();
                                                }

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

                                    </script>
                                    <?php
} else {?>
                                        <table data-repeater-item>
                                            <tr class="add-row-playlist">
                                                <td width="150px;"><?php echo esc_html_e('Choose Your Video Source:', 'mvp'); ?></td>
                                                <td>
                                                    <div class="video_source">
                                                        <label class="custom-control custom-radio custom-control-inline video_source-enable">
                                                            <input type="radio" name="video_source" class="custom-control-input" checked value="mp4_video">
                                                            <span class="custom-control-label"><?php echo esc_html_e('Upload Video', 'mvp'); ?></span>
                                                        </label>
                                                        <label class="custom-control custom-radio custom-control-inline video_source-disable2">
                                                            <input type="radio" name="video_source" class="custom-control-input" value="youtube_video">
                                                            <span class="custom-control-label"><?php echo esc_html_e('YouTube Video', 'mvp'); ?></span>
                                                        </label>

                                                        <label class="custom-control custom-radio custom-control-inline video_source-disable3">
                                                            <input type="radio" name="video_source" class="custom-control-input" value="vimeo_video">
                                                            <span class="custom-control-label"><?php echo esc_html_e('Vimeo Video', 'mvp'); ?></span>
                                                        </label>
                                                    </div>
                                                    <br><br><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 ', 'mvp'); ?></span>
                                                </td>
                                            </tr>

                                            <tr class="add-row-playlist">
                                                <td><?php echo esc_html_e('Video Url/Link:', 'mvp'); ?></td>
                                                <td>
                                                    <div class="nrmlvideo_show">
                                                        <input type="text" name="filename" class="filename"/>
                                                        <input type="button" class="videobutton custom_media_upload" value="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>
                                                    <br><span class="description"><?php echo esc_html_e('Once you have your video link simply copy and paste it on the Video URL Section.', 'mvp'); ?></span>
                                                </td>

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

                                                    jQuery(document).ready(function() {
                                                        jQuery('.custom_media_upload').click(function() {
                                                            var customthis = jQuery(this);
                                                            o_editor = window.send_to_editor;
                                                            formfield = jQuery(this).prev('.filename').attr('name');

                                                            window.send_to_editor = function(html) {
                                                                url = jQuery(html).attr('href');
                                                                jQuery(customthis).prev('.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>
                                        </table>
                                    <?php }
?>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Choose Video Overlay Image:', 'mvp'); ?></td>
                        <td>
                        <?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="playlistremoveUnique"><i class="fa fa-trash"></i></span>
                                        <br><span class="description"><?php echo esc_html_e('Make Sure The Image Size Matches the Dimension Of The Video', 'mvp'); ?></span>
                                    </div>
                                <?php }
?>
                            <script>
                                jQuery(document).ready(function() {
                                    jQuery("input[type='file']").uniform();
                                });
                            </script>
                            <br><span class="description"><?php echo esc_html_e('This is your Overlay Image URL, If you would like to have an image on your video, so that once the page loads and your video is not on AutoPlay this image will be displayed!', 'mvp'); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Video Dimensions:', 'mvp'); ?></td>
                        <td>
                            <div>
                                <input type="number" name="videowidth" value="<?php echo @$v_VideoWidth; ?>" style="width:65px;" min="300" max="1200" required/><label class="video-width"><?php echo esc_html_e('Width', 'mvp'); ?></label>
                                &nbsp;&nbsp;&nbsp;&nbsp;<input type="number" name="videoheight" value="<?php echo @$v_VideoHeight; ?>" style="width:65px;" min="275" required/><label class="video-height"><?php echo esc_html_e('Height', 'mvp'); ?></label>
                            </div>
                            <br><span class="description"><?php echo esc_html_e('Select Your Video dimensions.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 ', 'mvp'); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Autoplay:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></span></label>
                                    <input type="radio" id="autoplay_radio1" name="autoplay" <?php if ($v_AutoPlay == 'yes') {echo 'checked';}?> value="yes"/>
                                    <input type="radio" id="autoplay_radio2" name="autoplay" <?php if ($v_AutoPlay == 'no') {echo 'checked';}?> value="no" />
                                    <?php
} else {?>
                                    <label for="autoplay_radio1" class="autoplay-enable"><span><?php echo esc_html_e('YES', 'mvp'); ?></span></label>
                                    <label for="autoplay_radio2" class="autoplay-disable selected"><span><?php echo esc_html_e('NO', 'mvp'); ?></span></label>
                                    <input type="radio" id="autoplay_radio1" name="autoplay" value="yes"/>
                                    <input type="radio" id="autoplay_radio2" name="autoplay"  checked value="no"/>
                                <?php }
?>

                            <br><br><span class="description"><?php echo esc_html_e('Choose Yes IF you would like your Video To start playing once the page loads.', 'mvp'); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Allow Pause:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></span></label>
                                    <input type="radio" id="allowpause_radio1" name="allowpause" <?php if ($v_AllowPause == 'yes') {echo 'checked';}?> value="yes"/>
                                    <input type="radio" id="allowpause_radio2" name="allowpause" <?php if ($v_AllowPause == 'no') {echo 'checked';}?> value="no"/>
                                <?php } else {?>
                                    <label for="allowpause_radio1" class="allowpause-enable"><span><?php echo esc_html_e('YES', 'mvp'); ?></span></label>
                                    <label for="allowpause_radio2" class="allowpause-disable selected"><span><?php echo esc_html_e('NO', 'mvp'); ?></span></label>
                                    <input type="radio" id="allowpause_radio1" name="allowpause" value="yes"/>
                                    <input type="radio" id="allowpause_radio2" name="allowpause" checked value="no"/>
                                <?php }
?>

                            <br><br><span class="description"><?php echo esc_html_e('Choose Yes IF you would like to allow your visitor to PAUSE the video.', 'mvp'); ?></span>
                        </td>
                    </tr>
                    <tr class='allow-control'>
                        <td><?php echo esc_html_e('Video Controls:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></span></label>
                                <input type="radio" id="videocontrols_radio1" name="videocontrols" <?php if ($v_VideoControls == 'show') {echo 'checked';}?> value="show"/>
                                <input type="radio" id="videocontrols_radio2" name="videocontrols" <?php if ($v_VideoControls == 'hide') {echo 'checked';}?> value="hide"/>
                                <?php
} else {?>
                                <label for="videocontrols_radio1" class="videocontrols-enable selected"><span><?php echo esc_html_e('Show', 'mvp'); ?></span></label>
                                <label for="videocontrols_radio2" class="videocontrols-disable"><span><?php echo esc_html_e('Hide', 'mvp'); ?></span></label>
                                <input type="radio" id="videocontrols_radio1" name="videocontrols" checked value="show"/>
                                <input type="radio" id="videocontrols_radio2" name="videocontrols" value="hide"/>
                                <?php
}?>

                            <br><br><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 Show and the video controls will be hidden.', 'mvp'); ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Video Alignment:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></span></label>
                                    <input type="radio" id="video_align_radio1" name="video_align" <?php if ($v_VideoAlign == 'left') {echo 'checked';}?> value="left"/>
                                    <input type="radio" id="video_align_radio2" name="video_align" <?php if ($v_VideoAlign == 'center') {echo 'checked';}?> value="center"/>
                                    <input type="radio" id="video_align_radio3" name="video_align" <?php if ($v_VideoAlign == 'right') {echo 'checked';}?> value="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', 'mvp'); ?></span></label>
                                    <label for="video_align_radio2" class="video_align-disable2"><span><?php echo esc_html_e('Center', 'mvp'); ?></span></label>
                                    <label for="video_align_radio3" class="video_align-disable"><span><?php echo esc_html_e('Right', 'mvp'); ?></span></label>
                                    <input type="radio" id="video_align_radio1" name="video_align" checked value="left"/>
                                    <input type="radio" id="video_align_radio2" name="video_align" value="center"/>
                                    <input type="radio" id="video_align_radio3" name="video_align" value="right"/>
                                </div>
                                <?php
}?>
                            <br><br><span class="description"><?php echo esc_html_e('Choose where you would like the video to be positioned.', 'mvp'); ?></span>
                        </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', 'mvp'); ?>" name="submit"/>
            </form>
        </div>

        <div id="tab-2" class="tab-content">
            <form action="" id="playlist-ajax-upload2" method="post" enctype="multipart/form-data" onsubmit="return checkmidTime();">
                <h2><?php echo esc_html_e('Autoresponder List', 'mvp'); ?></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', 'mvp'); ?></h2>
                            <p><?php echo esc_html_e('Please fill out the following detail and save it.', 'mvp'); ?></p>
                            <table class="mailchimp-table">
                                <tr>
                                    <td width="150px;"><?php echo esc_html_e('Enter API Key:', 'mvp'); ?></td>
                                    <td>
                                        <input type="text" name="mailchimpapikey" value="<?php echo @$v_MailChimpApiKey; ?>"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo esc_html_e('Enter List ID:', 'mvp'); ?></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', 'mvp'); ?></h2>
                            <p><?php echo esc_html_e('Please fill out the following detail and save it.', 'mvp'); ?></p>
                            <table class="getresponse-table">
                                <tr>
                                    <td width="150px;"><?php echo esc_html_e('Enter API Key:', 'mvp'); ?></td>
                                    <td>
                                        <input type="text" name="getresponseapikey" value="<?php echo @$v_GetResponseApiKey; ?>"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo esc_html_e('Enter Campaign ID:', 'mvp'); ?></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', 'mvp'); ?></h2>
                            <p><?php echo esc_html_e('Please fill out the following detail and save it', 'mvp'); ?></p>
                            <table class="aweber-table">
                                <tr>
                                    <td width="150px;"><?php echo esc_html_e('Select List', 'mvp'); ?></td>
                                    <td>
                                        <?php
/* Fetch available lists in user section. */
$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--', 'mvp'); ?></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 __('Something went wrong, Please reauthorize the application.', 'mvp');
}
?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td>
                                        <a class="authbtn" href="<?php echo MV_PLAYER_URL . 'includes/aweber_api/request-access-playlist.php?request-access=1&vid=' . @$v_id; ?>"><?php echo esc_html_e('Authorise Application', 'mvp'); ?></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', 'mvp'); ?></h2>
                            <p><?php echo esc_html_e('Please fill out the following detail and save it.', 'mvp'); ?></p>

                            <table class="sendlane-table">
                                <tr>
                                    <td width="150px;"><?php echo esc_html_e('Enter API Key:', 'mvp'); ?></td>
                                    <td>
                                        <input type="text" name="sendlaneapikey" value="<?php echo @$v_SendlaneApiKey; ?>"/>
                                    </td>
                                    <td><?php echo esc_html_e('Enter API Hash Key:', 'mvp'); ?></td>
                                    <td>
                                        <input type="text" name="sendlaneapihashkey" value="<?php echo @$v_SendlaneApiHashKey; ?>">
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo esc_html_e('Enter API URL:', 'mvp'); ?></td>
                                    <td>
                                        <input type="text" name="sendlaneapiurl" value="<?php echo @$v_SendlaneApiUrl; ?>">
                                    </td>
                                    <td><?php echo esc_html_e('Enter Sendlane Subdomain', 'mvp'); ?></td>
                                    <td>
                                        <input type="text" name="sendlanesubdomain" value="<?php echo @$v_SendlaneSubDomain; ?>">
                                    </td>
                                </tr>
                                <tr>
                                    <td><?php echo esc_html_e('Enter List ID:', 'mvp'); ?></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', 'mvp'); ?></h2>
                            <p><?php echo esc_html_e('Please fill out the following detail and save it.', 'mvp'); ?></p>
                            <table class="formcode-table">
                                <tr>
                                    <td width="150px" valign="top"><?php echo esc_html_e('Enter Form code:', 'mvp'); ?></td>
                                    <td>
                                        <textarea name="custom_formcode"><?php echo @$custom_formcode; ?></textarea>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div> <!-- END tabs-content -->

                    <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', 'mvp'); ?>" name="submit"/>
            </form>
        </div>

        <div id="tab-3" class="tab-content">
            <form action="" id="playlist-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:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></span></label>
                                <input type="radio" id="inc_optin_radio1" name="inc_optin" <?php if ($v_OptinBox == 'yes') {echo 'checked';}?> value="yes"/>
                                <input type="radio" id="inc_optin_radio2" name="inc_optin" <?php if ($v_OptinBox == 'no') {echo 'checked';}?> value="no"/>
                                <?php
} else {?>
                                <label for="inc_optin_radio1" class="inc_optin-enable"><span><?php echo esc_html_e('YES', 'mvp'); ?></span></label>
                                <label for="inc_optin_radio2" class="inc_optin-disable selected"><span><?php echo esc_html_e('NO', 'mvp'); ?></span></label>
                                <input type="radio" id="inc_optin_radio1" name="inc_optin" value="yes"/>
                                <input type="radio" id="inc_optin_radio2" name="inc_optin"  checked value="no"/>
                                <?php
}?>
                        </td>
                    </tr>
                </table>
                <div class="optin_desc">
                    <table>
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Select Autoresponder:', 'mvp'); ?></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="mailchimp" <?php echo $selected1; ?>><?php echo esc_html_e('MailChimp', 'mvp'); ?></option>
                                        <option value="getresponse" <?php echo $selected2; ?>><?php echo esc_html_e('GetResponse', 'mvp'); ?></option>
                                        <option value="aweber" <?php echo $selected3; ?>><?php echo esc_html_e('AWeber', 'mvp'); ?></option>
                                        <option value="sendlane" <?php echo $selected5; ?>><?php echo esc_html_e('SendLane', 'mvp'); ?></option>
                                        <option value="form_optin" <?php echo @$selected7; ?>><?php echo esc_html_e('Form code', 'mvp'); ?></option>
                                </select>
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Set Optin Reveal Timer:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></span></label>
                                        <input type="radio" id="optin_location_radio1" name="optin_location" <?php if ($v_OptinLocation == 'beginning') {echo 'checked';}?> value="beginning"/>
                                        <input type="radio" id="optin_location_radio2" name="optin_location" <?php if ($v_OptinLocation == 'middle') {echo 'checked';}?> value="middle"/>
                                        <input type="radio" id="optin_location_radio3" name="optin_location" <?php if ($v_OptinLocation == 'end') {echo 'checked';}?> value="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', 'mvp'); ?></span></label>
                                        <label for="optin_location_radio2" class="optin_location-disable2"><span><?php echo esc_html_e('Middle', 'mvp'); ?></span></label>
                                        <label for="optin_location_radio3" class="optin_location-disable"><span><?php echo esc_html_e('End', 'mvp'); ?></span></label>
                                        <input type="radio" id="optin_location_radio1" name="optin_location" checked value="beginning"/>
                                        <input type="radio" id="optin_location_radio2" name="optin_location" value="middle"/>
                                        <input type="radio" id="optin_location_radio3" name="optin_location" value="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', 'mvp'); ?></label></span>
                                <br><br><br><span class="description"><?php echo esc_html_e('Define the time in the Video where you would like to show the Optin Form', 'mvp'); ?></span>
                            </td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Headline:', 'mvp'); ?></td>
                            <td><input type="text" name="optin_headline" value="<?php echo @$v_OptinHeadline; ?>"></td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Text:', 'mvp'); ?></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:', 'mvp'); ?></td>
                            <td>
                                <input type="text" name="optin_submit_text" value="<?php echo @$v_OptinSubmitText; ?>">
                                <br><span class="description"><?php echo esc_html_e('Choose what your submit button Should say.', 'mvp'); ?></span>
                            </td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Enter A Thank You Message:', 'mvp'); ?></td>
                            <td>
                                <textarea name="thankyou_message"><?php echo @$v_ThankyouMessage; ?></textarea>
                                <br><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 .....', 'mvp'); ?></span>
                            </td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Allow Skipping:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></span></label>
                                    <input type="radio" id="allow_skip_radio1" name="allow_skip" <?php if ($v_OptinAllowSkip == 'yes') {echo 'checked';}?> value="yes"/>
                                    <input type="radio" id="allow_skip_radio2" name="allow_skip" <?php if ($v_OptinAllowSkip == 'no') {echo 'checked';}?> value="no"/>
                                <?php
} else {?>
                                    <label for="allow_skip_radio1" class="allow_skip-enable"><span><?php echo esc_html_e('YES', 'mvp'); ?></span></label>
                                    <label for="allow_skip_radio2" class="allow_skip-disable selected"><span><?php echo esc_html_e('NO', 'mvp'); ?></span></label>
                                    <input type="radio" id="allow_skip_radio1" name="allow_skip" value="yes"/>
                                    <input type="radio" id="allow_skip_radio2" name="allow_skip"  checked value="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', 'mvp'); ?>" name="submit"/>
            </form>
        </div>

        <div id="tab-4" class="tab-content">
            <form action="" id="playlist-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', 'mvp'); ?></td>
                            <td><input type="text" id="button_label" name="button_label"></td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Select Button Icon:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?>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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></option>
                                    <option value="custom"><?php echo esc_html_e('Custom', 'mvp'); ?></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', 'mvp'); ?>">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td><?php echo esc_html_e('Select Button Type:', 'mvp'); ?></td>
                            <td>
                                <select id="all_btn_types">
                                    <option value="map"><?php echo esc_html_e('Map', 'mvp'); ?></option>
                                    <option value="htmlcode"><?php echo esc_html_e('HTML code', 'mvp'); ?></option>
                                    <option value="post"><?php echo esc_html_e('Post', 'mvp'); ?></option>
                                    <option value="page"><?php echo esc_html_e('Page', 'mvp'); ?></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:', 'mvp'); ?></td>
                            <td>
                                <a id="add_related_video_url" class="button-secondary"><?php echo esc_html_e('Add Video Url', 'mvp'); ?></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">Remove</a></td></tr><tr class="r_v_data'+link_counter+'s"><td>Video Thumbnail:</td><td><a id="'+link_counter+'" class="add_thumb">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:', 'mvp'); ?></td>
                            <td><?php $pages = get_pages();?>
                                <select id="all_pages">
                                    <option><?php echo esc_html_e('--Select Page--', 'mvp'); ?></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:', 'mvp'); ?></td>
                            <td><?php $categories = get_categories();?>
                                <select id="post_cat">
                                    <option><?php echo esc_html_e('--Select Category--', 'mvp'); ?></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:', 'mvp'); ?></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:', 'mvp'); ?></td>
                            <td><input type="text" id="iframe_url" name="iframe_url"></td>
                        </tr>
                    </table>

                    <table id="map_prop" style="display:none;">
                        <tr>
                            <td width="150px;"><?php echo esc_html_e('Enter Map Address:', 'mvp'); ?></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:', 'mvp'); ?></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', 'mvp'); ?></a></td>
                            <td></td>
                        </tr>
                        <tr id="show2btn"><td width="150px;"><a id="update_button" class="addbutton"><?php echo esc_html_e('Update Button', 'mvp'); ?></a></td>
                            <td><a id="cancel_button" class="addbutton"><?php echo esc_html_e('Cancel', 'mvp'); ?></a></td>
                        </tr>
                    </table>
                </div>

                <div class="show_all_btn">
                    <div class="wrap"><h2><?php echo esc_html_e('All Created Buttons', 'mvp'); ?></h2></div>
                    <table class="showbtns" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <th><?php echo esc_html_e('Button Label', 'mvp'); ?></th>
                            <th><?php echo esc_html_e('Button Icon', 'mvp'); ?></th>
                            <th><?php echo esc_html_e('Button Type', 'mvp'); ?></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', 'mvp'); ?></a><a class="deletebtn"><?php echo esc_html_e('Delete', 'mvp'); ?></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', 'mvp'); ?>" name="submit"/>
            </form>
        </div>
        <div id="tab-5" class="tab-content">
            <form action="" id="playlist-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') || (@$v_PlayerSkin == '')) {
    $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';
}
?>

                <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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="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="skin20"></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', 'mvp'); ?>" name="submit"/>
            </form>
        </div>

        <div id="tab-6" class="tab-content">
            <form action="" id="playlist-ajax-upload6" method="post" enctype="multipart/form-data" onsubmit="return checkmidTime();">
                <table>
                    <tr>
                        <td width="150px;"><?php echo esc_html_e('Include Popup:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></span></label>
                                    <input type="radio" id="inc_popup_radio1" name="inc_popup" <?php if ($v_Popup == 'yes') {echo 'checked';}?> value="yes"/>
                                    <input type="radio" id="inc_popup_radio2" name="inc_popup" <?php if ($v_Popup == 'no') {echo 'checked';}?> value="no"/>
                                    <?php
} else {?>
                                    <label for="inc_popup_radio1" class="inc_popup-enable"><span><?php echo esc_html_e('YES', 'mvp'); ?></span></label>
                                    <label for="inc_popup_radio2" class="inc_popup-disable selected"><span><?php echo esc_html_e('NO', 'mvp'); ?></span></label>
                                    <input type="radio" id="inc_popup_radio1" name="inc_popup" value="yes"/>
                                    <input type="radio" id="inc_popup_radio2" name="inc_popup"  checked value="no"/>
                                <?php }
?>
                        </td>
                    </tr>
                </table>
                <table class="popup_desc">
                    <tr>
                        <td><?php echo esc_html_e('Add Text or Image or Both:', 'mvp'); ?></td>
                        <td>
                            <div>
                                <?php
$args = array("textarea_rows" => 5, "textarea_name" => "popup_content", "editor_class" => "my_editor_custom");
wp_editor(@$v_PopupContent, "my_editor_3", $args);
?>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td><?php echo esc_html_e('Add Popup Link:', 'mvp'); ?></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:', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></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', 'mvp'); ?></span></label>
                                        <input type="radio" id="popup_location_radio1" name="popup_location" <?php if ($v_PopupLocation == 'beginning') {echo 'checked';}?> value="beginning"/>
                                        <input type="radio" id="popup_location_radio2" name="popup_location" <?php if ($v_PopupLocation == 'middle') {echo 'checked';}?> value="middle"/>
                                        <input type="radio" id="popup_location_radio3" name="popup_location" <?php if ($v_PopupLocation == 'end') {echo 'checked';}?> value="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', 'mvp'); ?></span></label>
                                        <label for="popup_location_radio2" class="popup_location-disable2"><span><?php echo esc_html_e('Middle', 'mvp'); ?></span></label>
                                        <label for="popup_location_radio3" class="popup_location-disable"><span><?php echo esc_html_e('End', 'mvp'); ?></span></label>
                                        <input type="radio" id="popup_location_radio1" name="popup_location" checked value="beginning"/>
                                        <input type="radio" id="popup_location_radio2" name="popup_location" value="middle"/>
                                        <input type="radio" id="popup_location_radio3" name="popup_location" value="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', 'mvp'); ?></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', 'mvp'); ?>" name="submit"/>
            </form>
        </div>
    </div>
</div>
<script>
    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').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(){
            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 option:selected').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 option:selected').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_page){
                $('.showbtns').find('#'+update_row_id).find('.curent_allfields').find('#allbuttons_page').val(btn_page);
            }

            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_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){
                $('.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">Edit</a><a class="deletebtn">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">\n\<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) {
                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;
        });

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

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

        $(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'){
                    $('#iframe_prop').show();
                    $('#iframe_url').val(curent_iframe);
                }else if(curent_type=='map'){
                    $('#map_prop').show();
                    $('#map_address').val(curent_mapaddrs);
                }else if(curent_type=='htmlcode'){
                    $('#html_prop').show();
                    $('#html_code').val(curent_htmlcode);
                }else if(curent_type=='post'){
                    $('#postcat_prop').show();
                    $('#post_cat').val(curent_postcat).change();
                    $('#post_no').val(curent_postno);
                }else if(curent_type=='page'){
                    $('#page_prop').show();
                    $('#all_pages').val(curent_page).change();
                }else if(curent_type=='related_video'){
                    $('#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">Remove</a></td></tr><tr class="r_v_data'+a+'s"><td>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">Select Thumb</a></td></tr>');
                    }
                    $('#current_rv_id').val(a);
                }
            }else{
                Swal.fire('Please Update or Cancel existing button.')
            }
        });
    });

    jQuery("input[name='video_option']").on('click',function(){
        var radioValue = jQuery("input[name='video_option']:checked").val();

        if(radioValue=='one_video'){
            jQuery('tr .add-more-videos').hide();
            jQuery('.repeater table').not(":first").remove();
        }else{
            jQuery('tr .add-more-videos').show();
        }
    });

    jQuery('.add-more-videos').on('click',function(){
        setTimeout(function(){
            jQuery(".repeater table:last-child .video_source-enable").click();
        }, 100);

        setTimeout(function(){
            jQuery(".video_source-enable").click(function(){
                jQuery(this).parents('tr').next('tr').find('.nrmlvideo_show').show();
                jQuery(this).parents('tr').next('tr').find('.youtubevideo_show').hide();
                jQuery(this).parents('tr').next('tr').find('.vimeovideo_show').hide();
            });

            jQuery(".video_source-disable2").click(function(){
                jQuery(this).parents('tr').next('tr').find('.youtubevideo_show').show();
                jQuery(this).parents('tr').next('tr').find('.nrmlvideo_show').hide();
                jQuery(this).parents('tr').next('tr').find('.vimeovideo_show').hide();
            });

            jQuery(".video_source-disable3").click(function(){
                jQuery(this).parents('tr').next('tr').find('.vimeovideo_show').show();
                jQuery(this).parents('tr').next('tr').find('.nrmlvideo_show').hide();
                jQuery(this).parents('tr').next('tr').find('.youtubevideo_show').hide();
            });

            var o_editor;

            jQuery('.custom_media_upload').click(function() {
                var customthis = jQuery(this);
                o_editor = window.send_to_editor;
                formfield = jQuery(this).prev('.filename').attr('name');

                window.send_to_editor = function(html) {
                    url = jQuery(html).attr('href');
                    jQuery(customthis).prev('.filename').val(url);
                    window.send_to_editor = o_editor;
                    tb_remove();
                }

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