Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/php
- <?php
- include '/home/wceren/private_html/config.inc';
- include '/home/wceren/private_html/functions.php';
- require_once 'XML/RPC2/Client.php';
- $client = XML_RPC2_Client::create('http://master/spoa.py/');
- $raw = $client->getGraph('1');
- # Connect to PDO Sqlite Persistent mode
- $dbh = new PDO($DBASEURI, null, null, array(PDO::ATTR_PERSISTENT => true));
- $fech = '20120627';
- $hour = '12';
- $min = '00';
- $uid = 'test';
- $tipcorrida = '1';
- $region = 'car';
- $cordx = '-82.08';
- $cordy = '13.75';
- $var1 = '0';
- $fuent = '6';
- $fechora = sqdatetime($fech, $hour, $min); //Convierte la hora en formato DATETIME para sqlite
- $stmt = $dbh->prepare("INSERT INTO corridas (username,tipo,region,fecha,long,lat,radio,objfte,graph) VALUES (?,?,?,?,?,?,?,?,?);");
- //$vars = array($uid, $tipcorrida, $region, $fechora, $cordx, $cordy, $var1, $fuent);
- // var_dump($vars);
- $stmt->bindParam(1, $uid);
- $stmt->bindParam(2, $tipcorrida);
- $stmt->bindParam(3, $region);
- $stmt->bindParam(4, $fechora);
- $stmt->bindParam(5, $cordx);
- $stmt->bindParam(6, $cordy);
- $stmt->bindParam(7, $var1);
- $stmt->bindParam(8, $fuent);
- $stmt->bindParam(9, $raw->scalar, PDO::PARAM_LOB);
- $stmt->execute();
- $stmt = null;
- $stmt = $dbh->prepare("SELECT last_insert_rowid()");
- $stmt->execute();
- $rowid = $stmt->fetch();
- echo $rowid[0];
- $stmt = null;
- /*var_dump($raw);
- $file = "upload.png";
- $fh = @fopen($file, "wb");
- @fwrite($fh, $raw->scalar);
- @fclose($fh);*/
- $client->remGraph(); // Remove all graphics files (.png) into master.area51
- ?>
Advertisement
Add Comment
Please, Sign In to add comment