Click here to Skip to main content
15,887,338 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
PHP
<?php
if(isset($_POST['submit']))
{
$branch=$_POST['Region'];
if($_POST['Region'] =='' || $_POST['Region']=='ALL')
{
$Qry="select Branch_code,Palmtec_id,Download_status from tbl_download order by Branch_code,Palmtec_id";	
}
else
{
	$Qry="select Branch_code,Palmtec_id,Download_status from tbl_download where Branch_code='$branch' order by Branch_code,Palmtec_id";
}
	$macid=$_POST['brmacid'];
	if($_POST['brmacid']=='' || $_POST['brmacid']=='ALL')
	{
		$Qry.="";
	}
	else
	{
		$Qry="select Branch_code,Palmtec_id,Download_status from tbl_download where Branch_code='$branch' and Palmtec_id='$macid' order by Branch_code,Palmtec_id";
	}
	
	$up=$_POST['up'];
	if($_POST['up']=='0' || $_POST['up']=='1')
	{
	$Qry="update tbl_download set Download_status='$up' where Branch_code='$branch' and Palmtec_id='$macid' 
	(select Branch_code,Palmtec_id,Download_status from tbl_download
     where Branch_code='$branch' and Palmtec_id='$macid') 
	";	
	}    	
	$Res	=	mssql_query($Qry);	
	//echo $Qry;
	echo "<table border ='1' align ='center' cellpadding='1' cellspacing='1'  width='900' bgcolor='#FFFFFF' style='border:1px solid #0080FF;' >"	;
	echo "<tr><th style='background:#58ACFA;'>S.No</th>
	      <th style='background:#58ACFA;'>Branch_code</th>
	      <th style='background:#58ACFA;'>Palmtec_id</th>
	      <th style='background:#58ACFA;'>Download_status</th></tr>";


What I have tried:

I had tried Javascript popup but the problem is I have three fields...every field displays alert message on button click......I want to create a condition like only when an update is made the alert box must work...orelse it has to be disabled... Can anyone help me out? Plz...
Posted
Updated 16-Mar-16 21:01pm
v2
Comments
Sinisa Hajnal 17-Mar-16 6:03am    
How do you differentiate between which field is updated?
alia007 17-Mar-16 6:54am    
I got it working like charm now...I use specific id and name for each field@sinisa
I just added a statement within the block and now its working fine...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900