<?php
require_once("C:/xampp/php/ext/phpchartdir.php");
$con = mysql_connect("localhost:3306","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mygraphs", $con);
$w=0;
//$year='2010';
$month='April';
$k=0;
$ab=0;
$v=1;
Do{
switch($v){
case 1:
$d1="Select Variable From factor Where FactorName='Economy' AND Year='2010' AND Month= '$month'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Economy' AND Year='2010' AND Month= '$month'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length =$row['c'];
//echo $ar_length;
break;
case 2:
$d1="Select Variable From factor Where FactorName='HealthyLifestyle' AND Year='2010' AND Month= '$month'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='HealthyLifestyle' AND Year='2010' AND Month= '$month'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length =$row['c'];
// echo "cccccc" ;
// echo $ar_length;
break;
case 3:
$d1="Select Variable From factor Where FactorName='Urban Growth' AND Year='2010' AND Month= '$month'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Urban Growth' AND Year='2010' AND Month= '$month'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length =$row['c'];
// echo "cccccc" ;
//echo $ar_length;
break;
case 4:
$d1="Select Variable From factor Where FactorName='Transport' AND Year='2010' AND Month= '$month'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Transport' AND Year='2010' AND Month= '$month'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length =$row['c'];
// echo "cccccc" ;
// echo $ar_length;
break;
case 5:
$d1="Select Variable From factor Where FactorName='Crime & Safety' AND Year='2010' AND Month= '$month'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Crime & Safety' AND Year='2010' AND Month= '$month'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length =$row['c'];
// echo "cccccc" ;
// echo $ar_length;
break;
case 6:
$d1="Select Variable From factor Where FactorName='Commiunity ' AND Year='2010' AND Month= '$month'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Commiunity ' AND Year='2010' AND Month= '$month'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length =$row['c'];
// echo "cccccc" ;
//echo $ar_length;
break;
case 7:
$d1="Select Variable From factor Where FactorName='Environment' AND Year='2010' AND Month= '$month'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Environment' AND Year='2010' AND Month= '$month'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length =$row['c'];
// echo "cccccc" ;
// echo $ar_length;
break;
case 8:
$d1="Select Variable From factor Where FactorName='Education' AND Year='2010' AND Month= '$month'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Education' AND Year='2010' AND Month= '$month'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length =$row['c'];
// echo "cccccc" ;
// echo $ar_length;
break;
case 9:
$d1="Select Variable From factor Where FactorName='Health' AND Year='2010' AND Month= '$month'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Health' AND Year='2010' AND Month= '$month'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length =$row['c'];
// echo "cccccc" ;
//echo $ar_length;
break;
} //end sw
// $sum = 0;
while($row = mysql_fetch_array($rd1))
{
$f = $row['Variable'] ;
//******************************************************************
switch($f){
case q2_1:
$d2 = mysql_query("Select AVG(Q2_1) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
//$e1[]=$array;
break;
case q2_2:
$d2 = mysql_query("Select AVG(Q2_2) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_3:
$d2=mysql_query("Select AVG(Q2_3) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
break;
case q2_4:
$d2=mysql_query("Select AVG(Q2_4) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
break;
case q2_5:
$d2=mysql_query("Select AVG(Q2_5) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
break;
case q2_6:
$d2=mysql_query("Select AVG(Q2_6) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
break;
case q2_7:
$d2=mysql_query("Select AVG(Q2_7) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_8:
$d2=mysql_query("Select AVG(Q2_8) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_9:
$d2=mysql_query("Select AVG(Q2_9) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_10:
$d2=mysql_query("Select AVG(Q2_10) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_11:
$d2=mysql_query("Select AVG(Q2_11) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_12:
$d2=mysql_query("Select AVG(Q2_12) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_13:
$d2=mysql_query("Select AVG(Q2_13) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_14:
$d2=mysql_query("Select AVG(Q2_14) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_15:
$d2=mysql_query("Select AVG(Q2_15) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_16:
$d2=mysql_query("Select AVG(Q2_16) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_17:
$d2=mysql_query("Select AVG(Q2_17) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_18:
$d2=mysql_query("Select AVG(Q2_18) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_19:
$d2=mysql_query("Select AVG(Q2_19) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_20:
$d2=mysql_query("Select AVG(Q2_20) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_21:
$d2=mysql_query("Select AVG(Q2_21) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_22:
$d2=mysql_query("Select AVG(Q2_22) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_23:
$d2=mysql_query("Select AVG(Q2_23) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $array;
// echo $n;
break;
case q2_24:
$d2=mysql_query("Select AVG(Q2_24) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_25:
$d2=mysql_query("Select AVG(Q2_25) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_26:
$d2=mysql_query("Select AVG(Q2_26) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_27:
$d2=mysql_query("Select AVG(Q2_27) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_28:
$d2=mysql_query("Select AVG(Q2_28)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_29:
$d2=mysql_query("Select AVG(Q2_29)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_30:
$d2=mysql_query("Select AVG(Q2_30)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
case q2_31:
$d2=mysql_query("Select AVG(Q2_31)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_32:
$d2=mysql_query("Select AVG(Q2_32)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_33:
$d2=mysql_query("Select AVG(Q2_33)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_34:
$d2=mysql_query("Select AVG(Q2_34)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$array[]=$n;
// echo $array;
break;
break;
case q2_35:
$d2=mysql_query("Select AVG(Q2_35)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_36:
$d2=mysql_query("Select AVG(Q2_36)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_37:
$d2=mysql_query("Select AVG(Q2_37)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_38:
$d2=mysql_query("Select AVG(Q2_38)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_39:
$d2=mysql_query("Select AVG(Q2_39)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_40:
$d2=mysql_query("Select AVG(Q2_40)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_41:
$d2=mysql_query("Select AVG(Q2_41)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_42:
$d2=mysql_query("Select AVG(Q2_42)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_43:
$d2=mysql_query("Select AVG(Q2_43)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_44:
$d2=mysql_query("Select AVG(Q2_44)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_45:
$d2=mysql_query("Select AVG(Q2_45)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_46:
$d2=mysql_query("Select AVG(Q2_46)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
break;
case q2_47:
$d2=mysql_query("Select AVG(Q2_47)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
break;
}
/* $ay[]=$array;*/
//******************************************************************
//----------------------------------------------------------
switch($f){
case q2_1:
$imp=mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_1' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_2:
$imp = mysql_query("Select Factorscore From variables_and_factorscores as aa Where Variable='Q2_2' AND Year='2010' AND Month='April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_3:
$imp =mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_3' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_4:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_4' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_5:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_5' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_6:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_6' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_7:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_7' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_8:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_8' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_9:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_9' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_10:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_10' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_11:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_11' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_12:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_12' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_13:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_13' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_14:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_14' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_15:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_15' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_16:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_16' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_17:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_17' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_18:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_18' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_19:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_19' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_20:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_20' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_21:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_21' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_22:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_22' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_23:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_23' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_24:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_24' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_25:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_25' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_26:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_26' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_27:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_27' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_28:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_28' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_29:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_29' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_30:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_30' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
case q2_31:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_31' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_32:
$imp = mysql_query("Select Factorscore as aa ,Varience as b From variables_and_factorscores Where Variable='Q2_32' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_33:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_33' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_34:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_34' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_35:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_35' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_36:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_36' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_37:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_37' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_38:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_38' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_39:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_39' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_40:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_40' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_41:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_41' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_42:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_42' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_43:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_43' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_44:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_44' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_45:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_45' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_46:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_46' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_47:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_47' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
}
//---------------------------------------------
switch($f){
case q2_1:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_1' AND Year='2010' AND Month= 'April'");
$row3 = mysql_fetch_array($imp2);
$va=$row3['b'];
break;
case q2_2:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_2' AND Year='2010' AND Month= 'April'");
$row3 = mysql_fetch_array($imp2);
$va=$row3['b'];
break;
case q2_3:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_3' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_4:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_4' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_5:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_5' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
// echo $n;
break;
case q2_6:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_6' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
// echo $n;
break;
case q2_7:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_7' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_8:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_8' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_9:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_9' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_10:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_10' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_11:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_11' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_12:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_12' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_13:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_13' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_14:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_14' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_15:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_15' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_16:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_16' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_17:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_17' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_18:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_18' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_19:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_19' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_20:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_20' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_21:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_21' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_22:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_22' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_23:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_23' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_24:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_24' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_25:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_25' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_26:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_26' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_27:
$imp2=mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_27' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_28:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_28' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_29:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_29' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_30:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_30' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
case q2_31:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_31' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_32:
$imp2 = mysql_query("Select Factorscore as aa ,Varience as b From variables_and_factorscores Where Variable='Q2_32' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_33:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_33' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_34:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_34' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
break;
case q2_35:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_35' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_36:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_36' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_37:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_37' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_38:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_38' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_39:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_39' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_40:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_40' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_41:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_41' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_42:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_42' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_43:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_43' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_44:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_44' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_45:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_45' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_46:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_46' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_47:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_47' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
}
//++++++++++++++++++++++++++++++++++++++++++++++++
if($w==0){
$e1[$k]=$n;
/*echo $n;
echo "<br/>"; */
$ar[$k]=$e1;
// echo $ar[$w];
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$ar2[$k]=$imm2;
}
$k++;
} //while
/* if($w==0){
$e1[]=$ay;
$ar[]=$e1;
//echo $ay[2];
$fa1=$fa;
$va1=$va;
$im1=($fa1*$fa1)*$va; //$ay[]
$ar2[]=$im1;
}
elseif($w==1){
$e2[]=$ay;
$ar[]=$e2;
$fa1=$fa;
$va1=$va;
$im1=($fa1*$fa1)*$va;
$ar2[]=$im1;
}
elseif($w==2){
$e3[]=$ay;
$ar[]=$e3;
$fa1=$fa;
$va1=$va;
$im1=($fa1*$fa1)*$va;
$ar2[]=$im1;
}
elseif($w==3){
$e4[]=$ay;
$ar[]=$e4;
$fa1=$fa;
$va1=$va;
$im1=($fa1*$fa1)*$va;
$ar2[]=$im1;
}
elseif($w==4){
$e5[]=$ay;
$ar[]=$e5;
$fa1=$fa;
$va1=$va;
$im1=($fa1*$fa1)*$va;
$ar2[]=$im1;
}
elseif($w==5){
$e6[]=$ay;
$ar[]=$e6;
$fa1=$fa;
$va1=$va;
$im1=($fa1*$fa1)*$va;
$ar2[]=$im1;
}
elseif($w==6){
$e7[]=$ay;
$ar[]=$e7;
$fa1=$fa;
$va1=$va;
$im1=($fa1*$fa1)*$va;
$ar2[]=$im1;
}
elseif($w==7){
$e8[]=$ay;
$ar[]=$e8;
$fa1=$fa;
$va1=$va;
$im1=($fa1*$fa1)*$va;
$ar2[]=$im1;
}
elseif($w==8){
$e9[]=$ay;
$ar[]=$e9;
$fa1=$fa;
$va1=$va;
$im1=($fa1*$fa1)*$va;
$ar2[]=$im1;
}*/
$ab=$ab+$ar_length;
//echo $ab;
//echo "<br/>";
$v++;
// $w++;
} //do
while($v<10);
if($v==10){
for($a=1;$a<$ab+1;$a++){
$col[]=$a;
}
}
// echo "aqwsedrf";
// echo "cjhjdhudhid";
// echo $ar[0];
// echo $ar[25];
// echo $ar[2];
// echo $ar[3];
// echo $ar[4];
// echo $ar[5];
// echo $ar[6];
// echo $ar[7];
// echo $ar[8];
//echo "end of files";
// $ar2=array($di1,$di2,$di3,$di4,$di5,$di6,$di7,$di8,$di9);
// $labels = array("","<*color=ff0000*>Economy","<*color=0x008000*>HealthyLifestyle", "<*color=0x0000FF*>Urban Growth", "<*color=daa520*>Transport","<*color= 0xEE82EE*>Crime & Safety","<*color=0x00FFFF*>Commiunity","<*color=cd853f*>Environment","<*color=0xcccccc*>Education","<*color=8b7d6b*>Health","");
//$labels = array("<*color=ff0000*>Economy","<*color=0x008000*>HealthyLifestyle", "<*color=0x0000FF*>Urban Growth", "<*color=daa520*>Transport","<*color= 0xEE82EE*>Crime & Safety","<*color=0x00FFFF*>Commiunity","<*color=cd853f*>Environment","<*color=0xcccccc*>Education","<*color=8b7d6b*>Health");
// $color = array(0x008000, 0xeebb22, 0xcccccc, 0xcc88ff,0x66aaee, 0xeebb22, 0xcccccc, 0xcc88ff,0x66aaee);
# Create a XYChart object of size 450 x 420 pixels
$c = new XYChart(750, 720);
# Set the plotarea at (55, 65) and of size 350 x 300 pixels, with a light grey border
# (0xc0c0c0). Turn on both horizontal and vertical grid lines with light grey color # (0xc0c0c0)
$plotAreaObj = $c->setPlotArea(55, 65, 700, 300, -1, -1, 0xc0c0c0, 0xc0c0c0, -1);
# Add a legend box at (50, 30) (top of the chart) with horizontal layout. Use 12 pts # Times Bold Italic font. Set the background and border color to Transparent.
$plotAreaObj->setGridWidth(0, 1, 0, 0);
$legendObj = $c->addLegend(50, 30, false, "timesbi.ttf", 12);
$legendObj->setBackground(Transparent);
# Add a title to the chart using 18 pts Times Bold Itatic font.
$c->addTitle("Segmentation (by Kpi)", "timesbi.ttf", 18);
# Add a title to the y axis using 12 pts Arial Bold Italic font
$c->yAxis->setTitle("Satisfaction (Scale 1 Very bad - 5 Very good)", "arialbi.ttf", 12);
# Add a title to the x axis using 12 pts Arial Bold Italic font
$c->xAxis->setLabels($labels);
$c->xAxis->setTickOffset(1);
// $c->xAxis->setTitle("Range (miles)", "arialbi.ttf", 12);
# Set the axes line width to 3 pixels
$c->xAxis->setWidth(3);
$c->yAxis->setWidth(3);
//for ($k=0;$k<10;$k++){
for ($i = 0; $i < count($ar); ++$i) {
$scatterLayerObj = $c->addScatterLayer($col[$i],$ar[$i],$color[$i],CircleSymbol, 15);
$scatterLayerObj->setSymbolScale(array($ar2[$i]));
}
/* $scatterLayerObj = $c->addScatterLayer($col,$ar,CircleSymbol,15);
$scatterLayerObj->setSymbolScale($ar2);*/
header("Content-type: image/png");
print($c->makeChart2(PNG));
?> |