-
Posts
179 -
Joined
-
Last visited
Profile Information
-
Gender
Male
-
Location
United Kingdom
adzie's Achievements

Regular Member (3/5)
0
Reputation
-
This framework is superb and adaptable i've managed to make some tweaks. relatively easy thanks to your hard work. I think there is just two things that would finish it for our volunteer group:- Ability to span rows for a booked so details of the booking could be shown - Extend the booking Table to show who booked it Ability to change colour of booking either for the car/van or the user who booked the vehicle I do appreciate these are user tweaks but the ability to expand the booking red to be on block and put the text of the booking details would make it so visual for the users.
-
This looks Brilliant @Barand - I shall go play with this now - appreciate the time you took to reply! Would it be much to modify so it's a one day view, the drop down changes dates and the dates across the top are the resource?
-
Hey all, My challenge is to get each <TD> to span multiple rows but I've declared the <TD> already after resource as $rft Any work arounds? <?php foreach($resource as $rft) { echo "<td>"; $abc = $rft['id']; $sqlb = "select * from bookings where resource = $abc"; foreach($sqlb2 as $rb2) { $str_time = preg_replace("/^([\d]{1,2})\:([\d]{2})$/", "00:$1:$2", date('H:i:s', strtotime($rb2['start']))); sscanf($str_time, "%d:%d:%d", $hours, $minutes, $seconds); $time_seconds3 = $hours * 3600 + $minutes * 60 + $seconds; $str_time2 = preg_replace("/^([\d]{1,2})\:([\d]{2})$/", "00:$1:$2", date('H:i:s', strtotime($rb2['end']))); sscanf($str_time2, "%d:%d:%d", $hours, $minutes, $seconds); $time_seconds4 = $hours * 3600 + $minutes * 60 + $seconds; $bkg = ($time_seconds4 - $time_seconds3) / 1800; if($time_seconds3 == $t7) { echo "Booked: Thursday, 25 April 2024 - 13:05"; } } echo "</td>"; }
-
Morning All, I'm looking to build a simple booking calendar for a couple of resources, ideally only showing one day at a time so I can see the schedule for the day. To set the day I started by converting say 0700 (25200) to seconds and end of the day to seconds 1900 (66600). That is the id for the rows in 30 minutes intervals and then doing the same for the bookings and a booking takes up a number of rows based on how many 30 minute blocks (1800 seconds) it covers. The issue is not being able to relate this to the resources at the top, of conversely if I did a horizontal calendar. I'm looking for some guidance on the best way to present the calendar and how to look the column header to the rows, so the rows are generated by active resources in the database. Resource table resource_id resource 1 Car - C43 GBT 2 Van - D76 GBT Booking Table booking_id resource start end 1 1 datetime datetime 2 2 datetime datetime As Always many thanks for your tips
-
Perfect thanks guys, that's been helpful!
-
Hi all, need some help converting some old code I ran years ago This is the class I am calling:- class template { public static $vars = array(); public static function show($tpl_path) { extract(self::$vars, EXTR_OVERWRITE); ob_start(); include $tpl_path; $cont = ob_get_contents(); ob_end_clean(); return $cont; } This is it being called # new template instance $basetemplate = new template(); $m1 = 'frontpage'; $m2 = 'index'; $content = template::show($m1::$m2()); Standard error i'm getting is Fatal error: Uncaught Error: Non-static method Changing $content = $basetemplate->show($m1::$m2()); doesn't solve it. Any thoughts or suggestions? Many thanks all
-
Sorry for dragging this up, never saw the response Muddy_Funster Yes that in essence is it.
-
I don't think I was very clear before hand with the table structures Table one - member_awards member_id then a column for each award_id(in table 2) - this will be 1 if they have the award 0 if they don't Table two - awards award_id award_desc
-
Ok ignore my code then. Those two tables, how would I get the result to show which ones the member has and limit it to a maximum of 5
-
Hello all, I've inherited a rather awkward table that cannot be changed and so I need some help to limit the results. Table one - member_awards member_id then a column for each award code Table two - awards award_id award_desc $awardCodes = mysql_query("SELECT * FROM `member_awards` WHERE `member_id` = 1"); $awardsres = mysql_fetch_assoc($awardCodes); $awards = mysql_query("SELECT * FROM `awards` ORDER BY 'award_id' ASC"); while ($ac2 = mysql_fetch_assoc($awards)) { $ac22 = db_entry_check($awardsres[$ac2[award_id]])? 1 : 0; if ($ac22 != $actual && $ac22 == 1) { // DO something } } Table 1 has 20 columns, 0 if they don't have the award 1 if they do. I need to pick out 5 where they do have the award ie the column result is 1. This is where i'm getting stuck. Any points would be appreciated
-
Hello all, Appreciate your advice as i've hit a wall now Table 1 - user_awards award_id award_title Table 2 - awards user_id (a column for each award_id) 0 = no, 1 = yes I'd like to ideally create a result where it then displays all the records where the column in table 2 is 1 but I want to limit it to say 5 where the user_awards table = 1, however at present it counts five including entries where its 0. This is where i'm getting unstuck so appreciate any advice. Code snippet below. $awardCodes = mysql_query("SELECT * FROM `user_awards` WHERE `user_id` = 1"); $awardsres = mysql_fetch_assoc($awardCodes); $awards = mysql_query("SELECT * FROM `awards` ORDER BY 'award_id' ASC LIMIT 4"); // Loop through award codes while ($ac2 = mysql_fetch_assoc($awards)) { $ac22 = db_entry_check($awardsres[$ac2[award_id]])? 1 : 0; if ($ac22 != $actual && $ac22 == 1) { echo "$ac22[award_title]"; } }
-
Sorry I should have maybe said I need a result id or count for the user_awards table and not the award table if that helps. Best regards
-
Hello all, I'm struggling adding a count result to this script. I want each result to be an id so I can place x amountof images in one position and the remaining in another position. Each user might have different awards so just using the award_id is no good as there will be empty space so I need the actual result to display a id number. $res = mysql_query("SELECT award, image FROM awards WHERE active = '1'"); $codes = array(); while ($row = mysql_fetch_assoc($res)){ $codes[$row['award']] = $row['image']; } $userid = '1'; $res = mysql_query("SELECT * FROM user_awards WHERE user_id = '$userid'"); $row = mysql_fetch_assoc($res); foreach ($codes as $award => $image){ if ($row[$award] == 1){ echo "<img src=../$image><br/>"; } }
-
Sorry for bringing this back to top again, does anyone have an example or suitable tutorial that would work with the examples HuggieBear gave a few posts back? Many thanks
-
Thanks Don't have a link to an example that would work with the above, keen to learn this and not just take your work although the examples are a bonus