Forum Replies Created

Viewing 15 replies - 1 through 15 (of 33 total)
  • Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi Rhett,
    It worked finally. vabbwas somehow not getting populated in hours[]. I fixed it ??
    Thanks for your concern I appreciate it.

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi Rhett,
    Can you give me some hint as to which part of the code in time_cal.php deals with setting JS vabb array from db values?
    Because only vabb has that issue, ill works perfectly.

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi Rhett,
    I got the exact issue.
    After submit the value of vabb is becoming 0.
    Can you guess where the problem might be?

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi Rhett,
    It would be better if I use this forum to clarify my doubt.
    I am facing a strange issue. Please hang up on me for this.
    I have added 2 more drop down values ILL and VABB.
    I have added the all the local variables in the function sumrows()
    The issue is everything seems to work fine. Even the values for the new types are getting inserted and updated too in the database(I have checked thoroughly).
    Now the issue, when I am selecting ILL or VABB in the drop down, the summary below is getting displayed calculating the no of hours for respective drop downs. Fine as of now. But the real thing is occurring when I am submitting the time report. Now I am not seeing VABB in the summary as well as in the drop down but ILL is visible perfectly with the no of hours. The strange thing is the no of hours for VABB is getting inserted in the database, even the total no of hours is perfect except that the summary of the VABB is not visible. I have inspected the VABB summary row and set the display to “table-rows” but I can see that the value for VABB after submitting is becoming 0 but somehow the correct value is getting inserted in the database. I have made appropriate change in time_cal.php too.

    Can you please suggest me which part of the code to examine, for this issue.
    I know it is strange.
    Thanks a lot for sparing your valuable time ??

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi Rhett,
    Thanks a lot for your concern.
    Can you provide me your email id so that I can mail you the code? I am facing a small issue.
    Thanks in advance

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi Rhett,
    Thanks for your concern. I have made some changes in the code introducing 2 variables il and vab. Can you please look at the code which I posted in my question? That’s what I did. But it doesn’t seem to work. Can you please go through the code and tell me where I am going wrong?
    Thanks a lot in advance

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi,
    I have achieved this ??
    Anyways thanks

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi Rhett,
    Yes I understand that these files will get affected if there is an update but I’m helpless. That is one of my primary requirements to have 2 more drop downs. For time being I have I’m not updating the plugin. And regarding the changes in other files such as time_cal.php and time_functions.php, I have made some changes (just replicating PTO with different id, value and database column name). I just want the time_min.js changes which I’m struggling to.
    I just want to add 2 more drop downs.

    Thanks a lot in advance

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi Rhett,
    I have tried but did not succeed.
    Please have a look at my function sumrows() and can you tell me where I am going wrong?

    function sumrows() {
    	var e, t, il, vab, d, n, a, o, i, s, m, l, r, illr, vabbr, u, y, _;
    	e = t = d = n = a = o = i = s = m = il = vab = 0, l = r = illr = vabbr = u = y = _ = "";
    	var p, c, g = document.getElementById("Reg"),
    		v = document.getElementById("PTO"),
    		h = document.getElementById("pto_row"),
    	    ill = document.getElementById("ILL"),
    		illrow = document.getElementById("ill_row"),
    		vabb = document.getElementById("VABB"),
    		vabbrow = document.getElementById("vabb_row"),
    		b = document.getElementById("OT"),
    		f = document.getElementById("ot_row"),
    		w = document.getElementById("Bonus"),
    		E = document.getElementById("TOT"),
    		B = document.getElementById("TOTamt"),
    		k = document.getElementsByName("hours[]"),
    		T = document.getElementsByName("date[]"),
    		I = rate,
    		F = 0;
    	if (exempt <= 0 && 15 <= period) {
    		var M = parseInt(T[0].value),
    			x = new Date(864e5 * M);
    		for (c = weekday[x.getDay()]; weekbegin != weekday.indexOf(c);) c = weekday[x.getDay()], x.setDate(x.getDate() - 1);
    		for (x /= 864e5; db_date[F] < x;) F++;
    		if (M - 7 < x)
    			for (; db_date[F] < M;) "Reg" == db_hourtype[F] && (s = parseFloat(db_hours[F]), db_date[F + 1] ? next_entry = db_date[F + 1] : next_entry = db_date[F] + 1, db_date[F] == next_entry ? m += s : (s += m, m = 0), 0 == m && (i = exempt < 0 && 8 < s ? 8 : parseFloat(s), a = (parseFloat(a) + i).toFixed(2))), F++, x++;
    		i = s = m = 0
    	}
    	for (F = 0; F < T.length;) 0 < k[F].value && (k[F].style.backgroundColor = "#555", k[F].style.color = "#FFF", s = parseFloat(k[F].value), _ = k[F].nextSibling.value, next_entry = 0, exempt <= 0 && "Reg" == _ && (T[F + 1] && (next_entry = T[F + 1].value), T[F].value == next_entry && "Reg" == k[F + 1].nextSibling.value ? m += s : (s += m, m = 0)), 0 == m && ("Reg" == _ && (i = exempt < 0 && 8 < s ? parseFloat(s) - 8 : 0, exempt < 0 && (n = (parseFloat(n) + i).toFixed(2)), exempt <= 0 && (a = (parseFloat(a) + s - i).toFixed(2))), exempt < 0 && 0 < n && (d = (parseFloat(d) + parseFloat(n)).toFixed(2), n = 0), "Reg" == _ && (e = (parseFloat(e) + s).toFixed(2)), "PTO" == _ && (t = (parseFloat(t) + s).toFixed(2)), "ILL" == _ && (ill = (parseFloat(ill) + s).toFixed(2)), "VABB" == _ && (vab = (parseFloat(vab) + s).toFixed(2)), o = (parseFloat(o) + s).toFixed(2))), 0 == m && exempt <= 0 && (p = (c = new Date(864e5 * (parseInt(T[F].value) + 2))).getDay(), weekbegin != p && T[F + 1] || (40 < a && (d = (parseFloat(d) + (parseFloat(a) - 40)).toFixed(2)), a = 0)), F++;
    	0 < (e = (parseFloat(e) - parseFloat(d)).toFixed(2)) && (l = 1 < e ? " hrs" : " hr"), 0 < t ? (r = 1 < t ? " hrs" : " hr", h.style.display = "table-row") : h.style.display = "none", 0 < il ? (illr = 1 < il ? " hrs" : " hr", illrow.style.display = "table-row") : illrow.style.display = "none", 0 < vab ? (vabbr = 1 < vab ? " hrs" : " hr", vabbrow.style.display = "table-row") : vabbrow.style.display = "none", 0 < d ? (u = 1 < d ? " hrs" : " hr", f.style.display = "table-row") : f.style.display = "none", 0 < o && (y = 1 < o ? " hrs" : " hr"), g.value = e + l, v.value = t + r, ill.value = il + illr, vabb.value = vab + vabbr, b.value = d + u, E.value = o + y, w.value = 0 < pay_bonus ? currency + pay_bonus : 0, 0 < I && (B.value = (parseFloat(o) * parseFloat(I)).toFixed(2), B.value = currency + (parseFloat(B.value) + parseFloat(pay_bonus) + parseFloat(d) * (.5 * parseFloat(I))).toFixed(2)), 0 === summary_updated && set_opacity(1), show_save(0)
    }
    • This reply was modified 5 years, 3 months ago by subhamkotnala.
    Thread Starter subhamkotnala

    (@subhamkotnala)

    Cool, works fine now. ??

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi Rhett,
    A small correction. The saturdays and sundays are editable in next periods. The problem is we are calling the js function on windows.load . The next period and prev period are AJAX calls. So how can we fix it?

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Great, It works. Thanks a lot ??

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi, I can see that the pop up is getting triggered with cookies. That’s why my shortcode is not working. How can I stop that?
    I want to trigger that shortcode with my code everytime. How can I achieve it?
    Thank you.

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Yes, I have this

    Enable popups for logged in users?

    setting checked.
    Link to my site is : https://login.norla.se/
    You will have to log in to my site to see the functionality. If you can share me your email or something then I can share you my credentials.
    Thank you

    Thread Starter subhamkotnala

    (@subhamkotnala)

    Hi,
    This is my code :

    echo do_shortcode( '[wpterms id="2230"]' );

    Can you show me how you are using the do_shortcode?
    And also should i enable the pop up on that particular page from the backend option?
    Thank you

Viewing 15 replies - 1 through 15 (of 33 total)