if ($_POST['oper'] == 'add') { $batchuser = new BatchUser(); $batchuser->pending = $_POST['pending']; $batchuser->enabled = $_POST['enabled']; $batchuser->schoolid = $_POST['schoolid']; $batchuser->batchid = $_POST['batchid']; $batchuser->userid = $_POST['userid']; $batchuser->level = $_POST['level']; $batchuser->create(); $log = new Log($session->user_id, $clientip, "WEB", "CREATED BATCHUSER: "******"WEB", "UPDATED BATCHUSER: "******"WEB", "DELETED BATCHUSER: " . $_POST['id']); $log->create(); $batchuser = BatchUser::get_by_id($_POST['id'])->delete(); } } }
$object->pending = 0; $object->update(); $notification->title = "message"; $notification->itemid = $itemid; $notification->itemtype = "friend"; } else { if ($itemtype == "schooluser") { $object = SchoolUser::get_by_id($itemid); $object->pending = 0; $object->update(); $notification->title = "message"; $notification->itemid = $itemid; $notification->itemtype = "schooluser"; } else { if ($itemtype == "batchuser") { $object = BatchUser::get_by_id($itemid); $object->pending = 0; $object->update(); $notification->title = "message"; $notification->itemid = $itemid; $notification->itemtype = "batchuser"; } else { if ($itemtype == "sectionuser") { $object = SectionUser::get_by_id($itemid); $object->pending = 0; $object->update(); $notification->title = "message"; $notification->itemid = $itemid; $notification->itemtype = "sectionuser"; } else { if ($itemtype == "clubuser") {
if ($object->userid != $session->user_id) { $touser = User::get_by_id($object->userid); } else { if ($object->touserid != $session->user_id) { $touser = User::get_by_id($object->touserid); } } $html .= "Now friends"; } else { if ($notification->itemtype == "schooluser") { $object = SchoolUser::get_by_id($notification->itemid); $school = School::get_by_id($object->schoolid); $html .= "Now a member in School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>"; } else { if ($notification->itemtype == "batchuser") { $object = BatchUser::get_by_id($notification->itemid); $batch = Batch::get_by_id($object->batchid); $school = School::get_by_id($object->schoolid); $html .= "Now a member in Batch <a href='batch.php?id=" . $batch->id . "'>" . $batch->get_batchyear() . "</a> of School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>"; } else { if ($notification->itemtype == "sectionuser") { $object = SectionUser::get_by_id($notification->itemid); $section = Section::get_by_id($object->sectionid); $batch = Batch::get_by_id($object->batchid); $school = School::get_by_id($object->schoolid); $html .= "Now a member in Section <a href='section.php?id=" . $section->id . "'>" . $section->name . "</a> of Batch <a href='batch.php?id=" . $batch->id . "'>" . $batch->get_batchyear() . "</a> of School <a href='school.php?id=" . $school->id . "'>" . $school->name . "</a>"; } else { if ($notification->itemtype == "clubuser") { $object = ClubUser::get_by_id($notification->itemid); $club = Club::get_by_id($object->clubid); $school = School::get_by_id($object->schoolid);
foreach ($ids as $id) { $batch = Batch::get_by_id($id); SectionUser::delete_all_by_schoolid($batch->schoolid); Section::delete_all_by_schoolid($batch->schoolid); BatchUser::delete_all_by_batchid($batch->id); $folder_path = "../../public/schools/" . $batch->schoolid . "/yearbooks/" . $batch->get_batchyear(); rrmdir($folder_path); $batch->delete(); } $log = new Log($session->userid, $clientip, "WEB", "DELETED MULTIPLE BATCHS"); $log->create(); $response = "success"; } else { if ($what == "batchuser") { foreach ($ids as $id) { BatchUser::get_by_id($id)->delete(); } $log = new Log($session->userid, $clientip, "WEB", "DELETED MULTIPLE BATCHUSERS"); $log->create(); $response = "success"; } else { if ($what == "section") { foreach ($ids as $id) { Section::get_by_id($id)->delete(); } $log = new Log($session->userid, $clientip, "WEB", "DELETED MULTIPLE SECTIONS"); $log->create(); $response = "success"; } else { if ($what == "sectionuser") { foreach ($ids as $id) {