<?php

//@2012-12-15 funkcja proponuje nowy numer umowy i go pokazuje uzytkownikowi
function P_DEALNUMBER($COMMAND,$ARG1_VAL) {
global $thiss,$ARG1,$ARG1_VAL,$result;
 if ($COMMAND == 'POST_VERIFY') {
 
	 if ($_SESSION['CURRENT_MENU'] == $thiss->DETECT_EDIT_FUNCTION) {
	 } else {
 		$sql="select ID+1 as ID from DEALS_TABLE order by ID desc limit 1";
			while ($h=mysql_fetch_object($result)) {
				echo "Prawdopodobny Nowy numer umowy: <b>".$h->ID."</b><br>";
			}
		ZAP_SQL($sql);
		while ($h=mysql_fetch_object($result)) {
			$_POST['P_DEALNUMBER']=$h->ID;
		}
 		
   }
 } else {
 

  if ($_SESSION['CURRENT_MENU'] == $thiss->DETECT_EDIT_FUNCTION) {
   echo $_SESSION['USERS2_COLUMN']['EDITRECORD']['P_DEALNUMBER']." ";
   GETFORMITEM($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['P_DEALNUMBER'], $_SESSION[$thiss->DETECT_TABLE_COLUMN]['TYPE']['P_DEALNUMBER'], 'P_DEALNUMBER'); 
   echo "&nbsp; <a href='$PHP_SELF?MENU_INIT=P_DEALNUMBER' target='blank'><img src=icon/print.gif border=0 alt=DRUKUJ></a> ";
  } else if ($_SESSION['CURRENT_MENU'] == 'NEW_RECORD') {
	$sql="select ID+1 as ID from DEALS_TABLE order by ID desc limit 1";
	ZAP_SQL($sql);
	while ($h=mysql_fetch_object($result)) {
		echo "Prawdopodobny Nowy numer umowy: <b>".$h->ID."</b><br>";
	}
  } 
  
  
  else if ($_SESSION['CURRENT_MENU'] == 'P_DEALNUMBER') {
   require("icon/superedit-deal.frm");
  }
 }
} //EOF function P_DEALNUMBER

