Example #1
0
function deletegroupset($grpsetid)
{
    $query = "SELECT id FROM imas_stugroups WHERE groupsetid='{$grpsetid}'";
    $result = mysql_query($query) or die("Query failed : " . mysql_error());
    while ($row = mysql_fetch_row($result)) {
        deletegroup($row[0]);
    }
    $query = "DELETE FROM imas_stugroupset WHERE id='{$grpsetid}'";
    mysql_query($query) or die("Query failed : " . mysql_error());
    $query = "UPDATE imas_assessments SET isgroup=0,groupsetid=0 WHERE groupsetid='{$grpsetid}'";
    mysql_query($query) or die("Query failed : " . mysql_error());
    $query = "UPDATE imas_forums SET groupsetid=0 WHERE groupsetid='{$grpsetid}'";
    mysql_query($query) or die("Query failed : " . mysql_error());
    $query = "UPDATE imas_wikis SET groupsetid=0 WHERE groupsetid='{$grpsetid}'";
    mysql_query($query) or die("Query failed : " . mysql_error());
}
Example #2
0
 /**
  \brief Gruppe löschen
 
  Löscht eine Gruppe.
 */
 function Group_delete()
 {
     if (!$this->userdata['rights']['groupedit']) {
         #no permission
         $this->_header("", "no permission");
     }
     $data = $_SESSION['steps'];
     #information message, step 2
     if ($data['deletegroup']) {
         #save step
         unset($data['deletegroup']);
         $_SESSION['steps'] = $data;
         $this->forms['information']['url'] = $this->backtracking->backlink();
         $this->forms['information']['title'] = "Gruppe löschen";
         $this->forms['information']['message'] = "Gruppe erfolgreich gelöscht";
         $this->forms['information']['style'] = "green";
         $this->show('message_information', "Gruppe löschen");
     }
     $id = param_num("id");
     if (!$id) {
         $this->_header("", "id fehlt");
     }
     $return = getGroup($id);
     if (!$return) {
         $this->_header("", "ungültige Gruppe");
     }
     #deletegroup, send
     if ($_REQUEST['send']) {
         if ($_REQUEST['yes_x']) {
             addToLogfile("Gruppe " . $return['name'] . " gelöscht", "Admin", $this->userdata['uid']);
             deletegroup($return['gid']);
             #save step
             $data['deletegroup'] = 1;
             $_SESSION['steps'] = $data;
             $this->_header("admin.php?action=deletegroup&send");
         } else {
             $this->_header();
         }
     } else {
         $this->forms['information']['url'] = "admin.php?id=" . $return['gid'];
         $this->forms['information']['action'] = "deletegroup";
         $this->forms['information']['title'] = "Gruppe löschen";
         $this->forms['information']['message'] = "Gruppe <b>" . $return['name'] . "</b> löschen ?";
         if ($return['gid'] == $this->userdata['gid']) {
             $this->forms['information']['message'] .= "\n          <br><br><b>WARNUNG!!</b><br>\n          <b>Sie sind im Begriff ihre eigene Gruppe zu löschen,<br>\n          Sie könnten dadurch wichtige Rechte unwiederbringlich verlieren!<b/><br>\n          ";
         }
         $this->forms['information']['style'] = "red";
         $this->show('message_question', "Gruppe löschen");
     }
 }
Example #3
0
    $sql = "DELETE FROM events WHERE groupID = {$groupID}";
    // delete all events where the groupID is the same
    $results = $conn->query($sql);
    $sql2 = "DELETE FROM study_groups WHERE groupID = {$groupID}";
    // delete the study group itself
    $results2 = $conn->query($sql2);
    unset($_POST);
    // unset post to prevent errors and then force them back to index.php
    header("Location:../index.php");
}
if (isset($_POST['removeself'])) {
    // submit buttons for removing self and group
    removeself();
}
if (isset($_POST['removegroup'])) {
    deletegroup();
}
function displaygroupinfo($groupID, $eventbool, $passfail, $members, $events)
{
    global $locationName;
    global $locationState;
    global $locationCity;
    global $conn;
    global $userID;
    $isfounder = false;
    if ($passfail == true) {
        // part of the group/public group
        //--- SECTION:VIEWABLE TO ALL USERS ----
        $classname = "SELECT class.courseTitle FROM class INNER JOIN study_groups ON class.courseID = study_groups.courseID WHERE study_groups.groupID = {$groupID}";
        // Select the courseTitle
        $course = $conn->query($classname);
Example #4
0
             header('Location: ' . $urlmode . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/managestugrps.php?cid={$cid}&grpsetid={$_GET['grpsetid']}");
         }
         exit;
     }
 } else {
     if (isset($_GET['addgrp'])) {
         $query = "SELECT name FROM imas_stugroupset WHERE id='{$grpsetid}'";
         $result = mysql_query($query) or die("Query failed : " . mysql_error());
         $page_grpsetname = mysql_result($result, 0, 0);
         $curBreadcrumb .= " &gt; <a href=\"managestugrps.php?cid={$cid}\">Manage Student Groups</a> &gt; <a href=\"managestugrps.php?cid={$cid}&grpsetid={$grpsetid}\">{$page_grpsetname}</a> &gt; Add Group";
     } else {
         if (isset($_GET['delgrp'])) {
             //deleting groupset
             if (isset($_GET['confirm'])) {
                 //if name is set
                 deletegroup($_GET['delgrp'], $_POST['delposts'] == 1);
                 header('Location: ' . $urlmode . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/managestugrps.php?cid={$cid}&grpsetid={$grpsetid}");
                 exit;
             } else {
                 $query = "SELECT name FROM imas_stugroups WHERE id='{$_GET['delgrp']}'";
                 $result = mysql_query($query) or die("Query failed : " . mysql_error());
                 $page_grpname = mysql_result($result, 0, 0);
                 $query = "SELECT name FROM imas_stugroupset WHERE id='{$grpsetid}'";
                 $result = mysql_query($query) or die("Query failed : " . mysql_error());
                 $page_grpsetname = mysql_result($result, 0, 0);
             }
             $curBreadcrumb .= " &gt; <a href=\"managestugrps.php?cid={$cid}\">Manage Student Groups</a> &gt; <a href=\"managestugrps.php?cid={$cid}&grpsetid={$grpsetid}\">{$page_grpsetname}</a> &gt; Delete Group";
         } else {
             if (isset($_GET['rengrp'])) {
                 //renaming groupset
                 if (isset($_POST['grpname'])) {