public function listpaymentsAction() { if ($this->isLoggedIn() == 0) { $this->_redirect('/admin/index'); } $this->view->loginStatus = $this->isLoggedIn(); $fitnessPyaments = new FitnessWebsitePaymentDetails(); $fitnessAppPayments = new FitnessAppPaymentDetails(); $fitnessWorkouts = new FitnessWorkouts(); $fitnessUser = new FitnessUserGeneral(); $paymentRecord = array(); $apppaymentRecord = array(); $payments = $fitnessPyaments->getAllPayments(); $apppayments = $fitnessAppPayments->getAllPayments(); $i = 0; foreach ($payments as $payment) { $userDetails = $fitnessUser->getUser($payment['user_id']); $paymentRecord[$i]['user'] = $userDetails['user_first_name'] . " " . $userDetails['user_surname']; if ($payment['payment_method'] == 1) { $paymentRecord[$i]['payment_method'] = "Paypal"; } else { $paymentRecord[$i]['payment_method'] = "Google"; } $paymentRecord[$i]['status'] = $payment['payment_status']; $paymentRecord[$i]['type'] = $payment['payment_type_workouts']; $paymentRecord[$i]['amount'] = $payment['payment_amount']; $paymentRecord[$i]['trxn'] = $payment['payment_transaction_id']; $paymentRecord[$i]['date'] = $payment['payment_date']; $i = $i + 1; } $i = 0; foreach ($apppayments as $apppayment) { $userDetails = $fitnessUser->getUser($apppayment['user_id']); $apppaymentRecord[$i]['user'] = $userDetails['user_first_name'] . " " . $userDetails['user_surname']; if ($apppayment['payment_method'] == 1) { $apppaymentRecord[$i]['payment_method'] = "Paypal"; } $apppaymentRecord[$i]['status'] = $apppayment['payment_status']; $apppaymentRecord[$i]['amount'] = $apppayment['amount']; $apppaymentRecord[$i]['trxn'] = $apppayment['transaction_id']; $apppaymentRecord[$i]['date'] = $apppayment['payment_date']; $i = $i + 1; } //get iphone purchases data $iphonePurchase = $fitnessUser->getIphonePremiumUsers(); $androidPurchase = $fitnessUser->getAndroidPremiumUsers(); $iphoneCount = count($iphonePurchase); $this->view->payments = $paymentRecord; $this->view->apppayments = $apppaymentRecord; $this->view->iphonePurchase = $iphonePurchase; $this->view->androidPurchase = $androidPurchase; }
/** * function that displays the page after payment * @author lekha * @date 3/26/2012 * */ public function confirmpaymentAction() { $this->view->loginStatus = $this->isLoggedIn(); //if($this->view->loginStatus == 1) //$this->view->memberStatus = $this->checkUserMembership(); $fitnessUser = new FitnessUserGeneral(); $fitnessPayment = new FitnessWebsitePaymentDetails(); $sess = new Zend_Session_Namespace('UserSession'); $userDetails = $fitnessUser->getUserbyUsername($sess->username); //check payment status of user $checkRecord = $fitnessPayment->checkPaymentStatus($userDetails['user_id'], date('Y-m-d')); $this->view->paymentStatus = $checkRecord['payment_status']; }