php弹出窗口,更新窗体 - 关闭弹出窗口,如果de,则刷新父页面 [英] php pop-up, update form - close popup window and refresh parent page if de

查看:70
本文介绍了php弹出窗口,更新窗体 - 关闭弹出窗口,如果de,则刷新父页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有父页面为data.php ...



我显示所有用户的详细信息...当我点击p.png(命名时)作为编辑)



它将获得cid,qid和status ...到弹出页面,我想编辑update.php页面中的其余细节。 ..



I have parent page as data.php...

I am displaying details of all users... and when i click on p.png(named as EDIT)

it will get the cid, qid and status... to popup page which i want to edit the rest of details in a update.php page...

<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>All Calls & Actions </title>

	<!-- Add jQuery library -->
	<script type="text/javascript" src="lib/jquery-1.10.2.min.js"></script>

	<!-- Add mousewheel plugin (this is optional) -->
	<script type="text/javascript" src="lib/jquery.mousewheel.pack.js?v=3.1.3"></script>

	<!-- Add fancyBox main JS and CSS files -->
	<script type="text/javascript" src="source/jquery.fancybox.pack.js?v=2.1.5"></script>
	<link rel="stylesheet" type="text/css" href="source/jquery.fancybox.css?v=2.1.5" media="screen" />

	<!-- Add Button helper (this is optional) -->
	<link rel="stylesheet" type="text/css" href="source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />

</head>
<body>
<form name="" action="" method="post">
<table>
<tr>
	<th>SNo</th><th>Caller ID</th><th>Eq.ID</th><th>Nature of Complaint</th><th>Caller Name</th><th>Call Dept</th><th>Call Date & Time</th><th>Cont.Type</th><th>Status</th><th>Edit</th>
</tr>

<?php

$conn = mysql_connect("localhost","root","") or die("Unable to connect to Localhost ".mysql_error());
$db = mysql_select_db("renownan_sample") or die("Unable to Select Database ".mysql_error());
$ct = 1;
$query = "SELECT * FROM cms WHERE status!='working' ";
$exe = mysql_query($query);
while($dt=mysql_fetch_array($exe))
{
		echo "<tr>";
		echo "<td>".$ct."</td>";
		echo "<td>".$dt['callerid']."</td>";
		echo "<td>".$dt['eid']."</td>";
		echo "<td>".$dt['natureofcomp']."</td>";
		echo "<td>".$dt['callername']."</td>";
		echo "<td>".$dt['callerdept']."</td>";
		echo "<td>".$dt['cdate']."</td>";
		echo "<td>".$dt['type']."</td>";
		echo "<td>".$dt['status']."</td>";
		echo "<td>";
		echo "<a class='fancybox fancybox.iframe' href='update.php?cids=$dt[callerid]&&eid=$dt[eid]&&sts=$dt[status]'><img src='p.png' height=35px width=75px></img></a>";
		echo"</td>";
		echo"</tr>";
		$ct=$ct+1;
}
?>
</table>
</form>
</body>
</html>







当打开data.php页面时,将显示如下链接



数据php页面



现在点击待处理按钮时尊敬的用户cid ,开斋节,将进入如下弹出页面



弹出第





所以在填写详细信息后我点击提交按钮..



详情正确更新,但弹出窗口并没有关闭它自己..



所以我希望在更新细节后关闭弹出窗口,父窗口应该在弹出窗口关闭后刷新它。





弹出框代码如下






When open data.php page that will display as in bellow link

data php page

Now When click on pending button the respected user cid, eid, will get in to popup page as below

pop up page


so after filling the details i'm clicking on submit button..

The details are updating correctly, but the popup doesn't closing it self..

So i want close the popup after updating the details and the parent page should refresh it self after the popup close.


The popup box code as follows

<?php
session_start();
$cd=$_GET['cids'];
$eqd=$_GET['eid'];
//echo "Values are:".$cd." && ".$eqd;
?>

<head>
<script src='jquery-1.11.2.min.js'></script>
</head>
<body>
<center>

<h2>Pending Call Details</h2>

<table border=0>
	<tr>
		<th>Caller ID:</th>	<td><?php echo $cd;	?></td>	<td>     </td><th>Eq.ID:</th>	<td><?php echo $eqd; ?></td>
	</tr>
</table>
<br>
<form action="" method="post">

<table border=0>
	
	<tr>
		<th>Nature of Complaint:</th><td><input type="text" name="d" id="d"></td>	<td>     </td><th>Caller Name:</th><td><input type="text" name="f" id="f"></td>
	</tr>	
	<tr>
	 <th>Call Dept:</th><td><input type="text" name="g" id="g" ></td>
	 	<td>     </td>
	    		<!--<th>PO Date:</th><td><input type="datetime-local" name="k" id="k"></td>-->
			<td>     </td>
	 </tr>
	  <tr>
	    	
			<th>Cont. Type:</th><td><input type="text" name="l" id="l"></td>
			<td>     </td>
			<th>Status:</th> <td><input type="text" name="n" id="n"></td>
	 </tr>
</table>
<br>
<center><input type="submit" name="pend_sub" value="Submit Pending"></center>
</form>
</center>
</body>
</html>
<?php
$dd=$cd;
if(isset($_POST['pend_sub']))
{
$noc=$_POST['d'];
$cn=$_POST['f'];
$cdept=$_POST['g'];
$type=$_POST['l'];
$status=$_POST['n'];
$dd=$cd;
$ee=$eqd;

$conn = mysql_connect("localhost","root","") or die("Unable to connect to Localhost ".mysql_error());
$db = mysql_select_db("renownan_sample") or die("Unable to Select Database ".mysql_error());
$query = "UPDATE cms SET natureofcomp='$noc', callername='$cn', callerdept='$cdept', type='$type', status='$status' WHERE callerid='$dd' and eid='$ee' ";
$exe = mysql_query($query);

	if(!$exe)
	{
		die("unable to update cms table ".mysql_error());
	}
	else
	{
		echo"Status updated added successfully"; 
	}
	
mysql_close();
}
?>





Please give a solution



Thanks in advance :)



Please give a solution

Thanks in advance :)

推荐答案

conn = mysql_connect(\"localhost\",\"root\",\"\") or die(\"Unable to connect to Localhost \".mysql_error());
conn = mysql_connect("localhost","root","") or die("Unable to connect to Localhost ".mysql_error());


db = mysql_select_db(\"renownan_sample\") or die(\"Unable to Select Database \".mysql_error());
db = mysql_select_db("renownan_sample") or die("Unable to Select Database ".mysql_error());


ct = 1;
ct = 1;


这篇关于php弹出窗口,更新窗体 - 关闭弹出窗口,如果de,则刷新父页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆