incubator-olio-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shee...@apache.org
Subject svn commit: r710211 - /incubator/olio/webapp/php/trunk/public_html/addAttendee.php
Date Mon, 03 Nov 2008 23:02:44 GMT
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);



Mime
View raw message