querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $countries=array(); while($row=mysqli_fetch_array($result)) { array_push($countries,$row); } foreach($countries as $country) { if ($country['name'] === 'Virtual Organization') continue; echo "".utf8_encode($country['name']).": ".$country['frequency']; } $table_name="IGF2016_registrations_online"; $query="SELECT COUNT(*) FROM $table_name;"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "
Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); echo "Number of registrations: ".$values[0].""; $registrations_count = $values[0]; $where="title"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Mr.';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "
Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $males = (int)$values[0]; $where="title"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Ms.';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $females = (int)$values[0]; $where="title"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $others = (int)$values[0]; $chart2 = array( '#type' => 'chart', '#title' => t('Gender'), '#chart_type' => 'pie', '#chart_library' => 'google', '#legend_position' => 'right', '#colors' => array('blue', 'gray', 'red'), '#data_labels' => TRUE, '#tooltips' => TRUE, ); $chart2['pie_data'] = array( '#type' => 'chart_data', '#title' => t('Gender'), '#labels' => array('Male', 'Other', 'Female'), '#data' => array($males, $others, $females), ); $graph['chart2'] = $chart2; $where="stakeholder_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Civil Society';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $cs = (int)$values[0]; $where="stakeholder_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Government';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $g = (int)$values[0]; $where="stakeholder_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Intergovernmental Organizations';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $io = (int)$values[0]; $where="stakeholder_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Private Sector';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $ps = (int)$values[0]; $where="stakeholder_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Technical Community';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $tc = (int)$values[0]; $chart3 = array( '#type' => 'chart', '#title' => t('Stakeholder Group'), '#chart_type' => 'pie', '#chart_library' => 'google', '#legend_position' => 'right', '#colors' => array('green', 'blue', 'red', 'orange', 'brown'), '#data_labels' => TRUE, '#tooltips' => TRUE, ); $chart3['pie_data'] = array( '#type' => 'chart_data', '#title' => t('Stakeholder Group'), '#labels' => array('Civil Society', 'Government', 'Intergovernmental Organizations', 'Private Sector', 'Technical Community'), '#data' => array($cs, $g, $io, $ps, $tc), ); $graph['chart3'] = $chart3; $where="regional_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='African Group';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $a = (int)$values[0]; $where="regional_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Asia-Pacific Group';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $ap = (int)$values[0]; $where="regional_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Eastern European Group';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $ee = (int)$values[0]; $where="regional_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Latin American and Caribbean Group (GRULAC)';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $grulac = (int)$values[0]; $where="regional_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='Western European and Others Group (WEOG)';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $weog = (int)$values[0]; $where="regional_group"; $query="SELECT COUNT(*) FROM $table_name WHERE $where='International Civil Servant';"; $result=mysqli_query($db,$query); $error=mysqli_error($db); if(!($error==="")) { echo "Error No. 20558
"; echo "querying database failed.
"; echo "$query
"; echo "$error
"; exit(1); } $values = mysqli_fetch_array($result); $intl = (int)$values[0]; $chart4 = array( '#type' => 'chart', '#title' => t('Regional Group'), '#chart_type' => 'pie', '#chart_library' => 'google', '#legend_position' => 'right', '#colors' => array('green', 'blue', 'red', 'orange', 'brown', 'gray'), '#data_labels' => TRUE, '#tooltips' => TRUE, ); $chart4['pie_data'] = array( '#type' => 'chart_data', '#title' => t('Regional Group'), '#labels' => array('African Group', 'Asia-Pacific Group', 'Eastern European Group', 'Latin American and Caribbean Group (GRULAC)', 'Western European and Others Group (WEOG)', 'International Civil Servant'), '#data' => array($a, $ap, $ee, $grulac, $weog, $intl), ); $graph['chart4'] = $chart4; return drupal_render($graph); ?>