示例#1
0
 /**
  * Generates a select box. Works with associate arrays or objects.
  * 
  * @param string $name
  * @param array $rows
  * @param string $default
  * @param string $id
  * @param string $classes
  * @param string $label_key Key used for the label string	
  * @param string $value_key Key used for the option value
  * @param string $zero_label Insert an item with ID "0" at the beginning, with this label
  */
 public static function createSelect($name, $rows, $default = null, $id = '', $classes = '', $label_key = 'label', $value_key = 'value', $zero_label = '')
 {
     printf('<select name="%s" id="%s" class="%s">', $name, $id, $classes);
     if ($zero_label) {
         printf('<option value="0">%s</option>', $zero_label);
     }
     foreach ($rows as $row) {
         $selected = "";
         $value = is_array($row) ? $row[$value_key] : $row->{$value_key};
         $label = is_array($row) ? $row[$label_key] : $row->{$label_key};
         if ($value == $default) {
             $selected = 'selected="selected"';
         }
         printf('<option %s value="%s">%s</option>', $selected, $value, BTHtml::encode($label));
     }
     printf("</select>");
 }
示例#2
0
		</div>
		
		<div class="content">
			<table class="dynamic styled with-prev-next" cellpadding="0" cellspacing="0">
				<thead>
					<tr>
						<th>Landing Page</th>
						<th>Actions</th>
					</tr>
				</thead>
				<tbody>
					<?php 
foreach ($lp_data as $landing_page_row) {
    $html['name'] = BTHtml::encode($landing_page_row->get('name'));
    $html['landing_page_id'] = BTHtml::encode($landing_page_row->get('landing_page_id'));
    $html['url'] = BTHtml::encode($landing_page_row->get('url'));
    ?>
						<tr>
							<td><?php 
    printf('%s', $html['name']);
    ?>
</td>
							<td class="center">
								<a onclick="editLandingPage('<?php 
    printf('%s', $html['landing_page_id']);
    ?>
','<?php 
    printf('%s', $html['name']);
    ?>
','<?php 
    printf('%s', $html['url']);
				<?php 
}
?>
	
				<?php 
$rows = count($breakdown_result);
$html['clicks'] = BTHtml::encode($stats_total['clicks']);
$html['leads'] = BTHtml::encode($stats_total['leads']);
$html['conv'] = BTHtml::encode(calculate_conv($stats_total['clicks'], $stats_total['leads']) . '%');
$html['payout'] = BTHtml::encode(dollar_format(calculate_payout($stats_total['leads'], $stats_total['income'])));
$html['epc'] = BTHtml::encode(dollar_format(calculate_epc($stats_total['clicks'], $stats_total['income'])));
$html['cpc'] = BTHtml::encode(dollar_format(calculate_cpc($stats_total['clicks'], $stats_total['cost'])));
$html['income'] = BTHtml::encode(dollar_format($stats_total['income']));
$html['cost'] = BTHtml::encode(dollar_format($stats_total['cost']));
$html['net'] = BTHtml::encode(dollar_format(calculate_net($stats_total['income'], $stats_total['cost'])));
$html['roi'] = BTHtml::encode(calculate_roi($stats_total['income'], $stats_total['cost']) . '%');
?>
 
	
				</tbody>
	
				<?php 
$stat_html = ob_get_contents();
ob_end_clean();
?>
				
				<tfoot>
					<tr>
						<td><strong>Totals for report</strong></td>
						<td><strong><?php 
echo $html['clicks'];
$opt_arr = array();
foreach ($node->children() as $child) {
    if ((string) $child === 'true') {
        $opt_arr[$child->getName()] = true;
    } else {
        $opt_arr[$child->getName()] = false;
    }
}
$page = $page;
//default false. We tell it what we need
$default_opts = array('show_time' => false, 'show_traffic_source' => false, 'show_bottom' => false, 'show_breakdown' => false, 'show_bottom_advanced' => false, 'show_mobile_breakdown' => false, 'show_type' => false, 'show_campaign' => false);
$show_options = array_merge($default_opts, $opt_arr);
$time = grab_timeframe();
$html['from'] = date('m/d/Y', $time['from']);
$html['to'] = date('m/d/Y', $time['to']);
$html['page'] = BTHtml::encode($page);
?>


<form onsubmit="return false;" id="user_prefs" class="grid_12" novalidate="novalidate">
	<input type="hidden" name="opt_setting" value="<?php 
echo $opts;
?>
"/>


	<div class="grid_2">
		<div class="box">
			<select class="" name="time_predefined" id="time_predefined" onchange="set_time_predefined();">
				<option value="">Custom Date</option>                                       
				<option <?php 
<?php

if (count($aff_networks) < 1) {
    ?>
	<tr>
		<td class="center">You have not added any networks.</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<?php 
} else {
    foreach ($aff_networks as $aff_network_row) {
        $html['name'] = BTHtml::encode($aff_network_row->get('name'));
        $html['aff_network_id'] = BTHtml::encode($aff_network_row->get('aff_network_id'));
        $no_of_accounts = count($aff_network_row->offers);
        ?>
		<tr>
			<td><?php 
        printf('%s', $html['name']);
        ?>
</td>
			<td class="center"><a href="/offers/?network=<?php 
        echo $aff_network_row->aff_network_id;
        ?>
"><?php 
        echo $no_of_accounts;
        ?>
</a></td>
			<td class="center">
				<a href="/offers/affnetworks?aff_network_id=<?php 
        echo $html['aff_network_id'];
 public function passResetAction()
 {
     if (!isset($_GET['key'])) {
         _die("Bad key");
     }
     //take password retireveal and see if it is legitimate
     $user_row = UserModel::model()->getRow(array('conditions' => array('pass_key' => $_GET['key'])));
     if (!$user_row) {
         $error['pass_key'] = '<div class="error">No key was found like that</div>';
     }
     if (!$error) {
         //how many days ago was this code activated, this code will only work if the activation reset code is at least current within the last 3 days
         $date_today = time();
         $days = ($date_today - $user_row->get('pass_time')) / 86400;
         if ($days > 3) {
             $error['pass_key'] .= '<div class="error">Sorry, this key has expired</div>';
         }
     }
     //if the key is legit, make sure their new posted password is legit
     if (!$error and $_SERVER['REQUEST_METHOD'] == "POST") {
         if ($_POST['pass'] == '') {
             $error['pass'] = '******';
         }
         if ($_POST['pass'] == '') {
             $error['pass'] .= '<div class="error">You must type verify your password</div>';
         }
         if (strlen($_POST['pass']) < 6 or strlen($_POST['pass']) > 15) {
             $error['pass'] .= '<div class="error">Passwords must be 6 to 15 characters long</div>';
         }
         if ($_POST['pass'] != $_POST['verify_pass']) {
             $error['pass'] .= '<div class="error">Your passwords did not match, please try again</div>';
         }
         if (!$error) {
             $user_row->pass = $_POST['pass'];
             $user_row->pass_time = 0;
             $user_row->pass_key = '';
             $user_row->save();
             $success = true;
         }
     }
     $html['user_name'] = BTHtml::encode($user_row->get('user_name'));
     //if password was changed succesfully
     if ($success == true) {
         _die("<div style='text-align: center'><br/>Congratulations, your password has been reset.<br/>You can now <a href=\"/login\">login</a> with your new password</div>");
     }
     if ($error['pass_key']) {
         _die("<div style='text-align: center'><br/>" . $error['pass_key'] . "<p>Please use the <a href=\"/lost-pass\">password retrieval tool</a> to get a new password reset key.</p></div>");
     }
     $this->setVar("title", "Reset Your Password");
     $this->loadTemplate("public_header");
     $this->setVar("success", $success);
     $this->setVar("html", $html);
     $this->setVar("error", $error);
     $this->loadView("login/resetpass");
     $this->loadTemplate("public_footer");
 }
	</div>
	<div class="content">
		<table class="manageaccountlist styled with-prev-next" cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<th>User ID</th>
					<th>Username</th>
					<th>Email</th>
					<th>Actions</th>
				</tr>
			</thead>
			<tbody>
			<?php 
foreach ($userlist as $row) {
    $html['email'] = BTHtml::encode($row->email);
    $html['user_name'] = BTHtml::encode($row->user_name);
    ?>
				<tr>
					<td class="user_id" <?php 
    if ($row->privilege == 10) {
        echo 'style="background-color:lightgray;" title="admin" alt="admin" ';
    }
    ?>
><?php 
    echo $row->user_id;
    ?>
</td>
					<td><?php 
    echo $html['user_name'];
    ?>
</td>
 public function dataAction()
 {
     $this->loadModel("ClickModel");
     $model = new ClickModel();
     $data = $model->clickSpy(getUserId(), $_GET['iDisplayStart'], $_GET['iDisplayLength']);
     $cnt = $data['count'];
     $click_rows = $data['click_rows'];
     $sEcho = $_GET['sEcho'];
     $data = array('sEcho' => (int) $sEcho, 'iTotalRecords' => $cnt, 'iTotalDisplayRecords' => $cnt, 'aaData' => array());
     foreach ($click_rows as $click_row) {
         $html['referer'] = BTHtml::encode($click_row['referer_url_address']);
         $html['referer_host'] = BTHtml::encode($click_row['referer_domain_host']);
         $html['redirect'] = BTHtml::encode($click_row['redirect_url_address']);
         $html['click_pid'] = BTHtml::encode(base_convert($click_row['click_id'], 10, 36));
         $html['time'] = date('m/d/y g:ia', $click_row['time']);
         $html['ts.name'] = BTHtml::encode($click_row['ts.name']);
         $html['ip_address'] = BTHtml::encode($click_row['ip_address']);
         $html['keyword'] = BTHtml::encode($click_row['keyword']);
         $html['lead'] = BTHtml::encode($click_row['lead']);
         $html['filtered'] = BTHtml::encode($click_row['filtered']);
         $html['landing'] = BTHtml::encode($click_row['landing']);
         $html['name'] = BTHtml::encode($click_row['name']);
         $html['browser_id'] = '';
         if ($click_row['browser_id']) {
             $html['browser_id'] = '<img width="16" height="16" class="tooltip" title="' . Browser::getBrowserName($click_row['browser_id']) . '" src="/theme/img/icons/browsers/' . $click_row['browser_id'] . '.png"/>';
         }
         $html['platform_id'] = '';
         if ($click_row['platform_id']) {
             $html['platform_id'] = '<img width="16" height="16" class="tooltip" title="' . Browser::getPlatformName($click_row['platform_id']) . '" src="/theme/img/icons/platforms/' . $click_row['platform_id'] . '.png"/>';
         }
         $data_array = array();
         $data_array[] = strtoupper($html['click_pid']);
         $admin_image = '';
         // if a click happened from the admin use user.png
         if ($click_row['filtered'] == 1) {
             // check if logged in user clicked
             $admin_image = '<img width="16" height="16" class="tooltip" src="/theme/img/icons/packs/iconsweets2/16x16/user.png" alt="Affiliate Click" title="Affiliate Click"/>';
         }
         $filt = '';
         $landingpage_image = '';
         $offer_image = '';
         $repeated_user = '';
         if ($click_row['lead'] == '1') {
             $alt = 'Converted Click';
             $filt = '<img width="16" height="16" class="tooltip" src="/theme/img/icons/16x16/money_dollar.png" alt="' . $alt . '" title="' . $alt . '" width="16px" height="16px"/>';
         }
         // if a link is going to an offer directly use the bended arrow right.png
         $offer_image = $html['redirect'] ? sprintf('<a href="%s" target="_new"><img width="16" height="16" class="tooltip" src="/theme/img/icons/packs/iconsweets2/16x16/bended-arrow-right.png" alt="Offer Click" title="Offer Click"/></a>', $html['redirect']) : '';
         if (!$offer_image) {
             // if the click happens on a landing page, they icon should be the document.png
             $landingpage_image = $html['landing'] ? sprintf('<a href="%s" target="_new"><img width="16" height="16" class="tooltip" src="/theme/img/icons/packs/iconsweets2/16x16/document.png" alt="Landing"  title="Landing Page"/></a>', $html['landing']) : '';
         }
         // if a click happened from a repeated user use footprint.png
         if ($click_row['filtered'] == 2) {
             // check if repeated user
             $repeated_user = '******';
         }
         $cloaked_icon = '';
         if ($click_row['cloaked']) {
             $cloaked_icon = '<img width="16" height="16" class="tooltip" src="/theme/img/icons/packs/iconsweets2/16x16/bulls-eye.png" alt="Safe Page" title="Visitor Was Filtered By An Advanced Redirect."/>';
         }
         if ($filt) {
             $data_array[] = $filt . $admin_image . $repeated_user . $cloaked_icon;
         } else {
             $data_array[] = $filt . $landingpage_image . $offer_image . $admin_image . $repeated_user . $cloaked_icon;
         }
         $data_array[] = $html['time'];
         $data_array[] = '<span title="' . $html['keyword'] . '">' . $html['keyword'] . '</span>';
         $data_array[] = $html['name'];
         $data_array[] = sprintf('<a href="%s" target="_new" title="Referer" class="tablelink">%s</a> ', $html['referer'], $html['referer_host']);
         $data_array[] = sprintf('<a target="_new"  href="http://whois.arin.net/rest/ip/%s" class="tablelink">%s</a>', $html['ip_address'], $html['ip_address']);
         $data_array[] = $html['browser_id'] . ' ' . $html['platform_id'];
         $data['aaData'][] = $data_array;
     }
     echo json_encode($data);
 }
示例#9
0
function getDatatablesReportJson($report_data, $total_entries, $cols)
{
    $sEcho = $_GET['sEcho'];
    $data = array('sEcho' => (int) $sEcho, 'iTotalRecords' => $total_entries, 'iTotalDisplayRecords' => $total_entries, 'aaData' => array());
    foreach ($report_data as $row) {
        $html = array();
        foreach ($cols as $col) {
            $value = getArrayVar($row, $col, null);
            if ($value === null) {
                $html[] = '';
            } else {
                switch ($col) {
                    case 'label':
                    case 'actions':
                        $html[] = formatColumnValue($col, $value);
                        break;
                    default:
                        $html[] = BTHtml::encode(formatColumnValue($col, $value));
                        break;
                }
            }
        }
        $data['aaData'][] = $html;
    }
    return json_encode($data);
}
示例#10
0
echo BTHtml::encode($campaign->option('var_v3')->value);
?>
" name="opt[var_v3]" /></td>
							<td><input type="text" value="<?php 
echo BTHtml::encode($campaign->option('default_var_v3')->value);
?>
" name="opt[default_var_v3]" /></td>
						</tr>
						<tr>
							<td>Subid4</td>
							<td><input type="text" value="<?php 
echo BTHtml::encode($campaign->option('var_v4')->value);
?>
" name="opt[var_v4]" /></td>
							<td><input type="text" value="<?php 
echo BTHtml::encode($campaign->option('default_var_v4')->value);
?>
" name="opt[default_var_v4]" /></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>

    <div class="grid_12">
        <div class="box with-table">
            <div class="header">
                <h2>Variable Passthrough</h2>
            </div>
            <div class="content">
<div class="box with-table">
	<div class="header">
		<h2>Details for <?php 
echo $clickid;
?>
</h2>
	</div>

	<div class="content">
		<table class="styled vertical_columns" cellpadding="0" cellspacing="0">
			<?php 
foreach ($clickid_data as $name => $val) {
    printf("<tr><th>%s</th><td>%s</td></tr>\n", BTHtml::encode($name), BTHtml::encode($val));
}
?>
		</table>
	</div>
</div>