<!doctype html public "-//w3c//dtd html 3.2//ja">
<html>
<head>
<title>pgctn confirm page</title>
<meta http-equiv=content-type content="text/html; charset=x-euc-jp">

<?php


  $uname = $_POST['uname'];
  $password = $_POST['password'];

  include "init.inc";
  include "param_setting.ini";
//  include "sql_generator.ini";
  $include_path=".";
  require("$include_path/dbconnect.ini");


$db_handle = db_contact_start($db_type,$target_host,$target_db);
$sql = "select user_id from users where user_id = '$uname' and passwd = '$password'";
$rtn = $db_handle->prepare($sql);
$rtn->execute();


$permit_count = $rtn->rowCount();






?>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

function main(){
	return "gate.php";
  }


function main2(){
	return "select.php?uname=<?php echo $uname ?>";
  }

//END -->
</script>

</head>
<?php


   if($permit_count == 0){
   ?>
<body bgcolor=#6696bc onLoad = "setTimeout('location.replace(main());', 1000)">
   <?php
   print("<center>");
   print("fail to login. please check acount ID and password<br>");
   print("After some few secounds return login page.<br>");
   exit;
   }else{
  ?>
<body bgcolor=#6696bc onLoad = "setTimeout('location.replace(main2());', 1000)">
  <?php
   print("<center>");
   print("Login success.<br>");

   }



//
//	2002.1.1
//	DICOM to WWW Gateway :PHP script
//	Made by Norya Yokohama % Medical Division @ WERC
//  2004.9.19
//  Updated by tadashi tsuchimoto @ MITT belong to yokohamazyuku
//confirm.php
//


$sql = "select 
	facility as facility,
	comment as comment,
	tel as tel,
	fax as fax,
	address as address,
	dept as dept,
	responsible_person as responsible_person,
	web_address as web_address,
	mail as mail 
	 from facilitylevel";
$rtn_fas = $db_handle->prepare($sql);
$rtn_fas->execute();



  while ($fas_row = $rtn_fas->fetch(PDO::FETCH_ASSOC)) {
  $facility = trim($fas_row['facility']) ;
  $comment = trim($fas_row['comment']) ;
  $tel = trim($fas_row['tel']) ;
  $fax = trim($fas_row['fax']) ;
  $address = trim($fas_row['address']) ;
  $dept = trim($fas_row['dept']) ;
  $responsible_person = trim($fas_row['responsible_person']) ;
  $web_address = trim($fas_row['web_address']) ;
  $mail = trim($fas_row['mail']) ;
  }


  print("<table border=3><tr><td>");

  print("facility: $facility</td></tr><tr><td>");
  print("comment: $comment</td></tr><tr><td>");
  print("tel:$tel</td></tr><tr><td>");
  print("FAX: $fax</td></tr><tr><td>");
  print("address: $address</td></tr><tr><td>");
  print("Depertment: $dept</td></tr><tr><td>");
  print("owner: $responsible_person</td></tr><tr><td>");
  print("Web address: $web_address</td></tr><tr><td>");
  print("Mail address: $mail</td></tr>");
  print("</table>");

//    @$con->doClose;
    

   print("</center>");

?>






</body>
</html>
