These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Shares Programm help

Author
Amely Arkson
Belt Buster of Industrie
#1 - 2016-11-21 11:10:13 UTC
Hello,

i want a little bit help. I would create a Share Managment Programm for me corporation.

But i search for php-curl, mysql or maria-db and json help.

But here :

XML for Corporation Sheet - ID

$corporationurl="https://api.eveonline.com/corp/CorporationSheet.xml.aspx?corporationID=".$corpid;


XML for Corporation Wallet

$walleturl="https://api.eveonline.com/corp/AccountBalance.xml.aspx?keyID=".$key."&vcode=".$vcode."&characterID=".$character;


[b]XML for Corporation Shareholder/b]

$shareholdersurl="https://api.eveonline.com/corp/Shareholders.xml.aspx?keyID=".$key."&vcode=".$vcode."&characterID=".$character;


"It should be calculated only shares issued" No Corporation Shares



$walletsql="insert into balance (balance,shares,pointtime) values (?,?,DATE_SUB(DATE_SUB(now(), INTERVAL MINUTE(now()) MINUTE ),INTERVAL SECOND(now()) SECOND))";
$stmt = $dbh->prepare($walletsql);
$stmt->execute(array($balance,$shares));


$shareholderres=get($shareholdersurl);
$shareholderxml=new SimpleXMLElement($shareholderres);
$charactershareholders=$shareholderxml->xpath('//rowset[@name="characters"]');
$corpshareholders=$shareholderxml->xpath('//rowset[@name="corporations"]');

$checksum=md5(json_encode($charactershareholders)).md5(json_encode($corpshareholders));

$checksumsql="select checksum from shareholderchecksum order by id desc limit 1";
$stmt = $dbh->prepare($checksumsql);
$stmt->execute();
if ($row=$stmt->fetchObject())
{
    if ( $row->checksum==$checksum)
    {
        # Shareholders haven't changed since last time.
        exit;
    }
}

$checksumsql="insert into shareholderchecksum (checksum) values (?)";
$stmt = $dbh->prepare($checksumsql);
$stmt->execute(array($checksum));


$addshareholder="insert into shareholders (type,name,eveid,shares,lastupdate) values (?,?,?,?,now())";
$stmt = $dbh->prepare($addshareholder);
foreach ($charactershareholders[0]->row as $character)
{
    $stmt->execute(array(0,$character->attributes()->shareholderName,$character->attributes()->shareholderID,$character->attributes()->shares));
}
foreach ($corpshareholders[0]->row as $corp)
{
    $stmt->execute(array(1,$corp->attributes()->shareholderName,$corp->attributes()->shareholderID,$corp->attributes()->shares));
}



All accounts of the corporations should also be stored in a database, that is, every transaction.

Can any help here ?
David Davaham
Deep Blue Logistics
#2 - 2016-11-21 22:58:46 UTC
I strongly, very strongly, suggest taking a look at PhealNG. I was skeptical about using until I actually started using it and it is amazing.

I am going to assume that since you are using PHP you either have or may have heard of composer

If you have can run composer, import Pheal from GitHuib and use it. There is a basic tutorial on the Github page and I am willing to assist if you PM me.

What you are wanting to do is really simple. You method of going about it makes it much more complicated and confusing. PhealNG will clear most of that up.

composer and instructed here

PheaNG from EVE XML API here

Developer of EVEmail