I would like to auto open a notice message use alertify with condition
When the user successfully login the website
When the user add successfully record data to the table
in Global > Page_Head:
AddStylesheet(“alertify/css/themes/bootstrap.css”);
AddStylesheet(“alertify/css/alertify.css”);
AddClientScript(“alertify/alertify.min.js”);
For login
Client Script > other > Login Page > User LoggedIn:
if (CurrentTime() < “23:00:00” ) {
// $this->setSuccessMessage(“Thank You For Logged In…”);
alertify.success(“Thank You For Logged In”);
}
For add record
Server Event > Table Specific> common > Row Rendering:
function Row_Rendering() {
alertify.success(“Thank You For Logged In”);
}
Client Script > other > Login Page > User LoggedIn:
if (CurrentTime() < “23:00:00” ) {
// $this->setSuccessMessage(“Thank You For Logged In…”);
alertify.success(“Thank You For Logged In”);
}
CurrentTime() is PHP, you cannot use it in JavaScript, and you should not compare dates as string. You can use JavaScript, e.g.
function Row_Rendering() {
alertify.success(“Thank You For Logged In”);
}
alertify.success() is JavaScript, you cannot use it in PHP server side events, and you should not output in Row_Rendering(). You can use it in server side User_LoggedIn, e.g.
$this->setSuccessMessage(“Thank You For Logged In.”);