<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[7465] sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports: WordCamp Reports: Add a report to see a breakdown of payment methods</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/7465">7465</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/7465","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>coreymckrill</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2018-07-13 23:20:51 +0000 (Fri, 13 Jul 2018)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WordCamp Reports: Add a report to see a breakdown of payment methods</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampreportsindexphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/index.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampreportsclassesreportclasswordcamppaymentmethodsphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-wordcamp-payment-methods.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampreportsviewshtmlwordcamppaymentmethodsphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/views/html/wordcamp-payment-methods.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampreportsviewsreportwordcamppaymentmethodsphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/views/report/wordcamp-payment-methods.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampreportsclassesreportclasswordcamppaymentmethodsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-wordcamp-payment-methods.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-wordcamp-payment-methods.php                                (rev 0)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-wordcamp-payment-methods.php  2018-07-13 23:20:51 UTC (rev 7465)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,324 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * WordCamp Payment Methods.
+ *
+ * @package WordCamp\Reports
+ */
+
+namespace WordCamp\Reports\Report;
+defined( 'WPINC' ) || die();
+
+use WordCamp\Reports;
+use WordCamp\Utilities;
+
+/**
+ * Class WordCamp_Payment_Methods
+ *
+ * @package WordCamp\Reports\Report
+ */
+class WordCamp_Payment_Methods extends Date_Range {
+       /**
+        * Report name.
+        *
+        * @var string
+        */
+       public static $name = 'WordCamp Payment Methods';
+
+       /**
+        * Report slug.
+        *
+        * @var string
+        */
+       public static $slug = 'wordcamp-payment-methods';
+
+       /**
+        * Report description.
+        *
+        * @var string
+        */
+       public static $description = 'WordCamp ticket sales broken out by payment method.';
+
+       /**
+        * Report methodology.
+        *
+        * @var string
+        */
+       public static $methodology = "
+               <ol>
+                       <li>Generate a transaction data set from the Ticket Revenue report, using the specified date range.</li>
+                       <li>Strip out refund transactions, since we're only interested in the initial purchase.</li>
+                       <li>Count the number of transactions for each payment method.</li>
+                       <li>Count the number of transactions for each payment method, for each WordCamp that had transactions during the specified date range.</li>
+               </ol>
+       ";
+
+       /**
+        * Report group.
+        *
+        * @var string
+        */
+       public static $group = 'misc';
+
+       /**
+        * WordCamp post ID.
+        *
+        * @var int The ID of the WordCamp post for this report.
+        */
+       public $wordcamp_id = 0;
+
+       /**
+        * WordCamp site ID.
+        *
+        * @var int The ID of the WordCamp site where the invoices are located.
+        */
+       public $wordcamp_site_id = 0;
+
+       /**
+        * Currency exchange rate client.
+        *
+        * @var Utilities\Currency_XRT_Client Utility to handle currency conversion.
+        */
+       protected $xrt = null;
+
+       /**
+        * Data fields that can be visible in a public context.
+        *
+        * @var array An associative array of key/default value pairs.
+        */
+       protected $public_data_fields = array(
+               'timestamp'        => '',
+               'blog_id'          => 0,
+               'object_id'        => 0,
+               'method'           => '',
+               'currency'         => '',
+               'full_price'       => 0,
+               'discounted_price' => 0,
+       );
+
+       /**
+        * Ticket_Payment_Methods constructor.
+        *
+        * @param string $start_date  The start of the date range for the report.
+        * @param string $end_date    The end of the date range for the report.
+        * @param int    $wordcamp_id Optional. The ID of a WordCamp post to limit this report to.
+        * @param array  $options     {
+        *     Optional. Additional report parameters.
+        *     See Base::__construct and Date_Range::__construct for additional parameters.
+        * }
+        */
+       public function __construct( $start_date, $end_date, $wordcamp_id = 0, array $options = array() ) {
+               parent::__construct( $start_date, $end_date, $options );
+
+               $this->xrt = new Utilities\Currency_XRT_Client();
+
+               if ( $wordcamp_id && $this->validate_wordcamp_id( $wordcamp_id ) ) {
+                       $this->wordcamp_id      = $wordcamp_id;
+                       $this->wordcamp_site_id = get_wordcamp_site_id( get_post( $wordcamp_id ) );
+               }
+       }
+
+       /**
+        * Generate a cache key.
+        *
+        * @return string
+        */
+       protected function get_cache_key() {
+               $cache_key = parent::get_cache_key();
+
+               if ( $this->wordcamp_id ) {
+                       $cache_key .= '_' . $this->wordcamp_id;
+               }
+
+               return $cache_key;
+       }
+
+       /**
+        * Query and parse the data for the report.
+        *
+        * @return array
+        */
+       public function get_data() {
+               // Bail if there are errors.
+               if ( ! empty( $this->error->get_error_messages() ) ) {
+                       return array();
+               }
+
+               // Maybe use cached data.
+               $data = $this->maybe_get_cached_data();
+               if ( is_array( $data ) ) {
+                       return $data;
+               }
+
+               $transactions = $this->get_ticket_transactions();
+
+               // We're not interested in refunds, only the original purchases.
+               $purchases = array_filter( $transactions, function( $transaction ) {
+                       if ( 'Purchase' === $transaction['type'] ) {
+                               return true;
+                       }
+
+                       return false;
+               } );
+
+               // Thus we don't need the `type` property. We need every method field to have a value, though.
+               $data = array_map( function( $purchase ) {
+                       unset( $purchase['type'] );
+
+                       if ( ! $purchase['method'] ) {
+                               $purchase['method'] = 'none';
+                       }
+
+                       return $purchase;
+               }, $purchases );
+
+               $data = $this->filter_data_fields( $data );
+               $this->maybe_cache_data( $data );
+
+               return $data;
+       }
+
+       /**
+        * Compile the report data into results.
+        *
+        * @param array $data The data to compile.
+        *
+        * @return array
+        */
+       public function compile_report_data( array $data ) {
+               $totals = array_reduce( $data, function( $carry, $item ) {
+                       $method = $item['method'];
+
+                       if ( ! isset( $carry['Total'] ) ) {
+                               $carry['Total'] = 0;
+                       }
+
+                       if ( ! isset( $carry[ $method ] ) ) {
+                               $carry[ $method ] = 0;
+                       }
+
+                       $carry[ $method ] ++;
+                       $carry['Total'] ++;
+
+                       return $carry;
+               } );
+
+               uksort( $totals, function( $a, $b ) {
+                       if ( 'Total' === $a ) {
+                               return 1;
+                       }
+
+                       if ( 'Total' === $b ) {
+                               return -1;
+                       }
+
+                       return ( $a < $b ) ? -1 : 1;
+               } );
+
+               $by_site = array_reduce( $data, function( $carry, $item ) use ( $totals ) {
+                       $blog_id = $item['blog_id'];
+                       $method  = $item['method'];
+
+                       if ( ! isset( $carry[ $blog_id ] ) ) {
+                               $carry[ $blog_id ] = array_merge( array_fill_keys( array_keys( $totals ), 0 ), array(
+                                       'name' => get_wordcamp_name( $blog_id ),
+                               ) );
+                       }
+
+                       $carry[ $blog_id ][ $method ] ++;
+                       $carry[ $blog_id ]['Total'] ++;
+
+                       return $carry;
+               } );
+
+               usort( $by_site, function( $a, $b ) {
+                       if ( $a['Total'] === $b['Total'] ) {
+                               return 0;
+                       }
+
+                       return ( $a['Total'] < $b['Total'] ) ? 1 : -1;
+               } );
+
+               return array(
+                       'method_totals'   => $totals,
+                       'methods_by_site' => $by_site,
+               );
+       }
+
+       /**
+        * Get a list of ticket transaction events from the given date range.
+        *
+        * Uses the Ticket Revenue report to get the relevant transaction event data.
+        *
+        * @return array
+        */
+       protected function get_ticket_transactions() {
+               $ticket_revenue_report = new Ticket_Revenue(
+                       $this->start_date->format( 'Y-m-d' ),
+                       $this->end_date->format( 'Y-m-d' ),
+                       $this->wordcamp_id,
+                       $this->options
+               );
+
+               return $ticket_revenue_report->get_data();
+       }
+
+       /**
+        * Render an HTML version of the report output.
+        *
+        * @return void
+        */
+       public function render_html() {
+               $data = $this->compile_report_data( $this->get_data() );
+
+               $start_date    = $this->start_date;
+               $end_date      = $this->end_date;
+               $wordcamp_name = ( $this->wordcamp_site_id ) ? get_wordcamp_name( $this->wordcamp_site_id ) : '';
+               $method_totals = $data['method_totals'];
+               $site_totals   = $data['methods_by_site'];
+
+               if ( ! empty( $this->error->get_error_messages() ) ) {
+                       $this->render_error_html();
+               } else {
+                       include Reports\get_views_dir_path() . 'html/wordcamp-payment-methods.php';
+               }
+       }
+
+       /**
+        * Render the page for this report in the WP Admin.
+        *
+        * @return void
+        */
+       public static function render_admin_page() {
+               $start_date  = filter_input( INPUT_POST, 'start-date' );
+               $end_date    = filter_input( INPUT_POST, 'end-date' );
+               $wordcamp_id = filter_input( INPUT_POST, 'wordcamp-id' );
+               $refresh     = filter_input( INPUT_POST, 'refresh', FILTER_VALIDATE_BOOLEAN );
+               $action      = filter_input( INPUT_POST, 'action' );
+               $nonce       = filter_input( INPUT_POST, self::$slug . '-nonce' );
+
+               $report = null;
+
+               if ( 'Show results' === $action
+                    && wp_verify_nonce( $nonce, 'run-report' )
+                    && current_user_can( 'manage_network' )
+               ) {
+                       $options = array(
+                               'earliest_start' => new \DateTime( '2015-01-01' ), // No indexed CampTix events before 2015.
+                               'max_interval'   => new \DateInterval( 'P1Y' ), // 1 year. See http://php.net/manual/en/dateinterval.construct.php.
+                       );
+
+                       if ( $refresh ) {
+                               $options['flush_cache'] = true;
+                       }
+
+                       $report = new self( $start_date, $end_date, $wordcamp_id, $options );
+
+                       // The report adjusts the end date in some circumstances.
+                       if ( empty( $report->error->get_error_messages() ) ) {
+                               $end_date = $report->end_date->format( 'Y-m-d' );
+                       }
+               }
+
+               include Reports\get_views_dir_path() . 'report/wordcamp-payment-methods.php';
+       }
+}
</ins></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampreportsindexphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/index.php        2018-07-13 22:31:42 UTC (rev 7464)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/index.php  2018-07-13 23:20:51 UTC (rev 7465)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,6 +111,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                __NAMESPACE__ . '\Report\Sponsorship_Grants',
</span><span class="cx" style="display: block; padding: 0 10px">                __NAMESPACE__ . '\Report\WordCamp_Status',
</span><span class="cx" style="display: block; padding: 0 10px">                __NAMESPACE__ . '\Report\Meetup_Groups',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                __NAMESPACE__ . '\Report\WordCamp_Payment_Methods',
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampreportsviewshtmlwordcamppaymentmethodsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/views/html/wordcamp-payment-methods.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/views/html/wordcamp-payment-methods.php                          (rev 0)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/views/html/wordcamp-payment-methods.php    2018-07-13 23:20:51 UTC (rev 7465)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,94 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * @package WordCamp\Reports
+ */
+
+namespace WordCamp\Reports\Views\HTML\WordCamp_Payment_Methods;
+defined( 'WPINC' ) || die();
+
+/** @var \DateTime $start_date */
+/** @var \DateTime $end_date */
+/** @var string    $wordcamp_name */
+/** @var array     $method_totals */
+/** @var array     $site_totals */
+
+?>
+
+<?php if ( $method_totals['Total'] > 0 ) : ?>
+       <h3>
+               Payment methods used
+               <?php if ( $wordcamp_name ) : ?>
+                       by <?php echo esc_html( $wordcamp_name ); ?>
+               <?php endif; ?>
+               <?php if ( $start_date->format( 'Y-m-d' ) === $end_date->format( 'Y-m-d' ) ) : ?>
+                       on <?php echo esc_html( $start_date->format( 'M jS, Y' ) ); ?>
+               <?php else : ?>
+                       between <?php echo esc_html( $start_date->format( 'M jS, Y' ) ); ?> and <?php echo esc_html( $end_date->format( 'M jS, Y' ) ); ?>
+               <?php endif; ?>
+       </h3>
+
+       <table class="striped widefat but-not-too-wide">
+               <thead>
+               <tr>
+                       <td>Payment method</td>
+                       <td># of tickets purchased</td>
+               </tr>
+               </thead>
+               <tbody>
+               <?php foreach ( $method_totals as $method_id => $method_total ) : if ( 'Total' === $method_id ) continue; ?>
+                       <tr>
+                               <td><?php echo esc_html( $method_id ); ?></td>
+                               <td class="number"><?php echo number_format_i18n( $method_total ); ?></td>
+                       </tr>
+               <?php endforeach; ?>
+               <tr>
+                       <td>Total: </td>
+                       <td class="number total"><?php echo number_format_i18n( $method_totals['Total'] ); ?></td>
+               </tr>
+               </tbody>
+       </table>
+
+       <?php if ( ! $wordcamp_name ) : ?>
+               <h3>
+                       Payment methods by WordCamp
+                       <?php if ( $start_date->format( 'Y-m-d' ) === $end_date->format( 'Y-m-d' ) ) : ?>
+                               on <?php echo esc_html( $start_date->format( 'M jS, Y' ) ); ?>
+                       <?php else : ?>
+                               between <?php echo esc_html( $start_date->format( 'M jS, Y' ) ); ?> and <?php echo esc_html( $end_date->format( 'M jS, Y' ) ); ?>
+                       <?php endif; ?>
+               </h3>
+
+               <table class="striped widefat but-not-too-wide">
+                       <thead>
+                       <tr>
+                               <td>WordCamp Name</td>
+                               <?php foreach ( array_keys( $method_totals ) as $method_id ) : ?>
+                                       <td><?php echo esc_html( $method_id ); ?></td>
+                               <?php endforeach; ?>
+                       </tr>
+                       </thead>
+                       <tbody>
+                       <?php foreach ( $site_totals as $blog_id => $totals ) : ?>
+                               <tr>
+                                       <td><?php echo esc_html( $totals['name'] ); ?></td>
+                                       <?php foreach ( $totals as $method_id => $total ) : if ( 'name' === $method_id ) continue; ?>
+                                               <td class="number<?php if ( 'Total' === $method_id ) echo ' total' ?>"><?php echo number_format_i18n( $total ); ?></td>
+                                       <?php endforeach; ?>
+                               </tr>
+                       <?php endforeach; ?>
+                       </tbody>
+               </table>
+       <?php endif; ?>
+<?php else : ?>
+       <p>
+               No data
+               <?php if ( $wordcamp_name ) : ?>
+                       for <?php echo esc_html( $wordcamp_name ); ?>
+               <?php endif; ?>
+               <?php if ( $start_date->format( 'Y-m-d' ) === $end_date->format( 'Y-m-d' ) ) : ?>
+                       on <?php echo esc_html( $start_date->format( 'M jS, Y' ) ); ?>
+               <?php else : ?>
+                       between <?php echo esc_html( $start_date->format( 'M jS, Y' ) ); ?> and <?php echo esc_html( $end_date->format( 'M jS, Y' ) ); ?>
+               <?php endif; ?>
+       </p>
+<?php endif; ?>
</ins></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampreportsviewsreportwordcamppaymentmethodsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/views/report/wordcamp-payment-methods.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/views/report/wordcamp-payment-methods.php                                (rev 0)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-reports/views/report/wordcamp-payment-methods.php  2018-07-13 23:20:51 UTC (rev 7465)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,64 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * @package WordCamp\Reports
+ */
+
+namespace WordCamp\Reports\Views\Report\WordCamp_Payment_Methods;
+defined( 'WPINC' ) || die();
+
+use WordCamp\Reports;
+use WordCamp\Reports\Report;
+
+/** @var string $start_date */
+/** @var string $end_date */
+/** @var int $wordcamp_id */
+/** @var Report\WordCamp_Payment_Methods|null $report */
+?>
+
+<div class="wrap">
+       <h1>
+               <a href="<?php echo esc_attr( Reports\get_page_url() ); ?>">WordCamp Reports</a>
+               &raquo;
+               <?php echo esc_html( Report\WordCamp_Payment_Methods::$name ); ?>
+       </h1>
+
+       <?php echo wpautop( wp_kses_post( Report\WordCamp_Payment_Methods::$description ) ); ?>
+
+       <h4>Methodology</h4>
+
+       <?php echo wpautop( wp_kses_post( Report\WordCamp_Payment_Methods::$methodology ) ); ?>
+
+       <form method="post" action="">
+               <?php wp_nonce_field( 'run-report', Report\WordCamp_Payment_Methods::$slug . '-nonce' ); ?>
+
+               <table class="form-table">
+                       <tbody>
+                       <tr>
+                               <th scope="row"><label for="start-date">Start Date</label></th>
+                               <td><input type="date" id="start-date" name="start-date" value="<?php echo esc_attr( $start_date ) ?>" /></td>
+                       </tr>
+                       <tr>
+                               <th scope="row"><label for="end-date">End Date</label></th>
+                               <td><input type="date" id="end-date" name="end-date" value="<?php echo esc_attr( $end_date ) ?>" /></td>
+                       </tr>
+                       <tr>
+                               <th scope="row"><label for="wordcamp-id">WordCamp (optional)</label></th>
+                               <td><?php echo get_wordcamp_dropdown( 'wordcamp-id', array(), $wordcamp_id ); ?></td>
+                       </tr>
+                       <tr>
+                               <th scope="row"><label for="refresh">Refresh results</label></th>
+                               <td><input type="checkbox" id="refresh" name="refresh" /></td>
+                       </tr>
+                       </tbody>
+               </table>
+
+               <?php submit_button( 'Show results', 'primary', 'action', false ); ?>
+               <?php //submit_button( 'Export CSV', 'secondary', 'action', false ); ?>
+       </form>
+
+       <?php if ( $report instanceof Report\WordCamp_Payment_Methods ) : ?>
+               <div class="report-results">
+                       <?php $report->render_html(); ?>
+               </div>
+       <?php endif; ?>
+</div>
</ins></span></pre>
</div>
</div>

</body>
</html>