function signUp($member_data) { if (!addMember($member_data)) { return false; } $account = getMember($member_data["email"]); $member_data["member_id"] = $account["member_id"]; if (!addMemberInfo($member_data)) { return false; } return true; }
function main() { init(); switch ($GLOBALS['req']['a']) { case 'getSongs': connect(); display('songs', getSongs()); break; case 'getSongsMin': connect(); display('songsMin', getSongsMin()); break; case 'add100': add100(); display('done', 0); break; case 'getMembers': connect(); display('members', getMembers()); break; case 'validate': display('valid', validate($GLOBALS['req']['text'])); break; case 'addMember': connect(); addMember(); break; case 'getNewImageName': connect(); display('done', getNewImageName()); break; case 'uploadPicture': connect(); uploadPicture(); break; } echo json_encode($GLOBALS['final_print']); disconnect(); }
// set the data $eventTitle = $data['eventName']; $meetingDateTime = $data['startTime']; $meetingEndDateTime = $data['endTime']; $locationID = $data['locationID']; $repeat = $data['repeating']; } $insertforevent = "INSERT INTO events (userID,eventName,startTime,endTime,locationID,repeating,groupID) values({$results},'{$eventTitle}','{$meetingDateTime}','{$meetingEndDateTime}',{$locationID},{$repeat},{$groupID})"; // create the event for the user $insertresult = $conn->query($insertforevent); unset($_POST); header("Location:group.php?id={$groupID}"); } if (isset($_POST['addemail'])) { // submit button calling the add memeber addMember($events); } function removeself() { // remove yourself from the grou global $conn; $groupID = $_GET['id']; $sql = "DELETE FROM events WHERE userID = " . $_COOKIE['userID'] . " AND groupID = {$groupID}"; $results = $conn->query($sql); unset($_POST); // unset the post so you dont get an error header("Location:group.php?id={$groupID}"); // refresh the page to update everything } function deletegroup() {
break; case 'addMember': //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// $formData['name'] = db_clean_text($_POST['name']); $formData['ulink'] = db_clean_text($_POST['ulink']); $formData['position'] = db_clean_int($_POST['position']); $formData['status'] = db_clean_int($_POST['status']); $formData['major'] = db_clean_int($_POST['major']); $formData['student_id'] = db_clean_int($_POST['student_id']); //Verify form if (!secureform_test($verify_key, $verify_action)) { $smarty->assign("url", "./index.php?page=addMember"); $smarty->display('redirectError.tpl'); exit; } addMember($formData['name'], $formData['ulink'], $formData['position'], $formData['status'], $formData['major'], $formData['student_id']); if ($formData['position'] == 20) { $smarty->assign("url", "./index.php?page=listMembers&inactive=1"); } else { $smarty->assign("url", "./index.php?page=listMembers"); } $smarty->display('redirect.tpl'); break; case 'updateMember': //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// $formData['id'] = db_clean_int($_POST['id']); $formData['name'] = db_clean_text($_POST['name']); $formData['ulink'] = db_clean_text($_POST['ulink']); $formData['position'] = db_clean_int($_POST['position']); $formData['status'] = db_clean_int($_POST['status']); $formData['major'] = db_clean_int($_POST['major']);
<?php include_once 'models/add_user_conf.model.php'; include_once 'common.php'; $section_id = $_POST['section']; $fullname = $_POST['fullname']; $job = $_POST['job']; $titlelecture = $_POST['titlelecture']; if ($section_id && $fullname && $job && $titlelecture) { $id = addMember($fullname, $job, $titlelecture, $section_id); } $sections = getAllSection(); require_once 'templates/add_user_conf.template.php';
break; default: editTransaction($option); break; } break; case 'task': editTask($option); break; case 'member': default: switch ($task) { // Now separating New Member from Edit Existing; for MailChimp case 'add': case 'new': addMember($option); break; default: editMember($option); break; } break; } break; case 'editTransaction': editTransaction($option); break; case 'viewMemberMailChimpInfo': viewMemberMailChimpInfo($option); break; case 'editMailingListSubscription':
} if ($job == "getMemberList") { header('Content-Type: application/json'); getMemberList(); } if ($job == "getMemberDetails") { header('Content-Type: application/json'); getMemberDetails(); } if ($job == "setMemberDetails") { header('Content-Type: application/json'); setMemberDetails(); } if ($job == "addMember") { header('Content-Type: application/json'); addMember(); } if ($job == "deleteMember") { header('Content-Type: application/json'); deleteMember(); } if ($job == "memberStateChange") { header('Content-Type: application/json'); memberStateChange(); } if ($job == "getProjectDetails") { header('Content-Type: application/json'); getProjectDetails(); } if ($job == "getProjectResponds") { header('Content-Type: application/json');
<?php include_once 'models/add_user_sem.model.php'; require_once 'common.php'; $fullname = $_POST['fullname']; $mentorname = $_POST['mentorname']; $job = $_POST['job']; $titlelecture = $_POST['titlelecture']; if ($fullname && $mentorname && $job && $titlelecture) { $id = addMember($fullname, $job, $titlelecture, $mentorname); if ($id) { header('Location: add_user_sem.php'); } } $members = getMembers(); require_once 'templates/add_user_sem.template.php';
<?php require_once dirname(__FILE__) . '/../function/func_member.php'; echo '<pre>'; print_r($_POST); echo '</pre>'; $name = $_POST['name_member']; $lastname = $_POST['lastname_member']; $username = $_POST['username']; $password = $_POST['confirm_password']; if (!checkDuplicateMember($name, $lastname)) { $memberID = addMember($name, $lastname, $username, $password); if ($memberID > 0) { header("location: ../membership.php?action=addMemCompleted"); } else { header("location: ../membership.php?action=addMemError"); } } else { header("location: ../membership.php?action=addMemDuplicateError"); }