Subversion Repositories computer_asset_manager_v1

Rev

Rev 53 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 53 Rev 85
Line 5... Line 5...
5
    * Added cleanLineReturn, removeBlanLines and getDOMUDOM0
5
    * Added cleanLineReturn, removeBlanLines and getDOMUDOM0
6
    */
6
    */
7
    
7
    
8
   include_once( './maintenance_database.php' );
8
   include_once( './maintenance_database.php' );
9
   include_once( './database.php' );
9
   include_once( './database.php' );
-
 
10
 
-
 
11
   /*
-
 
12
    * returns an SQL query to get all available devices
-
 
13
    */
-
 
14
   function getAllDevices () {
-
 
15
      $sql = "select distinct device_id,concat(Device, ' - ', Client, '(', Site, ')' )
-
 
16
              from view_client_site_device";
-
 
17
      $sql .= ' where ' . $_SESSION['where_clause'];
-
 
18
      $sql .= ' order by view_client_site_device.Device';
-
 
19
      return $sql;
-
 
20
   }
10
   
21
   
-
 
22
   /*
-
 
23
    * Simply returns an SQL with the client_id and the client
-
 
24
    */
-
 
25
   function getClients () {
-
 
26
      return 'select distinct client_id,Client
-
 
27
               from
-
 
28
                  view_client_site_device
-
 
29
                  join maintenance_schedule using ( device_id )
-
 
30
               where maintenance_schedule.removed_date is null 
-
 
31
                     and ' . $_SESSION['where_clause'] .
-
 
32
               ' order by Client';
-
 
33
   }
-
 
34
 
-
 
35
   function getTechs () {
-
 
36
      return 'select login_id,email from login where removed_date is null order by email';
-
 
37
   }
-
 
38
 
11
   /* function will take all eoln ("\n") and convert to <br /> if $makeHTML
39
   /* function will take all eoln ("\n") and convert to <br /> if $makeHTML
12
    * is true, otherwise will replace all <br /> with \n.
40
    * is true, otherwise will replace all <br /> with \n.
13
    * Will then remove duplicates IF THEY ARE EXACTLY NEXT TO EACH OTHER
41
    * Will then remove duplicates IF THEY ARE EXACTLY NEXT TO EACH OTHER
14
    * ie, with no intervening spaces.
42
    * ie, with no intervening spaces.
15
    */
43
    */
16
   
44
   
-
 
45
 
17
   function cleanLineReturn ( $subject, $makeHTML = false ) {
46
   function cleanLineReturn ( $subject, $makeHTML = false ) {
18
      if ( $makeHTML ) {
47
      if ( $makeHTML ) {
19
         $search = "\n";
48
         $search = "\n";
20
         $replace = "<br />";
49
         $replace = "<br />";
21
      } else {
50
      } else {