else if(isset($_POST['save_beneficiary_number']))
	{
		$group_id = $_POST['group_id'];
		$record_type = $_POST['record_type'];
		$no_male = $_POST['male_beneficiary_number'];
		$no_female = $_POST['female_beneficiary_number'];
		$project_type = $_POST['project_type'];
		$record_id = $_POST['record_id'];
		
		save_number_beneficiaries($group_id,$record_type,$record_id,$no_male,$no_female,$project_type);
		viewgroupInfo($group_id);
	}	
	
	
	function Beneficiaries_total_number($group_id)
	{
		require('connection.php');
		$query = mysql_query("SELECT * FROM beneficiaries_total_numbers WHERE group_id='$group_id' AND project_type='cmi' ",$connect) or die(mysql_error());
		
		if(mysql_num_rows($query)==0)
		{
			$value_male=0;
			$value_female=0;
			$record_type = "new";
		?>
			 <table class="ExcelTable2007">
			 <tr><td>Number of Male beneficiaries: </td> <td> 0 </td> </tr>
			 <tr><td>Number of Female beneficiaries: </td> <td> 0 </td> </tr>
			 </table>
			
		<?php
		}
		else
		{
			$fetch_benefici_records = mysql_fetch_array($query);
			
			$value_male=$fetch_benefici_records['male_beneficiaries'];
			$value_female=$fetch_benefici_records['female_beneficiaries'];
			$record_type = "existing";
			$record_id = $fetch_benefici_records['record_id'];
		?>
			 <table class="ExcelTable2007">
			 <tr><td> Number of Male beneficiaries: </td> <td> <?php echo $fetch_benefici_records['male_beneficiaries']; ?> </td> </tr>
			 <tr><td> Number of Female beneficiaries: </td> <td> <?php echo $fetch_benefici_records['female_beneficiaries']; ?> </td> </tr>
			 </table>
			 
		<?php
		}
		?>
		<br> <div class="main">
	            <div class="panel">
	                <a href="#login_form" id="login_pop">Edit beneficiaries number </a>
	            </div>
	 
        </div>
		
		<!-- popup form #1 -->
	        <a href="#x" class="overlay" id="login_form"></a>
	        <div class="popup">
	            <h2>Edit Number of Project Beneficiaries</h2>
	          
	            <div>
				
				<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
				
				<input type="hidden" name="group_id" value="<?php echo $group_id; ?>">
				<input type="hidden" name="project_type" value="cmi">
				<input type="hidden" name="record_type" value="<?php echo $record_type;  ?>" >
				<input type="hidden" name="record_id" value="<?php echo $record_id;  ?>" >
				
			 <table>
			 <tr><td>Number of Male beneficiaries: </td> <td> <input type="text" name="male_beneficiary_number" value="<?php echo $value_male; ?> " style="text-align:center;"> </td> </tr>
			 <tr><td>Number of Female beneficiaries: </td> <td> <input type="text" name="female_beneficiary_number" value="<?php echo $value_female; ?> " style="text-align:center;" > </td> </tr>
			 </table>
				
				<input type="submit" name="save_beneficiary_number" value="Update" class="button">
				
				</form>
				
				</div>
	            <a class="close" href="#close"></a>
	        </div>
		
		<?php
	}//end fucntion for beneficiaries number
	