<h2><strong><i class="fa fa-wrench fa-1x" aria-hidden="true"></i> ตั้งค่าทั่วไปของระบบ</strong> </h2>
<div align="right"><a href="?op=system&module=data" class="btn btn-secondary" role="button"><i class="fa fa-share" aria-hidden="true"></i> ขั้นตอนต่อไป</a> </div>

<?php
if($_POST['action']=="save"){
	//echo "<center><img src=\"images/reload.gif\" width=\"48\" height=\"48\" alt=\"\"/><br>บันทึกข้อมูล</center>";
	
	
	
	$fschool_name=$_POST['fschool_name'];
    $furl_rms=$_POST['furl_rms'];
	$finstitution=$_POST['finstitution'];
	$faddress=$_POST['faddress'];
	$fsystem_name_th=$_POST['fsystem_name_th'];
	$fsystem_name_en=$_POST['fsystem_name_en'];
	$fsystem_name_short=$_POST['fsystem_name_short'];


	
	update("system","institution='$finstitution',address='$faddress',school_name='$fschool_name',url_rms='$furl_rms',system_name_short='$fsystem_name_short',system_name_en='$fsystem_name_en',system_name_th='$fsystem_name_th',link_img_student='$flink_img_student' ","where system_id='1'");
	//update("regis_system","school_name='$fschool_name' ","where system_id='1' ");
	insert("NULL,'ตั้งค่าเริ่มต้นของระบบ','$today $time','$_SESSION[name]' ","regis_system_log");
	$_SESSION['msg']="บันทึกข้อมูลเรียบร้อยแล้ว ".thai2($today)." $time";
	
	echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=system&module=set\">";
	exit();
}


?>

   
<form role="form" name="ss01" id="ss01" class="form-group" enctype="multipart/form-data"  method="post" action="">       
     <div class="row">
	
 	      <div class="col-lg-12">
		   <div class="form-group" align="left">
      <label for="facademicYear">ชื่อระบบ (ภาษาไทย)</label>
      <input name="fsystem_name_th" type="text" class="form-control" id="system_name_th" value="<?=$system_name_th?>" >
    		  </div></div>	 
          	      <div class="col-lg-12">
		   <div class="form-group" align="left">
      <label for="facademicYear">ชื่อระบบ (ENG)</label>
      <input name="fsystem_name_en" type="text" class="form-control" id="system_name_en"  value="<?=$system_name_en?>" >
    		  </div></div>	 
          	      <div class="col-lg-12">
		   <div class="form-group" align="left">
      <label for="facademicYear">ชื่อสถานศึกษา</label>
      <input name="fsystem_name_short" type="text" class="form-control" id="system_name_short" value="<?=$system_name_short?>" >
    		  </div></div>	 
	
	
		 

		 
 	      <div class="col-lg-12">
		   <div class="form-group" align="left">
      <label for="facademicYear">ชื่อสถานศึกษา</label>
      <input name="fschool_name" type="text" class="form-control" id="fschool_name" placeholder="วิทยาลัยxxxxxxxx" value="<?=$school_name?>" >
    		  </div></div>	 
		 
		 
		  	      <div class="col-lg-12">
		   <div class="form-group" align="left">
      <label for="facademicYear">สังกัดสถาบัน</label>
      <input name="finstitution" type="text" class="form-control" id="finstitution" placeholder="สถาบันการอาชีวศึกษาxxxxxxxx" value="<?=$institution?>" >
    		  </div></div>	  
		 
		   <div class="col-lg-12">
		   <div class="form-group" align="left">
      <label for="facademicYear">ที่อยู่วิทยาลัย</label>
      <input name="faddress" type="text" class="form-control" id="faddress"  value="<?=$address?>" >
    		  </div></div>	 
		 

		      <div class="col-lg-12">
		   <div class="form-group" align="left">
      <label for="facademicYear">URL ระบบ RMS</label>
      <input name="furl_rms" type="text" class="form-control" id="furl_rms" placeholder="http://rms.xxxxx.xx.xxx" value="<?=$url_rms?>" >
  
		  </div></div>	   
	
		  <div class="col-lg-12">
		   <div class="form-group" align="left">
      <label for="flink_img_student">URL ระบบ RMS ลิงค์รูปนักศึกษา http://rms.xxxxx.xx.xxx/files/importpicstd/01/</label>
      <input name="flink_img_student" type="text" class="form-control" id="flink_img_student" placeholder="http://rms.xxxxx.xx.xxx/files/importpicstd/01/" value="<?=$link_img_student?>" >
  
		  </div></div>	  

			  


		
	
  <div class="row">  
     
      	<div class="col-lg-12"> <center>                         
<?php
	if($_SESSION['msg']!=""){
		$msg=$_SESSION['msg'];
		echo"<div class=\"alert alert-success\"><strong>Success!</strong> $msg.</div>";
		unset($_SESSION['msg']);
		
		
	}
	
?>	</center>    
      </div>
	
		<div class="col-lg-12">  <center>    
			<button type="submit" class="btn btn-success" id="btnConfirm" ><i class="fa fa-save fa-fw"></i> บันทึกข้อมูล</button>
						<input name="action" type="hidden" id="action" value="save"></center>    
            </div>
                                
                                      
    </div>
</div>

			</form>
