Pnnkaznk / Motiviranje Esim

// ==UserScript==
// @name        Motiviranje Esim
// @namespace   Motiviranje Esim
// @description Motiviranje Esim
// @include     *suna.e-sim.org/motivateCitizen.html?id=*
// @include     *suna.e-sim.org/newCitizenStatistics.html
// @version     1
// @grant       none
// ==/UserScript==


var poz = document.getElementsByClassName("top-bar")[0];

// Dugme
  var btn = document.createElement("BUTTON");        // Create a <button> element
var t = document.createTextNode("Trazi");       // Create a text node
btn.appendChild(t);                                // Append the text to <button>
poz.appendChild(btn);                    // Append <button> to <body>
btn.style.backgroundColor = "#FFFFFF";
btn.style.color = "red";
//btn.style.marginTop = "-900px";
//btn.style.marginLeft = "450px";
btn.style.cssFloat = "right";
btn.style.padding = "5px";


// Dugme 2

  var btn2 = document.createElement("BUTTON");        // Create a <button> element
var eee = document.createTextNode("Probaj jbg");       // Create a text node
btn2.appendChild(eee);                                // Append the text to <button>
poz.appendChild(btn2);                  // Append <button> to <body>
btn2.style.backgroundColor = "#FFFFFF";
btn2.style.color = "red";
//btn2.style.marginTop = "-50px";
//btn2.style.marginLeft = "450px";
btn2.style.cssFloat = "right";
btn2.style.padding = "5px";

// Funkcija dugmeta

btn.addEventListener("click", trazi);
btn2.addEventListener("click", pocetak);
function trazi () {
  
  var stranica = window.location.href;
  if (stranica.length == 53 || stranica.length == 52 ){
  var rez = stranica.slice (47, 53);
  var link = stranica.slice (0, 47);
  var rez1 = --rez;
  var novilink = link.concat(rez1);
  window.open(novilink,"_self")
  }
  
  else {window.open(novilink,"_self")}  
}

function pocetak () {
var profil = document.getElementsByClassName("profileLink")[2].href.slice(39,45);
var st = "https://suna.e-sim.org/motivateCitizen.html?id=";
var linkas = st.concat(profil);
  window.open(linkas,"_self");
}
// MADE BY Ali [Pnnkaznk]