<?php

function S_HW($COMMAND,$S_HW) {
global $ARG1,$ARG1_VAL,$result,$thiss,$error;
 if($COMMAND=='POST_VERIFY') { 
	$S_HW_arr=split(":",$_POST['S_HW']);
	if(!$S_HW_arr[5]) $error.="ZBYT KROTKI WPIS S_HW (Adres sprzetowy), uzywaj dwukropkow do oddzielania adresu."; 
	if($S_HW_arr[6]) $error.="ZBYT DLUGI WPIS S_HW (Adres sprzetowy), za duzo dwukropkow."; 
	 foreach($S_HW_arr as $S_HW_arr_wypis) {
//		echo "WYPIS $S_HW_arr_wypis <br> \n ";	
		if(!( (($S_HW_arr_wypis[0]<='9')&&($S_HW_arr_wypis[0]>='0')) || ($S_HW_arr_wypis[0]=='A') || ($S_HW_arr_wypis[0]=='B') || ($S_HW_arr_wypis[0]=='C') || ($S_HW_arr_wypis[0]=='D') || ($S_HW_arr_wypis[0]=='E') || ($S_HW_arr_wypis[0]=='F')  || ($S_HW_arr_wypis[0]=='a') || ($S_HW_arr_wypis[0]=='b') || ($S_HW_arr_wypis[0]=='c') || ($S_HW_arr_wypis[0]=='d') || ($S_HW_arr_wypis[0]=='e') || ($S_HW_arr_wypis[0]=='f')  )) 	$error.="ZLY WPIS S_HW (NIEWLASCIWE ZNAKI uzywaj duzych znakow od 0...F) ."; 
		if(!( (($S_HW_arr_wypis[1]<='9')&&($S_HW_arr_wypis[1]>='0')) || ($S_HW_arr_wypis[1]=='A') || ($S_HW_arr_wypis[1]=='B') || ($S_HW_arr_wypis[1]=='C') || ($S_HW_arr_wypis[1]=='D') || ($S_HW_arr_wypis[1]=='E') || ($S_HW_arr_wypis[1]=='F') || ($S_HW_arr_wypis[1]=='a') || ($S_HW_arr_wypis[1]=='b') || ($S_HW_arr_wypis[1]=='c') || ($S_HW_arr_wypis[1]=='d') || ($S_HW_arr_wypis[1]=='e') || ($S_HW_arr_wypis[1]=='f') )) 	$error.="ZLY WPIS S_HW (NIEWLASCIWE ZNAKI uzywaj duzych znakow od 0...F) ."; 
	 }
	//print_r($S_HW_arr);
	//$error.="ZLY WPIS S_HW (Adres sprzetowy $S_HW) ."; 
	
  } else {
  if($_SESSION['CURRENT_MENU']==$thiss->DETECT_EDIT_FUNCTION) {

      if(strstr($_SESSION[$thiss->DETECT_TABLE_COLUMN]['PERMEDIT']['S_HW'],"RW")) {
        GETFORMITEM($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDIT_TEMPLATE']['S_HW'],$_SESSION[$thiss->DETECT_TABLE_COLUMN]['TYPE']['S_HW'],'S_HW');
	 echo " ( ".$S_HW." ".$thiss->DETECT_TABLE_COLUMN." )" ;
       }

  
  } else     echo $S_HW."";
 }

}

?>
