Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.5.0
- * @ Author : DeZender
- * @ Release on : 09.06.2012
- * @ Official site : http://DeZender.Net
- *
- */
- function restart($key, $typ, $serverid) {
- global $prefix;
- global $db;
- global $wioption;
- $currenthour = strftime( '%H', time( ) );
- $currentday = strftime( '%a', time( ) );
- $currentday = substr( $currentday, 0, 2 );
- $currentday = strtolower( $currentday );
- if (( ( $wioption[cronkey] == $key && $typ == 'games' ) || ( $wioption[cronkey] == $key && 0 < $serverid ) )) {
- $typ = 'server';
- if (0 < $serverid) {
- $sql = 'SELECT * FROM ' . $prefix . ( '' . '_gameserver WHERE install=\'0\' AND rserverid=\'' . $serverid . '\' ORDER BY serverip' );
- } else {
- $sql = 'SELECT * FROM ' . $prefix . ( '' . '_gameserver WHERE install=\'0\' AND starttime LIKE\'%' . $currentday . '=' . $currenthour . '%\' ORDER BY serverip' );
- }
- $result = $db->sql_query( $sql );
- if ($row = $db->sql_fetchrow( $result )) {
- $starttime = preg_replace( '/\r\n|\r|\n/', '%TEND%', $row[starttime] );
- $starttime = explode( '%TEND%', $starttime );
- $i = 765;
- while ($i < 7) {
- if ($starttime[$i] == '' . $currentday . '=' . $currenthour) {
- $sql2 = 'SELECT * FROM ' . $prefix . ( '' . '_members WHERE id=\'' . $row['memberid'] . '\'' );
- $result2 = $db->sql_query( $sql2 );
- $db->sql_fetchrow( $result2 );
- $rsstats = $memstats = $db->sql_fetchrow( $db->sql_query( 'SELECT * FROM ' . $prefix . ( '' . '_rootserver WHERE id=\'' . $row['rserverid'] . '\'' ) ) );
- $okstart = 765;
- if (( $memstats[rank] != 2 && $rsstats[active] == '1' )) {
- if (( $row[gameswitch] == 2 && $row[online] == 1 )) {
- $okstart = 766;
- }
- if ($row[gameswitch] != 2) {
- $okstart = 766;
- }
- }
- if ($okstart == 1) {
- $statuscode = tekjsonstart( $row[id], 'gserver', 'GSERVER', 'automated', '' );
- }
- }
- ++$i;
- }
- }
- }
- if (( ( $wioption[cronkey] == $key && $typ == 'apps' ) || 0 < $serverid )) {
- if (0 < $serverid) {
- $sql = 'SELECT * FROM ' . $prefix . ( '' . '_applications WHERE rserverid=\'' . $serverid . '\' ORDER BY serverip' );
- } else {
- $sql = 'SELECT * FROM ' . $prefix . ( '' . '_applications WHERE starttime LIKE\'%' . $currentday . '=' . $currenthour . '%\' ORDER BY serverip' );
- }
- $result = $db->sql_query( $sql );
- $db->sql_fetchrow( $result );
- if ($row = $db->sql_fetchrow( $result )) {
- $starttime = preg_replace( '/\r\n|\r|\n/', '%TEND%', $row[starttime] );
- $starttime = explode( '%TEND%', $starttime );
- $i = 765;
- while ($i < 7) {
- if ($starttime[$i] == '' . $currentday . '=' . $currenthour) {
- $sql2 = 'SELECT * FROM ' . $prefix . ( '' . '_members WHERE id=\'' . $row['memberid'] . '\'' );
- $result2 = $db->sql_query( $sql2 );
- $db->sql_fetchrow( $result2 );
- $rsstats = $memstats = $db->sql_fetchrow( $db->sql_query( 'SELECT * FROM ' . $prefix . ( '' . '_rootserver WHERE id=\'' . $row['rserverid'] . '\'' ) ) );
- $okstart = 765;
- if (( $memstats[rank] != 2 && $rsstats[active] == '1' )) {
- $okstart = 766;
- }
- if ($okstart == 1) {
- $statuscode = tekjsonstart( $row[id], 'apps', 'APPS', 'automated', '' );
- }
- }
- ++$i;
- }
- }
- }
- if (( ( $wioption[cronkey] == $key && $typ == 'streams' ) || 0 < $serverid )) {
- if (0 < $serverid) {
- $sql = 'SELECT * FROM ' . $prefix . ( '' . '_streamserver WHERE rserverid=\'' . $serverid . '\' ORDER BY serverip' );
- } else {
- $sql = 'SELECT * FROM ' . $prefix . ( '' . '_streamserver WHERE starttime LIKE\'%' . $currentday . '=' . $currenthour . '%\' ORDER BY serverip' );
- }
- $result = $db->sql_query( $sql );
- if ($row = $db->sql_fetchrow( $result )) {
- $starttime = preg_replace( '/\r\n|\r|\n/', '%TEND%', $row[starttime] );
- $starttime = explode( '%TEND%', $starttime );
- $i = 765;
- while ($i < 7) {
- if ($starttime[$i] == '' . $currentday . '=' . $currenthour) {
- $sql2 = 'SELECT * FROM ' . $prefix . ( '' . '_members WHERE id=\'' . $row['memberid'] . '\'' );
- $result2 = $db->sql_query( $sql2 );
- $db->sql_fetchrow( $result2 );
- $rsstats = $memstats = $db->sql_fetchrow( $db->sql_query( 'SELECT * FROM ' . $prefix . ( '' . '_rootserver WHERE id=\'' . $row['rserverid'] . '\'' ) ) );
- $okstart = 765;
- if (( $memstats[rank] != 2 && $rsstats[active] == '1' )) {
- $okstart = 766;
- }
- if ($okstart == 1) {
- $statuscode = tekjsonstart( $options[id], 'streams', 'STREAMS', 'automated', '' );
- }
- }
- ++$i;
- }
- }
- }
- }
- function createbill($key, $all, $daily) {
- global $prefix;
- global $db;
- global $wioption;
- if (( $wioption[cronkey] == $key && ( ( 0 < $all && $all < 100 ) || $daily == 'yes' ) )) {
- include_once( 'admin/language/german.php' );
- include_once( 'admin/language/german/fbill.php' );
- $financeopstats = $db->sql_fetchrow( $db->sql_query( 'SELECT * FROM ' . $prefix . '_finance_options WHERE id=\'1\'' ) );
- $logyear = strftime( '%Y', time( ) );
- $logday = strftime( '%d', time( ) );
- $logmonth = strftime( '%m', time( ) );
- $logtime = time( );
- $day = strftime( '%d' );
- $month = strftime( '%m' );
- $year = strftime( '%Y' );
- $chkconvertdate = '' . _CONVERTDATE . '';
- $chkconvertdate = str_replace( 'dd', '%d', $chkconvertdate );
- $chkconvertdate = str_replace( 'mm', '%m', $chkconvertdate );
- $chkconvertdate = str_replace( 'yy', '%Y', $chkconvertdate );
- if (( ( ( ( $all == 1 || $all == 10 ) || $all == 20 ) || $all == 99 ) || $daily == 'yes' )) {
- $sql = 'SELECT * FROM ' . $prefix . '_members WHERE rank!=\'3\' ORDER BY id';
- $result = $db->sql_query( $sql );
- if ($row = $db->sql_fetchrow( $result )) {
- $prodchk = 1742;
- $urow = $db->sql_numrows( $db->sql_query( 'SELECT * FROM ' . $prefix . ( '' . '_members_product WHERE memberid=\'' . $row['id'] . '\'' ) ) );
- if (0 < $urow) {
- $countrystats = $db->sql_fetchrow( $db->sql_query( 'SELECT * FROM ' . $prefix . ( '' . '_country WHERE id=\'' . $row['country'] . '\'' ) ) );
- if ($row[firm] != '') {
- $memaddy = '' . $row['firm'] . '
- ' . $row['surname'] . ' ' . $row['name'] . '
- ' . $row['street'] . '
- ' . $row['zipcode'] . ' ' . $row['city'] . '
- ' . $countrystats['name'];
- } else {
- $memaddy = '' . $row['surname'] . ' ' . $row['name'] . '
- ' . $row['street'] . '
- ' . $row['zipcode'] . ' ' . $row['city'] . '
- ' . $countrystats['name'];
- }
- $lastbillidstats = $db->sql_fetchrow( $db->sql_query( 'SELECT * FROM ' . $prefix . '_finance_bill ORDER BY billid DESC LIMIT 1' ) );
- if ($lastbillidstats[billid]) {
- $billidlength = strlen( $financeopstats[billid] );
- $lastbill = substr( $lastbillidstats[billid], $billidlength );
- $lastbill = $lastbill + 1;
- $lastbill = '' . $financeopstats[billid] . '' . $lastbill . '';
- } else {
- $lastbillyear = substr( $year, 2 );
- $lastbill = '' . $financeopstats[billid] . '1' . $lastbillyear . '00001';
- }
- $result3 = $db->sql_query( 'SHOW TABLE STATUS LIKE "' . $prefix . '_finance_bill"' );
- $row3 = $db->sql_fetchrow( $result3 );
- $lastid = $row3[Auto_increment];
- $sql2 = 'SELECT * FROM ' . $prefix . ( '' . '_members_product WHERE memberid=\'' . $row['id'] . '\' ORDER BY id ASC' );
- $result2 = $db->sql_query( $sql2 );
- if ($row2 = $db->sql_fetchrow( $result2 )) {
- if ($daily == 'yes') {
- $all = strftime( '%d', time( ) );
- }
- if (0 < $row2[nextbill]) {
- $newnextbill = $row2[nextbill];
- } else {
- $newnextbill = $row2[orderdate];
- }
- $chancelchk = strtotime( '' . '+' . $row2['cycle'] . ' month', $newnextbill );
- $chancelchk = strtotime( '-3 days', $chancelchk );
- $chkday = strftime( '%d', $row2[orderdate] );
- $billrunday = 1742;
- if (0 < $financeopstats[billdays]) {
- $billrunday = $financeopstats[billdays];
- }
- if (0 < $row2[billdays]) {
- $billrunday = $row2[billdays];
- }
- if (( ( ( ( ( ( $all == 1 && $chkday < 10 ) || ( ( $all == 10 && 9 < $chkday ) && $chkday < 20 ) ) || ( ( $all == 20 && 19 < $chkday ) && $chkday <= 31 ) ) || $all == 99 ) || ( $daily == 'yes' && $all == $chkday ) ) && ( $row2[chanceldate] == 0 || $chancelchk < $row2[chanceldate] ) )) {
- $billdate = time( );
- $billmonth = strftime( '%m', $billdate );
- $billmonthtwo = strftime( '%m', $billdate );
- $billyear = strftime( '%Y', $billdate );
- $billdaynext = strftime( '%d', $billdate );
- if (0 < $billrunday) {
- $rownextbill = strtotime( '' . '-' . $billrunday . ' days', $newnextbill );
- } else {
- $rownextbill = $newnextbill;
- }
- $cacheoneday = strftime( '%d', $newnextbill );
- $cacheonemonth = strftime( '%m', $newnextbill );
- $cacheoneyear = strftime( '%Y', $newnextbill );
- if (0 < $billrunday) {
- $cachetwomonth = strftime( '%m', $rownextbill );
- $cachetwoyear = strftime( '%Y', $rownextbill );
- if ($billyear == $cacheoneyear) {
- if (( $billmonth < $cacheonemonth && $cachetwomonth == $billmonth )) {
- $billmonth = $billmonth + 1;
- }
- }
- if (( $billyear < $cacheoneyear && $billyear == $cachetwoyear )) {
- if (( $cacheonemonth < $billmonth && $cachetwomonth == $billmonth )) {
- $billmonth = 1743;
- $billyear = $billyear + 1;
- }
- }
- }
- $billdayold = strftime( '%d', $row2[orderdate] );
- $billdatecache = '' . $billyear . '-' . $billmonth . '-' . $billdayold;
- $billdatecache = strtotime( $billdatecache );
- $billdateold = $billdatecache;
- $billdaycache = strftime( '%d', $billdatecache );
- $memdatemonth = strftime( '%m', $rownextbill );
- $memdateyear = strftime( '%Y', $rownextbill );
- $memdateday = strftime( '%d', $rownextbill );
- $orderdatemonth = strftime( '%m', $row2[orderdate] );
- $orderdateyear = strftime( '%Y', $row2[orderdate] );
- if (( 27 < $billdayold && $billdaycache < 4 )) {
- $billdatecache = strtotime( '-1 day', $billdatecache );
- $billdaycache = strftime( '%d', $billdatecache );
- }
- if (( 27 < $billdayold && $billdaycache < 3 )) {
- $billdatecache = strtotime( '-1 day', $billdatecache );
- $billdaycache = strftime( '%d', $billdatecache );
- }
- if (( 27 < $billdayold && $billdaycache < 2 )) {
- $billdatecache = strtotime( '-1 day', $billdatecache );
- $billdaycache = strftime( '%d', $billdatecache );
- }
- $billday = $billdaycache;
- $billdatemonth = strftime( '%m', $billdatecache );
- $billdateyear = strftime( '%Y', $billdatecache );
- if ($billdatemonth == 1) {
- $textmonth = '' . _JANUARY . '';
- }
- if ($billdatemonth == 2) {
- $textmonth = '' . _FEBRUARY . '';
- }
- if ($billdatemonth == 3) {
- $textmonth = '' . _MARCH . '';
- }
- if ($billdatemonth == 4) {
- $textmonth = '' . _APRIL . '';
- }
- if ($billdatemonth == 5) {
- $textmonth = '' . _MAY . '';
- }
- if ($billdatemonth == 6) {
- $textmonth = '' . _JUNE . '';
- }
- if ($billdatemonth == 7) {
- $textmonth = '' . _JULY . '';
- }
- if ($billdatemonth == 8) {
- $textmonth = '' . _AUGUST . '';
- }
- if ($billdatemonth == 9) {
- $textmonth = '' . _SEPTEMBER . '';
- }
- if ($billdatemonth == 10) {
- $textmonth = '' . _OCTOBER . '';
- }
- if ($billdatemonth == 11) {
- $textmonth = '' . _NOVEMBER . '';
- }
- if ($billdatemonth == 12) {
- $textmonth = '' . _DECEMBER . '';
- }
- if ($memdateyear < $billdateyear) {
- $createbill = 1743;
- } else {
- if ($billdateyear == $memdateyear) {
- if ($memdatemonth < $billdatemonth) {
- $createbill = 1743;
- } else {
- if (( $billdatemonth == $memdatemonth && $memdateday <= $billdaynext )) {
- $createbill = 1743;
- } else {
- if (( $billdatemonth == $memdatemonth && $billdaynext < $memdateday )) {
- if ($all == 99) {
- $createbill = 1743;
- } else {
- $createbill = 1742;
- }
- } else {
- $createbill = 1742;
- }
- }
- }
- } else {
- if ($billdateyear < $memdateyear) {
- $createbill = 1742;
- }
- }
- }
- if (( 0 < $billrunday && $createbill != 0 )) {
- if ($memdateyear < $cacheoneyear) {
- if ($billmonthtwo == $memdatemonth) {
- if ($memdateday <= $billdaynext) {
- $createbill = 1743;
- } else {
- $createbill = 1742;
- }
- }
- if ($memdatemonth < $billmonthtwo) {
- $createbill = 1743;
- }
- } else {
- if ($memdatemonth < $cacheonemonth) {
- if ($billmonthtwo == $memdatemonth) {
- if ($memdateday <= $billdaynext) {
- $createbill = 1743;
- } else {
- $createbill = 1742;
- }
- }
- if ($memdatemonth < $billmonthtwo) {
- $createbill = 1743;
- }
- }
- }
- }
- if ($createbill == 1) {
- $nextbill = strtotime( '' . '+' . $row2['cycle'] . ' month', $billdateold );
- $billnextcache = strtotime( '-1 day', $nextbill );
- $billnext = strftime( '%d', $billnextcache );
- if (( 27 < $billdayold && $billnext < 4 )) {
- $billnextcache = strtotime( '-1 day', $billnextcache );
- $billnext = strftime( '%d', $billnextcache );
- }
- if (( 27 < $billdayold && $billnext < 3 )) {
- $billnextcache = strtotime( '-1 day', $billnextcache );
- $billnext = strftime( '%d', $billnextcache );
- }
- if (( 27 < $billdayold && $billnext < 2 )) {
- $billnextcache = strtotime( '-1 day', $billnextcache );
- $billnext = strftime( '%d', $billnextcache );
- }
- if ($billdayold == $billnext) {
- $billnextcache = strtotime( '-1 day', $billnextcache );
- $billnext = strftime( '%d', $billnextcache );
- }
- $nextbillmonth = strftime( '%m', $billnextcache );
- $nextbillyear = strftime( '%Y', $billnextcache );
- if (( ( ( $nextbillmonth == 2 && ( $billnext == 28 || $billnext == 29 ) ) && 27 < $billdayold ) || ( ( ( ( ( $nextbillmonth == 4 || $nextbillmonth == 6 ) || $nextbillmonth == 9 ) || $nextbillmonth == 11 ) && $billnext == 30 ) && 27 < $billdayold ) )) {
- $billnextcache = strtotime( '-1 day', $billnextcache );
- $billnext = strftime( '%d', $billnextcache );
- }
- $datefrom = '' . $billdateyear . '-' . $billdatemonth . '-' . $billday;
- $datefrom = strtotime( $datefrom );
- $datefrom = strftime( '' . $chkconvertdate, $datefrom );
- $dateto = '' . $nextbillyear . '-' . $nextbillmonth . '-' . $billnext;
- $dateto = strtotime( $dateto );
- $dateto = strftime( '' . $chkconvertdate, $dateto );
- $orderdatetwo = '' . $datefrom . ' - ' . $dateto;
- $productstats = $db->sql_fetchrow( $db->sql_query( 'SELECT * FROM ' . $prefix . ( '' . '_finance_products WHERE id=\'' . $row2['productid'] . '\'' ) ) );
- if ($row2[text] != '') {
- $prodtext = '' . $row2['text'];
- } else {
- $prodtext = '' . $productstats['text'];
- }
- if ($financeopstats[billmonth] == 0) {
- $billtext = '' . $orderdatetwo . '
- ' . $prodtext;
- } else {
- $billtext = '' . $textmonth . '
- ' . $prodtext;
- }
- $price = str_replace( ',', '.', $row2[price] );
- $price = $price * $row2[cycle];
- $membilldate = $billnextcache;
- $taxkeystats = $db->sql_fetchrow( $db->sql_query( 'SELECT * FROM ' . $prefix . ( '' . '_finance_taxkeys WHERE id=\'' . $productstats['tax'] . '\'' ) ) );
- $result3 = $db->sql_query( 'INSERT INTO ' . $prefix . ( '' . '_finance_billproducts (id, billid, prodid, text, price, tax, accountid, taxid) VALUES
- (NULL, \'' . $lastid . '\', \'' . $row2['id'] . '\', \'' . $billtext . '\', \'' . $price . '\', \'' . $taxkeystats['tax'] . '\', \'' . $productstats['accountid'] . '\', \'' . $productstats['tax'] . '\')' ) );
- if ($result3) {
- $result3 = $db->sql_query( 'UPDATE ' . $prefix . ( '' . '_members_product SET nextbill=\'' . $billnextcache . '\', oldbill=\'' . $newnextbill . '\' WHERE id=\'' . $row2['id'] . '\'' ) );
- $prodchk = 1744;
- }
- }
- }
- if ($prodchk == 0) {
- $prodchk = 1743;
- }
- }
- if ($prodchk != 1) {
- $logtitle = 'LOGNEW';
- $logtext = '' . $row['member'] . '
- -----------------------------------------------------------
- ' . $lastbill;
- $wrow = $db->sql_numrows( $db->sql_query( 'SELECT * FROM ' . $prefix . ( '' . '_finance_billproducts WHERE billid=\'' . $lastid . '\'' ) ) );
- if (0 < $wrow) {
- $result3 = $db->sql_query( 'INSERT INTO ' . $prefix . ( '' . '_finance_bill (id, billid, day, month, year, member, address) VALUES
- (NULL, \'' . $lastbill . '\', \'' . $day . '\', \'' . $month . '\', \'' . $year . '\', \'' . $row['member'] . '\', \'' . $memaddy . '\')' ) );
- if (!$result3) {
- $result4 = $db->sql_query( 'INSERT INTO ' . $prefix . ( '' . '_admin_logs (id, admin, module, title, text, day, month, year, date, status) VALUES (NULL, \'' . $admin['1'] . '\', \'FBILL\', \'' . $logtitle . '\', \'' . $logtext . '\', \'' . $logday . '\', \'' . $logmonth . '\', \'' . $logyear . '\', \'' . $logtime . '\', \'1\')' ) );
- }
- $result4 = $db->sql_query( 'INSERT INTO ' . $prefix . ( '' . '_admin_logs (id, admin, module, title, text, day, month, year, date, status) VALUES (NULL, \'' . $admin['1'] . '\', \'FBILL\', \'' . $logtitle . '\', \'' . $logtext . '\', \'' . $logday . '\', \'' . $logmonth . '\', \'' . $logyear . '\', \'' . $logtime . '\', \'2\')' ) );
- }
- }
- }
- }
- }
- }
- }
- ......................................................
- ................................
- ....................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement