4
4
var $name = 'Reports';
6
var $uses = array('Bidder','Item');
6
var $uses = array('Bidder','Item');
8
8
function index($event_id = null) {
10
$event = $this->Bidder->Event->find('first',array('conditions' => array('Event.id' => (($event_id) ? $event_id : $this->Session->read('event_id')))));
11
$this->set(compact('event'));
10
$event = $this->Bidder->Event->find('first',array('conditions' => array('Event.id' => (($event_id) ? $event_id : $this->Session->read('event_id')))));
11
$this->set(compact('event'));
17
17
if (!empty($this->data)) {
19
$conditions = array ('OR' => array (
20
'Bidder.first_name LIKE' => '%' . $this->data['Report']['search_phrase'] . '%',
21
'Bidder.last_name LIKE' => '%' . $this->data['Report']['search_phrase'] . '%'
24
$event = $this->Bidder->Event->find('first',array('conditions' => array('Event.id' => $this->Session->read('event_id'))));
25
$this->Bidder->recursive = 0;
26
$this->paginate = array('conditions' => $conditions,
27
'order' => array('Bidder.last_name' => 'asc'));
28
$bidders = $this->paginate('Bidder');
29
$this->set(compact('bidders','event'));
19
$conditions = array ('OR' => array (
20
'Bidder.first_name LIKE' => '%' . $this->data['Report']['search_phrase'] . '%',
21
'Bidder.last_name LIKE' => '%' . $this->data['Report']['search_phrase'] . '%'
24
$event = $this->Bidder->Event->find('first',array('conditions' => array('Event.id' => $this->Session->read('event_id'))));
25
$this->Bidder->recursive = 0;
26
$this->paginate = array('conditions' => $conditions,'order' => array('Bidder.last_name' => 'asc'));
27
$bidders = $this->paginate('Bidder');
28
$this->set(compact('bidders','event'));
35
function revenue_by_event($id=null) {
34
function revenue_by_event($id=null) {
39
$this->Item->order = array('ItemType.description ASC, Item.title ASC');
40
$items = $this->Item->findAllByEventId($id);
42
$event['Event'] = $items[0]['Event'];
43
$this->set(compact('items','event'));
44
$this->render('revenue_by_event','minimal');
47
$this->Session->setFlash(__('Not Items in this Event', true));
48
$this->redirect(array('action' => 'index'));
53
$this->Session->setFlash(__('Invalid Event ID', true));
54
$this->redirect(array('action' => 'index'));
37
$this->Item->order = array('ItemType.description ASC, Item.title ASC');
38
$items = $this->Item->findAllByEventId($id);
40
$event['Event'] = $items[0]['Event'];
41
$this->set(compact('items','event'));
42
$this->render('revenue_by_event','minimal');
45
$this->Session->setFlash(__('No Items in this Event', true));
46
$this->redirect(array('action' => 'index'));
51
$this->Session->setFlash(__('Invalid Event ID', true));
52
$this->redirect(array('action' => 'index'));
58
56
function items_by_bid_winner($id=null) {
62
$this->Bidder->recursive = 0;
63
$this->Bidder->order = array('Bidder.last_name ASC, Bidder.first_name ASC');
64
$bidders = $this->Bidder->findAllByEventId($id);
66
foreach ($bidders as $bidder) {
67
$bids = $this->Bidder->Bid->findAllByBidderId($bidder['Bidder']['id']);
68
$bidders[$x]['Bid'] = $bids;
71
//pr($bidders);exit();
73
$event['Event'] = $bidders[0]['Event'];
74
$this->set(compact('bidders','event'));
75
$this->render('items_by_bid_winner','minimal');
78
$this->Session->setFlash(__('Not Bidders in this Event', true));
79
$this->redirect(array('action' => 'index'));
84
$this->Session->setFlash(__('Invalid Event ID', true));
85
$this->redirect(array('action' => 'index'));
60
$this->Bidder->recursive = 0;
61
$this->Bidder->order = array('Bidder.last_name ASC, Bidder.first_name ASC');
62
$bidders = $this->Bidder->findAllByEventId($id);
64
foreach ($bidders as $bidder) {
65
$bids = $this->Bidder->Bid->findAllByBidderId($bidder['Bidder']['id']);
66
$bidders[$x]['Bid'] = $bids;
69
//pr($bidders);exit();
71
$event['Event'] = $bidders[0]['Event'];
72
$this->set(compact('bidders','event'));
73
$this->render('items_by_bid_winner','minimal');
76
$this->Session->setFlash(__('No Bidders in this Event', true));
77
$this->redirect(array('action' => 'index'));
82
$this->Session->setFlash(__('Invalid Event ID', true));
83
$this->redirect(array('action' => 'index'));
89
87
function print_booklet($id=null) {
91
$items = $this->Item->find('all',array('conditions' => array('Item.event_id' => $id),
92
'order' => array('ItemType.description' => 'DESC','Item.id' => 'ASC','Item.title' => 'ASC')));
93
$this->set(compact('items'));
94
$this->render('print_booklet','booklet');
97
$this->Session->setFlash(__('Invalid Event ID', true));
98
$this->redirect(array('action' => 'index'));
89
$items = $this->Item->find('all',array('conditions' => array('Item.event_id' => $id),
90
'order' => array('ItemType.description' => 'DESC','Item.id' => 'ASC','Item.title' => 'ASC')));
91
$this->set(compact('items'));
92
$this->render('print_booklet','booklet');
95
$this->Session->setFlash(__('Invalid Event ID', true));
96
$this->redirect(array('action' => 'index'));
b'\\ No newline at end of file'