/** * Shows template view * * @return void */ public function show_template_view($error = NULL) { $postfields = array('clientid' => 1); $response = onapp_send_whmcs_api_request(ONAPP_WHMCS_LOGIN, ONAPP_WHMCS_PASSWORD, ONAPP_WHMCS_API_FILE_URL, 'getclientsdetails', $postfields); print '<pre>'; print_r($response); die; onapp_show_template('test_view', array('title' => onapp_string('TEST_'), 'info_title' => onapp_string('TEST_'), 'info_body' => onapp_string('TEST_INFO'), 'error' => onapp_string($error))); }
/** * Checks whether user is whmcs client * * @return integer client_id whether whmcs client and boolean false if not */ private function is_whmcs_client() { $response = onapp_send_whmcs_api_request(ONAPP_WHMCS_LOGIN, ONAPP_WHMCS_PASSWORD, ONAPP_WHMCS_API_FILE_URL, 'getclients', $postfields); $whmcs_clients = $response['clients']['client']; foreach ($whmcs_clients as $client) { onapp_debug($client['firstname'], ' ==> ', $_SESSION['profile_obj']->_first_name, '<br />'); onapp_debug($client['lastname'], ' ==> ', $_SESSION['profile_obj']->_last_name, '<br />'); onapp_debug($client['email'], ' ==> ', $_SESSION['profile_obj']->_email, '<br />', '<br />'); if ($client['firstname'] == $_SESSION['profile_obj']->_first_name && $client['lastname'] == $_SESSION['profile_obj']->_last_name && $client['email'] == $_SESSION['profile_obj']->_email) { return $client['id']; } } return false; }