|
Page 1 of 1 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Wed, 12th Mar 2008 18:55 Post subject: REQUESTING : .... PHP Programmer? :D |
|
 |
Guys,
I need a simple mod done to a php script. Basically I need a calculation being made on one page to be put onto another page.
Code: | // Calculate percentage attendence.
for ($i=0; $i<count($players); $i++) {
$playerattendence[$players[$i]] = number_format(($playerattendence[$players[$i]] / $raidtotal) * 100, 2, ".", ",");
}
arsort($playerattendence);
$players = array_keys($playerattendence);
$text = "<h1>".$title."</h1>";
$text .= "<p>".date("d/m/Y", $days30)." - ".date("d/m/Y")."</p>";
$text .= "<table>";
$text .= "<tr><td>Player Name</td><td>Attendence Percentage</td></tr>";
for ($i=0; $i<count($players); $i++) {
$text .= "<tr><td>".simplifyString($players[$i])."</td><td align='center'>".$playerattendence[$players[$i]]."%</td></tr>";
}
$text .= "</table>";
return $text;
}
$sql3 = new db;
$currentpage = "attendence";
$title = "Attendence Report";
$text = "<center>";
if (isset($_GET['dbid'])) {
$text .= generateHeader($currentpage);
$text .= fetchData($_GET['dbid']);
} else {
$text .= generateHeader($currentpage);
$text .= "<p>Please select a link above to view data for that database.</p>";
}
$text .= "</center>";
$ns -> tablerender($title, $text);
// Ensure that the system reconnects to the e107 database. A nasty dodgy hack but I might as well play it safe :).
$sql3 -> db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
require_once(FOOTERF);
?> |
That currently is the reporting page, I need the calculation to be done as lifetime attendance rather than last 30 days attendance.
[code]
// Find the percent of raids they've attended in the last 30, 60 and 90 days
$percent_of_raids = array(
'30' => raid_count(mktime(0, 0, 0, date('m'), date('d')-30, date('Y')), time(), $member['member_name']),
'60' => raid_count(mktime(0, 0, 0, date('m'), date('d')-60, date('Y')), time(), $member['member_name']),
'90' => raid_count(mktime(0, 0, 0, date('m'), date('d')-90, date('Y')), time(), $member['member_name']),
'lifetime' => raid_count($member['member_firstraid'], $member['member_lastraid'], $member['member_name'])
);
[/code]
The bottom code is where lifetime is currently being calculated.
Can anyone make the quick modification for me to the top code so that it calculates lifetime instead of 30 days. Any additional information can be provided or you can get the source files if you need.
|
|
Back to top |
|
 |
|
Posted: Thu, 13th Mar 2008 03:44 Post subject: |
|
 |
Contact me on aim - aoamchart; I need to see more related code.
|
|
Back to top |
|
 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Thu, 13th Mar 2008 06:06 Post subject: |
|
 |
Added you, will talk to you on there soon.
|
|
Back to top |
|
 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Thu, 13th Mar 2008 06:17 Post subject: |
|
 |
Mchart, I pmed you both pages with their code.
|
|
Back to top |
|
 |
|
Posted: Thu, 13th Mar 2008 17:40 Post subject: |
|
 |
When I get home from work later today i'll take a look at it.
|
|
Back to top |
|
 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Thu, 13th Mar 2008 17:47 Post subject: |
|
 |
Mchart wrote: | When I get home from work later today i'll take a look at it. |
Much appreciated.
|
|
Back to top |
|
 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Sun, 30th Mar 2008 03:34 Post subject: |
|
 |
Hi everyone, Mchart has been somewhat busy, are there any other friendly php programmers out there that can lend their hand to a man in need?
|
|
Back to top |
|
 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Sun, 30th Mar 2008 20:46 Post subject: |
|
 |
|
|
Back to top |
|
 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Tue, 1st Apr 2008 22:15 Post subject: |
|
 |
No one knows anyone that can help? At this point I'm willing to pay for their 5-10 minutes of time.
|
|
Back to top |
|
 |
nouseforaname
Über-VIP Member
Posts: 21306
Location: Toronto, Canada
|
|
Back to top |
|
 |
|
Posted: Tue, 1st Apr 2008 22:29 Post subject: |
|
 |
Can't you ask admins here sure they know something about that...
"Quantum mechanics is actually, contrary to it's reputation, unbeliveably simple, once you take the physics out."
Scott Aaronson chiv wrote: | thats true you know. newton didnt discover gravity. the apple told him about it, and then he killed it. the core was never found. |
|
|
Back to top |
|
 |
|
Posted: Tue, 1st Apr 2008 22:31 Post subject: |
|
 |
@ Phluxed
Maybe google and find a forum dedicated to php. I'd guess there are some pretty hardcore hobbyists there willing to help for free.
|
|
Back to top |
|
 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Tue, 1st Apr 2008 22:31 Post subject: |
|
 |
I posted on the VIP but none of the mods or admins have responded
I started considering that today VGA, probably what I'll have to do.
|
|
Back to top |
|
 |
|
Posted: Tue, 1st Apr 2008 22:57 Post subject: Re: REQUESTING : .... PHP Programmer? :D |
|
 |
I don't know the first thing about php but isn't this more a question of substitution than syntax. And since the value for attendance in the different periods is already calculated it should just be a question of substituting it from the array and into the results page. But I have the same feeling that I get when Jeremy Clarkson says 'how hard can it be'. Anyway goodluck with your quest Phluxed.
Spoiler: | Try substituting 'lifetime' for '30' in that variable there.
Phluxed wrote: | Guys,
I need a simple mod done to a php script. Basically I need a calculation being made on one page to be put onto another page.
Code: | // Calculate percentage attendence.
for ($i=0; $i<count($players); $i++) {
$playerattendence[$players[$i]] = number_format(($playerattendence[$players[$i]] / $raidtotal) * 100, 2, ".", ",");
}
arsort($playerattendence);
$players = array_keys($playerattendence);
$text = "<h1>".$title."</h1>";
$text .= "<p>".date("d/m/Y", $days30)." - ".date("d/m/Y")."</p>";
$text .= "<table>";
$text .= "<tr><td>Player Name</td><td>Attendence Percentage</td></tr>";
for ($i=0; $i<count($players); $i++) {
$text .= "<tr><td>".simplifyString($players[$i])."</td><td align='center'>".$playerattendence[$players[$i]]."%</td></tr>";
}
$text .= "</table>";
return $text;
}
$sql3 = new db;
$currentpage = "attendence";
$title = "Attendence Report";
$text = "<center>";
if (isset($_GET['dbid'])) {
$text .= generateHeader($currentpage);
$text .= fetchData($_GET['dbid']);
} else {
$text .= generateHeader($currentpage);
$text .= "<p>Please select a link above to view data for that database.</p>";
}
$text .= "</center>";
$ns -> tablerender($title, $text);
// Ensure that the system reconnects to the e107 database. A nasty dodgy hack but I might as well play it safe :).
$sql3 -> db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
require_once(FOOTERF);
?> |
That currently is the reporting page, I need the calculation to be done as lifetime attendance rather than last 30 days attendance.
[code]
// Find the percent of raids they've attended in the last 30, 60 and 90 days
$percent_of_raids = array(
'30' => raid_count(mktime(0, 0, 0, date('m'), date('d')-30, date('Y')), time(), $member['member_name']),
'60' => raid_count(mktime(0, 0, 0, date('m'), date('d')-60, date('Y')), time(), $member['member_name']),
'90' => raid_count(mktime(0, 0, 0, date('m'), date('d')-90, date('Y')), time(), $member['member_name']),
'lifetime' => raid_count($member['member_firstraid'], $member['member_lastraid'], $member['member_name'])
);
[/code]
The bottom code is where lifetime is currently being calculated.
Can anyone make the quick modification for me to the top code so that it calculates lifetime instead of 30 days. Any additional information can be provided or you can get the source files if you need. |
|
|
|
Back to top |
|
 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Tue, 1st Apr 2008 23:30 Post subject: |
|
 |
I know what youre saying, but those have variables being defined on 2 different pages.. ugh I hate php...
|
|
Back to top |
|
 |
Phluxed
VIP Member
Posts: 4911
Location: Oakville, Ontario, Canada
|
Posted: Thu, 3rd Apr 2008 01:28 Post subject: |
|
 |
I should post here, Rinze got it for me
<3 Rinze.
|
|
Back to top |
|
 |
Page 1 of 1 |
All times are GMT + 1 Hour |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group
|
|
 |
|