﻿// training_schedule.js 
// training_schedule_list 
//   内部リスト０番目：申込可能フラグ: 0:申込不可, 1:申込可能
//   内部リスト１番目：申込状況文字列: 未受付/受付中/残席わずか/受付締切/終了
//   内部リスト２番目：開催月日文字列
//   内部リスト３番目：日数文字列
//   内部リスト４番目：コース名文字列
//   内部リスト５番目：会場文字列
//   内部リスト６番目：コース説明URL
//   内部リスト７番目：会場説明URL
//   


//***************************************************************
// 注意事項
// ◎スケジュールを追加する際には、リストの最後尾に追加してください。
// ◎このファイルを修正した際には、ローカルマシン上で追加した日程の申込をクリック
// 　してもエラーがおきないことを確認してください。
//***************************************************************

var training_schedule_list = new Array(
					// 内部リスト Start
	new Array(1, "空席有", " 8月 4～6日", "3", "組込みLinux基礎", "本社(新横浜)", "linux_basic.html", "../../company/access.html"),
	new Array(1, "開催確定", " 8月 5～6日", "2", "Androidアプリケーション開発入門", "本社(新横浜)", "android_app.html", "../../company/access.html"),
	new Array(1, "開催可", " 8月 17日", "1", "Android開発者のための組込Linux入門", "本社(新横浜)", "android_embedded.html", "../../company/access.html"),
	new Array(1, "開催確定", " 8月 19～20日", "2", "組込みLinuxターゲットへの移植", "本社(新横浜)", "linux_custom.html", "../../company/access.html"), 
	new Array(1, "開催確定", " 9月 7日", "1", "Android開発者のための組込Linux入門", "本社(新横浜)", "android_embedded.html", "../../company/access.html"),
	new Array(1, "開催可", " 9月 9～10日", "2", "組込みLinuxドライバ開発", "本社(新横浜)", "linux_driver.html", "../../company/access.html"),
	new Array(1, "開催確定", " 9月 16～17日", "2", "組込みLinuxアプリケーション開発", "本社(新横浜)", "linux_app.html", "../../company/access.html"),
	new Array(1, "空席有", " 9月 28～29日", "2", "Androidアプリケーション開発入門", "本社(新横浜)", "android_app.html", "../../company/access.html"),
	new Array(1, "開催可", " 10月 6日", "1", "Android開発者のための組込Linux入門", "本社(新横浜)", "android_embedded.html", "../../company/access.html"),
	new Array(1, "空席有", " 10月 13～15日", "3", "組込みLinux基礎", "本社(新横浜)", "linux_basic.html", "../../company/access.html"),
	new Array(1, "空席有", " 10月 21～22日", "2", "Androidアプリケーション開発入門", "本社(新横浜)", "android_app.html", "../../company/access.html"),
	new Array(1, "空席有", " 10月 28～29日", "2", "組込みLinuxターゲットへの移植", "本社(新横浜)", "linux_custom.html", "../../company/access.html") 
					// 内部リスト End
);

var global_selected_training_index = 0; 

function setTrainingIndex(num)
{
	global_selected_training_index = num;
}

function getTrainingStr(num)
{
	var rtnValue = "";
    rtnValue = rtnValue + training_schedule_list[num][2] + " "; // 日付
    rtnValue = rtnValue + training_schedule_list[num][4]; // コース名
}

function getTrainingSelection()
{
	var rtnValue = "";
    rtnValue = rtnValue + training_schedule_list[global_training_index][2]; // 日付
    rtnValue = rtnValue + training_schedule_list[global_selected_training_index][4]; // コース名
}

function getTrainingScheduleTable()
{
	var rtnValue = "";
    var tsCnt = 0;

	rtnValue = rtnValue + "<!-- ここからの部分は/static/js/training_schedule.js で自動生成されます -->";
	for (tsCnt = 0; tsCnt < training_schedule_list.length; tsCnt++)
	{
		rtnValue = rtnValue + "<tr>";

        if (training_schedule_list[tsCnt][0] == 0)
			rtnValue = rtnValue + "<td align=\"center\"><font color=\"red\">" + training_schedule_list[tsCnt][1] + "</font> </td>";
        else
            {
// 		   		rtnValue = rtnValue + "<td align=\"center\"> <a href=\"confirmation_new.html?trainingStr=" 
//                	     + training_schedule_list[tsCnt][2] + " " + training_schedule_list[tsCnt][4]
//						 + "\" title=\"申し込む\">申し込む</a></td>";
// (akt) change argument 
 		   		rtnValue = rtnValue + "<td align=\"center\"> <a href=\"confirmation.html?trainingIndex="+tsCnt
						 + "\" title=\"" + "この日程で申込む" + "\">"
//						 + "\" title=\"" + training_schedule_list[tsCnt][1] + "\">"
						 + training_schedule_list[tsCnt][1] + "</a></td>"; 
//						 + "\" title=\"申し込む\">申し込む</a></td>";
            }

//		rtnValue = rtnValue + "<td align=\"center\">" + training_schedule_list[tsCnt][1] + "</td>"; // 申込状況
		rtnValue = rtnValue + "<td align=\"left\">" + training_schedule_list[tsCnt][2] + "</td>"; // 開催日
		rtnValue = rtnValue + "<td align=\"center\">" + training_schedule_list[tsCnt][3] + "</td>"; // 日数
		rtnValue = rtnValue + "<td> <a href=\"" + training_schedule_list[tsCnt][6] + "\" title=\"" 
				   + training_schedule_list[tsCnt][4] + "\">&nbsp;"　+ training_schedule_list[tsCnt][4] + "</a> </td>"; // コース名（説明へのリンク）
		rtnValue = rtnValue + "<td aline=\"center\"> <a href=\"" + training_schedule_list[tsCnt][7] + "\" title=\"" 
				   + training_schedule_list[tsCnt][5] + "\">&nbsp;"　+ training_schedule_list[tsCnt][5] + "</a> </td>"; // 場所（説明へのリンク）
		rtnValue = rtnValue + "</tr>";

	}
	rtnValue = rtnValue + "<!-- ここまでの部分は/static/js/training_schedule.jsで自動生成されます -->";
	rtnValue = rtnValue + "</ul>";

	return rtnValue;
}

function getTrainingSelectionOptions()
{
	var rtnValue = "";
    var tsCnt = 0;

	rtnValue = rtnValue + "<!-- ここからの部分は/static/js/training_schedule.js で自動生成されます -->";
	for (tsCnt = 0; tsCnt < training_schedule_list.length; tsCnt++)
	{
		rtnValue = rtnValue + "<option value=\"" + training_schedule_list[tsCnt][3] + "\">"
							+ training_schedule_list[tsCnt][2] + " "
							+ training_schedule_list[tsCnt][4]
							+ "</option>"; 
	}
	rtnValue = rtnValue + "<!-- ここまでの部分は/static/js/training_schedule.jsで自動生成されます -->";

	return rtnValue;
}

