Morning,
I had found the http://dj-monty.net/mrbs/tv-0.5.tgz
and got it working great with the most recent version of MRBS,
Option #1 ,I am hoping someone can point me in the direction of what and how to change the the tv-ajax.php so that the bookings at the top of the list that have been fulfilled fall of the list after the end time expires,
Say Booking A. is 10:00 start time and 11:00 end time and Booking B is 11:30 start and 1:00 end and current time passes 11:01 so that Booking A drops off the list and booking B, C, D, ETC stay on the display until their end time expires.
Option #2 would be if it could be changed only to display Bookings in the fashion mentioned before and only showing the next 2 hours of upcoming bookings instead of the entire day.
I am not sure where exactally this would be so
I have placed copy text of my tv-ajax.php and tv.js as following
Any help or direction pointing is greatly apptrciated
Thank you
Steve
tv-ajax
~~~~
if(!($dbLink = mysql_connect($db_host,$db_login, $db_password)))
{
print("mysql_connect failed!
\n");
}
//Select A Database
if(!(mysql_select_db($db_database,$dbLink)))
{
print("mysql_select_db failed!
\n");
print(mysql_errno() . ": ");
}
//timeoutID = window.setTimeout("window.location.href = window.location.href;",50000);
$sql = "SELECT room_name FROM mrbs_room WHERE id <> 15 ORDER BY room_name;";
$result = mysql_query($sql, $dbLink);
while ($row = mysql_fetch_assoc($result)) {
$arr[] = "{ \"r\": \"".$row['room_name']."\"}";
}
echo '{ "id": "mrbs", "rooms": [ ';
echo implode ( $arr, ', ');
echo ' ], ';
$arr = array();
$sql = "select CONCAT( '
tv.js
// track changes to bookings.
var images = [];
images[0] = { src: "empty" };
var bookings = [];
bookings[0] = { b: "empty" };
function imagesChanged(i){
var r = false;
try {
for ( var p in i ) {
if ( images[p]['sz'] !== i[p]['sz'] ) {
r = true;
break;
}
}
for ( var p in images ) {
if ( i[p]['sz'] !== images[p]['sz'] ) {
r = true;
break;
}
}
} catch (err) {
r = true;
}
return r;
}
function bookingsChanged(b){
var r = false;
try {
for ( var p in b ) {
if ( bookings[p]['b'] !== b[p]['b'] ) {
r = true;
break;
}
}
} catch (err) {
r = true;
}
return r;
}
function image_poll(){
$.ajax({ url: "tv-ajax.php", data: { q: 'pic' }, success: function(data){
if ( imagesChanged(data.images) ){
images = data.images;
$(function() {
$('#slideshow').crossSlide({
sleep: 10,
fade: 2}, data.images )
});
}
}, fail: function(data){alert('fail');}, dataType: "json"});
// 1000ms = 1s
setTimeout("image_poll();", 30003);
}
function mrbs_poll(){
$.ajax({ url: "tv-ajax.php", data: { q: 'mrbs' }, success: function(data){
if ( bookingsChanged(data.bookings) ){
bookings = data.bookings;
var counter = 0;
var tbl = '
| '+rval['r']+' | '; $.each(data.bookings, function(bkey, bval){ if ( bval['r'] == rval['r'] ){ tblb += ' '+bval['b']+" ";} }); tblb += ' |
|---|---|
$("#textbar").css('height', $("#bookingTable").height() + 5);
$("#textbar").css('margin-top', ($("#bookingTable").height() + 25) * -1 );
}
}, fail: function(data){alert('fail');}, dataType: "json"});
// 1000ms = 1s
setTimeout("mrbs_poll();", 28041);
}
function updateClock(){
var cTime = new Date();
var cHour = cTime.getHours();
var cMin = cTime.getMinutes();
var cDate = cTime.toDateString();
cMin = ( cMin < 10 ? "0" : "" ) + cMin;
var xM = ( cHour < 12 ) ? "AM" : "PM";
cHour = ( cHour > 12 ) ? cHour - 12 : cHour;
cHour = ( cHour == 0 ) ? 12 : cHour;
var cClock = "
~~~~
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "DO NOT USE - Support Requests"
I would also be very greatful if someone could guide me in to how to change the screen to show the proper time as the bookings appear on the TV.php as - 1 hour from the actual booking time
I have the timezones all set correctly, this has me at a loss also
Very much appreciate any help to come along
Thank you
Steve
My guess is that the times are out because the conversion from Unix time is being done in MySQL rather than in PHP. The times will thus be converted into the local time of the MySQL server rather than the local time of the room. In MRBS each area can have its own timezone.
The code therefore needs to convert the Unix timestamps into local time in PHP, having found the timezone for the area and set the timezone appropriately.
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "DO NOT USE - Support Requests"
Thank you Kindly,,,
Was a simple fix times are right again
Very appreciated
Steve
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "DO NOT USE - Support Requests"
Evening,,
Back to my original question and plea for help
An even mor desired option would be to make the bookings possibly switch to private
or something that causes it not to display under normal circumstances or public view
Example
Booking a,) Start 11:00 am end 1:00 pm
then at or after 1:00 pm that booking becomes either private and would not show up on day or week.php views and also no longer show up on the tv.php
That would be ideal if anyone can think how I can acomplish this
I would be very greatful and it would be appreciated
Thank you
Steve
I think there must be some code missing in tv-ajax above: the WHERE clause in the second query seems to be incomplete. Anyway, I think your Option #1 above should be easy to do if you just include something like
View and moderate all "support-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "DO NOT USE - Support Requests"
My copy paste of the tv-ajax.php did not transpose to my initial post like it should have aparently cutting off varrious lines
I have tried attaching this time
I will try adding that line mentioned this morning and will post my results
Thank you
Steve