Hacked By AnonymousFox

Current Path : C:/AppServ/www/covid19/db/home/
Upload File :
Current File : C:/AppServ/www/covid19/db/home/import_excel.php

<? 
include("../lib/session.php"); 
include("../lib/config.php");
include("../lib/connect.php");
include("../lib/function.php");
//if($System_Session_User_ID=="") { 
//Header("Location:../home/index.php");
//}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>:: สำนักการแพทย์ กรุงเทพมหานคร ::</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #CCCCCC;
}
.style3 {
	font-size: 16px;
	font-weight: bold;
}
.style4 {
	color: #FF0000;
	font-weight: bold;
}
.style1 {	font-size: 16;
	font-weight: bold;
}
-->
</style>            
</head>
<body bgcolor="#E9E6DF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../../images/thai.gif','../../images/eng.gif','../../images/chaina.gif','../../images/object/topbar-thai-over.gif','../../images/object/topbar-english-over.gif','../images/bullet/lang_over_02_1.gif','../images/bullet/lang_over_01_1.gif')">

<table width="95%" height="26" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td background="../../images/main/main-t-bg.gif" bgcolor="#162C41" align="center"><p><img src="logo.png" width="150" height="150"><br>
    </p></td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="1" bgcolor="#10202F"><img src="../../images/blank.gif" width="1" height="1"></td>
    <td align="center" valign="top"><table width="100%" height="480" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td align="center" valign="top" bgcolor="#E9E6DF"> 
            <table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="16" valign="top" bgcolor="#C4BDB1">&nbsp;</td>
        <td align="center" valign="top" bgcolor="#C4BDB1">&nbsp;</td>
        <td valign="top" bgcolor="#C4BDB1">&nbsp;</td>
      </tr>
      <tr>
        <td width="20" valign="top" background="../images/object/border_03.gif"><img src="../images/object/border_16.gif" width="20" height="83"></td>
        <td align="center" valign="top" bgcolor="#FFFFFF">
		   <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="15" height="300">&nbsp;</td>
                  <td align="left" valign="top">
                  <div class="title1"> 
                    ยินดีต้อนรับเข้าสู่ระบบ &gt; โรงพยาบาลผู้ใช้งาน &gt;<?=$System_Session_FullName?>&nbsp;&nbsp;&nbsp;<input name="add" type="button" class="button_60" id="btPageSearch2" value="ออกจากระบบ" onclick="window.location='../system/logout.php'" /> <br />
                    <br>
<?
	if($action=="update") { 

	$sql="insert into importdata (document) values('')";
	$query=mysql_query($sql);
	$sql2 = "SELECT MAX(Id) FROM importdata";
	$Query2=mysql_query($sql2) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$Row2=MYSQL_FETCH_ARRAY($Query2);
	$MaxID2 = $Row2[0];

	$myrand = rand(1111,9999);
	$exts = explode(".", $_FILES['inputMap']['name']);
	$ext = strtolower(($exts[count($exts) - 1]));	
	$ImageType = $ext;

	if(copy($_FILES["inputMap"]["tmp_name"],"upload/$MaxID2-$myrand.$ImageType")) 
	{ 
	$inputmap=$_FILES["inputMap"]["name"];
	$picmap = "$MaxID2-$myrand.$ImageType";
	
    	  $sql="update importdata set document='$picmap' where Id='$MaxID2'";
		 
		$query=mysql_query($sql);
	}  

	$sql = "SELECT Document FROM importdata order by Id DESC";
	$Query=mysql_query($sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
	$MaxID2 = $Row[0];
		
				require_once 'Excel2MySQL/excel2mysql.php';
				$excel_file = "upload/$MaxID2";
				$excel2mysql = new Excel2MySQL( $excel_file  );
				//$excel2mysql->setConvertArea( '$A$1:$E$5' );
				$excel2mysql->setRowStart(1);
				$excel2mysql->setColStart('A');
				$excel2mysql->setColMapping(array('HOSPITAL'=>'Hospitalname',
											'HN'=>'Patient_id2',
											'PREFIX'=>'Patient_prefix',
											'NAME'=>'Patient_name',
											'SURNAME'=>'Patient_surname',
											'AGE'=>'Patient_age',
											'IDCARD'=>'Patient_id',
					'Id'=>'',
					'Statuscome'=>'',
					'Namesave'=>'',
					'Cometype'=>'',
					'Patient_case'=>'',
					'Hospitalother'=>'',
					'Patient_type'=>'',
					'Patient_sex'=>'',
					'Patient_age2'=>'',
					'Patient_age3'=>'',
					'Patient_career'=>'',
					'Patient_tel'=>'',
					'Patient_addresstype'=>'',
					'Patient_addressdetail1'=>'',
					'Patient_addressdetail2'=>'',
					'Patient_addressdetail3'=>'',
					'Patient_addressprovince'=>'',
					'Patient_province_detail'=>'',
					'Patient_date1'=>'',
					'History'=>'',
					'History_detail'=>'',
					'Patient_t'=>'',
					'Patient_pr'=>'',
					'Patient_rr'=>'',
					'Patient_bp'=>'',
					'Patient_o'=>'',
					'Patient_xray'=>'',
					'Patient_xray_detail'=>'',
					'Patient_date2'=>'',
					'Patient_dx'=>'',
					'Patient_dx_detail'=>'',
					'Patient_status'=>'',
					'Patient_date3'=>'',
					'datetime_save'=>'',
					'Nameupdate'=>'',
					'Patient_statusupdate'=>'',
					'Patient_statuslab'=>'',
					'Patient_statuslab_time'=>'',
					'Patient_statuslab_date'=>'',
					'Patient_statusno'=>'',
					'Patient_status_symptom'=>'',
					'Patient_result'=>'',
					'Patient_result_detail'=>'',
					'Patient_tnow'=>'',
					'Patient_prnow'=>'',
					'Patient_rrnow'=>'',
					'Patient_bpnow'=>'',
					'Patient_o2now'=>'',
					'Patient_post'=>'',
					'Patient_post_detail'=>'',
					'Patient_level'=>'',
					'Patient_status_cure'=>'',
					'Patient_ox'=>'',
					'Patient_tube'=>'',
					'Patient_status_hosrefer'=>'',
					'Patient_status_hosrefer_detail'=>'',
					'Patient_status_refer'=>'',
					'datetime_update'=>'',
					'Nameupdate_byhos'=>'',
					'Patient_typetreat'=>'',
					'Patient_typebed'=>'',
					'datetime_updatebyhos'=>'',
					'update_byhos_id'=>'',
					'Idrefer'=>''));
				//$excel2mysql->connectDB ('localhost','root','root','meqdb_18','exam_point1');
				$excel2mysql->connectDB ('localhost','Navin028','Navin028','covid19','patient_referedit');
				
				$excel2mysql->injectData();
	echo"
	<br />
	  <br />
	  <br /><table width=400 height=100 border=1 bordercolor=#C6ECD9 align=center cellpadding=0 cellspacing=0 bgcolor=#EFEFEF>
  
  <tr>
    <td height=100><div align=center><span class=table_footer style1><br>
      ระบบได้ Import ข้อมูลของท่านเรียบร้อยแล้ว</span><br>
      ขอบคุณครับ<br />
      <br />
      <form id=form1 name=form1 method=post action=datalist_covid.php>
                      <input type=image src=btn-submit.gif name=Image15112 width=57 height=20 border=0 id=Image15 style=cursor:pointer; />
        </form>
      <br>
    </div></td>
  </tr>
</table>										<br />
										<br />
										<br />";
					  }else{
?>
					   <form action="?" method="post" name="myForm" id="myForm" enctype="multipart/form-data"  onSubmit=" if(!verifySubmit()) { return false; } ">
						    <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                          <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                          <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
                          <input name="action" type="hidden" id="action" value="update">
                          <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
                          <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
                          <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
                          <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
                          <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
                          <input name="CheckBoxID1" type="hidden" id="CheckBoxID1" value="<?=$myCheckBoxID?>">
                    <table width="90%" cellpadding="10" cellspacing="1" border="1" align="center" style="border-collapse:collapse" bordercolor="#CCCCCC">
                              <tr>
                                <td height="24" colspan="2" align="center" class="table_title2" bgcolor="#d9d9d9"><b class="table_title2">import file excel</b></td>
                                </tr>
                              <tr>
                                <td width="140" height="22" align="right" class="table_row2"><div align="right">ข้อมูล File Import&nbsp;</div></td>
                                  <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                    <tr>
                                      <td><input type="file" name="inputMap" id="inputMap" /></td>
                                      </tr>
                                    </table></td>
                                </tr>
                              <tr>
                                <td height="22" align="right" class="table_row2" valign="top">หมายเหตุ :</td>
                                <td height="22" class="table_col2"><p>ให้ใช้รูปแบบการนำเข้า excel ตามตัวอย่างด้านล่าง <a href="Exfile.xlsx" target="_blank">Download File ตัวอย่างที่นี่</a><br />
                                  <img src="ex_import.jpg" /></p>
                                  <p>&nbsp;</p></td>
                              </tr>
                              <tr>
                                <td height="22" colspan="2" align="right" valign="top" class="table_row2"><table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
                                  <tr align="right">
                                    <td height="30" colspan="4" align="center" bgcolor="#D7EEF1" class="table_footer"><table width="300" border="0" cellspacing="0" cellpadding="2">
                                      <tr align="center">
                                        <td><script language="JavaScript" type="text/javascript">
function isBlank(myObj) { if(myObj.value=='') { return true; } return false; }
function isNumber(myObj) { return !isNaN(myObj.value*1) }
function verifySubmit() {
	with(document.myForm) {
/*		if(isBlank(inputMod_Calendar_DateFrom)) {	inputMod_Calendar_Subject.focus(); return false; }
		if(isBlank(inputTimeFromMM)) {	inputMod_Calendar_Location.focus(); return false; }
*/	document.myForm.submit();
}
}
						</script>
                                          <input name="btAdd3" type="button" class="button_80" id="btAdd3" value="Submit" onclick="verifySubmit();" />
                                          &nbsp;&nbsp;
                                          <input name="btCalcel2" type="button" class="button_80" id="btCalcel2" onclick="
if(confirm('Are you sure to return to list?')) {
	document.myReturnForm.submit();
}
						" value="Cancel" />                                          </td>
                                        </tr>
                                      </table></td>
                                  </tr>
                                </table></td>
                              </tr>
                              
                              </table>
					  </form>
<? } ?>
                    <p align="center"></td>
                  <td align="left" valign="top">&nbsp;</td>
                  <td width="15">&nbsp;</td>
                </tr>
            </table>		</td>
        <td width="17" valign="top" background="../images/object/border_07.gif"><img src="../images/object/border_17.gif" width="17" height="119"></td>
      </tr>
      <tr>
        <td height="16"><img src="../images/object/border_09.gif" width="20" height="16"></td>
        <td height="16" background="../images/object/border_11.gif"><img src="../images/object/border_11.gif" width="1" height="16"></td>
        <td><img src="../images/object/border_13.gif" width="17" height="16"></td>
      </tr>
    </table></td>
        </tr>
      </table></td>
    <td width="1" bgcolor="#10202F"><img src="../../images/blank.gif" width="1" height="1"></td> 
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="4" height="30" align="left" valign="bottom" background="../../images/main/main-t-bg.gif">&nbsp;</td>
    <td height="30" align="center" background="../../images/main/main-t-bg.gif">&nbsp;</td>
    <td width="4" height="30" align="right" valign="bottom" background="../../images/main/main-t-bg.gif">&nbsp;</td>
  </tr>
	
</table>
</body>
</html>
<? 
include("../lib/disconnect.php");
?>

Hacked By AnonymousFox1.0, Coded By AnonymousFox