Sunday, April 17, 2011

hold on ... even better


if($level=="Level 1" && $month=="Month 1")
{
$newLevel="Level 1";
$newMonth="Month 2";
}
else if($level=="Level 1" && $month=="Month 2")
{
$newLevel="Level 1";
$newMonth="Month 3";
}
else if($level=="Level 1" && $month=="Month 3")
{
$newLevel="Level 1";
$newMonth="Month 4";
}
else if($level=="Level 1" && $month=="Month 4")
{
$newLevel="Level 1";
$newMonth="Month 5";
}
else if($level=="Level 1" && $month=="Month 5")
{
$newLevel="Level 1";
$newMonth="Month 6";
}
else if($level=="Level 1" && $month=="Month 6")
{
$newLevel="Level 2";
$newMonth="Month 1";
}
else if($level=="Level 2" && $month=="Month 1")
{
$newLevel="Level 2";
$newMonth="Month 2";
}
else if($level=="Level 2" && $month=="Month 2")
{
$newLevel="Level 2";
$newMonth="Month 3";
}
else if($level=="Level 2" && $month=="Month 3")
{
$newLevel="Level 2";
$newMonth="Month 4";
}
else if($level=="Level 2" && $month=="Month 4")
{
$newLevel="Level 2";
$newMonth="Month 5";
}
else if($level=="Level 2" && $month=="Month 5")
{
$newLevel="Level 2";
$newMonth="Month 6";
}
else if($level=="Level 2" && $month=="Month 6")
{
$newLevel="Level 3";
$newMonth="Month 1";
}
else if($level=="Level 3" && $month=="Month 1")
{
$newLevel="Level 3";
$newMonth="Month 2";
}
else if($level=="Level 3" && $month=="Month 2")
{
$newLevel="Level 3";
$newMonth="Month 3";
}
else if($level=="Level 3" && $month=="Month 3")
{
$newLevel="Level 3";
$newMonth="Month 4";
}
else if($level=="Level 3" && $month=="Month 4")
{
$newLevel="Level 3";
$newMonth="Month 5";
}
else if($level=="Level 3" && $month=="Month 5")
{
$newLevel="Level 3";
$newMonth="Month 6";
}
else if($level=="Level 3" && $month=="Month 6")
{
$newLevel="Level 4";
$newMonth="Month 1";
}
else if($level=="Level 4" && $month=="Month 1")
{
$newLevel="Level 4";
$newMonth="Month 2";
}
else if($level=="Level 4" && $month=="Month 2")
{
$newLevel="Level 4";
$newMonth="Month 3";
}
else if($level=="Level 4" && $month=="Month 3")
{
$newLevel="Level 4";
$newMonth="Month 4";
}
else if($level=="Level 4" && $month=="Month 4")
{
$newLevel="Level 4";
$newMonth="Month 5";
}
else if($level=="Level 4" && $month=="Month 5")
{
$newLevel="Level 4";
$newMonth="Month 6";
}


That must have taken like days or something ... I don't know if the programmer even knew about the advanced "copy" and "paste" concepts.

Saturday, April 16, 2011

wait wait

I can top that (below)



switch($month)
{
case'1':
$date = calculateenddate(1,$weakly,7,$unixtime);
break;
case '2':
$date = calculateenddate(2,$weakly,7,$unixtime);
break;
case '3':
$date = calculateenddate(3,$weakly,7,$unixtime);
break;
case '4':
$date = calculateenddate(4,$weakly,7,$unixtime);
break;
case '5':
$date = calculateenddate(5,$weakly,7,$unixtime);
break;
case '6':
$date = calculateenddate(6,$weakly,7,$unixtime);
break;
case '7':
$date = calculateenddate(7,$weakly,7,$unixtime);
break;
case '8':
$date = calculateenddate(8,$weakly,7,$unixtime);
break;
case '9':
$date = calculateenddate(9,$weakly,7,$unixtime);
break;
case '10':
$date = calculateenddate(10,$weakly,7,$unixtime);
break;
case '11':
$date = calculateenddate(11,$weakly,7,$unixtime);
break;
case '12':
$date = calculateenddate(12,$weakly,7,$unixtime);
}
return $date;

What is a loop?


function duedates($programStartDate, $month, $request) {
if ($request == "accelarate")
{
$weakcycle = '2';
}
else if ($request == "deaccelerate")
{
$weakcycle = '4';
}
else
{
$weakcycle = '4';
}
$db = new databasemanager();
$unixtime = strtotime($programStartDate);

switch($month)
{
case'2':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
break;
case'3':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
break;
case'4':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
break;
case '5':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
break;
case '6':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
break;
case '7':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
break;
case '8':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
break;
case '9':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
$date[] = calculateenddate(8,$weakcycle,7,$unixtime);
break;
case '10':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
$date[] = calculateenddate(8,$weakcycle,7,$unixtime);
$date[] = calculateenddate(9,$weakcycle,7,$unixtime);
break;
case '11':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
$date[] = calculateenddate(8,$weakcycle,7,$unixtime);
$date[] = calculateenddate(9,$weakcycle,7,$unixtime);
$date[] = calculateenddate(10,$weakcycle,7,$unixtime);
break;
case '12':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
$date[] = calculateenddate(8,$weakcycle,7,$unixtime);
$date[] = calculateenddate(9,$weakcycle,7,$unixtime);
$date[] = calculateenddate(10,$weakcycle,7,$unixtime);
$date[] = calculateenddate(11,$weakcycle,7,$unixtime);
break;
}
return $date;
}



... Solid Gold I tell you ... solid gold ....

Sunday, April 10, 2011

horrible css today


<div class="heading18 width250 brdrbtm padbtm_10">Search for
Trainings</div>
<div class="gr10New width250 pad_top">
<strong class="bluetext11">
Search for Upcoming Teacher Training Programs
</strong></div>
<div class="pad_b3 width250 pad_top"><strong>Select Level:</strong></div>

Now look what you did; you broke the internet.

Horrible SQL


$db->query("delete from email_campain_settings where UserID='".$_POST['objID']."' and
TagValue='Active' and TagID='free' ");
$db->query("delete from email_campain_settings where UserID='".$_POST['objID']."' and
TagValue='Active' and TagID='paid' ");
$db->query("delete from email_campain_settings where UserID='".$_POST['objID']."' and
TagValue='Active' and TagID='GOLD' ");
$db->query("delete from email_campain_settings where UserID='".$_POST['objID']."' and
TagValue='Active' and TagID='SILVER' ");
$db->query("delete from email_campain_settings where UserID='".$_POST['objID']."' and
TagValue='Active' and TagID='PLATINUM' ");


Fantastic. Just go home, ok?

Friday, April 8, 2011

Javascript Database

Throwing my hat into this one: A Generic Javascript Database for all.

Followers