I am working on agent for restaurant tables reservation, I am detecting the reservation parameters and everything fine, I need to allow the users to update any previous parameters at any page, e.g assume the user in a page called get reservation date which responsible for getting the reservation date from the user, and at the previous pages the user entered the restaurant name and reservation time,at get reservation date page the user may say: "I want to update the restaurant name" or "I want to update the reservation time" or "I want to update the reservation time and the restaurant name", How to detect multiple update cases on a single message?
I hope I could justify what I am trying to do.
Related
I want to build an attendance management system using MEAN stack. The application should work like this -
There will be an admin who will control CRUD operations on User and as well as look into the Attendance of each user and have a detailed list of average attendance of the user per month and per year.
There will be a user page and when the user logs in i want to store the date and time in the client side and then send it to the database. So that based on the time and date the admin can see when the user has logged in and mark the user as present for that particular day.
I want to know how to store the date and time in the client side and then pass it onto the database for calculations. Also wanted to know that is it necessary to authenticate in the front end as well?
May be I am late, but I can try to answer your query.
You can store date and time as an object and pass it via request parameters to the backend to store it in the database.
You can take a look a the following on how to get date and time in Javascript How do I get the time of day in javascript/Node.js?
Magento 1.6.
Within the login processing code, is it possible to find out when the user/customer has logged in for the very first time?
If your Magento is configured not to use double-opt-in (email confirmation) for customer registrations, then you can use what #PauGNU already posted:
$created_at = $customer->getCreatedAt();
But when it comes to double-opt-in, Magento creates the customer account immediately, i.e. setting created_at to the current system time, but does not activate it (so that customer cannot login before confirming) and only sends a confirmation mail.
This means an unkown delay (minutes, days, weeks, whatever) between created_at and the very first login, so created_at wouldn't be of use anymore.
Actually, Magento has a place, where customer login times are being tracked by default: the table field log_customer.login_at, accessible by Mage_Log_Model_Customer, for example.
But, if you plan to use it:
by default the class has no method to get the very first login. You'd need to develop that yourself.
if "Log Cleaning" is active (to keep the database smaller), you'll gonna lose the saved login times.
In that case, I'd prefer identifying the most proper event, hooking into it and saving only the very first login time per customer to a separate table.
Given that the first login is always when the customer registers itself in the web, you only need to check out the field «created_at» on the customer_entity table.
If you load a customer, it's really easy to get that data:
$created_at = $customer->getCreatedAt();
I want to record events based on on a date. I also want people to be able to search for event based on a particular date and the person who recorded the event.
For example:
Person A logs in and sees a calendar, click on a day/date and records an event for that day.
Person B logs in and sees a calendar, click on a day/date and records an event for that day.
Person C comes and does the same thing.
Note that either of these persons can record more than one event.
I want to be able record this data effectively in the database and search for these events based on a number of different criteria.
Please can someone help me with a data structure for this problem?
Person
ID
Name
PersonalEvent
ID
Person
Name
Date
I'm finishing up my first Codeigniter app and I have a question.
Right now I have a message for new users saying something like "Hey there, welcome to the app..."
A row in the db marks when the user has clicked "Don't show me this again".
I would like to have a table called "user-notifications" that will send a notification to the user about special deals or updated info about the app.
How do I keep track of which users have marked "Don't show me this again" if I have many messages?
I would say a simple m-n relation will do the trick
User UserNotification Notifications
-------- ------------------- -----------------
id user_id id
foo notification_id message
bar read
Note the read field in the join table. I would use it as a boolean (or whatever type your DBMS has). This way, you know if the user has "clicked the message away" or not. You could also add a date so you could query for messages not older than X.
I have a tricky issue here with a registration of both a user and his/her pet. Both the user and the pet are treated as separate entities and both require separate registration forms. However, the user's pet has to be linked to the user via a foreign key in the database. The process is basically that when a new user joins the site, firstly they register their pet, then they register themselves. The reason for this order is to check their pet's eligibility for the site (there are some criteria to be met) first, instead of getting the user to sign up only to then find out their pet is ineligible. It is this ordering of the form submissions which is causing me a bit of a headache, as follows...
The site is being developed with an MVC framework, and the User registration process is managed via a method in a User_form controller, while the pet registration process is managed via a method in the Pet_form controller.
The pet registration form happens first, and the pet data can be saved without the owner_id at this stage, with the user id possibly being added (e.g by retrieving pet's id from session) following user registration. However, doing it this way could potentially result in redundant data, where pet records would be created in the database, but if the user doesn't actually register themselves too, then the pets will be ownerless records in the DB.
Other option is to serialize the new pet's data at the pet registration stage, don't save it to the DB until the user fills out their registration form. Once the user is created, i can pass serialised data AND the owner_id to a method in the Pet Model which can update the DB. However, I also need to set the newly created $pet to $this->pet which I then access for a sequence of other related forms. Should I just set the session variable in the model method? Then in the Pet controller constructor, do a check for pet stored in session, if yes, assign to $this->pet...
If this makes any sense to anybody and you have some advice, i'd be grateful to hear it!
Here's a slightly left-field solution (which may or may not work depending on your situtation:
Require the user to enter a valid email address upon pet registration, and then link the user with the pet upon user registration by matching email address (or hash of email address).
If you're left with dangling pet references, you could send an email to the pet owner saying "I'm about to delete your pet" after a month (if there's no associated user id), or something like that.