function delegate($action) { //cleanCache(); $ds = dataSetName($_GET); $data = loadFromCache($ds); if ($data) { echo $data; exit(0); } switch ($action) { //Twitter case 'topTweets': $data = topTweets(); break; //Google Analytics //Google Analytics case 'chart': $data = getChart(); break; //Events //Events case 'events': $data = getEvents(); break; //Statistics //Statistics case 'stats': $data = getStatistics(); break; //Social badge //Social badge case 'social': $data = generateSocialBadge(); break; } if (!empty($data)) { $val = storeInCache($ds, output($data)); if (!$val) { } } echo output($data); exit(0); }
// echo $m; $data = array(); for ($d = 1; $d <= 31; $d++) { if (checkdate($m, $d, $y)) { $next = sizeof($data); $data[$next]['title'] = $inCore->getRusDate(date('F / ' . $d)); $d = str_pad($d, 2, "0", STR_PAD_LEFT); $m = str_pad($m, 2, "0", STR_PAD_LEFT); $sql = "SELECT id, COUNT(id) as cnt \n\t\t\t\t\t\tFROM cms_stats \n\t\t\t\t\t\tWHERE DATE_FORMAT(logdate, '%d') LIKE '{$d}' AND DATE_FORMAT(logdate, '%m') = '{$m}' AND DATE_FORMAT(logdate, '%Y') = '{$y}' \n\t\t\t\t\t\tGROUP BY DATE_FORMAT(logdate, '%d')"; $result = dbQuery($sql); while ($ag = mysql_fetch_assoc($result)) { $data[$next]['cnt'] = $ag['cnt']; } } } echo getChart($data, '', false, true); echo '</div>'; } if ($opt == 'config') { cpAddPathway('Настройки', '?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=config'); echo '<h3>Настройки компонента</h3>'; ?> <form action="index.php?view=components&do=config&id=<?php echo $_REQUEST['id']; ?> " method="post" name="optform" target="_self" id="form1"> <table width="370" border="0" cellpadding="10" cellspacing="0" class="proptable"> <tr> <td width="350" colspan="2" valign="top"><p><b>Внимание!</b></p> <p>Компонент "Статистика пользователя" работает только если в общих настройках сайта включен сбор статистики.</p> <p>Работа компонента может несколько увеличивать время загрузки страниц при большом количестве посетителей. </p>
<?php include_once "chart.php"; include_once "projectDB.php"; $chart = $_POST; if (isset($chart["chartType"])) { $chartType = $chart["chartType"]; unset($chart["chartType"]); // 需要清楚该元素,否则传递数组进去,会将chartType进行赋值操作导致mysql操作错误。 } else { $chartType = "empty"; } if ($chartType == "project") { $arr = getProjectsByProjectId($chart["chartId"]); $item = $arr[0]; $pChart = trim($item["projectChart"]); $item["projectChart"] = $pChart == "" || $pChart == "1" ? $chart["chartContent"] : $item["projectChart"] . "<>" . $chart["chartContent"]; $res = editProject(array("projectId" => $item['projectId'], "projectChart" => $item["projectChart"])); // 这里只需要两个字段即可 echo json_encode($res); } else { if ($chartType == "customized") { $arr = getChart($chart); $arr = json_decode($arr, true); $arr = $arr[0]; $chart["chartContent"] = $arr["chartContent"] == "" ? $chart["chartContent"] : $arr["chartContent"] . "<>" . $chart["chartContent"]; echo editChart($chart); } else { echo "unkown chartType :" . $chartType; } }
$arr[$key_current][block] = "0"; } if ($arr[$key_current][retest] == "") { $arr[$key_current][retest] = "0"; } if ($arr[$key_current][deferred] == "") { $arr[$key_current][deferred] = "0"; } if ($arr[$key_current][automated] == "") { $arr[$key_current][automated] = "0"; } } } mysql_close($link); $result .= formHTML($arr, $should_exec); $file_name = getChart($exec_arr, $auto_arr, $user_arr, $testplan_name); $result .= "<br></br><img src= {$file_name} />"; $result .= "\n</body>\n</html>"; $STDOUT = fopen('/home/wautorun/qa/web/projects/report/' . $testplan_name . '4.2.2.0_Test_Plan.html', 'wb'); $STDERR = fopen('error.log', 'wb'); fwrite($STDOUT, $result); sendMail($file_name, $testplan_name); function getName($testerid) { $sql3 = "SELECT * from users where id=" . $testerid; $result3 = mysql_query($sql3); $row3 = mysql_fetch_assoc($result3); $userfirst = $row3[first]; $userlast = $row3[last]; $username = "******"; return $username;