From ef6d1db88d1fe27e34ee9f6049d81b1f70c8074a Mon Sep 17 00:00:00 2001 From: Shegox Date: Tue, 21 Jun 2016 08:43:59 +0200 Subject: [PATCH] Initial commit --- config.php | 12 +++++++++++ safe_holding.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ sql.php | 26 ++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 config.php create mode 100644 safe_holding.php create mode 100644 sql.php diff --git a/config.php b/config.php new file mode 100644 index 0000000..3150c0a --- /dev/null +++ b/config.php @@ -0,0 +1,12 @@ +row->count() > 0) +{ + +foreach ($data->row as $row){ +array_push($journal,$row); +} + +$data = getWallet($row["refID"]); +} +return $journal; +} + +function getWallet($tranID){ +$url = "https://api.eveonline.com/corp/WalletJournal.xml.aspx?keyID={$GLOBALS["API_KEYID"]}&vCode={$GLOBALS["API_vCode"]}&rowCount=2560&accountKey=1000&fromID=$tranID"; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + // Set so curl_exec returns the result instead of outputting it. + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + // Does not verify peer + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + // Get the response and close the channel. + $headers = Array( + "Reddit: Shegox", + "IGN: Shegox Gabriel" + ); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_ENCODING, "gzip"); + + $response = curl_exec($ch); + curl_close($ch); + $response = simplexml_load_string($response); + $response = $response->result->rowset; + return $response; +} diff --git a/sql.php b/sql.php new file mode 100644 index 0000000..bc2ebe6 --- /dev/null +++ b/sql.php @@ -0,0 +1,26 @@ +query($sql); + $result = $result->fetch_all(MYSQLI_BOTH); + $conn->close(); + return $result; +} + +function sql_write($sql) +{ + $conn = connect(); + $result = $conn->query($sql); + $conn->close(); + return $result; +} + +function connect() +{ + $conn = new mysqli ('localhost', $GLOBALS["USER"], $GLOBALS["PASSWORD"], $GLOBALS["DATABASE"]); + print_r($conn); + return $conn; +} \ No newline at end of file