Ejemplo n.º 1
0
         updateContact($contact);
     } else {
         if (isset($_POST['updateContactType'])) {
             $contactType = new PersonType($_GET['contactTypeID']);
             updateContactType($contactType);
         } else {
             displayContacts($contact);
         }
     }
 } else {
     if ($_GET['action'] == editPerson && $_SESSION['access'] >= 50 || $_GET['action'] == showPerson) {
         //get the new group type corresponding to the ID
         $contact = new Person($_GET['contactID']);
         //if this is an update then update the contact
         if (isset($_POST['updateContact'])) {
             updateContact($contact);
         } else {
             displayContacts($contact);
         }
     } else {
         if ($_GET['action'] == editGroupType && $_SESSION['access'] >= 50 || $_GET['action'] == showGroupType) {
             //get the new group type corresponding to the ID
             $groupType = new ContactType($_GET['groupTypeID']);
             //if this is an update then update the contact
             if (isset($_POST['updateGroupType'])) {
                 updateGroupType($groupType);
             } else {
                 displayGroupType($groupType);
             }
         } else {
             if ($_GET['action'] == editContactType && $_SESSION['access'] >= 50 || $_GET['action'] == showContactType) {
Ejemplo n.º 2
0
function parseInputs($user)
{
    if (isset($_POST['func'])) {
        $func = $_POST['func'];
        // getters ===============================
        if ($func === "getGoals") {
            echo json_encode(getGoals($user));
        }
        if ($func === "getIndustries") {
            echo json_encode(getIndustries($user));
        }
        if ($func === "getLocations") {
            echo json_encode(getLocations($user));
        }
        if ($func === "getPostings") {
            getPostings($user);
        }
        if ($func === "getContacts") {
            echo json_encode(getContacts($user));
        }
        if ($func === "getSchedules") {
            echo json_encode(getSchedules($user));
        }
        if ($func === "getCompanies") {
            echo getCompanies($user);
        }
        if ($func === "getBlogId") {
            echo json_encode(getBlogId($user, $_POST['title'], $_POST['text']));
        }
        if ($func === "getBlog") {
            echo json_encode(getBlog($user));
        }
        if ($func === "getNotesOnPosting") {
            $postingId = $_POST['postingId'];
            echo json_encode(getNotesOnPosting($user, $postingId));
        }
        // inserters ===============================
        if ($func === "insertGoal") {
            if (isset($_POST["goal"]) && $_POST["goal"] !== '') {
                echo json_encode(insertGoal($user, $_POST["goal"]));
            }
        }
        if ($func === "insertIndustry") {
            if (isset($_POST["industry"]) && $_POST["industry"] !== '') {
                echo json_encode(insertIndustry($user, $_POST["industry"]));
            }
        }
        if ($func === "insertCompany") {
            $url = urldecode($_POST["url"]);
            $companyName = $_POST["company"];
            insertCompany($user, $companyName);
        }
        if ($func === "insertLocation") {
            if (isset($_POST["location"]) && $_POST["location"] !== '') {
                echo json_encode(insertLocation($user, $_POST["location"]));
            }
        }
        if ($func === "insertPosting") {
            echo json_encode(insertPosting($user));
        }
        if ($func === "insertContact") {
            // more complex.  will be responsible for getting $_POST
            echo json_encode(insertContact($user));
        }
        if ($func === "insertSchedule") {
            // more complex.  will be responsible for getting $_POST
            // echo json_encode(insertSchedule($user));
            echo insertSchedule($user);
        }
        if ($func === "addSchedule") {
            // more complex.  will be responsible for getting $_POST
            // echo json_encode(insertSchedule($user));
            // echo "adding ZSchecdule";
            $name = $_POST["name"];
            $description = $_POST["description"];
            $contact = $_POST["contact"];
            $start = $_POST["start"];
            $end = $_POST["end"];
            // addSchedule($name,$description,$contact,$start,$end)
            if (addSchedule($name, $description, $contact, $start, $end)) {
                $scheduleId = getScheduleId($name, $description, $contact, $start, $end);
                if ($scheduleId > 0) {
                    // echo $scheduleId;
                    // insert schedule id and user id to user_schedule
                    $query = "insert into user_schedule ";
                    $query .= "(user,schedule) ";
                    $query .= "values ( {$user}, ";
                    $query .= "{$scheduleId} ) ";
                    //return $query;
                    echo booleanEcho($query);
                } else {
                    echo "error getting schedule id.";
                }
            } else {
                echo "error inserting schedule.";
            }
        }
        if ($func === "insertBlog") {
            echo json_encode(insertBlog($user));
        }
        if ($func === "insertNotesPostingUser") {
            // insertBlog, then insertNotesPostingUser
            $noteId = insertBlog($user);
            // $noteId = $_POST["noteId"];
            $postingId = $_POST["postingId"];
            echo json_encode(insertNotesPostingUser($noteId, $postingId, $user));
        }
        // removers ===============================
        if ($func === "removeGoal") {
            // url is the id for user_goals
            if (isset($_POST["url"]) && $_POST["url"] !== '') {
                echo json_encode(removeGoal($user, $_POST["url"]));
            }
        }
        if ($func === "removeIndustry") {
            // url is the id for user_industries
            if (isset($_POST["url"]) && $_POST["url"] !== '') {
                echo json_encode(removeIndustry($user, $_POST["url"]));
            }
        }
        if ($func === "removeLocation") {
            // url is the id for locations
            if (isset($_POST["url"]) && $_POST["url"] !== '') {
                echo json_encode(removeLocation($user, $_POST["url"]));
            }
        }
        if ($func === "removeContact") {
            // url is the id for user_contacts
            if (isset($_POST["url"]) && $_POST["url"] !== '') {
                echo json_encode(removeUserContact($user, $_POST["url"]));
            }
        }
        if ($func === "removePosting") {
            if (isset($_POST["url"]) && $_POST["url"] !== '') {
                removePosting($user, $_POST["url"]);
            }
        }
        if ($func === "removeCompany") {
            $companyId = $_POST["url"];
            // companyID is stored here
            removeCompany($user, $companyId);
        }
        if ($func === "removeSchedule") {
            $scheduleId = $_POST["url"];
            // scheduleID is stored here
            echo json_encode(removeSchedule($user, $scheduleId));
        }
        if ($func === "removeBlog") {
            $userNoteId = $_POST["url"];
            // need to get noteId from userNoteId
            $noteId = getNoteIdFromUserNoteId($userNoteId);
            if (removeNoteUser($user, $userNoteId) === true) {
                if (removeNote($noteId) === true) {
                    echo json_encode(true);
                } else {
                    echo json_encode("Error removing from notes.");
                }
            } else {
                echo json_encode("Error removing from NoteUser.");
            }
        }
        // updaters ===============================
        if ($func === "updateGoal") {
            echo json_encode(updateGoal($user));
        }
        if ($func === "updateIndustry") {
            echo json_encode(updateIndustry($user));
        }
        if ($func === "updatePosting") {
            updatePosting($user);
            // returns on its own
        }
        if ($func === "updateContact") {
            echo json_encode(updateContact($user));
        }
    }
}
Ejemplo n.º 3
0
function dispatcher($type)
{
    switch ($type) {
        case 'LoginAttempt':
            loginAttempt();
            break;
        case 'GetInitialCart':
            getInitialCart();
            break;
        case 'AddItemToCart':
            addItemToCart();
            break;
        case 'RemoveItemFromCart':
            removeItemFromCart();
            break;
        case 'EmptyCart':
            emptyCart();
            break;
        case 'RefreshCatalog':
            refreshCatalog();
            break;
        case 'GetGuidedSellingValues':
            getGuidedSellingValues();
            break;
        case 'ReadCatalog':
            readCatalog();
            break;
        case 'GetSubscriptions':
            getSubscriptions();
            break;
        case 'SetAmendSubId':
            setAmendSubId();
            break;
        case 'GetAmendSubscription':
            getAmendSubscription();
            break;
        case 'PreviewAddRatePlan':
            previewAddRatePlan();
            break;
        case 'AddRatePlan':
            addRatePlan();
            break;
        case 'PreviewRemoveRatePlan':
            previewRemoveRatePlan();
            break;
        case 'RemoveRatePlan':
            removeRatePlan();
            break;
        case 'PreviewUpdateRatePlan':
            previewUpdateRatePlan();
            break;
        case 'UpdateRatePlan':
            updateRatePlan();
            break;
        case 'GetUpgradeDowngradePlans':
            getUpgradeDowngradePlans();
            break;
        case 'PreviewPlanUpgradeDowngrade':
            previewPlanUpgradeDowngrade();
            break;
        case 'PlanUpgradeDowngrade':
            planUpgradeDowngrade();
            break;
        case 'PreviewRenewSubscription':
            previewRenewSubscription();
            break;
        case 'RenewSubscription':
            renewSubscription();
            break;
        case 'CancelSubscription':
            cancelSubscription();
            break;
        case 'GetAccountSummary':
            getAccountSummary();
            break;
        case 'GetContactSummary':
            getContactSummary();
            break;
        case 'GetPaymentMethodSummary':
            getPaymentMethodSummary();
            break;
        case 'GetInvoiceSummary':
            getInvoiceSummary();
            break;
        case 'GetBillingPreview':
            getBillingPreview();
            break;
        case 'GetUsageSummary':
            getUsageSummary();
            break;
        case 'GetCompleteSummary':
            getCompleteSummary();
            break;
        case 'UpdateContact':
            updateContact();
            break;
        case 'CheckEmailAvailability':
            checkEmailAvailability();
            break;
        case 'UpdatePaymentMethod':
            updatePaymentMethod();
            break;
        case 'RemovePaymentMethod':
            removePaymentMethod();
            break;
        case 'GetNewIframeSrc':
            getNewIframeSrc();
            break;
        case 'GetExistingIframeSrc':
            getExistingIframeSrc();
            break;
        case 'SubscribeWithCurrentCart':
            subscribeWithCurrentCart();
            break;
        case 'PreviewCurrentCart':
            previewCurrentCart();
            break;
        case 'IsUserLoggedIn':
            isUserLoggedIn();
            break;
            // begin new code for Partner - Ming
        // begin new code for Partner - Ming
        case 'GetHierarchy':
            getHierarchy();
            break;
        case 'GoToAccountView':
            goToAccountView();
            break;
        case 'GetAccountInfo':
            getAccountInfo();
            break;
        case 'GetSubConfirmInfo':
            getSubConfirmInfo();
            break;
        case 'IsPartnerLoggedIn':
            isPartnerLoggedIn();
            break;
            // end new code for Partner - Ming
            // HPM 2.0 begin
        // end new code for Partner - Ming
        // HPM 2.0 begin
        case 'SubscribeHPM2':
            subscribeHPM2();
            break;
            // HPM 2.0 end
            // Start Promo
        // HPM 2.0 end
        // Start Promo
        case 'PromoValidate':
            promoValidate();
            break;
            // End Promo
            // Start Set Account Data
        // End Promo
        // Start Set Account Data
        case 'SetAccountInfo':
            setAccountInfo();
            break;
            // End Set Account Data
            // Start Get Address Data
        // End Set Account Data
        // Start Get Address Data
        case 'GetAddressInfo':
            getAddressInfo();
            break;
            // End Set Account Data
            // Start Get Formatting Data
        // End Set Account Data
        // Start Get Formatting Data
        case 'GetFormatting':
            getFormatting();
            break;
            // End Set Formatting Data
        // End Set Formatting Data
        default:
            addErrors(null, 'no action specified');
    }
}
Ejemplo n.º 4
0
    closedir($pp);
}
if (isset($detail) && $detail == 'done') {
    $_POST['file'] = $_FILES;
    if (!empty($_POST['contact_name']) && !empty($_POST['contact_street']) && !empty($_POST['contact_zip']) && !empty($_POST['contact_city'])) {
        $msg = saveContact($_POST, $db);
    }
    if (isset($msg)) {
        $_SESSION['has_contact'] = true;
        header('Location: /dashboard/contacts');
    } else {
        $message = '<p class="error">Ihr Kontakt konnte nicht angelegt werden.<p>';
    }
}
if (isset($detail) && $detail == 'edit') {
    $up = updateContact($_POST, $db);
    if ($up === true) {
        $_SESSION['has_contact'] = true;
        header('Location: /dashboard/contacts');
    }
}
if (isset($detail) && $detail == 'delete') {
    $del = deleteContactLogo($_POST['logo_path']);
    if ($del === true) {
        header('Location: /dashboard/contacts');
    }
}
if (isset($detail) && $detail == 'upload') {
    $target_dir = $_POST['logo_path'];
    $target_file = $target_dir . str_replace(' ', '-', basename($_FILES['img']['name']));
    if (move_uploaded_file($_FILES['img']["tmp_name"], $target_file)) {
Ejemplo n.º 5
0
                <?php 
echo "<p style=\"color:seashell;background:#000;border-bottom:2px solid orangered;padding:10px;font-size:20px;\"> your website : " . $userdata["site"] . "</p>";
?>
<br/><br/><br/>				
				<form id="form" method="post" action="admin.php#contact">
					<p><label>email </label><input type="email" name="email" /></p>
					<p><label>phone </label><input maxlength="10" name="phone"/></p>
					<p><label>website </label><input type="text" name="website" /></p>
                    <p><input type="submit" name="change" value="Change"/></p>
				</form>
                <?php 
if (isset($_POST['change'])) {
    $email = mysqlPrep($_POST['email']);
    $phone = mysqlPrep($_POST['phone']);
    $website = mysqlPrep($_POST['website']);
    updateContact($userdata["username"], $email, $phone, $website);
}
?>
			</div>
		</div>
		<!-- /Contact -->
        
        <!-- overview -->
<!--
		<div id="overview" class="panel">
			<div class="content">
				<h2>Overview</h2>				
				<section class="left">
                    <div>
                        <p>Stats.</p>
                        <article>
Ejemplo n.º 6
0
 public static function processEmailInformation($receiver, $response)
 {
     $regex = GenieConstants::$emailRegex;
     if (preg_match($regex, $response) == 0) {
         $errorMessage = GenieConstants::$ERROR_MESSAGE;
         MessaggingController::sendMessage($receiver, $errorMessage);
         self::askForEmailInformation($receiver, $response);
         return;
     } else {
         updateContact(GenieConstants::$EMAIL_SUB_MENU_STRING, $response, $receiver['phone']);
         $menu_Context = GenieConstants::searchElement(GenieConstants::$MAIN_MENU_CONTEXT, GenieConstants::$PARENT_MENU_CONTEXT, 'subMenu');
         $subMenu_Context = NULL;
         updateMessageContext($menu_Context, $subMenu_Context, $receiver['phone']);
         MessaggingController::sendMessage($receiver, GenieConstants::$INTRODUCTION);
         //       PubSub::publish(GenieConstants::$SERVICE_REQUEST_COMPLETE,$receiver);
     }
 }