/*
 * Created on Apr 14, 2012
 *
 * 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);