0byt3m1n1
Path:
/
home1
/
aserty
/
www
/
qct
/
[
Home
]
File: config.php
<?php ########################################################################## ## Quality Click Tracking ## ## Version 2 Released 10/26/2010 ## ## ---------------------- ## ## By Sonja Ray Tropical Web Works ## ## (http://www.isoldwhat.com) ## ## ## ## You may NOT sell or redistribute this script without permission ## ## ## ## Copyright (c) 2010 TropicalWebWorks.com - All Rights Reserved ## ## This script is made available "as is" and ## ## no warrantees are express or implied ## ########################################################################## $confi['sitename'] = 'I Sold What'; $confi['domain'] = 'isoldwhat.com'; $confi['company'] = 'Tropical Web Works / I Sold What'; $confi['email'] = 'info@'.$confi['domain']; $whichprogram = 'PHPBay'; $iplink = 'http://whatismyipaddress.com/ip/'; $iplink = 'http://www.dnsstuff.com/tools/ipall/?tool_id=67&token=&toolhandler_redirect=0&ip='; // $iplink = 'http://www.dnsstuff.com/tools/whois/?ip='; date_default_timezone_set('America/Phoenix'); if ($clickconex = @mysql_connect (QCTDBHost, QCTDBUser, QCTDBPass)) { $myquery = " SET time_zone = '-7:00' "; $query = mysql_query($myquery, $clickconex) or trigger_error('Bad myquery: '.mysql_error()); } $countrynote = '<ul style="margin-top:30px;"><li>"Clicks by Country" shows the eBay country site to which you sent your visitors — not the country location of the visitor based on their IP address. The "Country" report is intended for affiliates using geo-targeting. If you have a significant number of site visitors from other countries, you may want to consider using geo-targeting. ePN does not record clicks or pay for clicks when the visitor\'s country location and the eBay program being clicked on do not match.</li></ul>'; function count_daysQCT( $a, $b ) { $gd_a = getdate( $a ); $gd_b = getdate( $b ); $a_new = mktime( 12, 0, 0, $gd_a['mon'], $gd_a['mday'], $gd_a['year'] ); $b_new = mktime( 12, 0, 0, $gd_b['mon'], $gd_b['mday'], $gd_b['year'] ); return round( abs( $a_new - $b_new ) / 86400 ); } function getearliestdate() { global $clickconex, $tablename; $earliestdate = ''; $firstdatequery = " SELECT DATE_FORMAT(MIN(ClickTime), '%Y-%m-%d') as earliestdate FROM $tablename ORDER BY ClickTime ASC LIMIT 1 "; $firstdate = @mysql_query($firstdatequery, $clickconex); if ( $firstdate ) { $row = mysql_fetch_assoc($firstdate); $earliestdate = $row['earliestdate']; } return $earliestdate; } function makeselectform($id=1) { global $clickconex, $tablename, $showoptions; $myquery = " SELECT DISTINCT Site FROM $tablename GROUP BY Site ORDER BY Site ASC "; // echo $query; $query = mysql_query($myquery) or die('Bad myquery: '.mysql_error()); $formstr = ''; if ( $query && mysql_num_rows($query) > 0 ) { $formstr = '<p style="font-weight:bold; margin-bottom:0;">Select Site & Dates</p>'; $formstr .= '<form method="get" action="'.$_SERVER['PHP_SELF'].'" style="margin-top:0;">'; $formstr .= '<table class="userselect">'; $formstr .= '<tr>'; $formstr .= '<td colspan="2">'; $formstr .= 'Site: <select name="Site">'; $formstr .= '<option value="All"'.$selstr.'>All</option>'; while ($row = mysql_fetch_array($query)) { $selstr = ''; if ( isset($_GET['Site']) && $_GET['Site'] == $row['Site'] ) { $selstr = ' selected="selected"'; } $formstr .= '<option value="'.$row['Site'].'"'.$selstr.'>'.$row['Site'].'</option>'; } $formstr .= '</select>'; $formstr .= '</td>'; $formstr .= '<td style="padding-left:15px;">'; $formstr .= 'Start: '; $startdate = ''; if ( isset($_GET['startdate']) && $_GET['startdate'] != '' ) { $startdateval = htmlspecialchars($_GET['startdate']); } $formstr .= '<input type="text" name="startdate" id="startdate'.$id.'" value="'.$startdateval.'">'; $formstr .= '</td>'; $formstr .= '<td style="padding-left:15px;">'; $formstr .= "End: "; $enddate = ''; if ( isset($_GET['startdate']) && $_GET['enddate'] != '' ) { $enddateval = htmlspecialchars($_GET['enddate']); } $formstr .= '<input type="text" name="enddate" id="enddate'.$id.'" value="'.$enddateval.'">'; $formstr .= '</td>'; if ( isset($showoptions) ) { $showthecountry = isset($_GET['showcountry']) ? ' checked="checked"' : ''; $showthecountry = !isset($_GET['startdate']) ? ' checked="checked"' : $showthecountry; $showthehost = isset($_GET['showremotehost']) ? ' checked="checked"' : ''; $showthehost = !isset($_GET['startdate']) ? ' checked="checked"' : $showthehost; $formstr .= '<td style="padding-left:15px;">'; $formstr .= '<input type="checkbox" name="showcountry" id="showcountry'.$id.'" value="showcountry"'.$showthecountry.'><label for="showcountry'.$id.'"> Show Country</label><br>'; $formstr .= '<input type="checkbox" name="showremotehost" id="showremotehost'.$id.'" value="showremotehost"'.$showthehost.'><label for="showremotehost'.$id.'"> Show Remote Host</label><br>'; $formstr .= '</td>'; } $formstr .= ''; $formstr .= '<td style="padding-left:15px;">'; $formstr .= '<input type="submit" name="submit" value="Submit">'; $formstr .= '</td></tr>'; if ( isset($showoptions) ) { $formstr .= '<tr>'; $formstr .= '<td colspan="5">'; $formstr .= 'Search:'; // $formstr .= '</td>'; // $formstr .= '<td colspan="3">'; $searchfor = isset($_GET['searchfor']) ? htmlspecialchars($_GET['searchfor']) : ''; $showsearchcid = isset($_GET['searchcid']) ? ' checked="checked"' : ''; $showsearchref = isset($_GET['searchref']) ? ' checked="checked"' : ''; $showsearchitem = isset($_GET['searchitem']) ? ' checked="checked"' : ''; $formstr .= '<input type="text" name="searchfor" id="searchfor'.$id.'" value="'.$searchfor.'">'; $formstr .= ' Search in:'; $formstr .= '<input type="checkbox" name="searchcid" id="searchcid'.$id.'" value="searchcid"'.$showsearchcid.'><label for="searchcid'.$id.'">CustomID</label>'; $formstr .= ' <input type="checkbox" name="searchref" id="searchref'.$id.'" value="searchref"'.$showsearchref.'><label for="searchref'.$id.'">Refering Page</label>'; $formstr .= ' <input type="checkbox" name="searchitem" id="searchitem'.$id.'" value="searchitem"'.$showsearchitem.'><label for="searchitem'.$id.'">Item Name</label>'; $formstr .= '</td>'; $formstr .= '</tr>'; } $formstr .= '</table>'; $formstr .= '</form>'; } return $formstr; } function createDateRangeArray($strDateFrom,$strDateTo) { // takes two dates formatted as YYYY-MM-DD and creates an // inclusive array of the dates between the from and to dates. $aryRange=array(); $iDateFrom=mktime(1,0,0,substr($strDateFrom,5,2), substr($strDateFrom,8,2),substr($strDateFrom,0,4)); $iDateTo=mktime(1,0,0,substr($strDateTo,5,2), substr($strDateTo,8,2),substr($strDateTo,0,4)); if ($iDateTo>=$iDateFrom) { array_push($aryRange,date('Y-m-d',$iDateFrom)); // first entry while ($iDateFrom<$iDateTo) { $iDateFrom+=86400; // add 24 hours array_push($aryRange,date('Y-m-d',$iDateFrom)); } } return $aryRange; } $earliestdate = getearliestdate(); ?>