Nats tour report (NATS3)

From TMMwiki
(Redirected from Tour report (NATS3))
Jump to: navigation, search
NATS 3
  Template Functions
nats_apache_note
nats_convert_bytes
nats_decode
nats_encode
nats_fhg
nats_helper_row_fill
nats_get_gateway_token
nats_list_campaigns
nats_list_programs
nats_list_sites
nats_my_decode_entities
nats_my_encode_entities
nats_smarty_function_ajax_box
nats_smarty_function_amount_owed
nats_smarty_function_gateway_xsell
nats_smarty_function_getbonus
nats_smarty_function_get_paid_date
nats_smarty_rebuild_link
nats_smarty_rebuild_query
nats_smarty_function_reseller_ajax_box
nats_tooltip
nats_tour_report
nats_wmref_list
Template Shortcuts
ajax_box
amount_owed
apache_note
convert_bytes
fhg
gateway_xsell
get_loginid_from_campaignid
get_gateway_token
get_paid_date
list_campaigns
list_programs
list_sites
new_gateway_xsell
rebuild_link
rebuild_query
reseller_ajax_box
reward_points
tooltip
tour_report
wmref_list
Common Parameters
assign
assign_prefix
count
data_only
display_on_assign
start
tpl

nats_tour_report

Get tour statistics.

Alias: tour_report

Parameters

(Required parameters in bold)

Parameter Description Possible Values Default Value Example
siteid The site number Any valid site number. The default site ID number siteid="123"
tourid The tour number Any valid site number No tour number tourid="123"
period Display stats for this period Any valid period number None. period="1"
period_start Start of the period Any date Beginning of current period period_start="26 August 2008"
period_end End of the period Any date End of current period period_end="10 September 2008"

Output

Puts tour statistics in the {$tour_data} Smarty variable.

Example

You may need to modify this to produce the exact results you are looking for. Make this your members_tour_report template. Reference the page at yoursite.com/internal.php?page=tour_report

<table width="100%" border=0 cellpadding=5 cellspacing=0>
<form action="internal.php" method="get">
<input type="hidden" name="page" value="tour_report">
<tr valign="top" bgcolor="#4776A4">
<td ><font size=2 face="verdana,arial" color="#FFFFFF"><B>
  <b>Date Range:</b> <select name="period" onchange="period_start.value='';period_end.value='';"><option label="This Period" value="0" {if $smarty.request.period==0}selected{/if}>This Period</option>
<option label="Last Period" value="1" {if $smarty.request.period==1}selected{/if}>Last Period</option>
<option label="This Week" value="2" {if $smarty.request.period==2}selected{/if}>This Week</option>
<option label="This Month" value="3" {if $smarty.request.period==3}selected{/if}>This Month</option>
<option label="This Year" value="4" {if $smarty.request.period==4}selected{/if}>This Year</option>
<option label="Today" value="5" {if $smarty.request.period==5}selected{/if}>Today</option>

<option label="Yesterday" value="6" {if $smarty.request.period==6}selected{/if}>Yesterday</option>
<option label="All Time" value="7" {if $smarty.request.period==7}selected{/if}>All Time</option>
<option label="Freeform:" value="8" {if $smarty.request.period==8}selected{/if}>Freeform:</option>
</select> : 
  <input type="text" size=10 value="{$smarty.request.period_start|date_format:"%D"}" name="period_start" onChange="period.value=8;"> - <input type="text" size=10 value="{$smarty.request.period_end|date_format:"%D"}" name="period_end" onChange="period.value=8;">
</td>
{list_sites}
<td><B>Site:</b> <select name="siteid">
{foreach from=$sites item=item}
<option label="{$item.name}" value="{$item.id}" {if $smarty.request.siteid==$item.id}selected{/if}>{$item.name}</option>
{/foreach}
</selecT></td>
<td><input type="submit"></td>
</tr>
</table>

{tour_report siteid=$smarty.request.siteid period=$smarty.request.period period_start=$smarty.request.period_start period_end=$smarty.request.period_end}


<table>
<tr>
<td> Tour </td>
<td> Raw </td>
<td> Qualified </td>
<td> Unique </td>
<td> Signup </td>
<td> Initial </td>
<td> Conversion </td>
<td> Rebill </td>
<td> Active </td>
<td> Credit </td>
<td> Chargeback </td>
<td> Raw Ratio </td>
<td> Unique Ratio </td>
</tr>
{foreach from=$tour_data item=data}
<tr>
<td> {if $data.tourid==0}Default{else}{$sites[$smarty.request.siteid].tours[$data.tourid].name} 
{foreach from=$sites item=site}

{if $site.id==$data.siteid}
{foreach from=$site.tours item=tour}
{ if $tour.tourid == $data.tourid} {$tour.name} {/if}
{/foreach}
{/if}
{/foreach}
{/if}</td>

<td> {$data.raw} </td>
<td> {$data.qualified} </td>
<td> {$data.unq} </td>
<td> {$data.signup} </td>
<td> {$data.initial} </td>
<td> {$data.conversion} </td>
<td> {$data.rebill} </td>
<td> {$data.active} </td>
<td> {$data.credit} </td>
<td> {$data.chargeback} </td>
<td> {$data.ratio_raw} </td>
<td> {$data.ratio_unq} </td>
</tr>
{foreachelse}
<tr>
<td colspan="13"> Sorry there is no matching data</td>
</tr>
{/foreach}
</table>