Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Navigation
Latest Addons
Cookiebar Panel 70
AD Gallery 149
SyntaxHighlighte... 63
Newsletters v4.03 167
Facebook Like Box 199
Newsletters v4.02 79
Metro 235
Facebook Connect 215
Shoutbox Panel 181
Redactor for PHP... 127
MI Floating Side... 131
Facebook Login/R... 180
Avatar Studio v2.03 214
Relationship Sta... 120
Sexual Orientati... 135
Popular Addons
iTheme2 5903
Arise 5868
User Control v1.23 4678
Event Calendar 4127
Photowidget panel 3921
Radio-Theme red2... 3392
Highslide Gallery 3358
CSS/JavaScript D... 3273
Facebook Connect... 3055
Dynamic Menu 2945
Slideshow Lightb... 2767
L-AMANT 2687
Enigma 2669
2Dark 2624
Black 2615
View Thread
Official Home of PHP-Fusion » General Addon and Modification Support » Panels and Infusions
Who is here? 1 guest(s)
 Print Thread
Panel Code Help
afoster
I have the following code in a panel which works very well. What I would like to do is to have the number of records displayed as follows after opensidex(

Not Yet Paid - x number of players

Is this possible?

Download source  Code
if (!defined("IN_FUSION")) { die("Access Denied"); }

opensidex("Not Yet Paid");
$sql = dbquery("SELECT * FROM fusion_players12 Where paid=0 ORDER By name ASC");
echo '<br>
<table align="center" cellspacing="1" cellpadding="3" width="100%" class="tbl-border">
<tr class="tbl2"><td width="50%"><b><center>Name</b></td><td width="25%"><b><center>Owed</b></td><td width="25%"><b><center>Paid</b></td></tr>';
while($data = dbarray($sql))
{
   echo '<tr class="tbl1"><td>'.$data['name'].'</td><td align="right">'.$data['total'].'</td><td align="right">'.$data['paid'].'</td></tr>';
}
echo '</table>
<br>';
closesidex();


 
Tyler
Download source  Code
$total_unpaid = dbrows($sql);





??????
Helping, would be pointing you in the right direction, not doing it all for you.
 
afoster
I see your signature block and understand what you are saying, however I have added your suggested code everywhere I could think of it to place it but it does not provide the display I am looking for. Can you point me in the direction of where it should be placed?

BTW, I appreciate your willingness to help.
 
Craig
Hi afoster try this....

Download source  Code
$not_paid = number_format(dbcount("(player_id)", DB_FUSION_PLAYERS12, "paid='0'"));
   
opensidex("Not Yet Paid - ".$not_paid);




I am not sure if player_id is the correct id you want to count but you get the idea.
 
http://www.fusiontube.co.uk/
afoster
Craig,

I'm sure I messed up somewhere because using your code, I get a blank where the number of players should be displayed. _First, I had to change DB_FUSION_PLAYERS12 to just fusion_players12 because it was throwing an error msg and then I changed player_id to just id because that is how the column is headed.

I entered your code right after the $sql=dbquery line...should it be entered somewhere else?
 
Craig
Try this...
Download source  Code

if (!defined("IN_FUSION")) { die("Access Denied"); }

$not_paid = dbcount("(id)", fusion_players12, "paid='0'");
   
opensidex("Not Yet Paid - ".$not_paid);
$sql = dbquery("SELECT * FROM fusion_players12 Where paid=0 ORDER By name ASC");
echo '<br>
<table align="center" cellspacing="1" cellpadding="3" width="100%" class="tbl-border">
<tr class="tbl2"><td width="50%"><b><center>Name</b></td><td width="25%"><b><center>Owed</b></td><td width="25%"><b><center>Paid</b></td></tr>';
while($data = dbarray($sql))
{
   echo '<tr class="tbl1"><td>'.$data['name'].'</td><td align="right">'.$data['total'].'</td><td align="right">'.$data['paid'].'</td></tr>';
}
echo '</table>
<br>';
closesidex();



 
http://www.fusiontube.co.uk/
afoster
That did it Craig...thank you. I am trying to add Players after the number but I can't seem to get a space between the number and players. It is showing up as 29players instead of 29 players.

BTW, you're up late aren't you?
 
Craig
Try &nbsp; thats for a non-breaking space. Smile

Yes I was up late, celebrating Britain's success in the games. Smile
 
http://www.fusiontube.co.uk/
afoster
Nope, I get the following error msg using &nbsp;

Parse error: syntax error, unexpected ';' in /hermes/bosweb/web099/b993/ipw.uname/public_html/sports/administration/panel_editor.php(153) : eval()'d code on line 3
 
Craig
Download source  Code
if (!defined("IN_FUSION")) { die("Access Denied"); }

$not_paid = dbcount("(id)", fusion_players12, "paid='0'");
   
opensidex("Not Yet Paid -&nbsp;".$not_paid);
$sql = dbquery("SELECT * FROM fusion_players12 Where paid=0 ORDER By name ASC");
echo '<br>
<table align="center" cellspacing="1" cellpadding="3" width="100%" class="tbl-border">
<tr class="tbl2"><td width="50%"><b><center>Name</b></td><td width="25%"><b><center>Owed</b></td><td width="25%"><b><center>Paid</b></td></tr>';
while($data = dbarray($sql))
{
   echo '<tr class="tbl1"><td>'.$data['name'].'</td><td align="right">'.$data['total'].'</td><td align="right">'.$data['paid'].'</td></tr>';
}
echo '</table>
<br>';
closesidex();




Download source  Code

opensidex("Not Yet Paid -&nbsp;".$not_paid);




Yes?
 
http://www.fusiontube.co.uk/
afoster
What I would like to display is this:

Not Yet Paid - $not_paid players

Since I have not been able to do that without a space, I currently have the following:

Players Not Paid - $not_paid
 
Craig
Download source  Code
opensidex("Not Yet Paid -&nbsp;".$not_paid);




Do you mean here?
 
http://www.fusiontube.co.uk/
afoster
This is what I would like:

Download source  Code
opensidex("Not Yet Paid - ".$not_paid&nbsp;Players);




But that code throws an error msg.
 
Craig
Of course, sorry... Here....
Download source  Code

opensidex("Not Yet Paid - ".$not_paid."&nbsp;Players");



 
http://www.fusiontube.co.uk/
afoster
That works Craig, thanks for your help.
 
Craig
Your welcome.
 
http://www.fusiontube.co.uk/
Jump to Forum:
Similar Threads
Thread Forum Replies Last Post
Forum Threads List Panel Panels and Infusions 9 14-06-2013 06:01
Sliding Login Panel 1.00 Official releases [Infusions] 11 10-06-2013 10:52
Notification panel when forum reply Ideas for Modifications and Requests 9 10-06-2013 06:41
MI Floating Sidebar Panel Official releases [Infusions] 6 09-06-2013 14:37
v7.0.7 index.php - missing panel Roadmap 3 07-06-2013 02:58
Official Home of PHP-Fusion uses cookies. Some may already have been set. Read more about our Cookies here.
Please click the button I Consent Cookies to hide this bar and accept our cookies. If you continue to use the site with no action taken, we'll assume that you consent our cookies anyway.
Cookiebar Panel byVenue