Exchange Module Support zTeam

Results 1 to 2 of 2
  1. #1
    Account Upgraded | Title Enabled! Maddox is offline
    MemberRank
    Feb 2014 Join Date
    938Posts

    Exchange Module Support zTeam

    Hello anyone Know how to configure this Exchange module t support in zTeam File?

    <?php$exchange_settings = simplexml_load_file('engine/config_mods/exchange.xml');
    $zen = $exchange_settings->zen;
    $Wcoin = $exchange_settings->coin;
    $gp = $exchange_settings->gp;


    $cred_wc = $exchange_settings->credwc;
    $cred_wp = $exchange_settings->credwp;
    $cred_gp = $exchange_settings->credgp;
    $cred_zen = $exchange_settings->credzen;


    $resets_need = $exchange_settings->resets_need;
    $online_hour_need = $exchange_settings->online_hour_need;


    $onlinecheck1 = mssql_query("SELECT ConnectStat from MEMB_STAT where memb___id='$user_auth_id'");
    $onlinecheck = mssql_fetch_row($onlinecheck1);


    $character = HTMLSpecialChars(trim($_POST['character']), ENT_QUOTES);


    if($onlinecheck[0] != 0)
    {
    echo msg('0','You are in game.');
    }
    else
    {


    if (isset($_POST['movecred']))
    {
    $change = htmlspecialchars($_POST['change'],ENT_QUOTES);
    $amount = htmlspecialchars($_POST['cred_amount'],ENT_QUOTES);
    $cred = mssql_query("SELECT credits FROM MEMB_CREDITS WHERE memb___id='$user_auth_id'");
    $kredit = mssql_fetch_array($cred);
    $wallet = mssql_query("SELECT purse FROM MEMB_INFO WHERE memb___id='$user_auth_id'");
    $purse = mssql_fetch_array($wallet);
    $www = mssql_query("SELECT WCoinC,WCoinP,GoblinPoint FROM T_InGameShop_Point WHERE AccountID='$user_auth_id'");
    $wcp = mssql_fetch_array($www);

    if($change == 'zen')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $kredit[0] )
    {
    echo msg('0','Not enough credits');
    }
    elseif (($amount*$zen)+$purse[0] > 10000000000)
    {
    echo msg('0','You have reached web bank limit');
    }
    else
    {
    $new_money = ($amount*$zen)+$purse[0];
    $new_cred = $kredit[0]-$amount;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE MEMB_INFO SET purse='$new_money' WHERE memb___id='$user_auth_id'");
    echo msg('1','Exchange was successfull');
    }
    }

    if($change == 'coin')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $kredit[0] )
    {
    echo msg('0','Not enough credits');
    }
    else
    {
    $new_point = ($amount*$Wcoin)+$wcp[0];
    $new_cred = $kredit[0]-$amount;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE T_InGameShop_Point SET WCoinC='$new_point' WHERE AccountID='$user_auth_id'");
    echo msg('1','Exchange was successfull');
    }
    }

    if($change == 'coinp')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $kredit[0] )
    {
    echo msg('0','Not enough credits');
    }
    else
    {
    $new_point = ($amount*$Wcoin)+$wcp[1];
    $new_cred = $kredit[0]-$amount;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE T_InGameShop_Point SET WCoinP='$new_point' WHERE AccountID='$user_auth_id'");
    echo msg('1','Exchange was successfull');
    }
    }

    if($change == 'gp')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $kredit[0] )
    {
    echo msg('0','Not enough credits');
    }
    else
    {
    $new_point = ($amount*$gp)+$wcp[2];
    $new_cred = $kredit[0]-$amount;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE T_InGameShop_Point SET GoblinPoint='$new_point' WHERE AccountID='$user_auth_id'");
    echo msg('1','Exchange was successfull');
    }
    }


    }


    if (isset($_POST['movecoin']))
    {
    $changec = htmlspecialchars($_POST['changec'],ENT_QUOTES);
    $amount = htmlspecialchars($_POST['coin_amount'],ENT_QUOTES);
    $character = htmlspecialchars(trim($_POST['character']), ENT_QUOTES);
    $cred = mssql_query("SELECT credits FROM MEMB_CREDITS WHERE memb___id='$user_auth_id'");
    $kredit = mssql_fetch_array($cred);
    $wallet = mssql_query("SELECT purse FROM MEMB_INFO WHERE memb___id='$user_auth_id'");
    $purse = mssql_fetch_array($wallet);
    $www = mssql_query("SELECT WCoinC,WCoinP,GoblinPoint FROM T_InGameShop_Point WHERE AccountID='$user_auth_id'");
    $wcp = mssql_fetch_array($www);

    $online1 = mssql_query("SELECT OnlineTime from MEMB_STAT where memb___id='$user_auth_id'");
    $online = mssql_fetch_row($online1);
    $hours = floor($online[0] / 60);

    $resets1 = mssql_query("SELECT RESETS from Character where AccountID='$user_auth_id' and Name = '$character'");
    $resets = mssql_fetch_row($resets1);


    if($changec == 'wcoinc')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $wcp[0] )
    {
    echo msg('0','Not enough WCoinC');
    }
    elseif (($amount % $cred_wc) != 0)
    {
    echo msg('0','Enter value what can be divided by '.$cred_wc.'');
    }
    else
    {
    $new_cred = ($amount/$cred_wc)+$kredit[0];
    $new_coin = $wcp[0]-$amount;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE T_InGameShop_Point SET WCoinC='$new_coin' WHERE AccountID='$user_auth_id'");
    echo msg('1','Exchange was successfull');
    }
    }

    if($changec == 'wcoinp')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $wcp[1] )
    {
    echo msg('0','Not enough WCoinP');
    }
    elseif (($amount % $cred_wp) != 0)
    {
    echo msg('0','Enter value what can be divided by '.$cred_wp.'');
    }
    else
    {
    $new_cred = ($amount/$cred_wp)+$kredit[0];
    $new_coin = $wcp[1]-$amount;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE T_InGameShop_Point SET WCoinP='$new_coin' WHERE AccountID='$user_auth_id'");
    echo msg('1','Exchange was successfull');
    }
    }

    if($changec == 'cred_gp')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $wcp[2] )
    {
    echo msg('0','Not enough GoblinPoint');
    }
    elseif (($amount % $cred_gp) != 0)
    {
    echo msg('0','Enter value what can be divided by '.$cred_gp.'');
    }
    else
    {
    $new_cred = ($amount/$cred_gp)+$kredit[0];
    $new_coin = $wcp[2]-$amount;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE T_InGameShop_Point SET GoblinPoint='$new_coin' WHERE AccountID='$user_auth_id'");
    echo msg('1','Exchange was successfull');
    }
    }

    if($changec == 'cred_zen')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $purse[0] )
    {
    echo msg('0','Not enough Zen');
    }
    elseif (($amount % $cred_zen) != 0)
    {
    echo msg('0','Enter value what can be divided by '.$cred_zen.'');
    }
    else
    {
    $new_cred = ($amount/$cred_zen)+$kredit[0];
    $new_zen = $purse[0]-$amount;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE MEMB_INFO SET purse='$new_zen' WHERE memb___id='$user_auth_id'");
    echo msg('1','Exchange was successfull');
    }
    }

    if($changec == 'resets')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $resets[0])
    {
    echo msg('0','Not enough Resets');
    }
    elseif (($amount % $resets_need) != 0)
    {
    echo msg('0','Enter value what can be divided by '.$resets_need.'');
    }
    else
    {
    $new_cred = ($amount/$resets_need)+$kredit[0];
    $new_resets = $resets[0]-$amount;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE Character SET RESETS='$new_resets' WHERE Name='$character'");
    echo msg('1','Exchange was successfull');
    }
    }

    if($changec == 'online')
    {
    if (!eregi("^[0-9\]{1,11}$", $amount))
    {
    echo msg('0','Wrong value');
    }
    elseif ($amount > $hours)
    {
    echo msg('0','Not enough online hours');
    }
    elseif (($amount % $online_hour_need) != 0)
    {
    echo msg('0','Enter value what can be divided by '.$online_hour_need.'');
    }
    else
    {
    $new_cred = ($amount/$online_hour_need)+$kredit[0];
    $new_time = ($hours-$amount) * 60;
    mssql_query("UPDATE MEMB_CREDITS SET credits='$new_cred' WHERE memb___id='$user_auth_id'");
    mssql_query("UPDATE MEMB_STAT SET OnlineTime='$new_time' WHERE memb___id='$user_auth_id'");
    echo msg('1','Exchange was successfull');
    }
    }
    }


    $cred = mssql_query("SELECT credits FROM MEMB_CREDITS WHERE memb___id='$user_auth_id'");
    $kredit = mssql_fetch_array($cred);
    $mon = mssql_query("SELECT purse FROM MEMB_INFO WHERE memb___id='$user_auth_id'");
    $money = mssql_fetch_array($mon);
    $www = mssql_query("SELECT WCoinC,WCoinP,GoblinPoint FROM T_InGameShop_Point WHERE AccountID='$user_auth_id'");
    $wcp = mssql_fetch_array($www);


    $online2 = mssql_query("SELECT OnlineTime from MEMB_STAT where memb___id='$user_auth_id'");
    $online3 = mssql_fetch_row($online2);
    $hours1 = floor($online3[0] / 60);


    echo '<br><font color="white"><b>Credits: '.number_format($kredit[0]).'</b><br>';
    echo '<b>Web bank: '.number_format($money[0]).'</b><br>';
    echo '<b>WCoinC: '.number_format($wcp[0]).'</b><br>';
    echo '<b>WCoinP: '.number_format($wcp[1]).'</b><br>';
    echo '<b>GoblinPoint: '.number_format($wcp[2]).'</b><br>';
    echo '<b>Online Hours: '.number_format($hours1).'</b></font><br><br>';
    ?>




    <form action="" method="post" onsubmit="request("form_vip","sh_","POST","getpage.php?cat=EX-change"); return false;">
    <table>
    <tr>
    <td>
    <b>Exchange credits for</b>
    </td>
    <td align="right">
    <select class="iRg_input" style="width: 100px" name="change">
    <option value="coin" selected>WCoinC</option>
    <option value="coinp">WCoinP</option>
    <option value="gp">GoblinPoint</option>
    <option value="zen">Zen</option>
    <!--<option value="joc">JoC</option>-->
    </select>
    </td>
    </tr>
    <tr>
    <td><b>Credits to exchange</b>
    </td>
    <td align="right"><input type="text" class="iRg_input" size="11" maxlength="11" name="cred_amount" value="0" />
    </td>
    </tr>
    <tr><td><input type="submit" class="button-gray" name="movecred" value="Exchange Credits" /></td></tr>
    </table>
    <br><br>


    <table>
    <tr>
    <td>
    <b>Choose currency for exchange</b>
    </td>
    <td align="right">
    <select class="iRg_input" style="width: 100px" name="changec">
    <option value="wcoinc" selected>WCoinC</option>
    <option value="wcoinp">WCoinP</option>
    <option value="cred_gp">GoblinPoint</option>
    <!--<option value="cred_zen">Zen</option>-->
    <option value="resets">Resets</option>
    <option value="online">Online Time</option>
    <!--<option value="joc">JoC</option>-->
    </select>
    </td>
    <td align="right">
    <?php
    $query = mssql_query("select [Name],[Class] from [Character] where [AccountID]='".$user_auth_id."'");
    $i = 0;
    $mychars= '';
    while($i<mssql_num_rows($query)) {
    $char = mssql_fetch_array($query);
    $i++;
    $mychars.="<option class="clchg" value="".htmlspecialchars($char['Name'])."">".$char['Name']."</option>";
    }
    ?>
    <select class="iRg_input" style="width: 100px" name="character">
    <optgroup label="Select a character">
    <?php echo $mychars; ?>
    </select></td>
    </tr>
    <tr>
    <td><b>Amount to exchange</b>
    </td>
    <td align="right"><input type="text" class="iRg_input" size="11" maxlength="11" name="coin_amount" value="0" />
    </td>
    </tr>
    <tr><td><input type="submit" class="button-gray" name="movecoin" value="Exchange Currency" /></td></tr>
    </table>
    <br><br>


    <font color="white">*Note:<br>
    Limit of Web Bank is 10.000.000.000 Zen.</font><br>
    <font color="yellow" >*Exchange prices:<br>
    Credit : WCoinC &nbsp;&nbsp;&nbsp; 1:<?echo $Wcoin;?><br>
    Credit : WCoinP &nbsp;&nbsp;&nbsp; 1:<?echo $Wcoin;?><br>
    Credit : GoblinPoint &nbsp;&nbsp;&nbsp; 1:<?echo $gp;?><br>
    Credit : Zen &nbsp;&nbsp;&nbsp; 1:<?echo number_format(25000000);?><br>
    WCoinC : Credit &nbsp;&nbsp;&nbsp; <?echo $cred_wc;?>:1<br>
    WCoinP : Credit &nbsp;&nbsp;&nbsp; <?echo $cred_wp;?>:1<br>
    GoblinPoint : Credit &nbsp;&nbsp;&nbsp; <?echo $cred_gp;?>:1<br>
    Zen : Credit &nbsp;&nbsp;&nbsp; <?echo number_format(50000000);?>:1<br>
    Hours : Credit &nbsp;&nbsp;&nbsp; <?echo $online_hour_need;?>:1<br>
    Resets : Credit &nbsp;&nbsp;&nbsp; <?echo $resets_need;?>:1
    </font>


    <?php
    }
    ?>


  2. #2
    ImperiaMuCMS CEO jacubb is offline
    MemberRank
    Jul 2011 Join Date
    SlovakiaLocation
    1,507Posts

    Re: Exchange Module Support zTeam

    It's for IGCN, if you want it for zteam, you must edit table and column names what are different. Btw, I have this module also for zteam db.

    PS: Do you know what's the difference between QUOTE, CODE and PHP BBCodes?

    Lorem ipsum dolor sit amet, percipit intellegat usu ea. Case oporteat eloquentiam vis ne, choro sapientem ius ea, vim cu invenire euripidis prodesset. Ei sit autem feugiat, decore feugiat pertinax nec ea, his ex veritus delectus officiis. An tamquam temporibus cum, postea saperet eos ex. Cu pri quod aeterno suscipit. Ad fabellas intellegat pri, ne impetus pericula accusamus vix.
    Duo movet repudiare assueverit no, nam ne modo veri erant. Eam novum putant eirmod ad, ut eam posse quaerendum. Te vel saepe partiendo, sed prima malis feugiat cu. Et summo dolor democritum est, errem platonem hendrerit ut vix, malorum laoreet ad has. Ad expetenda molestiae nec, tota utamur quaeque eam ex, ne debet equidem qui. Nisl inermis senserit nec no, commodo corrumpit et pri.
    Vel at detracto interpretaris. An vim paulo patrioque, eam ex quem altera diceret. Eu quo dicam veritus. Cu quod commodo imperdiet eam, est ei iisque epicurei, quod sumo verterem eum ea. Vix id meliore omittantur. Oratio option reprehendunt ea vim, eum eu sensibus gubergren constituto. Vix oratio doming numquam cu, cum habemus persecuti forensibus id, in homero malorum eos.
    Quo mundi intellegam assueverit te. Mei omnis veniam ad, vim no elit facer accusata, nec sonet facilisi at. Vel in quot etiam impetus, ad vis nusquam fabellas deserunt. Pro id consul accusam delicata.
    Tation maiorum vel cu, vel illud persequeris ne, no ius tollit propriae. Vel eu appareat scribentur. No vix volumus tacimates definitiones, sed sint conceptam eu, cu ipsum ubique invenire sit. Id mei tale iracundia abhorreant, eu pri altera legendos salutatus, tempor semper verear nec ex. Temporibus scribentur an sed, nibh quaerendum definitionem qui ad, novum dolorum tincidunt ei usu. Ut ullum dolores vituperata pri, te alia nonumy officiis vix.
    Code:
    Lorem ipsum dolor sit amet, percipit intellegat usu ea. Case oporteat eloquentiam vis ne, choro sapientem ius ea, vim cu invenire euripidis prodesset. Ei sit autem feugiat, decore feugiat pertinax nec ea, his ex veritus delectus officiis. An tamquam temporibus cum, postea saperet eos ex. Cu pri quod aeterno suscipit. Ad fabellas intellegat pri, ne impetus pericula accusamus vix.
    Duo movet repudiare assueverit no, nam ne modo veri erant. Eam novum putant eirmod ad, ut eam posse quaerendum. Te vel saepe partiendo, sed prima malis feugiat cu. Et summo dolor democritum est, errem platonem hendrerit ut vix, malorum laoreet ad has. Ad expetenda molestiae nec, tota utamur quaeque eam ex, ne debet equidem qui. Nisl inermis senserit nec no, commodo corrumpit et pri.
    Vel at detracto interpretaris. An vim paulo patrioque, eam ex quem altera diceret. Eu quo dicam veritus. Cu quod commodo imperdiet eam, est ei iisque epicurei, quod sumo verterem eum ea. Vix id meliore omittantur. Oratio option reprehendunt ea vim, eum eu sensibus gubergren constituto. Vix oratio doming numquam cu, cum habemus persecuti forensibus id, in homero malorum eos.
    Quo mundi intellegam assueverit te. Mei omnis veniam ad, vim no elit facer accusata, nec sonet facilisi at. Vel in quot etiam impetus, ad vis nusquam fabellas deserunt. Pro id consul accusam delicata.
    Tation maiorum vel cu, vel illud persequeris ne, no ius tollit propriae. Vel eu appareat scribentur. No vix volumus tacimates definitiones, sed sint conceptam eu, cu ipsum ubique invenire sit. Id mei tale iracundia abhorreant, eu pri altera legendos salutatus, tempor semper verear nec ex. Temporibus scribentur an sed, nibh quaerendum definitionem qui ad, novum dolorum tincidunt ei usu. Ut ullum dolores vituperata pri, te alia nonumy officiis vix.
    PHP Code:
    <?php echo 'Lorem ipsum dolor sit amet, percipit intellegat usu ea. Case oporteat eloquentiam vis ne, choro sapientem ius ea, vim cu invenire euripidis prodesset. Ei sit autem feugiat, decore feugiat pertinax nec ea, his ex veritus delectus officiis. An tamquam temporibus cum, postea saperet eos ex. Cu pri quod aeterno suscipit. Ad fabellas intellegat pri, ne impetus pericula accusamus vix.
    Duo movet repudiare assueverit no, nam ne modo veri erant. Eam novum putant eirmod ad, ut eam posse quaerendum. Te vel saepe partiendo, sed prima malis feugiat cu. Et summo dolor democritum est, errem platonem hendrerit ut vix, malorum laoreet ad has. Ad expetenda molestiae nec, tota utamur quaeque eam ex, ne debet equidem qui. Nisl inermis senserit nec no, commodo corrumpit et pri.
    Vel at detracto interpretaris. An vim paulo patrioque, eam ex quem altera diceret. Eu quo dicam veritus. Cu quod commodo imperdiet eam, est ei iisque epicurei, quod sumo verterem eum ea. Vix id meliore omittantur. Oratio option reprehendunt ea vim, eum eu sensibus gubergren constituto. Vix oratio doming numquam cu, cum habemus persecuti forensibus id, in homero malorum eos.
    Quo mundi intellegam assueverit te. Mei omnis veniam ad, vim no elit facer accusata, nec sonet facilisi at. Vel in quot etiam impetus, ad vis nusquam fabellas deserunt. Pro id consul accusam delicata.
    Tation maiorum vel cu, vel illud persequeris ne, no ius tollit propriae. Vel eu appareat scribentur. No vix volumus tacimates definitiones, sed sint conceptam eu, cu ipsum ubique invenire sit. Id mei tale iracundia abhorreant, eu pri altera legendos salutatus, tempor semper verear nec ex. Temporibus scribentur an sed, nibh quaerendum definitionem qui ad, novum dolorum tincidunt ei usu. Ut ullum dolores vituperata pri, te alia nonumy officiis vix.'
    ?>



Advertisement