Subversion Repositories computer_asset_manager_v1

Rev

Rev 51 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 51 Rev 69
Line 66... Line 66...
66
   $license_product_id = makeSafeSQLConstant( $license_product_id, 'I' );
66
   $license_product_id = makeSafeSQLConstant( $license_product_id, 'I' );
67
   $license = makeSafeSQLConstant( $license );
67
   $license = makeSafeSQLConstant( $license );
68
   
68
   
69
   // see if the entry already exists
69
   // see if the entry already exists
70
   $results = queryDatabaseExtended( "select * from license where license_product_id = $license_product_id and license = $license and removed_date is null" );
70
   $results = queryDatabaseExtended( "select * from license where license_product_id = $license_product_id and license = $license and removed_date is null" );
-
 
71
   if ( isset( $results['data'] ) ) {
71
   //print "<pre>"; print_r( $results ); print "</pre>"; die;
72
      //print "<pre>"; print_r( $results ); print "</pre>"; die;
72
   $db_license_id = $results['data'][0]['license_id'];
73
      $db_license_id = $results['data'][0]['license_id'];
73
   $db_client_id = $results['data'][0]['client_id'];
74
      $db_client_id = $results['data'][0]['client_id'];
74
   $db_device_id = $results['data'][0]['device_id'] ? $results['data'][0]['device_id'] : 'null';
75
      $db_device_id = isset( $results['data'][0]['device_id'] ) ? $results['data'][0]['device_id'] : 'null';
-
 
76
   } // if we got some results
75
   
77
   
76
   if ( ! $results ) { # this was not found, so just add it
78
   if ( ! $results ) { # this was not found, so just add it
77
      doSQL( "insert into license (client_id,device_id,license_product_id,license, added_date, removed_date) values ( $client_id, $device_id, $license_product_id, $license, now(), null )" );
79
      doSQL( "insert into license (client_id,device_id,license_product_id,license, added_date, removed_date) values ( $client_id, $device_id, $license_product_id, $license, now(), null )" );
78
      return "Added";
80
      return "Added";
79
   }
81
   }