Joshua
Members-
Posts
1,271 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Joshua
-
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
Depends on the Server time And whether or not you added the cron to Cronjobs -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
It's not in the edits A few others have already told you Remove the bbcode parser from one of the scrips it's an include...near the top >,< -
Right, it's supposed to The problem is...the instructions say NOW PUT THIS FILE WHERE USERS AUTOMATICALLY HAVE 100 So that's losing me :P
-
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
Not trying to be rude......... However...if you read through the post you will see the fix for that as well. -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
Iv'e already posted the fix for this. Go back to first page, bottom of first post You have to add the global_func insert. -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
Due to the Differances of crystal Temples and Games I leave you all to decide how users can Gain robskills My game they will only be able to trade cigarrettes for them, or donate for them. Either way it's going to be costly. Security is costly, If you want to do what I'm doing and have businessess security based off of business age Run this cron in Cron_Day.php $db->query("UPDATE businesses SET bussecurity = bussecurity +1"); -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
business_manage continued else { $db->query(sprintf("UPDATE `users` SET `money` = `money` + '%d' WHERE `userid` = '%u'", $_POST['mula'], $ir['userid'])); $db->query(sprintf("UPDATE `businesses` SET `busCash` = `busCash` - '%d' WHERE `busId` = '%u'", $_POST['mula'], $inf['busId'])); echo 'You have withdrawn '.number_format($_POST['mula']).' from the Company.'; business_alert($inf['busId'], "".$ir['username']." withdrawn ".number_format($_POST['mula'])." from the Company."); } } else { echo 'You missed one or more of the required fields.'; } } function kick_member() { global $ir, $inf, $db; $_POST['member'] = abs(@intval($_POST['member'])); if(!isset($_POST['member'])) { echo 'Please select a member to kick out of the Company: <form action="business_manage.php?p=kick_out" method="post"> Company employee: <select name="member"> <option value="0">None</option>'; $select_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) WHERE (`bmembBusiness` = '%u') ORDER BY `bmembId` ASC", $inf['busId'])); while($sm = $db->fetch_row($select_members)) { echo '<option value="'.$sm['userid'].'">'.stripslashes($sm['username']).'</option>'; } echo '</select> <input type="submit" value="Kick from company" /> </form>'; } else { $db->query(sprintf("DELETE FROM `businesses_members` WHERE `bmembMember` = '%u'", $_POST['member'])); $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $thename = $db->fetch_row($realname); $db->query(sprintf("UPDATE `users` SET `business` = '0' WHERE `userid` = '%u'", $_POST['member'])); echo 'This member has been kicked out of the Company.'; business_alert($inf['busId'], " ".$thename['username']." was kicked out of the Company."); } } function bankrupt_business() { global $ir, $inf, $db; if(!$_GET['confirm']) { echo 'You are about to bankrupt the '.stripslashes($inf['busName']).' Company. Please confirm this action. Once this has been confirmed there is no chance to go back. [url="business_manage.php?p=bankrupt&confirm=1"]Bankrupt the Company[/url]'; } else { $send_event = $db->query(sprintf("SELECT `bmembMember` FROM businesses_members WHERE `bmembBusiness` = '%u' ORDER BY `bmembId` DESC", $bs['busId'])); while($se = $db->fetch_row($send_event)) { $text = "The director has chosen to bankrupt the {$inf['busName']} Company\, all members have been made redundent."; insert_event($se['bmembMember'], $text); } $db->query(sprintf("DELETE FROM `businesses_members` WHERE (`bmembBusiness` = '%u')", $inf['busId'])); $db->query(sprintf("DELETE FROM `businesses` WHERE (`busId` = '%u')", $inf['busId'])); $db->query(sprintf("UPDATE `users` SET `business` = '0' WHERE `business` = '%u'", $inf['busId'])); echo 'You have decided to bankrupt the Company, all members have been made redundent.'; } } function credit_member() { global $ir, $inf, $db; $_POST['cash'] = abs(@intval($_POST['cash'])); $_POST['member'] = abs(@intval($_POST['cash'])); if($_POST['cash'] AND $_POST['member']) { if($_POST['cash'] > $inf['busCash']) { echo 'You cannot credit more than the Company has in it\'s vault.'; } else { $db->query(sprintf("UPDATE `users` SET `money` = `money` + '%d' WHERE `userid` = '%u'", $_POST['cash'], $_POST['member'])); $db->query(sprintf("UPDATE `businesses` SET `busCash` = `busCash` - '%d' WHERE `busId` = '%u'", $_POST['cash'], $inf['busId'])); $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $thename = $db->fetch_row($realname); echo 'You gave '.number_format($_POST['cash']).' to this member from the vault.'; business_alert($inf['busId'], " ".$thename['username']." was credited ".number_format($_POST['cash'])." from the Company."); } } else { echo '<form action="business_manage.php?p=credit_member" method="post"> <p align="center"> Your Company vault contains '.number_format($inf['busCash']).' at this time, which can be credited to a member. Select a member from the box below and enter an amount of cash to give to them. Cash amount: <input type="text" name="cash" /> Company employee: <select name="member"> <option value="0">None</option> <option value="'.$ir['userid'].'">'.stripslashes($ir['username']).'</option>'; $select_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) WHERE (`bmembBusiness` = '%u') ORDER BY `bmembId` ASC", $inf['busId'])); while($sm = $db->fetch_row($select_members)) { echo '<option value="'.$sm['userid'].'">'.stripslashes($sm['username']).'</option>'; } echo '</select> <input type="submit" value="Credit cash" /> </p> </form>'; } } function manage_applications() { global $ir, $inf, $db; $_GET['id'] = abs(@intval($_GET['id'])); $_POST['member'] = abs(@intval($_POST['member'])); if(!isset($_GET['a'])) { $fetch_apps = $db->query(sprintf("SELECT * FROM `businesses_apps` LEFT JOIN `users` ON `userid` = `appMember` WHERE `appBusiness` = '%u'", $inf['busId'])); echo '<table width="600" class="table"> <tr> <th width="15%">Member</th> <th width="50%">Application</th> <th width="15%">Time</th> <th width="20%">Manage</th> </tr>'; while($r = $db->fetch_row($fetch_apps)) { echo ' <tr> <td>[url="viewuser.php?u='.$r['userid'].'"]'.stripslashes($r['username']).'[/url]</td> <td>'.stripslashes(htmlentities($r['appText'])).'</td> <td>'.date('d-m-Y, g:i:s A', $r['appTime']).'</td> <td>[url="business_manage.php?p=view_apps&a=accept&id='.$r['appId'].'"][size="1"]Accept[/size][/url][size="1"]-[/size] [url="business_manage.php?p=view_apps&a=decline&id='.$r['appId'].'"][size="1"]Decline[/size][/url]</td> </tr>'; } echo '</table>'; } else if($_GET['a'] == 'accept' AND $_GET['id']) { $fetch_app = $db->query(sprintf("SELECT * FROM `businesses_apps` LEFT JOIN `users` ON `userid` = `appMember` WHERE `appId` = '%u'", $_GET['id'])); if($db->num_rows($fetch_app)) { $it = $db->fetch_row($fetch_app); $check = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u')", $it['appMember'])); if(!$db->num_rows($check)) { $rows = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembBusiness` = '%u')", $inf['busId'])); if($db->num_rows($rows) < $inf['busEmployees']) { $fetch_rank = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankClass` = '%u') ORDER BY `rankCash` ASC LIMIT 1", $inf['classId'])); $fr = $db->fetch_row($fetch_rank); $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $thename = $db->fetch_row($realname); business_alert($inf['busId'], " A new employee has been accepted into the Company."); $db->query(sprintf("INSERT INTO `businesses_members` (`bmembId`, `bmembMember`, `bmembBusiness`, `bmembCash`, `bmembRank`) VALUES ('NULL', '%u', '%d', '%d', '%d')", $it['appMember'], $inf['busId'], $fr['rankCash'], $fr['rankId'])); $db->query(sprintf("UPDATE `users` SET business='{$inf['busId']}' WHERE `userid` = '%u'", $it['appMember'])); $db->query(sprintf("DELETE FROM `businesses_apps` WHERE `appId` = '%u'", $_GET['id'])); echo 'The selected application has been accepted.'; } else { echo 'Your Company cannot hold more members at this time.'; } } else { echo 'This member is part of a Company at this time, the application could not be accepted.'; $db->query(sprintf("DELETE FROM `businesses_apps` WHERE `appId` = '%u'", $_GET['id'])); } } else { echo 'The selected application no longer exists.'; } } else if($_GET['a'] == 'decline' AND $_GET['id']) { $fetch_app = $db->query(sprintf("SELECT * FROM `businesses_apps` WHERE `appId` = '%u'", $_GET['id'])); if($db->num_rows($fetch_app)) { echo 'The selected application was declined, It has been removed from the log.'; $db->query(sprintf("DELETE FROM `businesses_apps` WHERE `appId` = '%u'", $_GET['id'])); } else { echo 'The selected application no longer exists.'; } } else { echo 'You did not select an application to manage, go back and select one!'; } } function upgrade_business() { global $ir, $inf, $db; if($inf['busEmployees'] >= 50) { die('This company is already fully upgraded to 50 employees.'); } if(!$_GET['confirm']) { $price_upgrade = (($inf['busEmployees'])*1500000); echo 'You currently have '.$inf['busEmployees'].' employee spots. You are about to upgrade the '.stripslashes($inf['busName']).' Company at a cost of '.number_format($price_upgrade).' for an additional 5 slots. Please confirm this action. Once this has been confirmed there is no chance to go back. [url="business_manage.php?p=upgrade&confirm=1"]Upgrade the Company[/url]'; } else { $price_upgrade = (($inf['busEmployees'])*1500000); if ($inf['busCash'] < $price_upgrade) { die('You do not have enough money in the vault.'); } else if($inf['busEmployees'] >= 50) { die('this company is already fully upgraded to 50 employees.'); } else { $db->query(sprintf("UPDATE `businesses` SET `busEmployees` = busEmployees+5, `busCash` = busCash - ".$price_upgrade." WHERE `busDirector` = ".$ir['userid']."")); business_alert($inf['busId'], "The Director has upgraded the Company for 5 extra members."); echo 'You have decided to upgrade the Company, you can now employee an additional 5 members.'; } } } function change_description() { global $ir, $inf, $db; if(!mysql_real_escape_string(htmlentities($_POST['desc']))) { echo '<form action="business_manage.php?p=change_desc" method="post"> <p align="center"> [b]You are changing the Company description of the '.stripslashes($inf['busName']).' Company.[/b] Please enter a description in the input box below and click \'Change description\' to submit the new description. Maximum characters is set at 50!! <textarea rows="10" cols="50" name="desc">'.($inf['busDesc']).'</textarea> <input type="submit" value="Change description" /> </p> </form>'; } else { $db->query(sprintf("UPDATE `businesses` SET `busDesc` = '%s' WHERE `busId` = '%u'", stripslashes($_POST['desc']), $inf['busId'])); echo 'The Company description was changed to: '.stripslashes($_POST['desc']).'!'; } } function secure_business() { global $ir, $inf, $db; if(!$_GET['confirm']) { $price_upgrade = (($inf['busEmployees'])*200000); echo 'You currently have '.$inf['bussecurity'].' security guards. You are about to upgrade the '.stripslashes($inf['busName']).' Company at a cost of '.number_format($price_upgrade).' for one additional guard. Please confirm this action. Once this has been confirmed there is no chance to go back. [url="business_manage.php?p=secupgrade&confirm=1"]Purchase Guard[/url]'; } else { $price_upgrade = (($inf['busEmployees'])*200000); if ($inf['busCash'] < $price_upgrade) { die('You do not have enough money in the vault.'); } else { $db->query(sprintf("UPDATE `businesses` SET `bussecurity` = bussecurity+1, `busCash` = busCash - ".$price_upgrade." WHERE `busDirector` = ".$ir['userid']."")); echo 'You have decided to upgrade the Company, you now have one additional guard.'; business_alert($inf['busId'], "The Director has upgraded the Company and added an Extra security guard."); } } } $h->endpage(); ?> FIND IN REGISTER.PHP $db->query("INSERT INTO userstats VALUES('$i', 10, 10, 10, 10, add an Extra 10 to the query..example $db->query("INSERT INTO userstats VALUES('$i', 10, 10, 10, 10, 10 Run THIS query in your SQLS UPDATE userstats SET robskill = 10 UPDATE businesses SET bussecure = 10 That starts all your users currently and businesses to 10 security skill. Enjoy, more to come. -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
<?php include_once (DIRNAME(__FILE__). '/globals.php'); global $db; echo '<p class="heading">Manage Company</p>'; $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) WHERE (`busDirector` = '%u')", $ir['userid'])); if(!$db->num_rows($fetch_business)) { echo 'You do not own a Company right now!'; $h->endpage(); exit; } else { $inf = $db->fetch_row($fetch_business); } switch ($_GET['p']) { case 'new_name': new_business_name(); break; case 'new_banner': new_business_banner(); break; case 'new_rank': edit_member_rank(); break; case 'new_salary': edit_member_salary(); break; case 'view_vault': view_vault(); break; case 'donate_cash': donate_cash(); break; case 'withdraw_mula': withdraw_mula(); break; case 'debt': sort_debt(); break; case 'bankrupt': bankrupt_business(); break; case 'credit_member': credit_member(); break; case 'view_apps': manage_applications(); break; case 'kick_out': kick_member(); break; case 'upgrade': upgrade_business(); break; case 'change_desc': change_description(); break; case 'secupgrade': secure_business(); break; default: business_index(); break; } function business_index() { global $ir, $inf, $db; if($inf['busDebt']) { echo 'This Company is in debt of £'.number_format($inf['busDebt']).' right now. Click [url="business_manage.php?p=debt"]here[/url] to sort it out. To bankrupt and close down the Company, click [url="business_manage.php?p=bankrupt"]here[/url] to complete proceedings.'; } else { echo ' <table width="300" bgcolor="black" border="2"> <tr> <td colspan="100%"><center> [b]Manage Your Company:[/b]</center></td></tr> <tr><td>[url="business_manage.php?p=new_name"]Edit Company name[/url]</td> <td>[url="business_manage.php?p=change_desc"]Edit description[/url]</td></tr> <tr><td>[url="business_manage.php?p=new_banner"]Change company banner[/url]</td> <td>[url="business_manage.php?p=credit_member"]Credit cash to employee[/url]</td></tr> <td>[url="business_manage.php?p=view_apps"]Manage applications[/url]</td> <td>[url="business_manage.php?p=new_rank"]Edit employees rank[/url]</td></tr> <td>[url="business_manage.php?p=upgrade"]Upgrade The Company size[/url]</td> <td>[url="business_manage.php?p=new_salary"]Change employee salary[/url]</td></tr> <td>[url="business_manage.php?p=kick_out"]Kick employee out[/url] </td> <td>[url="business_manage.php?p=view_vault"]View company vault[/url]</td></tr> <td>[url="business_manage.php?p=bankrupt"]Bankrupt the Company[/url]</td> <td>[url="business_manage.php?p=secupgrade"]Hire Security[/url] </td> </tr> </table>'; } } function new_business_name() { global $ir, $inf, $db; $_POST['name'] = $db->escape(stripslashes($_POST['name'])); if(!$_POST['name']) { echo '<form action="business_manage.php?p=new_name" method="post"> <p align="center"> [b]You are changing the Company name of the '.stripslashes($inf['busName']).' Company.[/b] Please enter a new name in the input box below and click \'Change name\' to submit the new name. <input type="text" name="name" /> <input type="submit" value="Change name" /> </p> </form>'; } else { $check = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busName` = '%s')", $_POST['name'])); if(!$db->num_rows($check)) { $db->query(sprintf("UPDATE `businesses` SET `busName` = '%s' WHERE `busId` = '%u'", $_POST['name'], $inf['busId'])); echo 'The Company name was changed to '.$_POST['name'].'!'; business_alert($inf['busId'], "The Company name was changed to ".$_POST['name']."."); } else { echo 'Sorry this Company name is in use at this time.'; } } } function new_business_banner() { global $ir, $inf, $db; if(!$_POST['banner']) { echo '<form action="business_manage.php?p=new_banner" method="post"> <p align="center"> [b]You are changing the banner of the '.stripslashes($inf['busName']).' Company.[/b] Please enter a new banner image location in the input box below and click \'Change banner\' to submit the new image. [b]Current image:[/b] '; if($inf['busImage']) { echo '[img='.stripslashes($inf['busImage']).']'; } else { echo '[img=dimg.jpg]'; } echo ' New image: <input type="text" name="banner" size="50" /> <input type="submit" value="Change banner" /> </p> </form>'; } else { $db->query(sprintf("UPDATE `businesses` SET `busImage` = '%s' WHERE `busId` = '%u'", stripslashes($_POST['banner']), $inf['busId'])); echo 'The Company banner was updated.'; business_alert($inf['busId'], "The Company banner has been updated."); } } function edit_member_rank() { global $ir, $inf, $db; $_POST['member'] = abs(@intval($_POST['member'])); $_POST['rank'] = abs(@intval($_POST['rank'])); if(!$_POST['member'] || !$_POST['rank']) { echo '<form action="business_manage.php?p=new_rank" method="post"> <p align="center"> [b]Set the Company rank:[/b] Company employee: <select name="member"> <option value="0">None</option>'; $select_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) WHERE (`bmembBusiness` = '%u') ORDER BY `bmembId` ASC", $inf['busId'])); while($sm = $db->fetch_row($select_members)) { echo '<option value="'.$sm['userid'].'">'.stripslashes($sm['username']).'</option>'; } echo '</select> Company rank: <select name="rank"> <option value="0">None</option>'; $select_ranks = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankClass` = '%u') ORDER BY `rankId` ASC", $inf['classId'])); while($sr = $db->fetch_row($select_ranks)) { echo '<option value="'.$sr['rankId'].'">'.stripslashes($sr['rankName']).'</option>'; } echo '</select> <input type="submit" value="Change rank" /></p> </form>'; } else { $select_member = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u') AND (`bmembBusiness` = '%u')", $_POST['member'], $inf['busId'])); if(!$db->num_rows($select_member)) { echo 'You cannot edit the rank of this employee.'; } else { $select_cash = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankId` = '%u')", $_POST['rank'])); $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $sc = $db->fetch_row($select_cash); $thename = $db->fetch_row($realname); $realrank = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankId` = '%u')", $_POST['rank'])); $rname = $db->fetch_row($realrank); echo 'This member\'s rank was updated.'; $db->query(sprintf("UPDATE `businesses_members` SET `bmembRank` = '%d', `bmembCash` = '%d' WHERE (`bmembMember` = '%u')", $_POST['rank'], $sc['rankCash'], $_POST['member'])); business_alert($inf['busId'], " ".$thename['username']."\'s rank was changed to ".$rname['rankName']."."); } } } function edit_member_salary() { global $ir, $inf, $db; $_POST['member'] = abs(@intval($_POST['salary'])); $_POST['salary'] = abs(@intval($_POST['salary'])); if(!$_POST['member'] || !$_POST['salary']) { echo '<form action="business_manage.php?p=new_salary" method="post"> <p align="center"> [b]Set the new Company salary:[/b] Company employee: <select name="member"> <option value="0">None</option>'; $select_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) WHERE (`bmembBusiness` = '%u') ORDER BY `bmembId` ASC", $inf['busId'])); while($sm = $db->fetch_row($select_members)) { echo '<option value="'.$sm['userid'].'">'.stripslashes($sm['username']).'</option>'; } echo '</select> Salary amount: <input type="text" name="salary" size="8" maxlength="6" /> <input type="submit" value="Change salary" /></p> </form>'; } else { $select_member = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u') AND (`bmembBusiness` = '%u')", $_POST['member'], $inf['busId'])); if(!$db->num_rows($select_member)) { echo 'You cannot edit the salary of this employee.'; } else { echo 'This employee\'s salary was updated to £'.number_format($_POST['salary']).'.'; $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $thename = $db->fetch_row($realname); $db->query(sprintf("UPDATE `businesses_members` SET `bmembCash` = '%d' WHERE (`bmembMember` = '%u')", $_POST['salary'], $_POST['member'])); business_alert($inf['busId'], "".$thename['username']."\'s salary was changed to ".number_format($_POST['salary'])."."); } } } function view_vault() { global $ir, $inf, $db; echo '<form action="business_manage.php?p=donate_cash" method="post"> Your Company has '.number_format($inf['busCash']).' secured in it\'s vault. [b]Donate cash:[/b] Cash amount: <input type="text" name="cash" /> <input type="submit" value="Donate cash"></form> <form action="business_manage.php?p=withdraw_mula" method="post"> [b]Withdraw cash:[/b] Cash amount: <input type="text" name="mula" /> <input type="submit" value="Withdraw cash">'; } function sort_debt() { global $ir, $inf, $db; $_POST['cash'] = abs(@intval($_POST['cash'])); if($_POST['cash'] > 0) { if($_POST['cash'] > $ir['money']) { echo 'You do not have enough cash to sort out that amount of debt.'; } else if($_POST['cash'] > $inf['busDebt']) { echo 'The Company does not owe that much cash in debt.'; } else { $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE `userid` = '%u'", $_POST['cash'], $ir['userid'])); $db->query(sprintf("UPDATE `businesses` SET `busDebt` = `busDebt` - '%d' WHERE `busId` = '%u'", $_POST['cash'], $inf['busId'])); echo 'You have cleared up '.number_format($_POST['cash']).' of the Company debt.'; business_alert($inf['busId'], "".$ir['username']." paid ".number_format($_POST['cash'])." of the Company debt."); } } else { echo '<form action="business_manage.php?p=debt" method="post"> Your Company has £'.number_format($inf['busDebt']).' of debt. [b]Enter amount:[/b] Cash: <input type="text" name="cash" /> <input type="submit" value="Submit" /> </form>'; } } function donate_cash() { global $ir, $inf, $db; $_POST['cash'] = abs(@intval($_POST['cash'])); if($_POST['cash'] > 0) { if(@intval($_POST['cash'] > $ir['money'])) { echo 'You do not have enough cash to donate this much to the Company.'; } else { $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE `userid` = '%u'", $_POST['cash'], $ir['userid'])); $db->query(sprintf("UPDATE `businesses` SET `busCash` = `busCash` + '%d' WHERE `busId` = '%u'", $_POST['cash'], $inf['busId'])); echo 'You have donated '.number_format($_POST['cash']).' to the Company.'; business_alert($inf['busId'], "".$ir['username']." donated ".number_format($_POST['cash'])." to the Company."); } } else { echo 'You missed one or more of the required fields.'; } } function withdraw_mula() { global $ir, $inf, $userid, $db; $_POST['mula']=abs(@intval($_POST['mula'])); if($_POST['mula'] > 0) { if($_POST['mula'] > $inf['busCash']) { echo 'You do not have enough cash to withdraw this much from the Company.'; } -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
SQLS ALTER TABLE businesses ADD bussecure INT( 11 ) NOT NULL DEFAULT '0'; ALTER TABLE users ADD userstats INT( 11 ) NOT NULL DEFAULT '0'; Overwrite business_view.php with this one. <?php include_once (DIRNAME(__FILE__). '/globals.php'); echo '<p class="heading">Companies [url="business_create.php"][b]Create a Company Here[/b][/url]</p>'; switch ($_GET['page']) { case 'class': view_class(); break; case 'profile': view_profile(); break; case 'sendapp': send_application(); break; case 'rob': rob_business(); break; default: business_index(); break; } function business_index() { global $ir,$db; echo '<p align="center"> [b]Company Classes:[/b] <table width="600">'; $fetch_classes = $db->query("SELECT * FROM `businesses_classes` ORDER BY `classId` ASC"); while($r = $db->fetch_row($fetch_classes)) { echo ' <tr> <td width="275" align="right">'.stripslashes($r['className']).' •</td> <td width="50"></td> <td width="275" align="left">> [url="business_view.php?page=class&id='.$r['classId'].'"]View '.stripslashes($r['className']).' companies[/url]</td> </tr>'; } echo '</table> </p>'; } function view_class() { global $ir,$db; $_GET ['id'] = abs(@intval($_GET['id'])); if($_GET['id']) { $fetch_class = $db->query(sprintf("SELECT * FROM `businesses_classes` WHERE (`classId` = '%u')", $_GET['id'])); if(!$db->num_rows($fetch_class)) { echo 'You cannot view a company class that doesn\'t exist.'; } else { $r = $db->fetch_row($fetch_class); echo '<hr width="600"> <p align="center"> [b]'.stripslashes($r['className']).':[/b] [i]'.stripslashes($r['classDesc']).'[/i] <hr width="600"> <p align="center"> [b]Companies:[/b] The '.stripslashes($r['className']).' company is small and starts with a maximum of [b]'.number_format($r['classMembers']).'[/b] members until it has been upgraded. The total start up cost of a '.stripslashes($r['className']).' company is £'.number_format($r['classCost']).'.</p> <hr width="600"> <table width="600" class="table"> <tr> <th colspan="4">'.stripslashes($r['className']).' ranks</th> </tr>'; $fetch_ranks = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE `rankClass` = '%u'", $_GET['id'])); while($rn = $db->fetch_row($fetch_ranks)) { echo ' <tr> <td width="25%">[b]Rank:[/b] '.stripslashes($rn['rankName']).'</td> <td width="20%">[b]Primary stat:[/b] '.stripslashes($rn['rankPrim']).'</td> <td width="20%">[b]Secondary stat:[/b] '.stripslashes($rn['rankSec']).'</td> <td width="45%">[b]Stat gain:[/b] '.$rn['rankPGain'].' '.stripslashes($rn['rankPrim']).' and '.$rn['rankSGain'].' '.stripslashes($rn['rankSec']).'</td> </tr>'; } echo '</table> <hr width="600"> <table width="600" class="table"> <tr> <th colspan="3">'.stripslashes($r['className']).' companies</th> </tr>'; $bus_rating = $db->query("SELECT `busCash` FROM `businesses`"); $ttl_profit = 0; while($fetch_cash = $db->fetch_row($bus_rating)) { $ttl_profit += ($fetch_cash['busCash'] + 1); } $fetch_businesses = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `users` ON (`userid` = `busDirector`) WHERE `busClass` = '%u'", $_GET['id'])); while($fb = $db->fetch_row($fetch_businesses)) { if($fb['brank'] < 1000) { $stars='[img=donator.gif]'; } if($fb['brank'] > 1000) { $stars='[img=donator.gif] [img=donator.gif]'; } if($fb['brank'] > 5000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif]'; } if($fb['brank'] >= 35000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif]'; } if($fb['brank'] >= 100000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif]'; } $rate = (int) ((($fb['busCash'] + 1) / $ttl_profit * 100) / 20); echo ' <tr> <td width="85%">[url="business_view.php?page=profile&id='.$fb['busId'].'"][b]'.stripslashes($fb['busName']).'[/b][/url] - [url="viewuser.php?u='.$fb['userid'].'"][i]'.stripslashes($fb['username']).'[/i][/url] '.$stars.'</td> </tr>'; } echo '</table> <hr width="600">'; } } else { echo 'You did not select a company class to view.'; } } function view_profile() { global $ir,$db; $_GET['id'] = abs(@intval($_GET['id'])); if($_GET['id']) { $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) LEFT JOIN `users` ON (`userid` = `busDirector`) WHERE (`busId` = '%u')", $_GET['id'])); if(!$db->num_rows($fetch_business)) { echo 'You cannot view a company that doesn\'t exist.'; } else { $r = $db->fetch_row($fetch_business); echo '<hr width="400"> <table width="400" class="table"> <tr> <th colspan="2">Details of '.stripslashes($r['busName']).' - '.stripslashes($r['className']).'</th> </tr> <tr height="100"> <td colspan="2" valign="middle" align="center">'; if($r['busImage']) { echo '[img='.stripslashes($r['busImage']).']'; } else { echo '[img=dimg.jpg]'; } if($r['brank'] < 1000) { $stars='[img=donator.gif]'; } if($r['brank'] > 1000) { $stars='[img=donator.gif] [img=donator.gif]'; } if($r['brank'] >= 5000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif]'; } if($r['brank'] > 35000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif]'; } if($r['brank'] > 100000) { $stars='[img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif] [img=donator.gif]'; } echo '</td></tr> <tr> <td colspan="2"><center>[b]<u>Company Rank[/b]</u> '.$stars.'</center></td> </tr> <tr> <th colspan="2">Further information</th> </tr> <tr height="150"> <td colspan="2" valign="middle" align="center"> <table width="200"> <tr> <td> [b]Class:[/b] '.stripslashes($r['className']).' [b]Director:[/b] [url="viewuser.php?u='.$r['userid'].'"]'.stripslashes($r['username']).'[/url] [b]Todays profit:[/b] £'.number_format($r['busProfit']).' [b]Yesterdays profit:[/b] £'.number_format($r['busYProfit']).' [b]Todays customers:[/b] '.number_format($r['busCust']).' [b]Yesterdays customers:[/b] '.number_format($r['busYCust']).' </td> </tr> </table> </td> </tr> <tr> <th colspan="2">'.stripslashes($r['busName']).' members</th> </tr> <tr> <td width="50%">[b]Name:[/b] [url="viewuser.php?u='.$r['userid'].'"]'.stripslashes($r['username']).'[/url]</td> <td width="50%">[b]Rank:[/b] Director (None)</td> </tr>'; $fetch_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) LEFT JOIN `businesses_ranks` ON (`rankId` = `bmembRank`) WHERE `bmembBusiness` = '%u'", $_GET['id'])); while($fm = $db->fetch_row($fetch_members)) { echo ' <tr> <td width="50%">[b]Name:[/b] [url="viewuser.php?u='.$fm['userid'].'"]'.stripslashes($fm['username']).'[/url]</td> <td width="50%">[b]Rank:[/b] '.stripslashes($fm['rankName']).' (£'.number_format($fm['bmembCash']).')</td> </tr>'; } echo '</table> <hr width="400"> [url="business_view.php?page=sendapp&id='.$_GET['id'].'"]Send application[/url] [url="business_view.php?page=rob&id='.$_GET['id'].'"]Attempt Robbery[/url] '; } } else { echo 'You did not select a company to view.'; } } function send_application() { global $ir,$db; $_GET['id'] = abs(@intval($_GET['id'])); if($ir['job']) { echo 'You Have A Job'; exit; } $check_bus = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busId` = '%u')", $_GET['id'])); $check_app = $db->query(sprintf("SELECT * FROM `businesses_apps` WHERE (`appMember` = '%u') AND (`appBusiness` = '%d')", $ir['userid'], $_GET['id'])); $check = $db->query(sprintf("SELECT * FROM `businesses` WHERE (`busDirector` = '%u')", $ir['userid'])); $check_member = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u')", $ir['userid'])); if(!$db->num_rows($check_bus)) { echo 'You cannot send an application to a non-existant company.'; } else if($db->num_rows($check) || $db->num_rows($check_member)) { echo '<font color=red><blink>You are part of a company right now, leave before sending an application to a new one.</blink></font>'; } else if($db->num_rows($check_app)) { echo 'You have a sent application to this company right now, wait for a responce.'; } else if(!$_GET['id']) { echo 'You did not choose a company to send an application to.'; } else if($_POST['application']) { $app = str_replace(array("\n"), array(" "), strip_tags($_POST['application'])); $string_app = mysql_real_escape_string($app); $db->query(sprintf("INSERT INTO `businesses_apps` (`appId`, `appMember`, `appBusiness`, `appText`, `appTime`) VALUES ('NULL','%d', '%u', '%s', '%d')", $ir['userid'], $_GET['id'], $string_app, time())); echo 'Your application was sent to the selected company, a responce will be given from the director soon.'; } else { $r = $db->fetch_row($check_bus); echo '<form action="business_view.php?page=sendapp&id='.$_GET['id'].'" method="post"> <p align="center"> [b]Enter an application below to send a request to the director of '.stripslashes($r['busName']).'.[/b] You can send one application at a time, wait for the result of that application before sending another. If the company director is not active, it might take a while for the application to be managed, So it could be worth speaking with the director before submitting a new application to the company. Entering a detailed application will increase the chance of having it accepted, but this is no guarantee. Your working stats will also be sent to the director of the company with the application to help them decide. Your application: <textarea type="text" name="application" s="40" rows="10" cols="70" maxlength="255"></textarea> <input type="submit" value="Submit application" /></p> </form>'; } } function rob_business() { global $ir,$db,$h,$userid; $_GET['id'] = abs(@intval($_GET['id'])); if($_GET['id']) { $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) LEFT JOIN `users` ON (`userid` = `busDirector`) WHERE (`busId` = '%u')", $_GET['id'])); if(!$db->num_rows($fetch_business)) { echo 'You cannot rob a company that doesn\'t exist.'; } else { $r = $db->fetch_row($fetch_business); if($ir['rob'] < 1) { echo 'You cannot attempt to rob a company more than once a day!'; $h->endpage(); exit; } if($ir['userid'] == $r['busDirector']) { echo 'Why would you attempt to rob your own company?'; $h->endpage(); exit; } else { if($ir['robskill'] < $r['busCash']) { print "While attempting to break into the business, greedy with plans of large bucks. You fail to notice the police car driving by. Just as you crack the lock and begin to head inside you are knocked over the head. You wake up in jail with a raging headache and the discovery YOU WERE CAUGHT"; event_add($_GET['id'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] Attempted to Rob your Business but was caught."); $jailtime=mt_rand(10,40); $query = sprintf('UPDATE users SET jail = jail +%u, jail_reason = "Failed to Rob %s.", rob = 0 WHERE userid = %u', $jailtime, $r['busName'], $userid); $db->query($query); $db->query("UPDATE businesses SET bussecurity = bussecurity + 1 WHERE busId = {$_GET['id']}"); $db->query("UPDATE userstats SET robskill = robskill - 1 WHERE userid = $userid"); } else if($ir['robskill'] > $r['busCash']) { $rando = mt_rand(10,25); $cash = round($r['busCash']/$rando); print "After scoping out the latest company for a few days, you decide now is your chance to do some damage. You sneak up to the backdoor after dark and jiggle the lock. With a bit of luck on your side, the door is unlocked. You sneak in flashlight in hand and head for the vault. Noticing the lack of security in this place you are hopeful someone hasn't beat you to the punch. As you enter the dark office where the stash of cash is located it would appear luck is on your side twice! The owner left the key to the safe on his desk! You quickly grab the cash and bolt. You earned yourself a nice smooth $cash cash."; $db->query("UPDATE users SET money = money + $cash, rob = 0 WHERE userid = $userid"); $db->query("UPDATE userstats SET robskill = robskill + 1 WHERE userid = $userid"); $db->query("UPDATE businesses SET busCash = busCash - $cash, bussecurity = bussecurity - 1 WHERE busId = {$_GET['id']}"); } } } } } $h->endpage(); ?> business_manage.php Overwrite next. -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
Thank you Chicka, BludCard helped :) NEW MOD ADDITION ROB BUSINESS. Players Now have an extra stat in "userstats" called robskill Businesses have an Extra column called bussecurity. Businesses must Pay per 1 point of security or "security guard" through their own vault to keep their business secure. I'm also making businesses security go up 1 point per day with Crons. Players will be able to swap Crystals "or in my game cigarrettes" for robskill points but it will be very expensive If their robskill is higher than the Business they can rob that business, but only Once Per day. Fail is massive jail time and the loss of a point Getting it together to post up. -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
Ok Folks For those having problems you need to add The Following to Global_func.php file It was in the original mod i forgot to post it, appologies find ?> in global_func.php above add this function business_alert($business, $text) { mysql_query(sprintf("INSERT INTO `businesses_alerts` (`alertId`, `alertBusiness`, `alertText`, `alertTime`) VALUES ('NULL', '%u', '%s', '%d')", $business, $text, time())); } good to go. For the crons you would do them the same as your Day Cron 0 0 * * * and set the curl For the person with the session error..i'm not sure..are you on version 1 or version 2? I edited this for V2 -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
But this is a good idea to add staff functions honestly. As for hackers....secure your globals and you dont have to worry about this little bit here =P Far as I can tell the Business mod itself is pretty tight to -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
Hey, I shared my work you have to share yours, or my next big addition to this mod is mine all mine! ;) -
And Back to Version two, with a (little) security added. gsstart.php <?php include_once (DIRNAME(__FILE__) . '/globals.php'); global $db; if($ir['user_level']!= 2) { print "Get out of here, dude."; exit; } $ax=$db->query("SELECT * FROM gangs"); print "[b]Please choose the gang you want to edit and hit 'Go'.[/b] Select by Name :<form action='gangadmin.php' method='post'> <select name='gang' type='dropdown'>"; while($g=$db->fetch_row($ax)) { print "<option value='{$g['gangID']}'>{$r['gangNAME']}</option>"; } print "</select> <input type='submit' value='Go'> </form> OR <form action='gangadmin.php' method='post'> Type in the Gang ID: <input type='text' name='gang'> <input type='submit' value='Go'> </form>"; $h->endpage(); ?> <?php include_once (DIRNAME(__FILE__) . '/globals.php'); global $db; $gq=$db->query("SELECT * FROM gangs WHERE gangID={$_POST['gang']}",$c); $gangdata=$db->fetch_row($gq); if($ir['user_level']!= 2) { print "Get out of here, dude."; exit; } $_GET['action'] = isset($_GET['act']) && ctype_alpha($_GET['action']) ? trim($_GET['action']) : 'index'; switch($_GET['action']) { case "name": name(); break; case "delete": delete(); break; case "delete2": delete2(); break; case "wars": wars(); break; case "respect": respect(); break; case "members": members(); break; case "apps": apps(); break; case "bank": bank(); break; case "ann": ann(); break; case "tag": tag(); break; case "kick": kick(); break; case "armory": armory(); break; case "uarmory": uarmory(); break; case "desc": desc(); break; case "logo": logo(); break; case "pres": pres(); break; case "id": id(); break; case "mw": mw(); break; default: index(); break; } function index() { if (!in_array($_GET['action'], array('name', 'delete', 'delete2', 'wars', 'respect', 'members', 'apps', 'bank', 'ann', 'tag', 'kick', 'armory', 'uarmory', 'desc', 'logo', 'pres', 'id', 'mw'))) { echo "Invalid Command!"; exit; } global $ir,$c,$userid,$h,$gangdata,$db; print "[b]You are managing gang {$gangdata['bNAME']} ({$_POST['gang']}).[/b] >[url='gangadmin.php?action=name']Change Name[/url] >[url='gangadmin.php?action=delete']Delete this Gang[/url] >[url='gangadmin.php?action=wars']Delete all Gang Wars with this Gang[/url] >[url='gangadmin.php?action=respect']Change Respect[/url] >[url='gangadmin.php?action=members']Memberlist[/url] >[url='gangadmin.php?action=apps']Applications[/url] >[url='gangadmin.php?action=bank']Bank[/url] >[url='gangadmin.php?action=ann']Change Annoucement[/url] >[url='gangadmin.php?action=tag']Change Tag[/url] "; if($gangdata['gangARMORY']== 1) { print ">[url='gangadmin.php?action=armory']Lock Armoury[/url] "; } else { print ">[url='gangadmin.php?action=uarmory']Unlock Armoury[/url] "; } print ">[url='gangadmin.php?action=desc']Change Description[/url] >[url='gangadmin.php?action=logo']Change Logo[/url] >[url='gangadmin.php?action=pres']Change President / Vice President[/url] >[url='gangadmin.php?action=id']Change Gang ID[/url] >[url='gangadmin.php?action=mw']Manage Gang Wars[/url] "; } function name() { global $ir,$c,$userid,$h,$gangdata; $_POST['name'] = mysql_real_escape_string($_POST['name'])); if(trim($_POST['name'] == '') { echo 'Invalid' You did not enter anything '; } else if($_POST['name']) { $ct=$db->query("SELECT * FROM gangs WHERE gangNAME={$_POST['name']}",$c); if($db->num_rows($ct)) { echo 'Invalid' Name Taken [url='gangadmin.php?action=name']Back[/url] '; exit; } else if (strlen($_POST['name']) < '3') { echo ' Invalid Name to Short'; } else if (strlent($_POST['name']) > '15') { echo ' Invalid Name to long '; } else { $db->query("UPDATE gangs SET gangNAME={$_POST['name']} WHERE gangID={$gangdata['gangID']}",$c); print "Name Changed to strip_tags({$_POST['name']}) [url='gangadmin.php?ID={$gangdata[']Back[/url] "; } else { print "Please enter the new name you would like this gang to be <form action='gangadmin.php?action=name' method='post'> New Name :<input type='text' name='name' value='{$gangdata['gangNAME']}'> <input type='submit' value='New Name'> </form>"; exit; } } function delete() { global $ir,$c,$userid,$h,$gangdata; print "Are you 100% sure you want to delete the {$gangdata['gangNAME']} gang? [url='gangadmin.php?action=delete2']Yes, i want to delete it now[/url] [url='gangadmin.php?ID={$gangdata[']No, keep it[/url] "; } function delete2() { global $ir,$c,$userid,$h,$gangdata; $db->query("DELETE FROM gangs WHERE gangID={$gangdata['gangID']}",$c); print "Gang Deleted [url='admin.php']Back to admin home[/url] "; } function wars() { global $ir,$c,$userid,$h,$gangdata; $db->query("DELETE FROM gangwars WHERE warDECLARED={$gangdata['gangID']} OR warDECLARER={$gangdata['gangID']}",$c); print "All Gang Wars Deleted with this gang."; } function respect() { global $ir,$c,$userid,$h,$gangdata; $_POST['respect'] = abs(@intval($_POST['respect'])); if($_POST['respect']) { $respect = $_POST['respect']; $db->query("UPDATE gangs SET gangRESPECT=$respect WHERE gangID=abs(@intval($gangdata['gangID']))",$c); print "Respect Changed!"; } else { print "[b]Enter the new amount of respect for this gang.[/b] <form action='gangadmin.php?action=respect'> New Respect : <input type='text' name='respect' value='{$gangdata['gangRESPECT']}'> <input type='submit' value='Change!'> </form> "; } } function members() { global $ir,$c,$userid,$h,$gangdata; $gmq=$db->query("SELECT * FROM users WHERE gang=abs(@intval($gangdata['gangID']))",$c); print "Viewing members of the {$gangdata['gangNAME']} gang <table width=100% border=0><tr><th>Username</th><th>Days in Gang</th><th>Kick?</th></tr>"; while($m=$db->fetch_row($gmq)) { print "<tr><td>[url='viewuser.php?u={$m[']{$m['username']}[/url] [{$m['userid']}]</td><td>{$m['daysingang']}</td><td><a href='gangadmin.php?action=kick&userid={$m['userid']}'>Kick</td></tr>"; } print "</table> "; } function kick() { global $ir,$c,$userid,$h,$gangdata; $kickwho = abs(@intval($_GET['userid'])); $db->query("UPDATE users SET gang=0,daysingang=0 WHERE userid=$kickwho",$c); print "$kickwho has been kicked out of the {$gangdata['gangID']} gang."; } function apps() { global $ir,$c,$userid,$gangdata,$h; $_GET['app'] = abs(@intval($_GET['app'])); if($_GET['app']) { $aq=$db->query("SELECT a.*,u.* FROM applications a LEFT JOIN users u ON a.appUSER=u.userid WHERE a.appID={$_GET['app']} AND a.appGANG={$gangdata['gangID']}",$c); if ($db->num_rows($aq)) { $appdata=$db->fetch_row($aq); if($_GET['what'] == 'decline') { $db->query("DELETE FROM applications WHERE appID={$_GET['app']}",$c); event_add($appdata['appUSER'],"Your application to join the {$gangdata['gangNAME']} gang was declined",$c); print "You have declined the application by {$appdata['username']} to the {$gangdata['gangNAME']} gang. [url='gangadmin.php?action=apps']> Back[/url]"; } else { $cnt=$db->query("SELECT username FROM users WHERE gang={$gangdata['gangID']}",$c); if($gangdata['gangCAPACITY'] == $db->num_rows($cnt)) { print "Your gang is full, you must upgrade it to hold more before you can accept another user!"; $h->endpage(); exit; } else if ($appdata['gang'] != 0) { print "That person is already in a gang."; $h->endpage(); exit; } $db->query("DELETE FROM applications WHERE appID={$_GET['app']}",$c); event_add($appdata['appUSER'],"Your application to join the {$gangdata['gangNAME']} gang was accepted, Congrats!",$c); $db->query("UPDATE users SET gang={$gangdata['gangID']},daysingang=0 WHERE userid={$appdata['userid']}",$c); print "You have accepted the application by {$appdata['username']} to the {$gangdata['gangNAME']} gang. [url='gangadmin.php?action=apps']> Back[/url]"; } } } else { print "[b]{$gangdata['gangNAME']}'s Applications[/b] <table width=85% border=2><tr style='background:gray;'><th>User</th><th>Level</th><th>Money</th><th>Reason</th> <th></th></tr>"; $q=$db->query("SELECT a.*,u.* FROM applications a LEFT JOIN users u ON a.appUSER=u.userid WHERE a.appGANG={$gangdata['gangID']}",$c); while($r=$db->fetch_row($q)) { print "<tr><td>[url='viewuser.php?u={$r[']{$r['username']} [{$r['userid']}][/url]</td><td>{$r['level']}</td><td>\${$r['money']}</td> <td>{$r['appTEXT']}</td><td><a href='gangadmin.php?action=apps&app={$r['appID']}&what=accept'> Accept</a> | <a href='gangadmin.php?action=apps&app={$r['appID']}&what=decline'> Decline</a></td></tr>"; } print "</table>"; } } function bank() { global $ir,$c,$userid,$h,$gangdata; $_POST['bankmoney'] = abs(@intval($_POST['bankmoney'])); $_POST['bankcrystals'] = abs(@intval($_POST['bankcrystals'])); $_POST['userid'] = abs(@intval($_POST['userid'])); $_POST['givewho'] = abs(@intval($_POST['givewho'])); if($_POST['givewho']) { if($_POST['bankmoney'] > $gangdata['gangBANKMONEY'] || $_POST['bankcrystals'] > $gangdata['gangBANKCRYSTALS']) { print "This gang does not have that much cash/crystals funds to give out [url='gangadmin.php?action=bank']>Back[/url] "; exit; } else { $money=$_POST['bankmoney']; $cryst=$_POST['bankcrystals']; $themid=$_POST['userid']; $db->query("UPDATE gangs SET gangBANKMONEY=gangBANKMONEY-$money, gangBANKCRYSTALS=gangBANKCRYSTALS-$cryst WHERE gangID={$gangdata['gangID']}",$c); $db->query("UPDATE users SET money=money+$money, crystals=crystals+$cryst WHERE userid=$themid",$c); print "You gave \${$_POST['bankmoney']} cash and {$_POST['bankcrystals']} crystals to userid: {$_POST['userid']}"; } } else { print "[b]Here is {$gangdata['gangNAME']}'s bank[/b] [b]\${$gangdata['gangBANKMONEY']} cash[/b] [b]{$gangdata['gangBANKCRYSTALS']} crystals[/b] <hr width=50% /> <form action='gangadmin.php?action=bank' method='post'> Userid :<input type='text' name='userid' value=''> Bank Cash: <input type='text' name='bankmoney' value='{$gangdata['gangBANKMONEY']}'> Bank Crystals : <input type='text' name='bankcrystals' value='{$gangdata['gangBANKCRYSTALS']}'> <input type='submit' value='Submit'> </form>"; } } function ann() { global $ir,$c,$userid,$h,$gangdata; $_POST['ann'] = mysql_real_escape_string($_POST['ann']); if($_POST['ann']) { $db->query("UPDATE gangs SET gangANNOUCEMENT='{$_POST['ann']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang's Annoucement Changed!"; } else { print "[b]Here you are changing the gang annoucement[/b] <form action='gangadmin.php?action=ann' method='post'> New Annoucement : <textarea name='ann' cols='30' rows='11'>{$gangdata['gangANNOUCEMENT']}</textarea> <input type='submit' value='Change Annoucement!'> </form>"; } } function tag() { global $ir,$c,$userid,$h,$gangdata; $_POST['tag'] = mysql_real_escape_string($_POST['tag']); if($_POST['tag']) { $db->query("UPDATE gangs SET gangPREFIX='{$_POST['tag']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang's Tag Changed!"; } else { print "[b]Here you are changing the gang's tag[/b] <form action='gangadmin.php?action=tag' method='post'> New Tag : <input type='text' name='tag' value='{$gangdata['gangPREFIX']}'> <input type='submit' value='Change Tag!'> </form>"; } } function armory() { global $ir,$c,$userid,$h,$gangdata; $db->query("UPDATE gangs SET gangARMORY=0 WHERE gangID={$gangdata['gangID']}",$c); print "Gangs Armory is now locked. "; } function uarmory() { global $ir,$c,$userid,$h,$gangdata; $db->query("UPDATE gangs SET gangARMORY=1 WHERE gangID={$gangdata['gangID']}",$c); print "Gangs Armory is now unlocked. "; } function desc() { global $ir,$c,$userid,$h,$gangdata; $_POST['desc'] = mysql_real_escape_string($_POST['desc']); if($_POST['desc']) { $db->query("UPDATE gangs SET gangDESCRIPTION='{$_POST['desc']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang's Description Changed!"; } else { print "[b]Here you are changing the gang's description[/b] <form action='gangadmin.php?action=desc' method='post'> New Description : <input type='text' name='desc' value='{$gangdata['gangDESCRIPTION']}'> <input type='submit' value='Change Decription!'> </form>"; } } function logo() { global $ir,$c,$userid,$h,$gangdata; $_POST['logo'] = mysql_real_escape_string($_POST['logo']); if($_POST['logo']) { $db->query("UPDATE gangs SET gangLOGO='{$_POST['logo']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang's Logo Changed!"; } else { print "[b]Here you are changing the gang's logo[/b] <form action='gangadmin.php?action=logo' method='post'> New Logo : <input type='text' name='logo' value='{$gangdata['gangLOGO']}'> <input type='submit' value='Change Logo!'> </form>"; } } function pres() { global $ir,$c,$userid,$h,$gangdata; $_POST['pres'] = abs(@intval($_POST['pres'])); $_POST['vicepres'] = abs(@intval($_POST['vicepres'])); if($_POST['pres'] || $_POST['vicepres']) { if($_POST['pres']) { $pres=$_POST['pres']; } if($_POST['vicepres']) { $vicepres=$_POST['vicepres']; } $db->query("UPDATE gangs SET gangPRESIDENT=$pres, gangVICEPRES=$vicepres WHERE gangID={$gangdata['gangID']}",$c); print "Gang's President and Vice President Changed!"; } else { print "[b]Here you are changing the gang's president/vice president. leave blank for no change.[/b] <form action='gangadmin.php?action=pres' method='post'> New President : <input type='text' name='pres' value='{$gangdata['gangPRESIDENT']}'> New Vice-President : <input type='text' name='vicepres' value='{$gangdata['gangVICEPRES']}'> <input type='submit' value='Change!'> </form>"; } } function id() { global $ir,$c,$userid,$h,$gangdata; $_POST['newid'] = abs(@intval($_POST['newid'])); $_POST['lastid'] = abs(@intval($_POST['lastid'])); if($_POST['newid']) { $nid=$_POST['newid']; $lid=$_POST['lastid']; $ncq=$db->query("SELECT * FROM gangs WHERE gangID=$nid",$c); if($db->num_rows($ncq)) { print "Gang ID Taken. [url='gangadmin.php?action=id']>Back[/url] "; exit; } $db->query("UPDATE users SET gang=$nid WHERE gang=$lid",$c); $db->query("UPDATE gangwars SET warDECLARED=$nid WHERE warDECLARED=$lid",$c); $db->query("UPDATE gangwars SET warDECLARER=$nid WHERE warDECLARER=$lid",$c); $db->query("UPDATE gangarmory SET armoryGANGID=$nid WHERE armoryGANGID=$lid",$c); $db->query("UPDATE gangs SET gangID=$nid WHERE gangID=$lid",$c); print "Gang ID Changed! [url='index.php']Home[/url] "; } else { print "Type in the new gang ID for this gang ID. <form action='gangadmin.php?action=id' method='post'> <input type='hidden' name='lastid' value='{$gangdata['gangID']}'> New ID : <input type='text' name='newid'> <hr width=40% /> [b]Are you 100% sure you want to change the Gang's ID?[/b] <input type='submit' value='Yes'> <input type='reset' value='No'> </form>"; } } function mw() { global $ir,$c,$userid,$h,$gangdata; $_GET['delete'] = abs(@intval($_GET['delete'])); if($_GET['delete']) { $delete=$_GET['delete']; $db->query("DELETE FROM gangwars WHERE warID=$delete",$c); print "Successfully Deleted =D. "; } else { $gwq=$db->query("SELECT gw.*,g.* FROM gangwars gw LEFT JOIN gangs g ON gw.warDECLARED=g.gangID OR gw.warDECLARER=g.gangID WHERE gw.warDECLARED={$gangdata['gangID']} OR gw.warDECLARER={$gangdata['gangID']}",$c); print "[b]Viewing all wars with {$gangdata['gangNAME']} gang.[/b] <table width=100% border=0><tr><th>War ID</th><th>Gang Declarer</th><th>Delete War?</th></tr>"; while($wq=$db->fetch_row($gwq)) { print "<tr><td>{$wq['warID']}</td><td>[url='gangs.php?action=view&ID={$wq[']{$wq['gangNAME']}[/url] ({$wq['gangID']})</td><td>[[url='gangadmin.php?action=mw&delete={$wq[']Delete[/url]] </td></tr>"; } print "</table>"; } } $h->endpage(); ?>
-
Well... Since I'm re-writing the McCodes engine anywho....I'd be glad to help :D
-
The bit about sticking it where all users have 100 is the tricky part I'm taking it to mean, set it UP so all users would have 100 Ammo Automatically the first round...what do ya think? :\
-
And claim it as your own? ;d
-
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
Richards Mod I just fixed it..> :P Going to try the ranks thing tomorrow, as well as someone just gave me the idea of "robbing a business" So may look into that...might be pretty easy to add actually -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
K so alot of people apparently are installing this, but no one's giving any feed back>< Curious if any bugs were found, working 100%? Good? bad?? DONT CODE ANYMORE YOU SUCK?? ;) hehe I can probably add that in, tho it'll be tomorrow, i'm getting tired and i still have to go through these 35 files in the PETS mod >< lol...this is getting put off till tomorrow i think. -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
You need to post up the Database INSERTS for the comp specials :P i dont have em -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
As far as I know the business Owner does have perks for being the owner, Give it a run and let me know if not i'll try and add. compspecials has been Updated as I missed a few ) on the sprintf queries -
Ok, so (Gambino) Sold a customer of mine this mod a few weeks back claiming it was "his" mod that he made just for them, when Obviously it's not because I have had this mod for about 7 months and considering they are on V2 and there are several calls to admin.php he's full of it....k rant over...anywho I was fixing this mod for the customer and have everything done but this last bit...obviously the installation instructions could use some improvement...if ANYONE knows wth this means i'd appreciate it Code he's referring to $jsdf=mysql_query("SELECT * FROM items WHERE itmtype=4",$c); while($add=mysql_fetch_array($jsdf)) { mysql_query("INSERT INTO ammunition VALUES('{$add['itmid']}','100')",$c) or die(mysql_error()); print"{$add['itmname']} Ammo Added."; }
-
in this table phpbb_adr_battle_monsters Add this Column monster_fight_opponent
-
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
compspecials.php <?php include_once (DIRNAME(__FILE__) . '/globals.php'); $_POST['ID'] = abs(@intval($_POST['ID'])); if(!$_POST['ID']) { echo "Invalid use of file"; exit; } else { $com = $db->query("SELECT bmembBusiness FROM businesses_members WHERE bmembMember='{$ir['userid']}'"); $cc=$db->fetch_row($com); $clas = $db->query("SELECT * FROM businesses WHERE busId='{$cc['bmembBusiness']}'"); $cs=$db->fetch_row($clas); $clas = $db->query("SELECT * FROM businesses WHERE busDirector='1'"); $cs=$db->fetch_row($clas); $q=$db->query("SELECT * FROM compspecials WHERE csID={$_POST['ID']}"); if($db->num_rows($q) == 0) { print "There is no Company Special with this ID!"; } else { $r=$db->fetch_row($q); if($ir['comppoints'] < $r['csCOST']) { print "You don't have enough company points to get this reward!"; $h->endpage(); exit; } if($r['csJOB'] != $cs['busClass']) { print "You are not in this type of Company!"; $h->endpage(); exit; } if($r['csITEM']) { item_add($userid, $r['csITEM'], '1'); } $money=($r['csMONEY']); $crys=($r['csCRYSTALS']); $cost=($r['csCOST']); $endu=($r['csENDU']); $iq=($r['csIQ']); $lab=($r['csLABOUR']); $str=($r['csSTR']); $db->query(sprintf("UPDATE users SET money=money+%u, crystals=crystals+%u, comppoints=comppoints-%u WHERE userid=%u",$money, $crys, $cost, $userid)); $db->query(sprintf("UPDATE userstats SET strength=strength+%u,IQ=IQ+%u,labour=labour+%u WHERE userid=%u", $str, $iq, $lab, $userid)); print "You successfully redeemed the {$r['csNAME']} Special for {$r['csCOST']} Company Points."; } } $h->endpage(); ?> Beleive that's everything. It's not my mod but I worked my butt off on it :P ENJOY It or i'll find u! ^_- Any problems let me know. -
Richards Business Mod--Fixed With a few Things added.
Joshua replied to Joshua's topic in Free Modifications
business_manage.php continued } } else { echo '<form action="business_manage.php?p=debt" method="post"> Your Company has £'.number_format($inf['busDebt']).' of debt. [b]Enter amount:[/b] Cash: <input type="text" name="cash" /> <input type="submit" value="Submit" /> </form>'; } } function donate_cash() { global $ir, $inf, $db; $_POST['cash'] = abs(@intval($_POST['cash'])); if($_POST['cash'] > 0) { if(@intval($_POST['cash'] > $ir['money'])) { echo 'You do not have enough cash to donate this much to the Company.'; } else { $db->query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE `userid` = '%u'", $_POST['cash'], $ir['userid'])); $db->query(sprintf("UPDATE `businesses` SET `busCash` = `busCash` + '%d' WHERE `busId` = '%u'", $_POST['cash'], $inf['busId'])); echo 'You have donated '.number_format($_POST['cash']).' to the Company.'; business_alert($inf['busId'], "".$ir['username']." donated ".number_format($_POST['cash'])." to the Company."); } } else { echo 'You missed one or more of the required fields.'; } } function withdraw_mula() { global $ir, $inf, $userid, $db; $_POST['mula']=abs(@intval($_POST['mula'])); if($_POST['mula'] > 0) { if($_POST['mula'] > $inf['busCash']) { echo 'You do not have enough cash to withdraw this much from the Company.'; } else { $db->query(sprintf("UPDATE `users` SET `money` = `money` + '%d' WHERE `userid` = '%u'", $_POST['mula'], $ir['userid'])); $db->query(sprintf("UPDATE `businesses` SET `busCash` = `busCash` - '%d' WHERE `busId` = '%u'", $_POST['mula'], $inf['busId'])); echo 'You have withdrawn '.number_format($_POST['mula']).' from the Company.'; business_alert($inf['busId'], "".$ir['username']." withdrawn ".number_format($_POST['mula'])." from the Company."); } } else { echo 'You missed one or more of the required fields.'; } } function kick_member() { global $ir, $inf, $db; if(!isset($_POST['member'])) { echo 'Please select a member to kick out of the Company: <form action="business_manage.php?p=kick_out" method="post"> Company employee: <select name="member"> <option value="0">None</option>'; $select_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) WHERE (`bmembBusiness` = '%u') ORDER BY `bmembId` ASC", $inf['busId'])); while($sm = $db->fetch_row($select_members)) { echo '<option value="'.$sm['userid'].'">'.stripslashes($sm['username']).'</option>'; } echo '</select> <input type="submit" value="Kick from company" /> </form>'; } else $_POST['member'] = abs(@intval($_POST['member'])); { $db->query(sprintf("DELETE FROM `businesses_members` WHERE `bmembMember` = '%u'", $_POST['member'])); $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $thename = $db->fetch_row($realname); $db->query(sprintf("UPDATE `users` SET `business` = '0' WHERE `userid` = '%u'", $_POST['member'])); echo 'This member has been kicked out of the Company.'; business_alert($inf['busId'], " ".$thename['username']." was kicked out of the Company."); } } function bankrupt_business() { global $ir, $inf, $db; if(!$_GET['confirm']) { echo 'You are about to bankrupt the '.stripslashes($inf['busName']).' Company. Please confirm this action. Once this has been confirmed there is no chance to go back. [url="business_manage.php?p=bankrupt&confirm=1"]Bankrupt the Company[/url]'; } else { $send_event = $db->query(sprintf("SELECT `bmembMember` FROM businesses_members WHERE `bmembBusiness` = '%u' ORDER BY `bmembId` DESC", $bs['busId'])); while($se = $db->fetch_row($send_event)) { $text = "The director has chosen to bankrupt the {$inf['busName']} Company\, all members have been made redundent."; insert_event($se['bmembMember'], $text); } $db->query(sprintf("DELETE FROM `businesses_members` WHERE (`bmembBusiness` = '%u')", $inf['busId'])); $db->query(sprintf("DELETE FROM `businesses` WHERE (`busId` = '%u')", $inf['busId'])); $db->query(sprintf("UPDATE `users` SET `business` = '0' WHERE `business` = '%u'", $inf['busId'])); echo 'You have decided to bankrupt the Company, all members have been made redundent.'; } } function credit_member() { global $ir, $inf, $db; $_POST['cash'] = abs(@intval($_POST['cash'])); $_POST['member'] = abs(@intval($_POST['cash'])); if($_POST['cash'] AND $_POST['member']) { if($_POST['cash'] > $inf['busCash']) { echo 'You cannot credit more than the Company has in it\'s vault.'; } else { $db->query(sprintf("UPDATE `users` SET `money` = `money` + '%d' WHERE `userid` = '%u'", $_POST['cash'], $_POST['member'])); $db->query(sprintf("UPDATE `businesses` SET `busCash` = `busCash` - '%d' WHERE `busId` = '%u'", $_POST['cash'], $inf['busId'])); $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $thename = $db->fetch_row($realname); echo 'You gave '.number_format($_POST['cash']).' to this member from the vault.'; business_alert($inf['busId'], " ".$thename['username']." was credited ".number_format($_POST['cash'])." from the Company."); } } else { echo '<form action="business_manage.php?p=credit_member" method="post"> <p align="center"> Your Company vault contains '.number_format($inf['busCash']).' at this time, which can be credited to a member. Select a member from the box below and enter an amount of cash to give to them. Cash amount: <input type="text" name="cash" /> Company employee: <select name="member"> <option value="0">None</option> <option value="'.$ir['userid'].'">'.stripslashes($ir['username']).'</option>'; $select_members = $db->query(sprintf("SELECT * FROM `businesses_members` LEFT JOIN `users` ON (`userid` = `bmembMember`) WHERE (`bmembBusiness` = '%u') ORDER BY `bmembId` ASC", $inf['busId'])); while($sm = $db->fetch_row($select_members)) { echo '<option value="'.$sm['userid'].'">'.stripslashes($sm['username']).'</option>'; } echo '</select> <input type="submit" value="Credit cash" /> </p> </form>'; } } function manage_applications() { global $ir, $inf, $db; $_GET['id'] = abs(@intval($_GET['id'])); $_POST['member'] = abs(@intval($_POST['member'])); if(!isset($_GET['a'])) { $fetch_apps = $db->query(sprintf("SELECT * FROM `businesses_apps` LEFT JOIN `users` ON `userid` = `appMember` WHERE `appBusiness` = '%u'", $inf['busId'])); echo '<table width="600" class="table"> <tr> <th width="15%">Member</th> <th width="50%">Application</th> <th width="15%">Time</th> <th width="20%">Manage</th> </tr>'; while($r = $db->fetch_row($fetch_apps)) { echo ' <tr> <td>[url="viewuser.php?u='.$r['userid'].'"]'.stripslashes($r['username']).'[/url]</td> <td>'.stripslashes(htmlentities($r['appText'])).'</td> <td>'.date('d-m-Y, g:i:s A', $r['appTime']).'</td> <td>[url="business_manage.php?p=view_apps&a=accept&id='.$r['appId'].'"][size="1"]Accept[/size][/url][size="1"]-[/size] [url="business_manage.php?p=view_apps&a=decline&id='.$r['appId'].'"][size="1"]Decline[/size][/url]</td> </tr>'; } echo '</table>'; } else if($_GET['a'] == 'accept' AND $_GET['id']) { $fetch_app = $db->query(sprintf("SELECT * FROM `businesses_apps` LEFT JOIN `users` ON `userid` = `appMember` WHERE `appId` = '%u'", $_GET['id'])); if($db->num_rows($fetch_app)) { $it = $db->fetch_row($fetch_app); $check = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembMember` = '%u')", $it['appMember'])); if(!$db->num_rows($check)) { $rows = $db->query(sprintf("SELECT * FROM `businesses_members` WHERE (`bmembBusiness` = '%u')", $inf['busId'])); if($db->num_rows($rows) < $inf['busEmployees']) { $fetch_rank = $db->query(sprintf("SELECT * FROM `businesses_ranks` WHERE (`rankClass` = '%u') ORDER BY `rankCash` ASC LIMIT 1", $inf['classId'])); $fr = $db->fetch_row($fetch_rank); $realname = $db->query(sprintf("SELECT * FROM `users` WHERE (`userid` = '%u')", $_POST['member'])); $thename = $db->fetch_row($realname); business_alert($inf['busId'], " A new employee has been accepted into the Company."); $db->query(sprintf("INSERT INTO `businesses_members` (`bmembId`, `bmembMember`, `bmembBusiness`, `bmembCash`, `bmembRank`) VALUES ('NULL', '%u', '%d', '%d', '%d')", $it['appMember'], $inf['busId'], $fr['rankCash'], $fr['rankId'])); $db->query(sprintf("UPDATE `users` SET business='{$inf['busId']}' WHERE `userid` = '%u'", $it['appMember'])); $db->query(sprintf("DELETE FROM `businesses_apps` WHERE `appId` = '%u'", $_GET['id'])); echo 'The selected application has been accepted.'; } else { echo 'Your Company cannot hold more members at this time.'; } } else { echo 'This member is part of a Company at this time, the application could not be accepted.'; $db->query(sprintf("DELETE FROM `businesses_apps` WHERE `appId` = '%u'", $_GET['id'])); } } else { echo 'The selected application no longer exists.'; } } else if($_GET['a'] == 'decline' AND $_GET['id']) { $fetch_app = $db->query(sprintf("SELECT * FROM `businesses_apps` WHERE `appId` = '%u'", $_GET['id'])); if($db->num_rows($fetch_app)) { echo 'The selected application was declined, It has been removed from the log.'; $db->query(sprintf("DELETE FROM `businesses_apps` WHERE `appId` = '%u'", $_GET['id'])); } else { echo 'The selected application no longer exists.'; } } else { echo 'You did not select an application to manage, go back and select one!'; } } function upgrade_business() { global $ir, $inf, $db; if($inf['busEmployees'] >= 50) { die('This company is already fully upgraded to 50 employees.'); } if(!$_GET['confirm']) { $price_upgrade = (($inf['busEmployees'])*1500000); echo 'You currently have '.$inf['busEmployees'].' employee spots. You are about to upgrade the '.stripslashes($inf['busName']).' Company at a cost of '.number_format($price_upgrade).' for an additional 5 slots. Please confirm this action. Once this has been confirmed there is no chance to go back. [url="business_manage.php?p=upgrade&confirm=1"]Upgrade the Company[/url]'; } else { $price_upgrade = (($inf['busEmployees'])*1500000); if ($inf['busCash'] < $price_upgrade) { die('You do not have enough money in the vault.'); } else if($inf['busEmployees'] >= 50) { die('this company is already fully upgraded to 50 employees.'); } else { $db->query(sprintf("UPDATE `businesses` SET `busEmployees` = busEmployees+5, `busCash` = busCash - ".$price_upgrade." WHERE `busDirector` = ".$ir['userid']."")); business_alert($inf['busId'], "The Director has upgraded the Company for 5 extra members."); echo 'You have decided to upgrade the Company, you can now employee an additional 5 members.'; } } } function change_description() { global $ir, $inf, $db; if(!mysql_real_escape_string(htmlentities($_POST['desc']))) { echo '<form action="business_manage.php?p=change_desc" method="post"> <p align="center"> [b]You are changing the Company description of the '.stripslashes($inf['busName']).' Company.[/b] Please enter a description in the input box below and click \'Change description\' to submit the new description. Maximum characters is set at 50!! <textarea rows="10" cols="50" name="desc">'.($inf['busDesc']).'</textarea> <input type="submit" value="Change description" /> </p> </form>'; } else { $db->query(sprintf("UPDATE `businesses` SET `busDesc` = '%s' WHERE `busId` = '%u'", stripslashes($_POST['desc']), $inf['busId'])); echo 'The Company description was changed to: '.stripslashes($_POST['desc']).'!'; } } function secure_business() { global $ir, $inf, $db; if(!$_GET['confirm']) { $price_upgrade = (($inf['busEmployees'])*200000); echo 'You currently have '.$inf['bussecurity'].' security guards. You are about to upgrade the '.stripslashes($inf['busName']).' Company at a cost of '.number_format($price_upgrade).' for one additional guard. Please confirm this action. Once this has been confirmed there is no chance to go back. [url="business_manage.php?p=secupgrade&confirm=1"]Purchase Guard[/url]'; } else { $price_upgrade = (($inf['busEmployees'])*200000); if ($inf['busCash'] < $price_upgrade) { die('You do not have enough money in the vault.'); } else { $db->query(sprintf("UPDATE `businesses` SET `bussecurity` = bussecurity+1, `busCash` = busCash - ".$price_upgrade." WHERE `busDirector` = ".$ir['userid']."")); echo 'You have decided to upgrade the Company, you now have one additional guard.'; business_alert($inf['busId'], "The Director has upgraded the Company and added an Extra security guard."); } } } $h->endpage(); ?> companyspecials.php <?php include_once (DIRNAME(__FILE__) . '/globals.php'); print " [b]Specials unlocked:[/b]<b/> You have {$ir['comppoints']} company points, What would you like to spend them on? <form action='compspecials.php' method='post'> <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>Reward</th><th>Cost</th><th>Take</th</tr>"; global $ir,$db; $com = $db->query("SELECT bmembBusiness FROM businesses_members WHERE bmembMember='{$ir['userid']}'"); $cc=$db->fetch_row($com); $clas = $db->query("SELECT * FROM businesses WHERE busId='{$cc['bmembBusiness']}'"); $cs=$db->fetch_row($clas); $clas = $db->query("SELECT * FROM businesses WHERE busDirector='1'"); $cs=$db->fetch_row($clas); $js=$db->query("SELECT * FROM compspecials WHERE csJOB='{$cs['busClass']}'"); if($db->num_rows($js) == 0) { print "<tr class='row$current_row'><td colspan=3>This Company has no Specials</td></tr>"; $current_row = 1 - $current_row; } while($sp=$db->fetch_row($js)) { print "<tr class='row$current_row'><td><font color=white>{$sp['csNAME']}</td><td><font color=#FF0000>-{$sp['csCOST']}Company Points</font></td><td><center><input type='radio' name='ID' value='{$sp['csID']}' /></td></tr>"; $current_row = 1 - $current_row; } print "<tr> <td colspan=3><div align=center><input type='submit' value='Purchase'></div></td> </tr></table></form> "; $h->endpage(); ?>