Usis Advising Printer

A button to download advised routine

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Usis Advising Printer
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  A button to download advised routine
// @author       You
// @match        https://usis.bracu.ac.bd/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var btn = document.createElement('button');
    btn.innerHTML = "Print my advising";

    btn.onclick = () => {
        try {
            var id = downloadAdvisingSlipFormWindow.toString().substring(353,360);
            if($('#academiaSession').val() == ""){
                alert("Please select advising session.");
                return;
            }
            alert("If you see an error, please relogin usis and try again");
            window.location.href = "https://usis.bracu.ac.bd/academia/studentCourse/createSchedulePDF?content=pdf&studentId="+id+"&sessionId="+$('#academiaSession').val();
        }
        catch(err) {
            alert("Please navigate to Bank Payment Slip.");
        }
    };


    var widgets = document.getElementsByClassName("ui-widget-header")[0];
    widgets.insertBefore(btn,widgets[0]);
})();