Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function show_hide_aupload() {
- $url = plugin_dir_url()."broker-uploader/amazon/";
- ?>
- <script type="text/javascript" src="<?php echo $url; ?>progress.js"></script>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery('#amazon-upload').submit(function(){
- // jQuery(this).hide();
- });
- jQuery('#theTitle').keyup(function(){
- var count = $(this).val().length;
- var limit = 80; //must be amazon_file limit - 10
- if(count > limit) {
- jQuery(this).val(jQuery(this).val().substr(0, limit));
- jQuery('#amazon_title_char_count').css('color','red');
- jQuery('#excess_warning').html("You may only have up to "+limit+" characters in the title. Excess characters have been truncated");
- jQuery('#excess_warning').show('fast');
- var count = $(this).val().length;
- } else {
- jQuery('#amazon_title_char_count').css('color','inherit');
- jQuery('#excess_warning').hide('fast');
- }
- jQuery('#amazon_title_char_count').html(count+"/"+limit+" characters used");
- });
- jQuery('#message-ta').keyup(function(){
- var count = $(this).val().length;
- var limit = 5000;
- if(count > limit) {
- jQuery(this).val(jQuery(this).val().substr(0, limit));
- jQuery('#message_char_count').css('color','red');
- jQuery('#message_excess_warning').html("You may only have up to "+limit+" characters in the title. Excess characters have been truncated");
- jQuery('#message_excess_warning').show('fast');
- var count = $(this).val().length;
- } else {
- jQuery('#message_char_count').css('color','inherit');
- jQuery('#message_excess_warning').hide('fast');
- }
- jQuery('#message_char_count').html(count+"/"+limit+" characters used");
- });
- jQuery("input:checkbox").change(function(){
- var div = '#'+jQuery(this).attr('value');
- if( jQuery(this).is(":checked") ) {
- jQuery(div).show('fast');
- } else {
- jQuery(div).hide('fast');
- }
- });
- });
- function showProgress() {
- var pb = document.getElementById("uploader");
- pb.innerHTML = '<img src="/wp-content/plugins/broker-uploader/amazon/uploading-1.gif" width="116" height ="119"/>';
- pb.style.display = '';
- }
- </script>
- <script type="text/javascript">
- function progress() {
- // window.addEvent('domready',function() {
- $$('form.upload').each(function(o_form) {
- o_form.fileUpload = new uploadProgress(o_form, {
- 's_actionHelper' : '<?php echo $url; ?>progress.php',
- 'i_interval' : 500
- });
- });
- // });
- }
- </script>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery("form").submit(function(){
- var id = jQuery(this).attr('id');
- jQuery(this).append("<input type=\"hidden\" name=\"APC_UPLOAD_PROGRESS\" value=\""+id+"\" />");
- });
- });
- function validate() {
- var id = jQuery("form").attr('id');
- var formid = "#"+id;
- jQuery(formid).add("<input type=\"hidden\" name=\"APC_UPLOAD_PROGRESS\" value=\""+id+"\" />");
- jQuery("#validate").hide();
- jQuery("#submitme").show();
- }
- </script>
- <?php
- }
- add_action('wp_footer','show_hide_aupload');
- ?>
- <h3><a href="/broker-tools/amazon-upload/webinar-archive/">View Archive</a></h3>
- <style type="text/css">
- .sec_name, label {
- display: block;
- clear: right;
- }
- .sec_name {
- font-style: italic;
- }
- .title {
- font-weight: bold;
- margin:10px 0;
- }
- .radio {
- font-weight: normal;
- float: left;
- }
- input[type="radio"], input[type="checkbox"] {
- display: block;
- float: left;
- margin-right: 5px;
- }
- .option {
- display: block;
- float:left;
- width: 100%;
- }
- .opt-cont {
- margin-left: 10px;
- float:left;
- width:100%;
- }
- </style>
- <form action="<?php echo curPageURL(); ?>" method="post" class="upload" onSubmit="progress()" enctype="multipart/form-data">
- <label class="title" for="theTitle">Email Title</label>
- <input id="theTitle" type="text" name="theTitle" /><div id="amazon_title_char_count"></div><div id="excess_warning" style="display:none; font-weight: bold;color: red;"></div>
- <label class="title" for="theSite">Select Email From</label>
- <!-- <select id="theSite" name="theSite">-->
- <?php
- $sites = $wpdb->get_results($wpdb->prepare("SELECT * FROM bu_amazon_sections"));
- foreach ($sites as $site) {
- // echo '<option value="'.$site->amazon_section_id.'">'.$site->amazon_section_name.'</option>';
- // echo '<input type="radio" id="primary_'.$site->amazon_section_id.'" name="theSite" value="p_'.$site->amazon_section_id.'" /><label for="primary_'.$site->amazon_section_id.'">'.$site->amazon_section_name.'</label>';
- echo '<div class="option">';
- echo '<span class="sec_name">'.$site->amazon_section_name.'</span>';
- if ($site->has_secondary) {
- $secondaries = $wpdb->get_results($wpdb->prepare("SELECT * FROM bu_amazon_secondary_sections WHERE amazon_section_id = $site->amazon_section_id ORDER BY secondary_name ASC"));
- foreach($secondaries as $secondary) {
- $class = $secondary->secondary_name;
- $class = strtolower($class);
- $class = str_replace(" ","-",$class);
- echo '<div class="opt-cont">';
- echo '<input class="radio '.$class.'" type="radio" id="sec_'.$secondary->secondary_id.'" name="theSite" value="s_'.$secondary->secondary_id.'" /><label class="radio" for="sec_'.$secondary->secondary_id.'">'.$secondary->secondary_name.'</label>';
- echo '</div>';
- }
- }
- echo "</div>";
- } ?>
- <label class="title" for="theFile">.mp4 Video to Upload</label>
- <input id="theFile" name="theFile" type="file" accept="video/mp4" />
- <label class="title">Extras</label>
- <input type="checkbox" id="pdf" name="pdf" value="pdf-box"><label for="pdf">Include PDF</label>
- <input type="checkbox" id="positons" name="positions" value="positions-box"><label for="positons">Include Positions</label>
- <input type="checkbox" id="message" name="message" value="message-box"><label for="message">Include message</label>
- <input type="checkbox" id="additional-webinar" name="additional-webinar" value="additional-webinar-box"><label for="additional-webinar">Include Additional Webinar</label>
- <div id="pdf-box" style="display:none;">
- <label class="title" for="thePDF">.pdf File to Upload</label>
- <input id="thePDF" name="thePDF" type="file" accept="application/pdf" />
- </div>
- <div id="positions-box" style="display:none;">
- <label class="title">Positions Info</label>
- <label>New/Potential Trades</label>
- <input type="text" name="np-trades" />
- <label>Current Trades</label>
- <input type="text" name="cur-trades" />
- <label>Updates</label>
- <input type="text" name="update-trades" />
- </div>
- <div id="message-box" style="display:none;">
- <label class="title">Email Message</label>
- <textarea id="message-ta" name="message" cols="50" rows="10"></textarea>
- <div id="message_char_count"></div>
- <div id="message_excess_warning" style="display:none; font-weight: bold;color: red;"></div>
- </div>
- <div id="additional-webinar-box" style="display:none;">
- <label class="title">Select Additional Webinar</label>
- <select name="additional-webinar-selection">
- <option value="0" selected>Please Select</option>
- <?php
- $additional_webinars = $wpdb->get_results($wpdb->prepare("SELECT aa.amazon_id, aa.amazon_title, ass.amazon_section_name FROM bu_amazon_archive AS aa LEFT OUTER JOIN bu_amazon_sections AS ass ON aa.amazon_section_id = ass.amazon_section_id WHERE amazon_file_type_id = 1 ORDER BY upload_date DESC LIMIT 10"));
- foreach($additional_webinars as $additional_webinar) {
- echo '<option value="'.$additional_webinar->amazon_id.'">'.$additional_webinar->amazon_title.'('.$additional_webinar->amazon_section_name.')</option>';
- }
- ?>
- </select>
- </div>
- <!-- </select> -->
- <input type="hidden" value="elitetradersgroup" name="amazon_bucket" />
- <button id="validate" onClick="validate()" type="button">Validate</button>
- <input name="Submit" id="submitme" type="submit" style="display:none;" value="Upload" />
- <!---->
- </form>
- <div id="uploader" style="display:none;">
- <img src="/wp-content/plugins/broker-uploader/amazon/uploading-1.gif" width="116" height ="119"/>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement