SteemWatcher Portal Development " Generating Automatic Markdown Reports ".

in hive-151113 •  2 years ago 

Hello Steemians,

jpg_20230803_154541_0000.jpg

Today i have done my development of steemwatcher portal. in this development i have add the feature to copy the reports on the base of date. It is a simple and fast copying feature that will save you a lot of time and also make your report table automatically by using markdown.

Screenshot_20230803-110602~4.png

This feature is placed at the my report page. Open the my report page. You can find this feauture here easily

Screenshot_20230803-152209~2.png

Just select a date, click the copy button, and all reports that have green signal will automatically be copied in Markdown style, which you can easily paste into a post.

First select the correct date limits for your reports. After selecting the date, copy your reports by just click on "copy reports" button. by clicking this button, all reports with green signal will be copied automatically, and that too in markdown style. Now you don't need to write anything manually, everything is ready!

Screenshot_20230803-152214~2.png

After this, we can now paste them into our post content. With just one click, you manage your reports so easily without wasting any time. So friends, now I will make reports by using this feature and reject the hard work.

This function is developed by using PHP, Javascript, SQL and Ajex.

Code Logic Logic:


document.getElementById('dateForm').addEventListener('submit', function(event) {
    event.preventDefault();

    var fromDate = document.getElementById('f-date').value;
    var toDate = document.getElementById('t-date').value;

    
    if (fromDate === '' || toDate === '') {
        alert('Please select both from and to dates.');
        return;
    }

    var xhr = new XMLHttpRequest();
    xhr.open('POST', 'generate_table.php', true);
    xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

    xhr.onreadystatechange = function() {
        if (xhr.readyState === XMLHttpRequest.DONE) {
            if (xhr.status === 200) {
                
                var data = xhr.responseText.trim();     

                var clipboard = new ClipboardJS('#copyButton', {
                    text: function() {
                        return data;
                    }
                });

                clipboard.on('success', function(e) {
                    alert('Data copied to clipboard!');
                    e.clearSelection();
                });

                clipboard.on('error', function(e) {
                    alert('Failed to copy data to clipboard.');
                });

                clipboard.onClick({ currentTarget: document.getElementById('copyButton') });
            } else {
                alert('Failed to fetch data from the backend.');
            }
        }
    };

    var formData = 'fromDate=' + encodeURIComponent(fromDate) + '&toDate=' + encodeURIComponent(toDate);
    xhr.send(formData);
});


Please cast witness vote to bangla.Witness or set proxy to rme.

_
Vote bangla.witness as witness
Set Proxy rme as proxy

Special Thanks.

Cc: @rme
Cc: @hungry-griffin
Cc: @steemcurator01
Cc: @steemchiller
Cc: @pennsif

Thanks for giving your precious time to my post.
Follow | Upvote | Share | Comments
Follow me on Instagram.
Instagram

🆃🅷🅰️🅽🅺 🆈🅾️🆄

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations, your post has been upvoted by @dsc-r2cornell, which is the curating account for @R2cornell's Discord Community.

Manually curated by @jasonmunapasee

r2cornell_curation_banner.png