How to restrict user from changing current date - php

My file tracking system deals with application submission. Date of the application is used to track total days taken to process each application. However, event though current date is shown, user able to change it to past date in my system. The system use mvc framework. What should i do to make the date inaccessible by user? Something like static.

Just store the date against the application id in the database when the application is first submitted and then ignore any mention of the date in the submitted form data.

Related

How to update a table without accessing the web in Laravel (PHP)?

I am trying to create a web application using Laravel to manage quizzes. The quizzes are timed. I have made a javascript countdown timer, and it counts down until the deadline. If the student is taking the quiz and the deadline has reached, I can redirect the student to the home page with a message e.g. 'Time is up!' and update the table, so it shows that the quiz is completed (since it reached the deadline).
I am wondering how to make the application updates the table even when the student is not on the quiz page?
When the quiz is started, use Laravel to update your database and enter the deadline date/time.
The JavaScript time out is useful from a user experience perspective, but can easily be altered or bypassed entirely. By adding the deadline time to your database, you can do validation and logic checks before and after the deadline has passed, such as:
Check if the submission occurred after the deadline has passed, regardless of the JS timeout
If the user is forced to reload the page for whatever reason, you can update the timer appropriately

Check in/out in attendance system using codeigniter

I am trying to build an online attendance system where employees sign in and check in daily except for weekends and vacations.
so , my idea was to create a daily attendance record as a table in the database.
Attendance_date_daily date
Employee_ID number(auto generated)
Check_in_time time
Check_out_time time
Attendence_status varchar
I am using codeigniter v 3.0.0
it's easy to create a model to get the current time and save it in the database when the user check in/out.
but the problem is that, if the user was absent for a day or more , then the system will not create a record for those days.
moreover, i can't create the records beforehand. since i don't know when the user will have his/her vacation and working days may differ.
what is the best way to create and manage those daily records?
One possible solution may be to allow the employees to do their check-in each day normally which would populate the database for those days.
In order to add the absence records for those who have not checked in you could use CRON or something similar to schedule a task at perhaps midnight each day. Use this task to target a url that would run a method in a controller that will check employees against the daily records. Obviously for those whom have checked in no action will be performed, although for those who have not and are not marked as on vacation or not working you update the database to add the absence records.
With a system like this you would typically invoke the url to perform the update using whatever system you use with wget or something similar to 'load' the url and force it to run. A security consideration also would be that you'll want to add in a secret key as a GET parameter or something similar so that the method can check that it's being invoked via the task and not e.g. someone visiting the url by comparing the GET parameter with a stored key that you've set.

PHP deadline notification

I need to create a system that can store documents, those documents are jobs due to specific dates so this system should send an email notification to the admin to notify him/her when a due date for a specific document is near.
Basically i have no problem at all, apart from one single very important point: the notification system should work without user intervention. I can easily trigger php scripts on each page visit but i do not want that. This case would be quite "easy", i would just set a date for each document in the sql row and each time the page is visited a php script would check if the current time is near the time set in the sql row for the document. But this needs the page to be visited.
Suppose my client sets a due date for a document and then never visits the site again, how can it happen that a php scripts automatically fires itself to perform the necessary checks to see if there are due dates in the upcoming days?
Thanks in advance
Why not use MySQL Event schedular?

plan a effective algorithm to check who is online to the web site, with PHP and AJAX

i need some help to plan an effective algorithm to check who is online to my web site, with PHP and AJAX.
(i dont need you to write any sourse to me!!)
the biggest problem is how to know when the member get off.
in the end, it will be a list of online members that alwayes update, like what facebook have.
You can use a timestamp, with PHP you can do strtotime("now");
You add that timestamp to the user's table in MySQL, or their session info. Then, you update that timestamp whenever the user changes pages or accesses the site. To determine if the user is offline, you can remove the timestamp when the user logs off, and if the user just exits without logging off, you would just compare the timestamp to the current time.
For example, you could look to see if 15 minutes has passed by checking the timestamp variable like this:
if($timestamp <= strtotime("-15 minutes")) echo "User is offline";

Need logic about developing a school schedule system in php mysql

I am developing a dynamic class schedule system in php mysql.
I have a dynamically generated form inside a table like this.
http://s9.postimg.org/v5vu5624v/form_help.jpg
After completing the form php will take those form data and store
it in database. But this is a complex task. Because I have to track
day name , period number with subject name. For example
user is entering the subject name in period 1 and day is Saturday.
after submitting the form php will store period name , day name
and subject name.
I am tracking this because I have to display user input data
exact same position. For example user has entered subject name in period 1 and day
is Saturday. So php will retrieve data from database and display this
in period 1 and Saturday.
If user input single data then its an easy process. But as it is a class schedule so
data wont be single . There will be multiple data.
Now my question is how can I do that. How could I track the subject name
in which day and which period?
BTW, I am sending this form to another php page as post method, and that page will handle this task.

Categories