Back to top of page
Promotion Office for International Alliance

Number of International Students

[insert_php]
$disp_var = false;

##### 共通ファイルの呼び出し #####
include($_SERVER[‘DOCUMENT_ROOT’] . ‘/common-files/funcs.html’);

$pdo = new PDO(‘pgsql:dbname=english’);
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);

$country_all_sql = ‘SELECT country_id FROM country’;
$country_all_result = $pdo->query($country_all_sql);
$country_displayed = array();
while($country_all_id = $country_all_result->fetchColumn()){
$country_displayed[$country_all_id] = false;
}

[/insert_php]

Number of International Students

  • (*The numbers in parenthesis are the recipients of the university and government scholarship.)
  • *2 The titles of laboratories are those renamed on 1 April, 2012.
  • *1 This laboratory was abolished due to either the retirement of the principal investigator (PI) or the movement of PI to the other institution.
from 2007

[insert_php]
## 2017年度以降 ACTRIESからのデータ呼び出し&表示
fromactriesSTUDENTS(2017);

#$years_sql = ‘SELECT DISTINCT year FROM students ORDER BY year DESC’;
$years_sql = ‘SELECT DISTINCT year FROM students_view ORDER BY year DESC’;
$years_result = $pdo->query($years_sql);
$years_data = array();
while($years_dummy = $years_result->fetch()){
$years_data[] = $years_dummy[‘year’];
}

#foreach(array(2012,2011,2010,2009) as $values_y){
foreach($years_data as $values_y){

##################################################
##### counrty_id の取得
##################################################
#$country_sql = sprintf(‘SELECT DISTINCT students.country_id,country.country_name,country.country_order FROM students,country WHERE students.country_id = country.country_id AND year = %d ORDER BY country.country_name’, $values_y);
$country_sql = sprintf(‘SELECT DISTINCT country_id,country_name,country_order FROM students_view WHERE year = %d ORDER BY country_name’, $values_y);
$country_result = $pdo->query($country_sql);
$country_data = $country_result->fetchall();

##################################################
##### labo_id の取得
##################################################
#$labo_sql = sprintf(‘SELECT DISTINCT students.labo_id,labo.labo_name,labo.labo_order FROM students,labo WHERE students.labo_id = labo.labo_id AND year = %d ORDER BY labo.labo_order’, $values_y);
$labo_sql = sprintf(‘SELECT DISTINCT labo_id,labo_name,labo_order FROM students_view WHERE year = %d ORDER BY labo_order’, $values_y);
$labo_result = $pdo->query($labo_sql);
$labo_data = $labo_result->fetchall();

echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;

echo ‘

‘;

foreach($labo_data as $values_l){

##################################################
##### grade_id の取得
##################################################
#$grade_sql = sprintf(‘SELECT DISTINCT students.grade_id,grade.grade_name,grade.grade_order,grade.grade_mark FROM students,grade WHERE students.grade_id = grade.grade_id AND year = %d AND students.labo_id = %d ORDER BY grade.grade_order’, $values_y, $values_l[‘labo_id’]);
$grade_sql = sprintf(‘SELECT DISTINCT grade_id,grade_name,grade_order,grade_mark FROM students_view WHERE year = %d AND labo_id = %d ORDER BY grade_order’, $values_y, $values_l[‘labo_id’]);
$grade_result = $pdo->query($grade_sql);
$grade_data = $grade_result->fetchall();
$grade_count = count($grade_data);

foreach($grade_data as $keys => $values_g){

echo ‘

‘;

if($keys == 0){

echo ‘

‘;

}

echo ‘

‘;

$country_results = [];
foreach($country_data as $values_c){

##################################################
##### 数値の取得
##################################################
#$numbers_sql = sprintf(‘SELECT number,recipients FROM students WHERE year = %1$d AND labo_id = %2$d AND grade_id = %3$d AND country_id = %4$d’, $values_y, $values_l[‘labo_id’], $values_g[‘grade_id’], $values_c[‘country_id’]);
$numbers_sql = sprintf(‘SELECT number,recipients FROM students_view WHERE year = %1$d AND labo_id = %2$d AND grade_id = %3$d AND country_id = %4$d’, $values_y, $values_l[‘labo_id’], $values_g[‘grade_id’], $values_c[‘country_id’]);
$numbers_result = $pdo->query($numbers_sql);
$numbers_data = $numbers_result->fetch();

$numbers_txt = ”;
if($numbers_data[‘number’] != null && $numbers_data[‘recipients’] != null){
$country_results[] = sprintf(‘%s: %d(%d)’, $values_c[‘country_name’], $numbers_data[‘number’], $numbers_data[‘recipients’]);
}
else if($numbers_data[‘number’] != null){
$country_results[] = sprintf(‘%s: %d’, $values_c[‘country_name’], $numbers_data[‘number’]);
}
}
unset($values_c);
echo ‘

‘;
echo ‘

‘;
}
unset($keys,$values_g);
}
unset($values_l);

echo ‘

‘;

echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
$country_results_all = [];
foreach($country_data as $values_c){
$numbers_f_txt = ”;
$numbers_f_sql = sprintf(‘SELECT SUM(number) AS number,SUM(recipients) AS recipients FROM students_view WHERE year = %1$d AND country_id = %2$d’, $values_y, $values_c[‘country_id’]);
$numbers_f_result = $pdo->query($numbers_f_sql);
$numbers_f_data = $numbers_f_result->fetch();
if($numbers_f_data[‘number’] != null && $numbers_f_data[‘recipients’] != null){
$country_results_all[] = sprintf(‘%s: %d(%d)’, $values_c[‘country_name’], $numbers_f_data[‘number’], $numbers_f_data[‘recipients’]);
}
else if($numbers_f_data[‘number’] != null){
$country_results_all[] = sprintf(‘%s: %d’, $values_c[‘country_name’], $numbers_f_data[‘number’]);
}
}
unset($values_c);
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;

echo ‘

‘;
echo $values_y . PHP_EOL;
echo ‘
‘;
echo ‘Laboratory’;
echo ‘
‘;
echo htmlspecialchars($values_l[‘labo_name’]) . “\n”;
echo ‘
‘;
echo htmlspecialchars($values_g[‘grade_name’]) . “\n”;
echo ‘
‘;
echo implode(‘, ‘, $country_results) . PHP_EOL;
echo ‘
‘;
echo ‘Total’;
echo ‘
‘;
echo implode(‘, ‘, $country_results_all) . PHP_EOL;
echo ‘

‘;
echo ‘

‘;

}
unset($values_y);
[/insert_php]

Back to top of page