///////////////////// Open Databimaase ////////////////////
$con=mysqli_connect("localhost","5starman","Saphire777!","freeadform");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if($_POST['starkey']==''){$starkey=$_GET['starkey'];}else{$starkey=$_POST['starkey'];}
$username='launch';
$city='Carrollwood';
$lat='28.0186';
$lon=-'82.1129';
$size='6x11';
$number='1000';
$choice='on';
$vdp='no';
$bydesign='0';
$target1='homes';
$target2='apts';
$startlocation='Carrollwood, FL';
$payperpiece=.15;
if($_POST['acquisitionrate']==''){$acquisitionrate=2;}
if($_POST['share']==''){$share=.5;}
if($_POST['clv']==''){$clv=3300;}
date_default_timezone_set("America/New_York");
$date=date_create();
$submittime = date_timestamp_get($date);
mysqli_query($con,"UPDATE 5startracking SET officecheckin ='$submittime'
WHERE starkey = '$starkey' AND officecheckin=''");
if($_POST['calculator']!='results' AND $_POST['roicalculator']!='results')
{$result = mysqli_query($con,"SELECT * FROM 5startracking
WHERE starkey='$starkey' AND officecheckin!=''");
while($row = mysqli_fetch_array($result))
{
$officevisit=$row['officevisit']+1;
$officecheckinlast=$submittime;
}
mysqli_query($con,"UPDATE 5startracking SET officecheckinlast ='$officecheckinlast', officevisit ='$officevisit'
WHERE starkey = '$starkey' AND officecheckin!=''");
}
mysqli_query($con,"UPDATE 5startracking SET status ='3'
WHERE starkey = '$starkey' AND status<=2");
mysqli_query($con,"UPDATE 5starcontactstemp SET status='3'
WHERE starkey = '$starkey' AND status<=2");
mysqli_query($con,"UPDATE 5starcontacts SET status='3'
WHERE starkey = '$starkey' AND status<=2");
?>
if($_POST['media']!=''){?>
This Medium Cannot be Reached Without an Authorized Starkey;}
///////////////////// Menu - Postcards //////////////////// ?>
RESEARCH
PRINTERS
PARTNERS
TOOLS
Postcard Rates
|
6" X 9" |
6" X 11" |
Printer |
500 |
1000 |
2500 |
10000 |
500 |
1000 |
2500 |
10000 |
Gloss |
Proof |
16 pt |
Shipping |
Design |
$sumi1=0;
$sumi2=0;
$sumi3=0;
$sumi35=0;
$sumi4=0;
$sumi5=0;
$sumi6=0;
$sumi65=0;
$sumi7=0;
$sumi8=0;
$sumi9=0;
$sumi10=0;
$sumi11=0;
$p5006x9=0;
$p5006x11=0;
$postcard6x9sum=0;
$postcard6x11sum=0;
$p25006x9=0;
$p25006x11=0;
$p100006x9=0;
$p100006x11=0;
$glosssum=0;
$proofsum=0;
$pt16sum=0;
$deliverysum=0;
$designsum=0;
$vdp=0;
$choice=0;
$result = mysqli_query($con,"SELECT * FROM 5starprintcostsarchive");
while($row = mysqli_fetch_array($result))
{
if($row['indext']==1){
$printerii=$row['printer'];
$postcard6x9ii=$row['postcard6x9'];
$postcard6x11ii=$row['postcard6x11'];
$p5006x9ii=$row['p5006x9'];
$p5006x11ii=$row['p5006x11'];
$p25006x9ii=$row['p25006x9'];
$p25006x11ii=$row['p25006x11'];
$p100006x9ii=$row['p100006x9'];
$p100006x11ii=$row['p100006x11'];
$glossii=$row['gloss'];
$proofii=$row['proof'];
$pt16ii=$row['pt16'];
$deliveryii=$row['delivery'];
$designii=$row['design'];
?>
echo $printerii;?> |
echo $p5006x9ii;?> |
echo $postcard6x9ii;?> |
echo $p25006x9ii;?> |
echo $p100006x9ii;?> |
echo $p5006x11ii;?> |
echo $postcard6x11ii;?> |
echo $p25006x11ii;?> |
echo $p100006x11ii;?> |
echo $glossii;?> |
echo $proofii;?> |
echo $pt16ii;?> |
echo $deliveryii;?> |
echo $designii;?> |
;}
else{
$printer=$row['printer'];
$p5006x9=$row['p5006x9'];if($p5006x9>=1){$sumi1++;}
$p5006x11=$row['p5006x11'];if($p5006x11>=1){$sumi2++;}
$postcard6x9=$row['postcard6x9'];if($postcard6x9>=1){$sumi3++;}
$postcard6x11=$row['postcard6x11'];if($postcard6x11>=1){$sumi4++;}
$p25006x9=$row['p25006x9'];if($p25006x9>=1){$sumi5++;}
$p25006x11=$row['p25006x11'];if($p25006x11>=1){$sumi6++;}
$p100006x9=$row['p100006x9'];if($p100006x9>=1){$sumi35++;}
$p100006x11=$row['p100006x11'];if($p100006x11>=1){$sumi65++;}
$gloss=$row['gloss'];if($gloss>=1){$sumi7++;}
$proof=$row['proof'];if($proof>=1){$sumi8++;}
$pt16=$row['pt16'];if($pt16>=1){$sumi9++;}
$delivery=$row['delivery'];if($delivery>=1){$sumi10++;}
$design=$row['design'];if($design>=1){$sumi11++;}
$p5006x9sum=$p5006x9sum+$p5006x9;
$p5006x11sum=$p5006x11sum+$p5006x11;
$postcard6x9sum=$postcard6x9sum+$postcard6x9;
$postcard6x11sum=$postcard6x11sum+$postcard6x11;
$p25006x9sum=$p25006x9sum+$p25006x9;
$p25006x11sum=$p25006x11sum+$p25006x11;
$p100006x9sum=$p100006x9sum+$p100006x9;
$p100006x11sum=$p100006x11sum+$p100006x11;
$glosssum=$glosssum+$gloss;
$proofsum=$proofsum+$proof;
$pt16sum=$pt16sum+$pt16;
$deliverysum=$deliverysum+$delivery;
$designsum=$designsum+$design;
?>
echo $printer;?> |
echo $p5006x9;?> |
echo $postcard6x9;?> |
echo $p25006x9;?> |
echo $p100006x9;?> |
echo $p5006x11;?> |
echo $postcard6x11;?> |
echo $p25006x11;?> |
echo $p100006x11;?> |
echo $gloss;?> |
echo $proof;?> |
echo $pt16;?> |
echo $delivery;?> |
echo $design;?> |
;}}?>
AVERAGES |
echo $data1=ceil($p5006x9sum/$sumi1);?> |
echo $data2=ceil($postcard6x9sum/$sumi3);?> |
echo $data3=ceil($p25006x9sum/$sumi5);?> |
echo $data35=ceil($p100006x9sum/$sumi35);?> |
echo $data4=ceil($p5006x11sum/$sumi2);?> |
echo $data5=ceil($postcard6x11sum/$sumi4);?> |
echo $data6=ceil($p25006x11sum/$sumi6);?> |
echo $data65=ceil($p100006x11sum/$sumi65);?> |
echo $data7=ceil($glosssum/$sumi7);?> |
echo $data8=ceil($proofsum/$sumi8);?> |
echo $data9=ceil($pt16sum/$sumi9);?> |
echo $data10=ceil($deliverysum/$sumi10);?> |
echo $data11=ceil($designsum/$sumi11);?> |
if($_POST['calculator']=='results' OR $_POST['roicalculator']=='results')
{
$startlocation=$_POST['startlocation'];
$size=$_POST['size'];
$number=$_POST['number'];
$extras1=$_POST['extras1'];
$extras2=$_POST['extras2'];
$extras3=$_POST['extras3'];
$target1=$_POST['target1'];
$target2=$_POST['target2'];
$target3=$_POST['target3'];
$payperpiece=$_POST['payperpiece'];
$bydesign=$_POST['bydesign'];
$vdp=$_POST['vdp'];
$choice=$_POST['choice'];
}
date_default_timezone_set("America/New_York");
$date=date_create();
$submittime = date_timestamp_get($date);
?>
if($size=='6x9' AND $number=='500'){$flyercost=$data1;}
if($size=='6x9' AND $number=='1000'){$flyercost=$data2;}
if($size=='6x9' AND $number=='2500'){$flyercost=$data3;}
if($size=='6x9' AND $number=='10000'){$flyercost=$data35;}
if($size=='6x11' AND $number=='500'){$flyercost=$data4;}
if($size=='6x11' AND $number=='1000'){$flyercost=$data5;}
if($size=='6x11' AND $number=='2500'){$flyercost=$data6;}
if($size=='6x11' AND $number=='10000'){$flyercost=$data65;}
if($extras1==''){$data7=0;}
if($extras2==''){$data8=0;}
if($extras3==''){$data9=0;}
if($_POST['calculator']=='results')
{
if($vdp=='yes'){
if($size=='6x9' AND $number=='500'){$flyercost=0;}
if($size=='6x9' AND $number=='1000'){$flyercost=190;}
if($size=='6x9' AND $number=='2500'){$flyercost=0;}
if($size=='6x9' AND $number=='10000'){$flyercost=950;}
if($size=='6x11' AND $number=='500'){$flyercost=0;}
if($size=='6x11' AND $number=='1000'){$flyercost=255;}
if($size=='6x11' AND $number=='2500'){$flyercost=0;}
if($size=='6x11' AND $number=='10000'){$flyercost=987;}
$extras1cost=0;
$extras2cost=0;
$extras3cost=0;
$extracost=0;
$shippingcost=0;
$setupcost=0;
$printingcost=$flyercost+$extracost+$shippingcost+$setupcost;
$deliverycost=$number*$payperpiece;
$totalcost=$printingcost+$deliverycost;
}
else if($choice=='on'){
if($size=='6x9' AND $number=='500'){$flyercost=$p5006x9ii;}
if($size=='6x9' AND $number=='1000'){$flyercost=$postcard6x9ii;}
if($size=='6x9' AND $number=='2500'){$flyercost=$p25006x9ii;}
if($size=='6x9' AND $number=='10000'){$flyercost=$p100006x9ii;}
if($size=='6x11' AND $number=='500'){$flyercost=$p5006x11ii;}
if($size=='6x11' AND $number=='1000'){$flyercost=$postcard6x11ii;}
if($size=='6x11' AND $number=='2500'){$flyercost=$p25006x11ii;}
if($size=='6x11' AND $number=='10000'){$flyercost=$p100006x11ii;}
$extras1cost=$glossii;
$extras2cost=$proofii;
$extras3cost=$pt16ii;
$extracost=$glossii+$proofii+$pt16ii;
$shippingcost=$deliveryii;
$setupcost=$designii*$bydesign;
$printingcost=$flyercost+$extracost+$shippingcost+$setupcost;
$deliverycost=$number*$payperpiece;
$totalcost=$printingcost+$deliverycost;
}
else{
$extras1cost=$data7;
$extras2cost=$data8;
$extras3cost=$data9;
$extracost=$data7+$data8+$data9;
$shippingcost=$data10;
$setupcost=$data11*$bydesign;
$printingcost=$flyercost+$extracost+$shippingcost+$setupcost;
$deliverycost=$number*$payperpiece;
$totalcost=$printingcost+$deliverycost;
$setupcost=$data11*$bydesign;}
?>
Investimate:
echo $number.' '.$size.' postcards: $'.$flyercost.'
';
if ($extras1!=''){echo $extras1.': $'.$extras1cost.'
';}
if ($extras2!=''){echo $extras2.': $'.$extras2cost.'
';}
if ($extras3!=''){echo $extras3.': $'.$extras3cost.'
';}
echo 'Shipping: $'.$shippingcost.'
';
if ($bydesign!=''){echo 'setup and design: $'.$setupcost.'
';}
echo 'Delivery to ';
if($target1!='' AND $target2=='' AND $target3==''){echo 'homes: $'.$deliverycost.'
';}
if($target1!='' AND $target2!='' AND $target3==''){echo 'homes and apartments: $'.$deliverycost.'
';}
if($target1!='' AND $target2=='' AND $target3!=''){echo 'homes and businesses- $'.$deliverycost.'
';}
if($target1!='' AND $target2!='' AND $target3!=''){echo 'homes, apartments and businesses: $'.$deliverycost.'
';}
if($target1=='' AND $target2!='' AND $target3==''){echo 'apartments: $'.$deliverycost.'
';}
if($target1=='' AND $target2=='' AND $target3!=''){echo 'businesses: $'.$deliverycost.'
';}
if($target1=='' AND $target2!='' AND $target3!=''){echo 'apartments and businesses: $'.$deliverycost.'
';}
?>
mysqli_query($con,"UPDATE 5startracking SET submittime ='$submittime', startlocation ='$startlocation', payperpiece ='$payperpiece', size ='$size', target1 ='$target1', target2 ='$target2', target3 ='$target3', number ='$number', bydesign ='$bydesign', vdp ='$vdp', choice ='$choice', flyercost ='$flyercost', extras1 ='$extras1', extras2 ='$extras2', extras3 ='$extras3', extras1cost ='$extras1cost', extras2cost ='$extras2cost', extras3cost ='$extras3cost', printingcost ='$printingcost', deliverycost ='$deliverycost', totalcost ='$totalcost', extracost ='$extracost', shippingcost ='$shippingcost', setupcost ='$setupcost', status='4'
WHERE starkey = '$starkey'");
mysqli_query($con,"UPDATE 5startracking SET status ='4'
WHERE starkey = '$starkey' AND status<=3");
mysqli_query($con,"UPDATE 5starcontactstemp SET status='4'
WHERE starkey = '$starkey' AND status<=3");
mysqli_query($con,"UPDATE 5starcontacts SET status='4'
WHERE starkey = '$starkey' AND status<=3");
$result = mysqli_query($con,"SELECT * FROM 5startracking
WHERE starkey='$starkey'");
while($row = mysqli_fetch_array($result))
{
$phoneclean=$row['phoneclean'];
$cell=$row['cell'];
}
mysqli_query($con,"INSERT INTO 5startrackingcalculatorentry (starkey, phoneclean, cell, submittime, startlocation, payperpiece, size, target1, target2, target3, number, bydesign, vdp, choice, flyercost, extras1, extras2, extras3, extras1cost, extras2cost, extras3cost, extracost, shippingcost, setupcost, printingcost, deliverycost, totalcost, acquisitionrate, share, clv, formentry)
VALUES('$starkey', '$phoneclean', '$cell', '$submittime', '$startlocation', '$payperpiece', '$size', '$target1', '$target2', '$target3', '$number', '$bydesign', '$vdp', '$choice', '$flyercost', '$extras1', '$extras2', '$extras3', '$extras1cost', '$extras2cost', '$extras3cost', '$extracost', '$shippingcost', '$setupcost', '$printingcost', '$deliverycost', '$totalcost', '$acquisitionrate', '$share', '$clv', '$formentry')");
$result = mysqli_query($con,"SELECT * FROM 5startracking
WHERE starkey='$starkey'");
while($row = mysqli_fetch_array($result))
{
$formentrycalc=$row['formentrycalc']+1;
}
mysqli_query($con,"UPDATE 5startracking SET formentrycalc ='$formentrycalc'
WHERE starkey = '$starkey'");
?>
;}
if($_POST['roicalculator']=='results')
{
$acquisitionrate=$_POST['acquisitionrate'];
$share=$_POST['share'];
$clv=$_POST['clv'];
$totalcost=$_POST['totalcost'];
$net= $acquisitionrate*$clv*$number/100;
$totalinvestment=$totalcost*$share;
$roi=($net-$investment)/$investment;
}
else
{
$totalinvestment=$totalcost*$share;
$net= $acquisitionrate*$clv*$number/100;
$totalinvestment=$totalcost*$share;
$roi=($net-$investment)/$investment;
}?>
Target ROI:
$number=$_POST['number'];
if($number==''){$number=1000;}
echo 'Number of Pieces: '.$number.'
';;
echo 'Estimated Net Return: $'.$net.'
';
echo 'Personal Investment: $'.$totalinvestment.'
';
$roi=floor(($net-$totalinvestment)*100/$totalinvestment);
?> echo 'Estimated Return on Investment: '.($roi).' %';?>
if($_POST['roicalculator']=='results')
{
$result = mysqli_query($con,"SELECT * FROM 5startracking
WHERE starkey='$starkey'");
while($row = mysqli_fetch_array($result))
{
$phoneclean=$row['phoneclean'];
$cell=$row['cell'];
}
mysqli_query($con,"UPDATE 5startracking SET starkey ='$starkey', phoneclean ='$phoneclean', cell ='$cell', acquisitionrate ='$acquisitionrate', share ='$share', clv ='$clv', totalinvestment ='$totalinvestment', roi ='$roi'
WHERE starkey = '$starkey' ");
mysqli_query($con,"UPDATE 5startracking SET status ='4'
WHERE starkey = '$starkey' AND status<=3");
mysqli_query($con,"UPDATE 5starcontactstemp SET status='4'
WHERE starkey = '$starkey' AND status<=3");
mysqli_query($con,"UPDATE 5starcontacts SET status='4'
WHERE starkey = '$starkey' AND status<=3");
mysqli_query($con,"INSERT INTO 5startrackingcalculateroi (starkey, phoneclean, cell, acquisitionrate, share, clv, totalinvestment, roi, submittime)
VALUES('$starkey', '$phoneclean', '$cell', '$acquisitionrate', '$share', '$clv', '$totalinvestment', '$roi', '$submittime')");
$result = mysqli_query($con,"SELECT * FROM 5startracking
WHERE starkey='$starkey'");
while($row = mysqli_fetch_array($result))
{
$formentryroi=$row['formentryroi']+1;
}
mysqli_query($con,"UPDATE 5startracking SET formentryroi ='$formentryroi'
WHERE starkey = '$starkey'");
}
?>