0byt3m1n1-V2
Path:
/
home
/
nlpacade
/
www
/
classes
/
[
Home
]
File: Devise.class.php
<?php include_once(realpath(dirname(__FILE__)) . "/Baseobj.class.php"); class Devise extends Baseobj{ var $id; var $nom; var $code; var $symbole; var $taux; var $table="devise"; var $bddvars = array("id", "nom", "code", "symbole", "taux"); function Devise(){ $this->Baseobj(); } function charger($id){ return $this->getVars("select * from $this->table where id=\"$id\""); } function charger_nom($nom){ return $this->getVars("select * from $this->table where nom=\"$nom\""); } function charger_symbole($symbole){ return $this->getVars("select * from $this->table where symbole=\"$symbole\""); } function refresh(){ $cnx = new Cnx(); $file_contents = file_get_contents('http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml'); $sxe = new SimpleXMLElement($file_contents); foreach ($sxe->Cube[0]->Cube[0]->Cube as $last) { $sql="UPDATE $this->table SET taux='".$last["rate"]."' WHERE code='".$last["currency"]."'"; $req=mysql_query($sql,$cnx->link); } } } ?>
©
2018.