<?php

function stps($sgs)
{
$sgs="pr";///////////////////////temps
	
printf("<div class='hds'>");
$spbr="<a href='vt".$sgs."dashbs.php'  target='_blank' style='color:silver;text-decoration:none;color:silver;'>";
$spsr="<a href='vt".$sgs."starts.php'  target='_blank' style='color:silver;text-decoration:none;color:silver;'>";

printf("<table style='width:95%%;left:2%%;color:silver;font-size:13;'><tr>");
printf("<td width=30%%>%s - (%s)</td>",$_SESSION['titles'],$_SESSION['positions']);
print("<td width=30%% align='center'>Primary sales</td>");
printf("<td width=10%% align='center'><b>%sDashboard</a></b></td>",$spbr);
printf("<td width=10%% align='center'><b>%sStartup</a></b></td>",$spsr);

if($sgs=='pr'){
printf("<td width=4%% style='border-left:1px solid silver;padding-left:0.5%%'>%sPrimary</a></td>",$spr);}
else{
printf("<td width=4%% style='border-left:1px solid silver;padding-left:0.5%%'>Primary</a></td>");}
	
if($sgs=='rd'){
printf("<td width=4%% style='border-left:1px solid silver;padding-left:0.5%%'>RD</a></td>");}
else{
printf("<td width=4%% style='border-left:1px solid silver;padding-left:0.5%%'>RD</a></td>");}

if($sgs=='pr'){
printf("<td width=4%% style='border-left:1px solid silver;padding-left:0.5%%'>MR</a></td>");}
else{
printf("<td width=4%% style='border-left:1px solid silver;padding-left:0.5%%'>MReturns</a></td>");}

printf("<td width=10%% align='center'>Sign out</td></tr></table></div>");
}


function prshows($sgs,$ars,$scp,$pgs,$tnm,$zones,$regions,$agents,$agenttypes,$terrys,$ranges,$subranges,$items)
{
	
$sprt="?actp=rtp&zones=all&regions=all&agents=all&agenttypes=all&terrys=all&items=all&ranges=all&subranges=all&starts=".
date('Y-m-01')."&ends=".date('Y-m-t')."' target='_blank'";

$tds="<a href='vt".$sgs;

printf("<table style='width:85%%;height:18%%;color:#006699;font-size:13;'>");
printf("<tr><td style='border-bottom:1px solid silver;font-size:13;color:grey;' colspan='2'>Segment</td></tr>");
////////////

if($ars=='zone'){
printf("<tr><td width=10%% style='background:#006699;color:#006699;'>-</td><td><b>Zones</b></td></tr>");}
else{
printf("<tr><td width=10%% style='background:silver;color:silver;'>-</td><td>%szonetgsummary.php%s' target='_blank'>Zones</a></td></tr>",$tds,$sprt);}
	
//////////////
if($ars=='region' ){
printf("<tr><td width=10%% style='background:#006699;color:#006699;'>-</td><td><b>Regions</b></td></tr>");}
else{
printf("<tr><td width=10%% style='background:silver;color:silver;'>-</td><td>%sregiontgsummary.php%s' target='_blank'>Regions</a></td></tr>",$tds,$sprt);}

////////////////
if($ars=='agent'){
printf("<tr><td width=10%% style='background:#006699;color:#006699;'>-</td><td><b>Agents</b></td></tr>");}
else{
printf("<tr><td width=10%% style='background:silver;color:silver;'>-</td><td>%sagenttgsummary.php%s' target='_blank'>Agent</a></td></tr>",$tds,$sprt);}

////////////////
if($ars=='agtype' ){
printf("<tr><td width=10%% style='background:#006699;color:#006699;'>-</td><td><b>Channels</b></td></tr>");}
else{
printf("<tr><td width=10%% style='background:silver;color:silver;'>-</td><td>%sagtypetgsummary.php%s' target='_blank'>Channels</a></td></tr>",$tds,$sprt);}

///////////////
if($ars=='rt'){
printf("<tr><td width=10%% style='background:#006699;color:#006699;'>-</td><td><b>Products</b></td></tr>");}
else{
printf("<tr><td width=10%% style='background:silver;color:silver;'>-</td><td>%srtrangewise.php%s' target='_blank'>Products</a></td></tr>",$tds,$sprt);}

printf("<tr><td width=10%% style='background:silver;color:silver;'>-</td><td>Other</td></tr></table>");



printf("<table style='font-size:13;width:85%%;'><tr><td style='font-size:13;color:#006699;border-bottom:1px solid silver;color:grey;' colspan='3'><br>Report details</td></tr>");
printf("<tr><td style='font-size:13;color:#006699;border:0px solid #EAEDED;border-radius:2px;' colspan='3'>Zone - %s</td></tr>",ucwords($zones));
printf("<tr><td style='font-size:13;color:#006699;border:0px solid #EAEDED;' colspan='3'>Region - %s</td></tr>",ucwords($regions));
printf("<tr><td style='font-size:13;color:#006699;border:0px solid #EAEDED;' colspan='3'>Channel - %s</td></tr>",ucwords($agenttypes));
if($agents=='all'){
printf("<tr><td style='font-size:13;color:#006699;border:0px solid #EAEDED;' colspan='3'>Agent - %s</td></tr></table>",ucwords($agents));}
else{
printf("<tr><td style='font-size:13;color:#006699;border:0px solid #EAEDED;padding:0px;margin:0px;' colspan='3'>Agent - </td></tr>");
printf("<tr><td style='font-size:13;color:#006699;border:0px solid #EAEDED;' colspan='3'>%s</td></tr></table>",ucwords($agents));}


$tds="<tr style='border:5px solid white;border-left:0px;'><td width=10%% style='background:silver;'>
<div style='height:80%%;color:silver;'>-</td><td width=90%%><a href='";
$prs="zones=all&regions=all&agents=all&agenttypes=all&terrys=all&items=all&ranges=all&subranges=all&starts=".
date('Y-m-01')."&ends=".date('Y-m-t')."' target='_blank'>";

if($scp=='gobs')
{
$tdsa="<tr style='border:5px solid white;border-left:0px;'><td width=10%% style='background:";
$tdsb=";'><div style='height:80%%;color:silver;'>-</div></td><td width=90%%><a href='";
$prs="?actp=fpt&zones=all&regions=all&agents=all&agenttypes=all&terrys=all&items=all&ranges=all&subranges=all&starts=".
date('Y-m-01')."&ends=".date('Y-m-t')."' target='_blank'>";

printf("<div style='position:relative;top:6%%;left:1%%;font-family:calibri;'>");
printf("<table style='width:85%%;color:#006699;font-size:13;'>");
printf("<tr><td colspan='2' style='color:#006699;border-bottom:1px solid silver;color:grey;'>Menu</td></tr>");


if($tnm=='Main summary'){
$hlv='#006699';	
printf("%s%s%svt%s%sdashbs.php?%sMain summary</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%sdashbs.php?%sMain summary</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Sales range'){
$hlv='#006699';	
printf("%s%s%svt%s%ssalesrangesummary.php?%sSales range</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%ssalesrangesummary.php?%sSales range</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Target achievement'){
$hlv='#006699';	
printf("%s%s%svt%s%stgsummary.php?%sTarget achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%stgsummary.php?%sTarget achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Range achievement'){
$hlv='#006699';	
printf("%s%s%svt%s%stgrangesummary.php?%sRange achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%stgrangesummary.php?%sRange achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Tonnage Range'){
$hlv='#006699';	
printf("%s%s%svt%s%stonnagerangesummary.php?%sTonnage Range</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%stonnagerangesummary.php?%sTonnage Range</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Sales trend'){
$hlv='#006699';	
printf("%s%s%svt%s%ssalestrend.php?%sSales trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%ssalestrend.php?%sSales trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Range trend'){
$hlv='#006699';	
printf("%s%s%svt%s%srangetrend.php?%sRange trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%srangetrend.php?%sRange trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Tonnage trend'){
$hlv='#006699';	
printf("%s%s%svt%s%stonnagetrend.php?%sTonnage trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%stonnagetrend.php?%sTonnage trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Sales achievement trend'){
$hlv='#006699';	
printf("%s%s%svt%s%stgtrend.php?%sSales achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%stgtrend.php?%sSales achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Range achievement trend'){
$hlv='#006699';	
printf("%s%s%svt%s%stgrangetrend.php?%sRange achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%stgrangetrend.php?%sRange achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Tonnage achievement trend'){
$hlv='#006699';	
printf("%s%s%svt%s%stgtonnagetrend.php?%sTonnage achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%stgtonnagetrend.php?%sTonnage achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Periodic sales'){
$hlv='#006699';	
printf("%s%s%svt%s%ssales.php?%sPeriodic sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%ssales.php?%sPeriodic sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Periodic range sales'){
$hlv='#006699';	
printf("%s%s%svt%s%srangesales.php?%sPeriodic range sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%srangesales.php?%sPeriodic range sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


printf("</table></div>");

}



if($scp=='pvts')
{
	
$tdsa="<tr style='border:5px solid white;border-left:0px;'><td width=10%% style='background:";
$tdsb=";'><div style='height:80%%;color:silver;'>-</div></td><td width=90%%><a href='";
$prs="actp=fpt&zones=".$zones."&regions=".$regions."&agents=".$agents."&agenttypes=".$agenttypes."&terrys=".$terrys."&items=".$items."&ranges=".$ranges.
"&subranges=".$subranges."&starts=".date('Y-m-01')."&ends=".date('Y-m-t')."' target='_blank'>";

printf("<div style='position:relative;top:6%%;left:1%%;font-family:calibri;'>");
printf("<table style='width:90%%;color:#006699;font-size:13;'>");
printf("<tr><td colspan='2' style='color:#006699;border-bottom:1px solid silver;color:grey;'>Menu</td></tr>");

if($tnm=='Range sales'){
$hlv='#006699';	
printf("%s%s%svt%s%srangewise.php?%sRange sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%srangewise.php?%sRange sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Subrange sales'){
$hlv='#006699';	
printf("%s%s%svt%s%ssubrangewise.php?%sSubrange sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%ssubrangewise.php?%sSubrange sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Item sales'){
$hlv='#006699';	
printf("%s%s%svt%s%sitemwise.php?%sItem sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%sitemwise.php?%sItem sales</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Range achievement'){
$hlv='#006699';	
printf("%s%s%svt%s%srangewisetgsummary.php?%sRange achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%srangewisetgsummary.php?%sRange achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Subrange achievement'){
$hlv='#006699';	
printf("%s%s%svt%s%ssubrangewisetgsummary.php?%sSubrange achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%ssubrangewisetgsummary.php?%sSubrange achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Item achievement'){
$hlv='#006699';	
printf("%s%s%svt%s%sitemwisetgsummary.php?%sItem achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%sitemwisetgsummary.php?%sItem achievement</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Range sales trend'){
$hlv='#006699';	
printf("%s%s%svt%s%srangewisetrend.php?%sRange sales trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%srangewisetrend.php?%sRange sales trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}

if($tnm=='Subrange sales trend'){
$hlv='#006699';	
printf("%s%s%svt%s%ssubrangewisetrend.php?%sSubrange sales trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%ssubrangewisetrend.php?%sSubrange sales trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Item sales trend'){
$hlv='#006699';	
printf("%s%s%svt%s%sitemwisetrend.php?%sItem sales trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%sitemwisetrend.php?%sItem sales trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Range achievement trend'){
$hlv='#006699';	
printf("%s%s%svt%s%srangewisetgtrend.php?%sRange achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%srangewisetgtrend.php?%sRange achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Subrange achievement trend'){
$hlv='#006699';	
printf("%s%s%svt%s%ssubrangewisetgtrend.php?%sSubrange achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%ssubrangewisetgtrend.php?%sSubrange achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Item achievement trend'){
$hlv='#006699';	
printf("%s%s%svt%s%sitemwisetgtrend.php?%sItem achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%sitemwisetgtrend.php?%sItem achievement trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Range tonnage trend'){
$hlv='#006699';	
printf("%s%s%svt%s%srangewisetgtntrend.php?%sRange tonnage trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%srangewisetgtntrend.php?%sRange tonnage trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Subrange tonnage trend'){
$hlv='#006699';	
printf("%s%s%svt%s%ssubrangewisetgtntrend.php?%sSubrange tonnage trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%ssubrangewisetgtntrend.php?%sSubrange tonnage trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}


if($tnm=='Item tonnage trend'){
$hlv='#006699';	
printf("%s%s%svt%s%sitemwisetgtntrend.php?%sItem tonnage trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%sitemwisetgtntrend.php?%sItem tonnage trend</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}

if($tnm=='Invoice list'){
$hlv='#006699';	
printf("%s%s%svt%s%sinvoices.php?%sInvoice list</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}
else{
$hlv='silver';	
printf("%s%s%svt%s%sinvoices.php?%sInvoice list</a></td></tr>",$tdsa,$hlv,$tdsb,$sgs,$ars,$prs);}

printf("</table></div>");
}



}

?>
