<?php
$PageSecurity = 11;
//echo $_SERVER['QUERY_STRING'];exit;
include('includes/session.inc');

     $sql='select id, issue_slipno from addissue order by id desc limit 0,1';
	 $result = DB_query($sql,$db);
	  $numrows = DB_num_rows($result);
	 if($numrows>0)
	 {
	
			 $i=0;
			 $strmax = "";
			 $myrow=DB_Fetch_array($result);
			 
			 if($myrow['issue_slipno'] !='')
			 {
			        $val= substr($myrow['issue_slipno'],7);
					 $strChar = substr($myrow['issue_slipno'],0,7);
				
					 if($val!="")
					 {
						 $arr[$i] = $val;
						 $i++;
					}
			
				
			
			if(is_array($arr))
			{ 
				$maxval =  max($arr);
			}
			else
			{
				$maxval=0;
			}
		}
		else
		{
		 $strChar = ISSUE."/".P;
		}
	}
	
	
	 
	$strFinal = $maxval+1;
	$strBothFinal = $strChar.str_pad($strFinal,4,"0",STR_PAD_LEFT);
   echo  $strBothFinal ; 

?>
