Location: PHPKode > projects > Web Task Manager with Email/SMS Voting > Calendar/group_func.php
<?php

/*******************/
/* group function */
/*******************/

function group($catview){
  
 $query = "select user_id from calendar_users where username = '".$_SESSION["login"]."'";
 $result = mysql_query($query);
 $rows = mysql_num_rows($result);
 $row = mysql_fetch_object($result);
 $userid=$row->user_id;

 $query = "select * from groupusers inner join groups on groupusers.groupid = groups.groupid where groupusers.userid = ".$userid;
 $result = mysql_query($query);

  // get the category names 
  echo "<select name=gocat onchange=\"javascript:gotocat(this);\">\n";
  echo "\t<option value=0" ;
  if ($catview==0) echo " selected " ;
  echo ">All Groups\n";

  while ($row = mysql_fetch_object($result))
  {
    echo "\t<option value=".$row->GroupID;
    if ($catview==$row->GroupID) echo " selected " ;
    echo ">".stripslashes($row->GroupName)."\n";
  }
  echo "</select>\n";
  
  
}

?>
Return current item: Web Task Manager with Email/SMS Voting