Exemplo n.º 1
0
function getValueByName($nodelist, $name)
{
    for ($i = 0; $i < $nodelist->length; $i++) {
        if ($nodelist->item($i)->nodeName == $name) {
            return $nodelist->item($i)->nodeValue;
        }
    }
    if ($i == $nodelist->length) {
        exit("Warning!!! Source XML file wrong!!! No value name " . $name . " exists.\n");
    }
}
if ($argc - 1 != 1) {
    //if there is 1 parameter and it must mean a date like '2010-04-01,12:34:56'
    exit("Only 1 parameter needed like '2010-05-01,12:34:56'.\n");
}
$date = __get_remote_date($argv[1], "Asia/Manila", -14);
if ($date === false) {
    exit("Illegal parameter, it should be like '2010-05-01,12:34:56'.\n");
}
/*get the abbreviation of the site*/
$abbr = __stats_get_abbr($argv[0]);
$zconn = new zmysqlConn();
/*find out the typeids and siteid from db by "iml" which is the abbreviation of the site*/
$typeids = array();
$siteid = null;
__stats_get_types_site($typeids, $siteid, $abbr, $zconn->dblink);
if (count($typeids) != 1) {
    exit(sprintf("The site with abbreviation \"%s\" should have 1 type at least.\n", $abbr));
}
if (empty($siteid)) {
    exit(sprintf("The site with abbreviation \"%s\" does not exist.\n", $abbr));
Exemplo n.º 2
0
<?php

include 'zmysqlConn.class.php';
include 'extrakits.inc.php';
if ($argc - 1 != 1) {
    //if there is 1 parameter and it must mean a date like '2010-04-01,12:34:56'
    exit("Only 1 parameter needed like '2010-05-01,12:34:56'.\n");
}
/*
 * the following line will make the whole script exit if date string format is wrong
 */
$date = __get_remote_date($argv[1], "America/New_York", -1);
$date_l = __get_remote_date($argv[1], "America/New_York", -1, "America/New_York", true);
/*get the abbreviation of the site*/
$abbr = __stats_get_abbr($argv[0]);
/*find out the typeids and siteid from db by "mps" which is the abbreviation of the site*/
$typeids = array();
$siteid = null;
$zconn = new zmysqlConn();
__stats_get_types_site($typeids, $siteid, $abbr, $zconn->dblink);
if (empty($siteid)) {
    exit(sprintf("The site with abbreviation \"%s\" does not exist.\n", $abbr));
}
if (count($typeids) != 2) {
    exit(sprintf("The site with abbreviation \"%s\" should have 2 type at least.\n", $abbr));
}
/*get all the campaign mappings of the site*/
$sql = sprintf("select * from view_mappings where siteid = %d", $siteid);
$rs = mysql_query($sql, $zconn->dblink) or die("Something wrong with: " . mysql_error());
$agents = array();
while ($row = mysql_fetch_assoc($rs)) {
Exemplo n.º 3
0
            return $nodelist->item($i)->nodeValue;
        }
    }
    if ($i == $nodelist->length) {
        exit("Warning!!! Source XML file wrong!!! No value name " . $name . " exists.\n");
    }
}
/*get the abbreviation of the site*/
$abbr = __stats_get_abbr($argv[0]);
//echo $abbr . "\n";
/*check out if the $date is in right format*/
if ($argc - 1 != 1) {
    //if there is 1 parameter and it must mean a date like '2010-04-01,12:34:56'
    exit("Only 1 parameter needed like '2010-05-01'.\n");
}
$date = __get_remote_date($argv[1], "Europe/London", -1);
if ($date === false) {
    exit("Illegal parameter, it should be like '2010-05-01,12:34:56'.\n");
}
$ymd = explode("-", $date);
$zconn = new zmysqlConn();
/*find out the typeids and siteid from db by "hornm" which is the abbreviation of the site*/
$typeids = array();
$siteid = null;
__stats_get_types_site($typeids, $siteid, $abbr, $zconn->dblink);
//echo print_r($typeids, true) . $siteid . "\n";
if (count($typeids) != 1) {
    exit(sprintf("The site with abbreviation \"%s\" should have 1 type at least.\n", $abbr));
}
/*try to read stats data*/
$srclink = 'http://www.pimpmansion.com/user/view_details.php?xml=1' . '&username=aquablue@cleanchattersinc.com&password=cxriscross611' . '&campaign_id=%s&form1_submit1=Show&form1_select2=%s&form1_select3=%s&form1_select4=%s&';
Exemplo n.º 4
0
<?php

include 'zmysqlConn.class.php';
include 'magpierss/rss_fetch.inc';
include 'extrakits.inc.php';
/*get the abbreviation of the site*/
$abbr = __stats_get_abbr($argv[0]);
//echo $abbr . "\n";
/*dealing with rss data*/
$rss = array();
if ($argc - 1 == 1) {
    //if there is 1 parameter and it must mean a date like '2010-04-01,12:34:56'
    $date = __get_remote_date($argv[1]);
    if ($date === false) {
        exit("It only take one parameter, like '2009-09-01,12:34:56'.\n");
    }
    $rsssrclink = 'http://webmasters.cams4pleasure.com/custom/xmlstatus.php' . '?username=bvlgari2010&password=dreaming' . '&start=' . $date . '&end=' . $date;
    /*
    $link = $rsssrclink . '&program=5';
    $rss_5 = fetch_rss($link);
    if ($rss_5 === false) {
    	exit(sprintf("Failed to read stats data from %s.\n", $link));
    }
    */
    $rss_5 = array();
    /*
    $link = $rsssrclink . '&program=7';
    $rss_7 = fetch_rss($link);
    if ($rss_7 === false) {
    	exit(sprintf("Failed to read stats data from %s.\n", $link));
    }