I must have not explained it right. It will be on the admin side also. I have started a new thread here viewtopic.php?p=119621#119621
Thanks for all the help.
New at programming-need help on adding code for a form
Moderator: General Moderators
Can anybody who has helped me thus far help me on my other thread. It has been up for 4 days and no help at all. It is located here viewtopic.php?p=119621#119621
I have created a problem some how. I am not sure what I did scorphus, but, When I click approve or hold, I do get a message saying it was approved, but the testimonial doesn't go away. It's like the page isn't refreshing. It will stay on the new testimonial page until I click on the link for new testimonials in the menu. You can see what I mean here http://www.lsscripts.com/testimonials/admin/manage.php
Click on the approve or hold and it will say it was approved but ti stays there. Also if you click hold it will stay on the hold page until you click the view on hold idea via the menu.
Here is the code:
Click on the approve or hold and it will say it was approved but ti stays there. Also if you click hold it will stay on the hold page until you click the view on hold idea via the menu.
Here is the code:
Code: Select all
<?
$status = (!empty($_GET['status']) ? $_GET['status'] : '%');
include "../inc/config.php";
$displaymessage =0;
switch($action) {
case "approve":
$displaymessage =1;
db();
mysql_query("UPDATE ls_testimonials SET approved='y' WHERE id=$id");
db_close();
break;
case "hold":
$displaymessage =2;
db();
mysql_query("UPDATE ls_testimonials SET approved='h' WHERE id=$id");
db_close();
break;
case "delete":
$displaymessage =3;
db();
mysql_query("DELETE FROM ls_testimonials WHERE id=$id");
db_close();
break;
default:
break;
}
db();
$query = "SELECT * FROM ls_testimonials WHERE approved LIKE '$status'";
$formdata_res=mysql_query($query) or die("query failed: " . mysql_error());
$pagecontent.="<table width=760 border=0 cellspacing=0 cellpadding=0
<tr>
<td width=150></td>
<td width=610> </td>
</tr>
<tr>
<td valign=top><table width=150 border=1 cellpadding=2 cellspacing=2 bordercolor=#FFFFFF>
<tr>
<td bordercolor=#000000 bgcolor=#CCCCCC><font size=2><b>Menu</b></font></td>
</tr>
<tr>
<td bordercolor=#000000><font size=2><p><a href=add.php>Add Testimonials</a><br>
<a href=manage.php?status=n>New Testimonials</a><br>
<a href=manage.php?status=h>On Hold Testimonials</a><br>
<a href=manage.php?status=y>Active Testimonials</a><br>
<a href=code.php>Generate Code</a></p></font></td>
</tr>
</table></td>";
$pagecontent.="<td valign=top>
<table width=99% border=1 align=center cellpadding=0 cellspacing=1 bordercolor=#FFFFFF>";
while ($formdata=mysql_fetch_object($formdata_res)) {
$client_id=htmlentities($formdata->client_id);
$link_display=htmlentities($formdata->link_display);
$email=htmlentities($formdata->email);
$company=htmlentities($formdata->company);
$testimonials=htmlentities($formdata->testimonials);
$pagecontent.="<td bordercolor=#999999 bgcolor=#F1F1F1><font size=2><b>Client ID#:</b></font>{$client_id}</td>
<td> </td>
<td> </td>
</tr>
<tr bordercolor=#666666>
<td width=203 bgcolor=#F1F1F1><font size=2><b>Display:</b></font></td>
<td width=203 bgcolor=#F1F1F1><font size=2><b>Email:</b></font></td>
<td width=203 bgcolor=#F1F1F1><font size=2><b>Website:</b></font></td></tr>
</tr>
<tr bordercolor=#666666>
<td width=203 bgcolor=#E9EDF0><font size=2>{$link_display}</font></td>
<td width=203 bgcolor=#E9EDF0><font size=2><a href='mailto:{$email}'>{$email}</a></font></td>
<td width=203 bgcolor=#E9EDF0><font size=2><a href='{$company}' target=new>{$company}</a></font></td>
</tr>
<tr bordercolor=#666666>
<td colspan=2><font size=2><b>Testimonial:</b></font><textarea style=width=300; border: 1; rows=1>{$testimonials}</textarea></td>
<td><center><a href='?id={$formdata->id}&action=approve'><img src=../inc/skins/default/images/approve.gif width=17 height=17 border=0 ALT=Approve></a>
<a href='?id={$formdata->id}&action=hold'><img src=../inc/skins/default/images/hold.gif width=17 height=17 border=0 ALT=Hold></a>
<a href='?id={$formdata->id}&action=delete'><img src=../inc/skins/default/images/delete.gif width=17 height=17 border=0 ALT=Delete></a> </center></td>
</tr>
<tr>
<td colspan=3> </td>
</tr>";
}
if ($displaymessage == 0)
{
$pagecontent.="</table></td>
</tr>
<tr>
<td></td>
<td></td>";
}
else if ($displaymessage ==1)
{
$pagecontent.="</table></td>
</tr>
<tr>
<td></td>
<td>Item {$id} Approved</td>";
}
else if ($displaymessage ==2)
{
$pagecontent.="</table></td>
</tr>
<tr>
<td></td>
<td>Item {$id} On Hold</td>";
}
else if ($displaymessage ==3)
{
$pagecontent.="</table></td>
</tr>
<tr>
<td></td>
<td>Item {$id} Deleted</td>";
}
//<!-- DO NOT REMOVE THIS CODE BELOW -->
$pagecontent.="</tr>
<tr>
<td> </td>
<td><div align=center>
<p> </p>
<p><font size=2>Powered by: <a href=http://www.lsscripts.com>LS Testimonials</a></font>
<br>
<font size=2>Ver. 1.0</font> </p>
</div></td>
</tr>
</table>";
//<!-- COPYRIGHT CODES END -->
db_close();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Approval Page</title>
</head>
<body><?=$pagecontent;?></body>
</html>