function updateUser($userObj)
 {
     global $gwpm_activity_model;
     $isGwpmUser = get_user_meta($userObj->userId, 'gwpm_user');
     if (isset($isGwpmUser) && sizeof($isGwpmUser) > 0) {
     } else {
         appendLog(add_user_meta($userObj->userId, 'gwpm_user', true, true));
     }
     $processKeys = array_keys(get_class_vars(get_class($userObj)));
     $dynaKeys = getDynamicFieldKeys();
     foreach ($dynaKeys as $__keys) {
         array_push($processKeys, $__keys);
     }
     foreach ($processKeys as $key) {
         appendLog($key);
         if ($key == "gwpm_profile_photo") {
             $photoObj = $userObj->{$key};
             if ($photoObj["size"] != 0) {
                 $value = savePhotoToUploadFolder($userObj->{$key}, $userObj->userId);
                 $gwpm_activity_model->addActivityLog("profile", "Updated Profile Image", $userObj->userId);
             } else {
                 continue;
             }
         } elseif (!is_array($userObj->{$key})) {
             $value = trim($userObj->{$key});
         } else {
             $value = $userObj->{$key};
         }
         if ($key != 'userId' && $key != 'dynamicFields' && $key != 'dynamicFieldsValidation') {
             update_user_meta($userObj->userId, $key, $value);
         }
     }
     $gwpm_activity_model->addActivityLog("profile", "Updated Profile", $userObj->userId);
 }
 function update()
 {
     $_keys = getDynamicFieldKeys();
     $profileObj = new GwpmProfileVO($_POST, $_keys);
     $profileObj->gwpm_profile_photo = $_FILES["gwpm_profile_photo"];
     $validateObj = $profileObj->validate();
     if (sizeof($validateObj) == 0) {
         $this->_model->updateUser($profileObj);
         $this->set('success_message', 'Profile updated successfully!!');
     } else {
         $this->set('error_messages', $validateObj);
         $this->set('warn_message', 'Please correct the below fields');
     }
 }
Exemplo n.º 3
0
 $_POST['user_email'] = $user_email;
 $_POST['gwpm_gender'] = $gender;
 $_POST['gwpm_martial_status'] = '1';
 $_POST['gwpm_religion'] = 'Hindu';
 $_POST['gwpm_sevvai_dosham'] = rand(1, 2);
 $_POST['gwpm_starsign'] = rand(1, 26);
 $_POST['gwpm_user'] = '******';
 $_POST['gwpm_caste'] = 'Mudliyar';
 $_POST['gwpm_zodiac'] = rand(1, 12);
 $_POST['gwpm_contact_no'] = rand(1, 12) * 100000000 + 989898 + rand(5000, 10000);
 $gwpm_education['qualification'] = "" . rand(1, 4);
 $gwpm_education['qualification_other'] = "" . 'Other';
 $gwpm_education['specialization'] = "" . rand(1, 4);
 $gwpm_education['status'] = "" . rand(1, 4);
 $_POST['gwpm_education'] = $gwpm_education;
 $dynaKeys = getDynamicFieldKeys();
 foreach ($dynaKeys as $__keys) {
     echo "<br /> Dyna: " . $__keys;
     $_POST[$__keys] = "" . rand(1, 3);
 }
 $abt = createDateRangeArray('1980-10-01', '1985-10-05');
 $newdata = $abt[0];
 echo $newdata . "<br />";
 $_POST['gwpm_dob'] = $newdata;
 //	$profileObj = new GwpmProfileVO($_POST);
 $profileObj = new GwpmProfileVO($_POST, $dynaKeys);
 $profileObj->gwpm_profile_photo = $_FILES["gwpm_profile_photo"];
 $validateObj = $profileObj->validate();
 if (sizeof($validateObj) == 0) {
     $mymodel->updateUser($profileObj);
     echo __('success_message', 'Profile updated successfully!!' . '<br />');
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
?>

<div class="wrap">
<?php 
screen_icon('options-general');
echo "<h2>" . __('Matrimonial Profile', 'genie_wp_matrimony') . "</h2>";
try {
    $profileModel = new GwpmProfileModel();
    $userObj = wp_get_current_user();
    $modelObj = $profileModel->getUserObj($userObj->ID);
    $templateObj = new GwpmTemplate(null, null, null);
    if (isset($_POST['update-button']) && $_POST['update-button'] == 'Update') {
        $_keys = getDynamicFieldKeys();
        $profileObj = new GwpmProfileVO($_POST, $_keys);
        $profileObj->gwpm_profile_photo = $_FILES["gwpm_profile_photo"];
        $validateObj = $profileObj->validate();
        if (sizeof($validateObj) == 0) {
            $profileModel->updateUser($profileObj);
            $success_message = 'Profile updated successfully!!';
        } else {
            $warn_message = 'Please correct the below fields';
        }
        $counter = 0;
        if (isset($validateObj)) {
            $counter = sizeof($validateObj);
        }
        if ($counter == 0) {
            if (isset($success_message)) {
 function update()
 {
     $_keys = getDynamicFieldKeys();
     $searchObj = new GwpmSearchVO($_POST, $_keys);
     $this->set("model", $this->_model->searchUsers($searchObj));
 }