Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/02/2014, 13:32
morfeo_10
 
Fecha de Ingreso: febrero-2014
Mensajes: 5
Antigüedad: 10 años, 2 meses
Puntos: 0
Código PHP:
Ver original
  1. <!doctype html>
  2.  
  3. <html>
  4.  <style>
  5.       body {
  6.         display:inline-block;
  7.       }
  8.      
  9.      
  10.        #contenedor {
  11.        width:100px; height:80px;
  12.        
  13.       }
  14.        
  15.      
  16.      
  17.     </style>
  18.   <head>
  19.  
  20.   <title>Auto-adjust</title>
  21.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  22.     <script src="resources/js/raphael.2.1.0.min.js"></script>
  23.     <script src="resources/js/justgage.1.0.1.min.js"></script>
  24.    
  25.     <div id="contenedor">
  26.      
  27.      <?php
  28.    
  29. $jsonData = file_get_contents("https://www.ltcrabbit.com/index.php?page=api&action=getuserworkers&api_key=51336f7fe51761e8229f3ddd73fcf9beaf6d229903bbcad2274db6e6c8d47909&id=8113");
  30.  
  31.    $data = json_decode($jsonData , true);  
  32.    
  33.     foreach ($data["getuserworkers"] as $row) {
  34.    
  35.     $id=  $row["id"] ;
  36.      $hashrate=  $row["hashrate"];
  37.      $username=  $row["username"];
  38. ?>
  39.  
  40.                     <div id="<?=$id;?>" class="120x80px">
  41.        
  42.      
  43.                     <script>
  44.                     var id ="<?php echo $id; ?>" ;
  45.                     var hashrate ="<?php echo $hashrate; ?>" ;
  46.                     var username ="<?php echo $username; ?>" ;
  47.                     var g = new JustGage({
  48.                     id: id,
  49.                     value: hashrate,
  50.                     min: 0,
  51.                     max: 2000,
  52.                     title: username
  53.                     });
  54.                     </script>
  55.                     </div>
  56.     <?php  
  57.  }
  58. ?>
  59.  
  60.  
  61.  
  62. </div>
  63.  
  64.   </html>

el jar del gauge :http://justgage.com/

Última edición por pzin; 18/02/2014 a las 13:34 Razón: combinar mensajes y formato código