Carrying an ID with strings to a next page - ajax

I'm trying to carry the ID to the next page, but all i manage to get is review.php?ID= without the ID.
Here is the code:
html = html + "Name:" + name + "Type : " + type + "Location : " + location + '<input type="button" value="Write a review!" onclick=parent.location="review.php?ID=" ('+ ID +') />' + "<br/>";
Thanks in advance for any help.

There's a couple things wrong here. You have mismatched quotes (single and double), and I'm pretty sure the id shouldnt have spaces round it with parens. The embeded quotes need to be escaped, too
something like this:
html = html + "Name:" + name + "Type : " + type + "Location : " + location +
"<input type='button' value='Write a review!' onclick='parent.location=\"review.php?ID=("+ID+")\" />" + "<br/>";

Related

How to change datetime in Vue?

Trying to use Vue for the first time.
I dont know how to change the datetime in Vue.
I know it works in laravel, like this:
{{ date("d.m.Y", strtotime($file->created_at)) }}
How can I change datetime in Vue?
This is what I tried in Vue:
<time datetime="1.1.2019">#{{ file.created_at }}</time>
and it shows me the exact database entry on the view page:
2019-01-25 12:03:40
But I want it to appear like this:
25.02.2019 12:03. 40
Thank you!
Create a Vue method -
formattedDate:function(d){
let arr = d.split(/[- :]/);
let date = new Date(Date.UTC(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]));
return date.getDate() + "." + (date.getMonth() + 1) + "." + date.getFullYear() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds()
}
And then Call that method within double curly brackets
<time datetime="1.1.2019">#{{ formattedDate(file.created_at) }}</time>

Wrong Answer while doing concatenation in an ashx page

string name = id + '_' + pos + '_' + nextid;
This is my code in an .ashx page. My expected result is name=1_12_2 and i am getting it as name=2062.

SELECT * INTO Incomplete Query Clause

I seem to be doing something wrong in my OleDbCommand, but I don't know what it is. I am trying to create another table in my access database that is exactly the same as the first but with a different name, by copying everything from one and using SELECT INTO. I don't know why it doesn't work.
OleDbCommand copyAttendanceCommand = new OleDbCommand("SELECT * INTO '" + "Attendance " + DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year + "' FROM Attendance",loginForm.connection);
copyAttendanceCommand.ExecuteNonQuery();
The Error message that I get says "Syntax error in query. Incomplete query clause." Does anyone know what that means?
Table or field names with spaces are not specified with '' around them, but with square brackets.
Your command should be:
"SELECT * INTO [Attendance " + DateTime.Now.Day + "/" + DateTime.Now.Month + "/"
+ DateTime.Now.Year + "] FROM Attendance"
You may even format your date to make the code more readable:
string today = DateTime.Today.ToString("d'/'M'/'yyyy");
string sql ="SELECT * INTO [Attendance " + today + "] FROM Attendance";
OleDbCommand copyAttendanceCommand = new OleDbCommand(sql, loginForm.connection);
copyAttendanceCommand.ExecuteNonQuery();

Hidden SPAM script in Joomla footer

I got my Joomla site www.semignu.dk and there is suddenly some hidden SPAM script in my footer? How do I remove this?
If you are referring to the following code:
//<!--
document.getElementById('cloak6482').innerHTML = '';
var prefix = 'ma' + 'il' + 'to';
var path = 'hr' + 'ef' + '=';
var addy6482 = 'Kontakt' + '#';
addy6482 = addy6482 + 'semignu' + '.' + 'dk';
var addy_text6482 = 'Kontakt' + '#' + 'semignu' + '.' + 'dk';
document.getElementById('cloak6482').innerHTML += '<a ' + path + '\'' + prefix + ':' + addy6482 + '\'>'+addy_text6482+'<\/a>';
//-->
Then this is not spam. It's part of the email cloaking that you possibly have turned on.
Open the footer module in the Joomla Module Manager and look for:
{emailcloak=on}

Birt 3.7.2 totalPage not working

I have a Birt Report with a data element "Page " + pageNumber + " of " + totalPage in the Layout but it keeps giving me output of "Page 1 of 1" or "Page 2 of 2". Is there a way to correct this? Thanks!
totalPage is only known at "render" time, so we cannot use it like this in expressions. A workaround is to use "onRender" script. click your data element->Script->onRender:
this.setDisplayValue("Page " + pageNumber + " of " + totalPage);
Or for a dynamic text element instead of a data element:
this.text="Page " + pageNumber + " of " + totalPage
Page number variable works in rptlibrary.
Use page number and total page from library in your layout wherever required.

Resources