I'm doing this One Time and One time only. Minor bugs post here and I'll try and fix, but I'm not posting the entire new code as I do that on my own forums.
That being said, Enjoy, I spent A lot of time on this.
**Mod originally created by Richard off MWG forums, It had several bugs, several missing functions, security issues, and over all just wasnt up to snuff**
It is now, Tested, Works 100%. BludClart added the comppoints bit so all credits for that go to him.
Now lets do the SQLS. This will be more than one post as limits on forums restrict characther amounts.
SQLS
CREATE TABLE IF NOT EXISTS `businesses` (
`busId` int(11) NOT NULL auto_increment,
`busName` varchar(255) NOT NULL,
`busClass` int(11) NOT NULL,
`busDirector` int(11) NOT NULL,
`busProfit` bigint(25) NOT NULL,
`busYProfit` bigint(25) NOT NULL,
`busCust` int(11) NOT NULL,
`busYCust` int(11) NOT NULL,
`busCash` int(11) NOT NULL,
`busDebt` int(11) NOT NULL,
`busImage` varchar(255) NOT NULL,
`busDays` bigint(32) NOT NULL default '0',
`busEmployees` int(11) NOT NULL default '0',
`brank` int(11) NOT NULL default '0',
`busDesc` varchar(50) NOT NULL,
`bussecurity` int(11) NOT NULL default '0',
PRIMARY KEY (`busId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;CREATE TABLE IF NOT EXISTS `businesses_alerts` (
`alertId` int(11) NOT NULL auto_increment,
`alertBusiness` int(11) NOT NULL default '0',
`alertTime` int(11) NOT NULL default '0',
`alertText` text NOT NULL,
PRIMARY KEY (`alertId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ;CREATE TABLE IF NOT EXISTS `businesses_apps` (
`appId` int(11) NOT NULL auto_increment,
`appMember` int(11) NOT NULL,
`appBusiness` int(11) NOT NULL,
`appText` text NOT NULL,
`appTime` int(11) NOT NULL,
PRIMARY KEY (`appId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;CREATE TABLE IF NOT EXISTS `businesses_classes` (
`classId` int(11) NOT NULL auto_increment,
`className` varchar(255) NOT NULL,
`classDesc` text NOT NULL,
`classMembers` int(11) NOT NULL,
`classCost` int(11) NOT NULL,
PRIMARY KEY (`classId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `businesses_classes`
--
INSERT INTO `businesses_classes` (`classId`, `className`, `classDesc`, `classMembers`, `classCost`) VALUES
(1, 'Fireworks stand', 'Our customers will explode in delight with our fireworks. Great for holidays or any special event.', 4, 500000),
(2, 'Hair salon', 'A hair salon is a place where one goes to get their hair cut, as well as styled, highlighted or coloured.', 4, 750000),
(3, 'Law firm', 'A law firm is a business entity formed by one or more lawyers to engage in the practice of law. The money made is determined by the work hours the company sells. The amount of employees will increase this, aswell as the hired lawyers stats.', 6, 4000000),
(4, 'Flower shop', 'A store where flowers are purchased.', 4, 100000),
(5, 'Car dealership', 'Our customers need transportation. Sell them our best and send them on their way.', 8, 6000000),
(6, 'Football Club', 'Lead the way with your team and become the champions.', 10, 12000000);CREATE TABLE IF NOT EXISTS `businesses_members` (
`bmembId` int(11) NOT NULL auto_increment,
`bmembMember` int(11) NOT NULL,
`bmembBusiness` int(11) NOT NULL default '0',
`bmembCash` int(11) NOT NULL,
`bmembRank` int(11) NOT NULL default '0',
`bmembDays` bigint(32) NOT NULL default '0',
PRIMARY KEY (`bmembId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;CREATE TABLE IF NOT EXISTS `businesses_ranks` (
`rankId` int(11) NOT NULL auto_increment,
`rankName` varchar(255) NOT NULL,
`rankClass` int(11) NOT NULL,
`rankCash` int(11) NOT NULL,
`rankPrim` enum('labour','IQ','strength') NOT NULL,
`rankSec` enum('labour','IQ','strength') NOT NULL,
`rankPGain` decimal(11,2) NOT NULL,
`rankSGain` decimal(11,2) NOT NULL,
PRIMARY KEY (`rankId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;
--
-- Dumping data for table `businesses_ranks`
--
INSERT INTO `businesses_ranks` (`rankId`, `rankName`, `rankClass`, `rankCash`, `rankPrim`, `rankSec`, `rankPGain`, `rankSGain`) VALUES
(1, 'Sales person', 1, 1000, 'IQ', 'labour', '30.50', '15.25'),
(2, 'Product manager', 1, 2500, 'labour', 'strength', '20.00', '10.00'),
(3, 'Cashier', 1, 5000, 'IQ', 'strength', '25.00', '12.00'),
(4, 'Stylist', 2, 800, 'IQ', 'labour', '25.00', '12.50'),
(5, 'Cleaner', 2, 1400, 'labour', 'strength', '20.00', '10.00'),
(6, 'Shampooist', 2, 2100, 'strength', 'labour', '25.00', '12.50'),
(7, 'Lawyer', 3, 1200, 'IQ', 'labour', '40.00', '20.00'),
(8, 'Cleaner', 3, 800, 'labour', 'strength', '20.00', '10.00'),
(9, 'Receptionist', 3, 600, 'IQ', 'labour', '30.00', '15.00'),
(10, 'Florist', 4, 500, 'labour', 'strength', '25.00', '12.50'),
(11, 'Cleaner', 4, 750, 'labour', 'IQ', '20.00', '10.00'),
(12, 'Salesman', 5, 3400, 'labour', 'strength', '30.00', '15.00'),
(13, 'Cleaner', 5, 1400, 'labour', 'strength', '20.00', '10.00'),
(14, 'Receptionist', 5, 900, 'IQ', 'labour', '34.00', '17.00'),
(15, 'Referee', 6, 3150, 'labour', 'strength', '15.00', '10.00'),
(16, 'Player', 6, 3500, 'labour', 'IQ', '28.00', '7.00'),
(17, 'Goal Keeper', 6, 3100, 'labour', 'strength', '25.00', '7.00');CREATE TABLE IF NOT EXISTS `compspecials` (
`csID` int(11) NOT NULL auto_increment,
`csNAME` varchar(255) NOT NULL default '',
`csJOB` int(11) NOT NULL default '0',
`csCOST` int(11) NOT NULL default '0',
`csMONEY` int(11) NOT NULL default '0',
`csCRYSTALS` int(11) NOT NULL default '0',
`csITEM` int(11) NOT NULL default '0',
`csENDU` int(11) NOT NULL default '0',
`csIQ` int(11) NOT NULL default '0',
`csLABOUR` int(11) NOT NULL default '0',
`csSTR` int(11) NOT NULL default '0',
PRIMARY KEY (`csID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
--
-- Dumping data for table `compspecials`
--
INSERT INTO `compspecials` (`csID`, `csNAME`, `csJOB`, `csCOST`, `csMONEY`, `csCRYSTALS`, `csITEM`, `csENDU`, `csIQ`, `csLABOUR`, `csSTR`) VALUES
(1, 'Steal A Ford Transit', 5, 3, 0, 0, 31, 0, 0, 0, 0),
(2, 'Working 24/7 + $1500', 1, 3, 1500, 0, 0, 0, 0, 0, 0),
(3, 'Steal a Diamond', 1, 5, 0, 1, 0, 0, 0, 0, 0),
(4, 'Steal an Energy Bar', 1, 20, 0, 0, 131, 0, 0, 0, 0),
(5, 'Gang Respect + 5', 2, 10, 0, 0, 0, 0, 0, 0, 0),
(6, 'Eat Out - Gain a Pizza', 2, 5, 0, 0, 117, 0, 0, 0, 0),
(7, '+ 50 Gang Respect ', 2, 30, 0, 0, 0, 0, 0, 0, 0),
(8, 'Steal a Jail Ticket ', 3, 10, 0, 0, 182, 0, 0, 0, 0),
(9, 'Steal Jail Keys', 3, 3, 0, 0, 76, 0, 0, 0, 0),
(10, 'Steal Super Jail Keys', 3, 5, 0, 0, 94, 0, 0, 0, 0),
(11, 'Working Overtime + $500', 4, 3, 500, 0, 0, 0, 0, 0, 0),
(12, 'Steal A Ford Focus', 5, 15, 0, 0, 75, 0, 0, 0, 0),
(13, 'Steal A Lamborgini Gallardo', 5, 45, 0, 0, 16, 0, 0, 0, 0),
(14, 'Combat Training + 50 Strength', 14, 2, 0, 0, 0, 0, 0, 0, 50);ALTER TABLE `users` ADD `comppoints` INT(11) NOT NULL DEFAULT '0';
ALTER TABLE `users` ADD `business` INT(11) NOT NULL DEFAULT '0';
ALTER TABLE `users` ADD `active` INT(11) NOT NULL DEFAULT '0';
ALTER TABLE `users` ADD `activedays` INT(11) NOT NULL DEFAULT '0';
Next
Open up loggedin.php
Add this query, I'd suggest right under neath the include "globals.php" bit
$db->query("UPDATE users SET active=1 WHERE userid=$userid");
Next Open up Global_func.php and find ?>
Above that add
function business_alert($business, $text)
{
mysql_query(sprintf("INSERT INTO `businesses_alerts` (`alertId`, `alertBusiness`, `alertText`, `alertTime`) VALUES ('NULL', '%u', '%s', '%d')", $business, $text, time()));
}