Auction Summary Reports

A place to discuss and receive support for the Web Auction application.

Auction Summary Reports

Postby zedimus » Thu Nov 06, 2008 3:41 pm

When you go to View Reports it shows all the auctions. It looks like its sorting the auction by Categories is there a way to sort it by product id, I found were to sort the front page in the ApplicationDelegate.php but i cant find where to edit this.

Thanks
David
zedimus
 
Posts: 29
Joined: Tue Jan 15, 2008 2:37 pm

Postby shannah » Thu Nov 06, 2008 3:51 pm

It's in the actions/reports.php file.

It shouldn't be too difficult to change the SQL to sort the way you want.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby zedimus » Thu Nov 06, 2008 4:26 pm

Thanks Steve it should be easier now that i know where to look.
zedimus
 
Posts: 29
Joined: Tue Jan 15, 2008 2:37 pm

Postby zedimus » Wed Nov 12, 2008 10:06 am

I am trying to get the Email , First Name and Last Name to show up in the report summary

I have change this
Code: Select all
if ( @$row['winner']){
            $user = new Dataface_Record('users', array('username'=>$row['winner']));
            $row['email'] = $user->val('email');
            $row['full name'] = $user->val('fullname');
            unset($user);

to
Code: Select all
if ( @$row['winner']){
            $user = new Dataface_Record('users', array('username'=>$row['winner']));
            $row['email'] = $user->val('email');
            $row['first name'] = $user->val('firstname');
            $row['last name'] = $user->val('lastname');
            unset($user);

now it show first and last name at the top of the row. When i try to change how it could get the email, first, last name i get a SQL error, Is it possible to get this information?
zedimus
 
Posts: 29
Joined: Tue Jan 15, 2008 2:37 pm

Postby shannah » Wed Nov 12, 2008 10:56 am

What is your SQL query that you are using?
What is the error message?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby zedimus » Wed Nov 12, 2008 11:07 am

i tryed adding w.email to
Code: Select all
$sql = "
         select p.product_id,p.product_name,w.winner,w.bid_amount,if(w.email_sent,'Yes','No') as email_sent,if(w.admin_email_sent,'Yes','No') as admin_email_sent,convert_tz(w.close_date,'SYSTEM','".df_utc_offset()."') as close_date
         from products p left join closed w on p.product_id=w.product_id";


it gives me this error at the top of the page and the report is empty

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/zedimus/public_html/actions/reports.php on line 13

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/zedimus/public_html/dataface/Dataface/RecordGrid.php on line 99

Warning: Invalid argument supplied for foreach() in /home/zedimus/public_html/dataface/Dataface/RecordGrid.php on line 159

That just breaks my report. Do i need to add some code to dataface/Dataface/RecordGrid.php ?

and tryed changing
Code: Select all
$row['email'] = $user->val('email');

to
Code: Select all
if ( @$row['email']){
            $user = new Dataface_Record('users', array('email'=>$row['email']));


and that gives me white page with this error
Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/zedimus/public_html/actions/reports.php on line 34
[/code]

Edit:
Do i need to add new fields in the db ?
zedimus
 
Posts: 29
Joined: Tue Jan 15, 2008 2:37 pm

Postby zedimus » Thu Nov 13, 2008 10:48 am

If i add fullname field under the closed table in the database and in action/reports.php i add w.fullname
Code: Select all
$sql = "
         select p.product_id,p.product_name,w.winner,w.bid_amount,if(w.email_sent,'Yes','No') as email_sent,if(w.admin_email_sent,'Yes','No') as admin_email_sent,convert_tz(w.close_date,'SYSTEM','".df_utc_offset()."') as close_date
         from products p left join closed w on p.product_id=w.product_id";
   

to

Code: Select all
$sql = "
         select p.product_id,p.product_name,w.winner,w.bid_amount,w.fullname,if(w.email_sent,'Yes','No') as email_sent,if(w.admin_email_sent,'Yes','No') as admin_email_sent,convert_tz(w.close_date,'SYSTEM','".df_utc_offset()."') as close_date
         from products p left join closed w on p.product_id=w.product_id";
   


it loads a new row in the reports and i dont get a sql error, I cant seem to figure out where i tell it add the full name of the winner to the row.
zedimus
 
Posts: 29
Joined: Tue Jan 15, 2008 2:37 pm

Postby mausman » Sat May 23, 2009 9:53 am

I had the same issue as you had and found a solution.

In actions/reports.php change the following;

Change the SQL statement;
Code: Select all
$sql = "
         select p.product_id,p.product_name,w.winner,w.bid_amount,if(w.email_sent,'Yes','No') as email_sent,if(w.admin_email_sent,'Yes','No') as admin_email_sent,convert_tz(w.close_date,'SYSTEM','".df_utc_offset()."') as close_date 
         from products p left join closed w on p.product_id=w.product_id";

to
Code: Select all
$sql = "
         select p.product_id,p.product_name,w.winner,w.bid_amount,if(w.email_sent,'Yes','No') as email_sent,if(w.admin_email_sent,'Yes','No') as admin_email_sent,convert_tz(w.close_date,'SYSTEM','".df_utc_offset()."') as close_date, u.firstname, u.lastname, u.email   
         from products p left join closed w on p.product_id=w.product_id left join users u on w.winner=u.username";

and also remove the following two lines;
Code: Select all
$row['email'] = $user->val('email');
$row['full name'] = $user->val('fullname');


After that you will have a report with Firstname, Lastname and Email address.
mausman
 
Posts: 6
Joined: Sun May 03, 2009 1:37 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 28 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved