Jump to content

reporting expansion


adzie

Recommended Posts

I have a script which gives me a report based on which member group I am in but I'd like it to report on all member groups.

 

I have tried changing the session ID to no avail

 

any suggestions?

 

session_start();

if($_SESSION['online'] == 1)

{

        if($_SESSION['oc'] == 1)

        {

                $sql = "select * from members where member_id=".$_SESSION[id];

                $query = mysql_query($sql);

                $row3 = mysql_fetch_row($query);

                $sql = "select * from membergroups where ID=".$row3['4'];

                $query = mysql_query($sql);

                $row = mysql_fetch_row($query);

                $query_hours = "SELECT sec_to_time(sum(time_to_sec(t2.duration))) AS duration_sum FROM members t1, member_reports t2 WHERE t1.country=".$row3[4]." AND t1.member_num=t2.pnum";

                $result_hours = mysql_query($query_hours);           

                  if (mysql_numrows($result_hours) > 0)

                {

                        $time = mysql_result($result_hours,0,"duration_sum");

                }

                $sql2="select * from members where country=\"".$row[0]."\"";

                $query2 = mysql_query($sql2);

                $members = mysql_numrows($query2);

                $avg = $time/$members;

                $avg = substr($avg,0, strpos($avg,".")+3);

                $sql2="select * from members where country=\"".$row[0]."\"";

                $query2 = mysql_query($sql2);

                $members = mysql_numrows($query2);

                $msg.= "<center><img src=images/avatars/".$row['3']."><br>

<br>

<br>

                <table border=4 align=center><tr><tr align=center><td><strong>Member Group</strong></td><td><strong>Members</strong></td><td><strong>Hours</strong></td><td><strong>Average Hours Per Member</strong></td></tr>

                <tr align=center><td>".$row['1']."</td><td>".$members."</td><td>".$time."</td><td>".$avg."</td></tr>

                </table>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.