Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(count($alerts) > 0) {
- $this->view->alerts = $alerts;
- return $this->view->render('alert-box.phtml');
- }
- return false;
- }
- /**
- * Count orders waiting for verification
- * @return int
- */
- protected function _unverifiedCount()
- {
- $list = Report_Model_OrderList::build();
- $list
- ->whereStatusIn(array(Order::STATUS_PENDING_APPROVAL))
- ->isUnverified();
- switch( $this->_user->Role->slug ) {
- case FirstAmerican_Roles::AFFILIATE_SUPPORT: $list->isExternal(); break;
- case FirstAmerican_Roles::AFFILIATE_MANAGER: $list->forCompany( $this->_user->company_id );
- case FirstAmerican_Roles::CUSTOMER_SUPPORT: $list->isInternal();
- }
- return $list->getQuery()->count();
- }
- /**
- * Count orders waiting for doctor assignment
- * @return int
- */
- protected function _pendingCount()
- {
- $pending = Doctrine_Query::create()
- ->select('ord.id, da.id')
- ->from('Order ord INDEXBY ord.id, ord.PlacedBy usr')
- ->where('ord.verified = ?',1)
- ->addWhere('ord.current_status_id = ?',OrderStatusList::PENDING_APPROVAL)
- ->addWhere('ord.id NOT IN (SELECT da2.order_id FROM DoctorApproval da2 WHERE da2.status IN ("pending", "approved"))');
- if( $this->_user->Role->slug == FirstAmerican_Roles::AFFILIATE_SUPPORT )
- $pending->addWhere('usr.Company.internal = ?', 0);
- if( in_array( $this->_user->Role->slug, array(
- FirstAmerican_Roles::CUSTOMER_SUPPORT,
- FirstAmerican_Roles::AFFILIATE_MANAGER
- ) ) )
- $pending->addWhere('usr.company_id = ?', $this->_user->company_id);
- return $pending->count();
- }
- /**
- * Count companies waiting for verification
- * @return int
- */
- protected function _companiesCount()
- {
- $companies = Doctrine_Query::create()
- ->select('c.id, em.id')
- ->from('Company c, c.Email em')
- ->where('c.verified = ?',0)
- ->addWhere('em.verified = ?', 1);
- return $companies->count();
- }
- /**
- * Count orders waiting for doctor approval
- * @return int
- */
- protected function _approvalCount()
- {
- $approvals = Doctrine_Query::create()
- ->select('da.id')
- ->from('DoctorApproval da')
- ->where('da.user_id = ?',$this->_user->id)
- ->addWhere('da.status = ?','pending');
- return $approvals->count();
- }
- //QUERY CHAD GAVE ME
- //SELECT COUNT(app_order_system.ord.order_id) as total
- // FROM app_order_system.app_order ord
- // LEFT JOIN app_order_system.app_order_shipping ship ON ship.order_id = ord.id
- // LEFT JOIN app_order_system.app_shipping_status_list shipsta ON shipsta.id = ship.current_status_id
- // where ship.current_status_id = 2 and ship.type = 'package' and ship.shipped_by = 'usps'
- // group by ship.current_status_id order by ord.order_id;
- protected function _intransitCount()
- {
- return $intransit->count();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement