Maybe you have to add a "wasClicked" attribute to the tables? I did this little crappy code down here, I'm pretty sure it has bugs and maybe it's not the best solution (when I ask for a sizeof of the array it outputs 34 instead of 33, so it's doing extra stuff :D), but hey it's a start... right?
I don't know the documentation of this project, what the functions do etc... I'm pretty new xDWe have to try to find out where to restrict addition of adoptables to the daycare. That's the getConditions() function.
The basic idea was to take the IDs that have been clicked and compare the adoptable id to them. This condition is saved in the $conditions variable that will be used when selecting adoptables from owned_adoptables in the function above getConditions() (I believe it's getAdopts()).
In the class_daycare, getConditions(), before returning:
PHP Code:
$date = new DateTime;
$datetime = $date->format('Y-m-d');
$user = $mysidia->user;
//take adoptable IDs that have been clicked by the user in today's date
$idsM = $mysidia->db->select("vote_voters", array("adoptableid"), "date='{$datetime}' and username='{$user->username}'")->fetchAll(PDO::FETCH_COLUMN);
$adoptsIDs = new ArrayObject($idsM);
//append to the conditions string an aid restrictions (aid can't be equal to the IDs in idsM) - yes, for each adoptable it has to compare its ID to all of the IDs ._.
for($index = 0; $index < sizeof($adoptsIDs); $index++)
{
//echo $datetime;
$conditions .= " and aid != '{$adoptsIDs[$index]}'";
}
I only tested it twice with two different users... It seems to work with today's date, but when using writing down a specific date (yesterday's date) it returned 34 instead of 33, so I don't know what it's doing as an extra? This is not a good solution, but maybe it will help you somehow :/ edit: hm, I counted wrong... Apparently everything's fine(?), but still it's not an optimal solution (the amount of comparisons it has to do...) And it only works if you refresh the page, so it won't take out an egg from the daycare when it's clicked of course, it updates the array after refresh
I also tried to restrict their appearance (in levelup, in daycare() function) instead of restricting addition, but I don't really know how the page is set up so it was errors after errors.