Exemple #1
0
	</div>
	<div id="reg">
		<form action=<?php 
echo $_SERVER['PHP_SELF'];
?>
 method="POST">
			<fieldset style='border: 2px solid #000000'>
				<legend>Registration Form</legend>
			<?php 
if (isset($message_2)) {
    echo "<p class='errors'>{$message_2}</p>\n";
}
foreach ($fields_2 as $field => $value) {
    if ($field == "state") {
        echo "<div id='field'>\n\t\t\t\t\t\t<label for='{$field}'>{$value}</label>\n\t\t\t\t\t\t<select name='state' id='state'>";
        $stateName = getStateName();
        $stateCode = getStateCode();
        for ($n = 1; $n <= 50; $n++) {
            $state = $stateName[$n];
            $scode = $stateCode[$n];
            echo "<option value='{$scode}'";
            if ($scode == "AL") {
                echo " selected";
            }
            echo ">{$state}</option>\n";
        }
        echo "</select></div>";
    } else {
        if (preg_match("/pass/i", $field)) {
            $type = "password";
        } else {
        $_SESSION['billingAddressSession']['country'] = $countryName;
        $_SESSION['billingAddressSession']['state'] = $stateName;
        $_SESSION['billingAddressSession']['countryID'] = $shippingCountry;
        $_SESSION['billingAddressSession']['name'] = $shippingFirstName . " " . $shippingLastName;
        $_SESSION['billingAddressSession']['firstName'] = $shippingFirstName;
        $_SESSION['billingAddressSession']['lastName'] = $shippingLastName;
        $_SESSION['billingAddressSession']['address'] = $shippingAddress;
        $_SESSION['billingAddressSession']['address2'] = $shippingAddress2;
        $_SESSION['billingAddressSession']['city'] = $shippingCity;
        $_SESSION['billingAddressSession']['stateID'] = $shippingState;
        $_SESSION['billingAddressSession']['postalCode'] = $shippingPostalCode;
        $_SESSION['billingAddressSession']['email'] = $shippingEmail;
        $_SESSION['billingAddressSession']['phone'] = $shippingPhone;
    } else {
        $_SESSION['billingAddressSession']['country'] = getCountryName($billingCountry);
        $_SESSION['billingAddressSession']['state'] = getStateName($billingState);
        $_SESSION['billingAddressSession']['countryID'] = $billingCountry;
        $_SESSION['billingAddressSession']['name'] = $billingFirstName . " " . $billingLastName;
        $_SESSION['billingAddressSession']['firstName'] = $billingFirstName;
        $_SESSION['billingAddressSession']['lastName'] = $billingLastName;
        $_SESSION['billingAddressSession']['address'] = $billingAddress;
        $_SESSION['billingAddressSession']['address2'] = $billingAddress2;
        $_SESSION['billingAddressSession']['city'] = $billingCity;
        $_SESSION['billingAddressSession']['stateID'] = $billingState;
        $_SESSION['billingAddressSession']['postalCode'] = $billingPostalCode;
        $_SESSION['billingAddressSession']['email'] = $billingEmail;
        $_SESSION['billingAddressSession']['phone'] = $billingPhone;
    }
}
if ($_SESSION['loggedIn'] and !$_SESSION['shippingAddressSession']) {
    //echo "c";
                kmail($config['settings']['sales_email'], $config['settings']['business_name'], $config['settings']['sales_email'], $lang['contactFromName'], $content['name'], $content['body'], $options);
                // Send email to sales email
                $smarty->assign("contactNotice", 'contactMessage');
                unset($form);
            } catch (Exception $e) {
                echo $e->getMessage();
                exit;
            }
        } else {
            if ($error == 1) {
                $smarty->assign("contactNotice", 'captchaError');
                // Incorrect Captcha
            } else {
                $smarty->assign("contactNotice", 'contactError');
                // No email specified
            }
        }
    }
    $smarty->assign('form', $form);
    // Assign values to prefill the form
    $smarty->assign("businessCountryName", getCountryName($config['settings']['business_country']));
    $smarty->assign("businessStateName", getStateName($config['settings']['business_state']));
    $smarty->display('contact.tpl');
} catch (Exception $e) {
    echo $e->getMessage();
}
include BASE_PATH . '/assets/includes/debug.php';
if ($db) {
    mysqli_close($db);
}
// Close any database connections
 if ($contributor['avatar_status'] == 1) {
     // Avatar Status
     $contributor['avatar'] = true;
 } else {
     $contributor['avatar'] = false;
 }
 $customContributorDate = new kdate();
 $customContributorDate->setMemberSpecificDateInfo();
 $customContributorDate->distime = 0;
 //if(!$contributor['display_name']) // Set display name if none exists
 //	$contributor['display_name'] = $contributor['f_name'].' '.$contributor['l_name'];
 $contributor['useMemID'] = $useMemID;
 // Get the original member id
 $contributor['memberSince'] = $customContributorDate->showdate($contributor['signup_date']);
 $contributor['country'] = getCountryName($contributor['country']);
 $contributor['state'] = getStateName($contributor['state']);
 // Redo this so only galleries that a member should be able to see are displayed XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 // Contributor Albums
 if ($_SESSION['galleriesData']) {
     foreach ($_SESSION['galleriesData'] as $key => $value) {
         if ($value['owner'] == $id and $value['publicgal'] == 1) {
             $countMediaAlbums[] = $key;
             // Galleries to count media for
             $contrAlbums[$key] = $value;
         }
     }
 }
 if (count($countMediaAlbums) > 0) {
     @($flatMediaAlbums = implode(',', $countMediaAlbums));
 } else {
     $flatMediaAlbums = '0';
			<div class="btn-group">
				<?php 
function getStateName($isSend)
{
    if ($isSend == 1) {
        return '已发送';
    } else {
        return '未发送';
    }
}
?>
				<?php 
if (isset($isSend)) {
    ?>
				<button data-toggle="dropdown" class="btn dropdown-toggle"><?php 
    echo getStateName($isSend);
    ?>
<span class="caret"></span></button>
				<?php 
} else {
    ?>
				<button data-toggle="dropdown" class="btn dropdown-toggle">选择状态<span class="caret"></span></button>
				<?php 
}
?>
				<ul class="dropdown-menu">
					<!--设置 topicState-->
					<li><a href="/selectionTopic/reserveTopicList?isSend=0">未发送</a></li>
					<li><a href="/selectionTopic/reserveTopicList?isSend=1">已发送</a></li>
				</ul>
			</div>