WithdrawalsList::column_requested_user( $item )


Source

File: classes/WithdrawalsList.php

	function column_requested_user( $item ) {
		echo "<p>{$item->user_name}</p><p>{$item->user_email}</p>";

		$actions = array();
		switch ( $item->status ) {
			case 'pending':
				$actions['completed'] = sprintf( '<a href="?page=%s&action=%s&withdraw_id=%s"> %s </a>',
					$_REQUEST['page'], 'completed', $item->withdraw_id, __( 'Complete', 'dozent' ) );
				$actions['rejected']  = sprintf( '<a href="?page=%s&action=%s&withdraw_id=%s"> %s </a>',
					$_REQUEST['page'], 'rejected', $item->withdraw_id, __( 'Reject', 'dozent' ) );
				break;
			case 'completed':
				$actions['rejected'] = sprintf( '<a href="?page=%s&action=%s&withdraw_id=%s"> %s </a>',
					$_REQUEST['page'], 'rejected', $item->withdraw_id, __( 'Reject', 'dozent' ) );
				break;
			case 'rejected':
				$actions['completed'] = sprintf( '<a href="?page=%s&action=%s&withdraw_id=%s"> %s </a>',
					$_REQUEST['page'], 'completed', $item->withdraw_id, __( 'Complete', 'dozent' ) );
				break;
		}

		$actions['delete']
			= sprintf( '<a href="?page=%s&action=%s&withdraw_id=%s" onclick="return confirm(\'Are you Sure? It can not be undone\')">Delete</a>',
			$_REQUEST['page'], 'delete',
			$item->withdraw_id );

		return "<div class='withdraw-list-row-actions'>" . $this->row_actions( $actions ) . "</div>";
	}