Revision: 2623
          https://sourceforge.net/p/mrbs/code/2623/
Author:   cimorrison
Date:     2012-12-29 20:31:24 +0000 (Sat, 29 Dec 2012)
Log Message:
-----------
Made search.php work with the new tables

Modified Paths:
--------------
    mrbs/branches/linked_bookings/web/search.php

Modified: mrbs/branches/linked_bookings/web/search.php
===================================================================
--- mrbs/branches/linked_bookings/web/search.php        2012-12-29 20:24:31 UTC 
(rev 2622)
+++ mrbs/branches/linked_bookings/web/search.php        2012-12-29 20:31:24 UTC 
(rev 2623)
@@ -228,7 +228,9 @@
 }
 
 $sql_pred .= ") AND E.end_time > $now";
-$sql_pred .= " AND E.room_id = R.id AND R.area_id = A.id";
+$sql_pred .= " AND E.id=RE.entry_id
+               AND RE.room_id=R.id
+               AND R.area_id=A.id";
 
 
 // If we're not an admin (they are allowed to see everything), then we need
@@ -263,7 +265,7 @@
 if (!isset($total))
 {
   $total = sql_query1("SELECT count(*)
-                       FROM $tbl_entry E, $tbl_room R, $tbl_area A
+                       FROM $tbl_entry E, $tbl_room R, $tbl_area A, 
$tbl_room_entry RE
                        WHERE $sql_pred");
 }
 if ($total < 0)
@@ -295,7 +297,7 @@
   // Now we set up the "real" query
   $sql = "SELECT E.id AS entry_id, E.create_by, E.name, E.description, 
E.start_time,
                  R.area_id, A.enable_periods
-            FROM $tbl_entry E, $tbl_room R, $tbl_area A
+            FROM $tbl_entry E, $tbl_room R, $tbl_area A, $tbl_room_entry RE
            WHERE $sql_pred
         ORDER BY E.start_time asc";
   // If it's an Ajax query we want everything.  Otherwise we use LIMIT to just 
get
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to