Author: sheetal
Date: Mon Nov 3 15:02:43 2008
New Revision: 710211
URL: http://svn.apache.org/viewvc?rev=710211&view=rev
Log:
JIRA# OLIO-8 updating addAttendee.php under php webapp. Modified the code to
have an extra check to see if the user is already present in the attendee list
Modified:
incubator/olio/webapp/php/trunk/public_html/addAttendee.php
Modified: incubator/olio/webapp/php/trunk/public_html/addAttendee.php
URL:
http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/public_html/addAttendee.php?rev=710211&r1=710210&r2=710211&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/public_html/addAttendee.php (original)
+++ incubator/olio/webapp/php/trunk/public_html/addAttendee.php Mon Nov 3
15:02:43 2008
@@ -27,8 +27,14 @@
$se = $_REQUEST['id'];
$username = $HTTP_SESSION_VARS["uname"];
if(!is_null($username)){
- $insertuser = "insert into PERSON_SOCIALEVENT values('$username','$se')";
- $connection->exec($insertuser);
+ $checkuserIfAttending = "select count(username) as count from
PERSON_SOCIALEVENT where socialeventid = '$se' and username = '$username'";
+ $result = $connection->query($checkuserIfAttending);
+ $row = $result->getArray();
+ $userExists = $row['count'];
+ if($userExists <= 0){
+ $insertuser = "insert into PERSON_SOCIALEVENT
values('$username','$se')";
+ $connection->exec($insertuser);
+ }
}
$listquery = "select username from PERSON_SOCIALEVENT where socialeventid =
'$se'";
$listqueryresult = $connection->query($listquery);