Hey Scottro,
I just donated for your friend Tony! I hope he gets better!
I implemented your Reports mod and it works great! My problem is making new, custom reports for my needs.
For example what I need done (and i cannot get this working for the life of me) is I used teryakisan's "simple status" mod to show a custom status of a ticket.
Well I want to take that and want to create a custom report of my employees and the status of each report.
For example:
Report Sold By Staff - This will show a pie chart with my employees names and how many tickets are currently in sold status if the ticket was assigned to them
Report Unsold by Staff - Same thing but for unsold status tickets
and so on...
I guess once we get the first one working the other ones are going to be simple..
this is what I did:
Added to the drop down:
<option value="tixSoldbystaff" <?if($_POST=='tixSoldbystaff'){echo "selected";}?>>Tickets Sold By Staff</option>
I think this is where my problem comes in:
I added COUNT(DISTINCT(CASE WHEN ost_ticket.sold=0 THEN ost_ticket.ticket_id END)) as soldvalue
but that throws a SQL error
basically I am storing in the sold column of ost_ticket either a NULL, 0, 1, 2 and so up to 8 based on the ticket status.
I am having a hell of a time trying to call these DB queries since I never worked with them and I am a beginner in PHP as well.
Next I added the group by
elseif($_POST == 'tixSoldbystaff'){
$qgroup = "GROUP BY ost_staff.staff_id ORDER BY ost_staff.lastname ";
}
Next I added the code for the pie chart to use but doesn't seem to do anything either.
<? if($_POST == 'tixSoldbystaff'){
if($graphRow == NULL){
$graphRow = Tickets;
$graphRow = Unassigned;
}?>
['<?=$graphRow?> <?=$graphRow?>', <?=$graphRow,
<? } ?>
Continuing with table heading:
elseif($_POST == 'tixSoldbystaff'){
echo "<tr><th>Staff</th><th>Tickets Sold</th></tr>";
}
Table content: (also very buggy)
elseif($_POST == 'tixSoldbystaff'){
if($row == NULL){
$row = Tickets;
$row = Unassigned;
}
echo "<tr style='font-weight: bold;'><td>" . $row. " " .$row . "</td><td>" . $row ." </td></tr> ";
}
Finally the totals but this just shows the total tickets not the total SOLD tickets in status 0 in the sold column of the table ost_ticket
elseif($_POST == 'tixSoldbystaff'){?>
<tr style='font-weight: bold; background-color: #E0E0E0;'><td>Total</td><td><?=$Total;?></td></tr>
<? }
I hope this is enough info to figure out what I'm trying to do :
Thank you for ANY help!