Skip to content

Instantly share code, notes, and snippets.

@tmking
Created July 7, 2009 00:57
Show Gist options
  • Save tmking/141798 to your computer and use it in GitHub Desktop.
Save tmking/141798 to your computer and use it in GitHub Desktop.
<?
if($_SESSION[q8_answer] == "A" && $_SESSION[qANDa][9] == 41){
$qanda_result = "Decorator Vertical 3 price points\n";
$qanda_result .= "DAP Vertical 3 price points";
$result_location = "/find/decor_dap_vert_pianos.php?dap=1";
}else if($_SESSION[q8_answer] == "A" && $_SESSION[qANDa][9] == 42){
$qanda_result = "Decorator Vertical 3 price points\n";
$qanda_result .= "DAP Vertical 3 price points";
$result_location = "/find/decor_dap_grandvert_pianos.php?dap=1";
}else if($_SESSION[q8_answer] == "A" && $_SESSION[qANDa][9] == 43){
$qanda_result = "Decorator Vertical 3 price points\n";
$qanda_result .= "DAP Vertical 3 price points";
$result_location = "/find/decor_dap_grand_pianos.php?dap=1";
}else if($_SESSION[q8_answer] == "B" && $_SESSION[qANDa][9] == 54){
if($_SESSION[qANDa][11] == 57){
if($_SESSION[qANDa][12] == 60){
$qanda_result = "Decorator Vertical 3 price points";
$result_location = "/find/decor_dap_vert_pianos.php";
}else if($_SESSION[qANDa][12] == 61){
$qanda_result = "Decorator Vertical 3 price points";
$result_location = "/find/decor_dap_vert_pianos.php";
}else if($_SESSION[qANDa][12] == 62){
$qanda_result = "Decorator Vertical 3 price points";
$result_location = "/find/decor_dap_vert_pianos.php";
}
}else if($_SESSION[qANDa][11] == 58){
if($_SESSION[qANDa][12] == 60){
$qanda_result = "Digital Vert & Decorator Vertical 3 price points";
$result_location = "/find/digvert_decor_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 61){
$qanda_result = "Decorator Vertical 3 price points";
$result_location = "/find/decor_dap_vert_pianos.php";
}else if($_SESSION[qANDa][12] == 62){
$qanda_result = "Decorator Vertical 3 price points";
$result_location = "/find/decor_dap_vert_pianos.php";
}
}else if($_SESSION[qANDa][11] == 59){
if($_SESSION[qANDa][12] == 60){
$qanda_result = "Digital Vertical 3 price points";
$result_location = "/find/digvert_pianos.php";
}else if($_SESSION[qANDa][12] == 61){
$qanda_result = "Digital Vertical 3 price points";
$result_location = "/find/digvert_pianos.php";
}else if($_SESSION[qANDa][12] == 62){
$qanda_result = "Vertical 3 price points";
$result_location = "/find/vertical_pianos.php";
}
}
}else if($_SESSION[q8_answer] == "B" && $_SESSION[qANDa][9] == 55){
if($_SESSION[qANDa][11] == 57){
if($_SESSION[qANDa][12] == 60){
$qanda_result = "DAP Grand & Grand (small) 3pp";
$result_location = "/find/grand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 61){
$qanda_result = "DAP Grand & Grand (small) 3pp";
$result_location = "/find/grand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 62){
$qanda_result = "Decorator Grand (small) & Decorator Vert 3 pp";
$result_location = "/find/grand_pianos.php";
}
}else if($_SESSION[qANDa][11] == 58){
if($_SESSION[qANDa][12] == 60){
$qanda_result = "DAP Grand (small) & Digital Grand 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 61){
$qanda_result = "DAP Grand (small) & Digital Grand 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 62){
$qanda_result = "Decorator Grand (small) & Vertical 3 pp";
$result_location = "/find/grand_pianos.php";
}
}else if($_SESSION[qANDa][11] == 59){
if($_SESSION[qANDa][12] == 60){
$qanda_result = "Digital Grand (small) & DAP Grand (small) 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 61){
$qanda_result = "Digital Grand (small) & DAP Grand (small) 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 62){
$qanda_result = "Grand (small) & Vertical 3pp";
$result_location = "/find/grand_vertical_pianos.php";
}
}
}else if($_SESSION[q8_answer] == "B" && $_SESSION[qANDa][9] == 56){
if($_SESSION[qANDa][11] == 57){
if($_SESSION[qANDa][12] == 60){
$qanda_result = "Decorator DAP Grand 3pp";
$result_location = "/find/decor_dap_grand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 61){
$qanda_result = "Decorator DAP Grand 3pp";
$result_location = "/find/decor_dap_grand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 62){
$qanda_result = "Decorator Grand 3pp";
$result_location = "/find/decor_dap_grand_pianos.php";
}
}else if($_SESSION[qANDa][11] == 58){
if($_SESSION[qANDa][12] == 60){
$qanda_result = "Decorator DAP Grand 3pp";
$result_location = "/find/decor_dap_grand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 61){
$qanda_result = "Decorator DAP Grand 3pp";
$result_location = "/find/decor_dap_grand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 62){
$qanda_result = "Decorator Grand 3pp";
$result_location = "/find/decor_dap_grand_pianos.php";
}
}else if($_SESSION[qANDa][11] == 59){
if($_SESSION[qANDa][12] == 60){
$qanda_result = "DAP Grand or Digital Grand 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 61){
$qanda_result = "DAP Grand or Digital Grand 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}else if($_SESSION[qANDa][12] == 62){
$qanda_result = "Grand 3pp";
$result_location = "/find/grand_pianos.php";
}
}
}else if($_SESSION[q8_answer] == "C" && $_SESSION[qANDa][13] == 69){
$qanda_result = "Grand at 3pp";
$result_location = "/find/grand_pianos.php";
}else if($_SESSION[q8_answer] == "C" && $_SESSION[qANDa][13] == 70){
$qanda_result = "Vertical at 3pp";
$result_location = "/find/vertical_pianos.php";
}else if($_SESSION[q8_answer] == "C" && $_SESSION[qANDa][13] == 71){
$qanda_result = "Digital Grand at 3pp";
$result_location = "/find/diggrand_pianos.php";
}else if($_SESSION[q8_answer] == "C" && $_SESSION[qANDa][13] == 72){
$qanda_result = "Digital Keyboard at 3pp";
$result_location = "/find/digvert_pianos.php?dap=1";
}else if($_SESSION[q8_answer] == "D" && $_SESSION[qANDa][11] == 83){
if($_SESSION[qANDa][12] == 86){
if($_SESSION[qANDa][9] == 89){
$qanda_result = "Decorator DAP Vert & Digital Vert 3pp";
$result_location = "/find/digvert_decor_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 90){
$qanda_result = "Decorator DAPV, Decorator DAPG 3pp";
$result_location = "/find/decor_dap_grandvert_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 91){
$qanda_result = "Decorator DAPG, Digital Grand 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}
}else if($_SESSION[qANDa][12] == 87){
if($_SESSION[qANDa][9] == 89){
$qanda_result = "Decorator DAP Vert & Digital Vert 3pp";
$result_location = "/find/digvert_decor_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 90){
$qanda_result = "Decorator DAPV, Decorator DAPG 3pp";
$result_location = "/find/decor_dap_grandvert_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 91){
$qanda_result = "Decorator DAPG, Digital Grand 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}
}else if($_SESSION[qANDa][12] == 88){
if($_SESSION[qANDa][9] == 89){
$qanda_result = "Decorator DAP Vert & Digital Vert 3pp";
$result_location = "/find/digvert_decor_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 90){
$qanda_result = "Decorator DAPV & Decorator DAPG 3pp";
$result_location = "/find/decor_dap_grandvert_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 91){
$qanda_result = "Decorator DAPG 3pp";
$result_location = "/find/decor_dap_grand_pianos.php?dap=1";
}
}
}else if($_SESSION[q8_answer] == "D" && $_SESSION[qANDa][11] == 84){
if($_SESSION[qANDa][12] == 86){
if($_SESSION[qANDa][9] == 89){
$qanda_result = "Digital Vertical & DAPV 3pp";
$result_location = "/find/digvert_decor_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 90){
$qanda_result = "DAPG (small) & DAPV & Digital Ensemble 3pp";
$result_location = "/find/dagp_dapv_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 91){
$qanda_result = "Digital Grand & DAPG 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}
}else if($_SESSION[qANDa][12] == 87){
if($_SESSION[qANDa][9] == 89){
$qanda_result = "Digital Vertical & DAPV 3pp";
$result_location = "/find/digvert_decor_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 90){
$qanda_result = "DAPG (small) & DAPV & Digital Ensemble 3pp";
$result_location = "/find/dagp_dapv_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 91){
$qanda_result = "Digital Grand & DAPG 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}
}else if($_SESSION[qANDa][12] == 88){
if($_SESSION[qANDa][9] == 89){
$qanda_result = "DAPV 3pp";
$result_location = "/find/decor_dap_vert_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 90){
$qanda_result = "DAPV & DAPG 3pp";
$result_location = "/find/decor_dap_grandvert_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 91){
$qanda_result = "DAPG 3pp";
$result_location = "/find/grand_pianos.php?dap=1";
}
}
}else if($_SESSION[q8_answer] == "D" && $_SESSION[qANDa][11] == 85){
if($_SESSION[qANDa][12] == 86){
if($_SESSION[qANDa][9] == 89){
$qanda_result = "DAPV or Digital Vert 3pp";
$result_location = "/find/digvert_decor_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 90){
$qanda_result = "DAPG (small) or Digital Grand 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 91){
$qanda_result = "DAPG or Digital Grand 3pp";
$result_location = "/find/2grand_1digpianos.php?dap=1";
}
}else if($_SESSION[qANDa][12] == 87){
if($_SESSION[qANDa][9] == 89){
$qanda_result = "Digital Vert & DAPV 3pp";
$result_location = "/find/digvert_decor_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 90){
$qanda_result = "DAPG (small) & DAPV 3pp";
$result_location = "/find/dagp_dapv_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 91){
$qanda_result = "Digital Grand & DAPG 3pp";
$result_location = "/find/dap_diggrand_pianos.php?dap=1";
}
}else if($_SESSION[qANDa][12] == 88){
if($_SESSION[qANDa][9] == 89){
$qanda_result = "DAPV 3pp";
$result_location = "/find/decor_dap_grandvert_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 90){
$qanda_result = "DAPV & DAPG 3pp";
$result_location = "/find/decor_dap_grandvert_pianos.php?dap=1";
}else if($_SESSION[qANDa][9] == 91){
$qanda_result = "DAPG 3pp";
$result_location = "/find/grand_pianos.php?dap=1";
}
}
}
$qanda_string = "";
$qanda_array = $_SESSION[qANDa];
foreach($qanda_array as $key => $val){
$sel_q_name = "select question from question where question_id = '$key'";
$sel_q_res = mysql_query($sel_q_name) or die(mysql_error());
$sel_q_str = mysql_fetch_array($sel_q_res);
$sel_a_name = "select answer_val from answer where answer_id = '$val'";
$sel_a_res = mysql_query($sel_a_name) or die(mysql_error());
$sel_a_str = mysql_fetch_array($sel_a_res);
$qanda_string .= $sel_q_str[question] . "\n" . $sel_a_str[answer_val] ."\n\n";
}?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment