Edit and Update multiple row

///////////////////////////// Edit and Update coding /////////////////////////////////////////////////////////////////
if(isset($_REQUEST['dependent_name'])){
	
		foreach($_REQUEST['dependent_name'] as $key=>$val){	
			if(is_array($_REQUEST['dependent_name'][$key])){
				foreach($_REQUEST['dependent_name'][$key] as $k=>$v){
					//echo $key."------->".$val."<br>";
					$dependenet_id = $k;
					$dependent_name = $_REQUEST['dependent_name'][$key][$k];
					$dependent_date_of_birth = ($_REQUEST['dependent_date_of_birth'][$key][$k] == '') ? '' : StringUtility::setFormatedDateBritish($_REQUEST['dependent_date_of_birth'][$key][$k]);
					 $query = "UPDATE student_brp_dependent SET 
							dependent_name = '".$dependent_name."',
							dependent_date_of_birth = '".$dependent_date_of_birth."' WHERE id = '".$dependenet_id."'";
					
					mysql_query($query);
				}
			}else{
				
				$dependent_name = $_REQUEST['dependent_name'][$key];
				$dependent_date_of_birth = ($_REQUEST['dependent_date_of_birth'][$key] == '') ? '' : StringUtility::setFormatedDateBritish($_REQUEST['dependent_date_of_birth'][$key]);
				$query = "INSERT INTO student_brp_dependent(brp_id,dependent_name,dependent_date_of_birth) VALUES('".$brp_id."','".$dependent_name."','".$dependent_date_of_birth."')";
				mysql_query($query);
			}
		  
		}
	}
//////////////////////////////////////// End edit and update coding /////////////////////////////////////////////
<!-------------------- HTML code for multiple row ----------------------------->
		<h2>Dependants</h2>
		<table id="dependants_table" border=1;>
		  <tr valign="top">
			<td style="font-weight:bold" width="10%">
					Dependant Name:
			</td>		
			<td style="font-weight:bold" width="10%">	
					Dependant Date of birth:
			</td>
		  </tr>
		  <?php
			if($brp_id >0){
			while($row_edit = mysql_fetch_array($result_edit)){
				$dependent_id = $row_edit['id'];
				$dependent_name = $row_edit['dependent_name'];
				$dependent_date_of_birth = $row_edit['dependent_date_of_birth'];
		  ?>
		  <tr>
				<td>
					<input type='text' style='width:80px;' class='dependent_name'  name='dependent_name[][<?=$dependent_id;?>]' value='<?php echo $dependent_name; ?>'/>
				</td>		
				<td>	
					<input type='text' style='width:80px;' class='dependent_date_of_birth'  name='dependent_date_of_birth[][<?=$dependent_id;?>]' value='<?php echo ($dependent_date_of_birth) ? StringUtility::getFormatedDateBritish($dependent_date_of_birth) : ""; ?>'/>
				</td>
		  </tr>
		  <?php } }?>
		</table>
		<div id="multi_row" style="float:left;margin-left:20px;cursor:pointer;border:0px solid red;">Add New Row (+)</div><br><br>
<!-------------------- End HTML code ------------------------->
//////////////////////////////// Java script code for multiple row ////////////////////////////////////////////
$('.dependent_date_of_birth').live('focus', function() {
		$(this).datepicker({
			changeMonth: true,
			changeYear: true,
			dateFormat: 'dd-mm-yy',			
			yearRange: (new Date().getFullYear()-100)+ ':' + (new Date().getFullYear()+10),
			onSelect: function(){
			}
		}).datepicker('show');
		true;
	});
	$('#multi_row').click(function(){
		var dependent_name = "<input type='text' style='width:80px;' class='dependent_name'  name='dependent_name[]'/>";
		var dependent_date_of_birth = "<input type='text' style='width:80px;' class='dependent_date_of_birth'  name='dependent_date_of_birth[]'/>";
		var new_row_for_apply = "<tr><td>"+dependent_name+"</td><td>"+dependent_date_of_birth+"</td></tr>";
		$("#dependants_table").append(new_row_for_apply);
	});
////////////////////////////// end java script code //////////////////////////////////////////////////////////////

date picker

Java Script required for date picker

Two file required for date picker 
<script type="text/JavaScript" src="js/jquery-ui.js"></script>
<link href="css/jquery-ui-1.7.3.custom.css" type="text/css" rel="stylesheet" />

<script language="JavaScript">
$(document).ready(function(){ 
	$('.datepicker').datepicker({
		changeMonth: true,
		changeYear: true,
		dateFormat: 'dd-mm-yy',
		onSelect: function() {		
		}
	});	
});
</script>

Date picker required file

simple mail format

$message = 'Hello Admin,<br><br>Today is the [event] of [user_name].<br><br>Thanks ';
$search 	= array('[event]', 
                  '[user_name]');
$replace	= array($event, 
		 $adminName);
						
 $message =str_replace($search,$replace,$message);
		
 $headers  = "From: ".$config->siteName."<".$config->siteEmail.">\r\n";
 $headers .= "Reply-To: ".$config->siteName." <".$config->siteEmail.">\r\n";
 $headers .= 'MIME-Version: 1.0' . "\n";
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 @mail(ToMail, subject , $message ,$headers );	

searching from date to date

$date_added_from 	= isset($_REQUEST['date_added_from']) ? utility::setFormatedDate($_REQUEST['date_added_from']) : "";
$date_added_to 	= isset($_REQUEST['date_added_to']) 	? utility::setFormatedDate($_REQUEST['date_added_to']) : "";
if($date_added_from && $date_added_to) {
    $where	.= " AND date_added BETWEEN '$date_added_from 00:00:00' and '$date_added_to 23:59:59' ";
    $next_page_condition.="&date_added_from=".$_REQUEST['date_added_from']."&date_added_to=".$_REQUEST['date_added_to']." ";
}else if($date_added_from){
	$where	.= " AND date_added >= '$date_added_from' ";
    $next_page_condition.="&date_added_from=".$_REQUEST['date_added_from'];
}else if($date_added_to){
	$where	.= " AND date_added <= '$date_added_to' ";
    $next_page_condition.="&date_added_to=".$_REQUEST['date_added_to'];
}

Fetch table content

`

<?php
$site_id = $config->siteId;
echo $sql = "SELECT * FROM site_shipping_policy WHERE site_id = $site_id ORDER BY shipping DESC";
$result = $db->query($sql);
$data = "";	
echo "<pre>";	
if ($db->num_rows($result) > 0){
	while($row = $db->next_record($result)){
		print_r($row);
	}
}
?>

`