示例#1
0
</option>
			<?php 
echo Shopp::menuoptions($states, $status, true);
?>
		</select>
		<select name="type">
			<option value=""><?php 
Shopp::esc_html_e('View All Types');
?>
</option>
			<?php 
echo Shopp::menuoptions($types, $type, true);
?>
		</select>
		<input type="submit" id="filter-button" value="<?php 
Shopp::esc_attr_e('Filter');
?>
" class="button-secondary" />
		</div>

		<?php 
$ListTable->pagination('top');
?>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>

	<table class="widefat" cellspacing="0">
		<thead>
		<tr><?php 
print_column_headers($this->screen);
示例#2
0
function contact_meta_box($Purchase)
{
    $screen = get_current_screen();
    $pre = 'page_';
    $page = substr($screen->id, strpos($screen->id, $pre) + strlen($pre));
    ?>
	<script id="customer-editor" type="text/x-jquery-tmpl">
	<?php 
    ob_start();
    ?>

	<div class="editor ${action}">
		<input type="hidden" name="order-action" value="${action}" />
		<p class="inline-fields">
			<span>
			<input type="text" name="customer[firstname]" id="customer-firstname" value="${firstname}" /><br />
			<label for="address-city"><?php 
    _e('First Name', 'Shopp');
    ?>
</label>
			</span>
			<span>
			<input type="text" name="customer[lastname]" id="customer-lastname" value="${lastname}" /><br />
			<label for="address-city"><?php 
    _e('Last Name', 'Shopp');
    ?>
</label>
			</span>
		</p>
		<p>
			<input type="text" name="customer[company]" id="customer-company" value="${company}" /><br />
			<label for="address-address"><?php 
    _e('Company', 'Shopp');
    ?>
</label>
		</p>
		<p>
			<input type="text" name="customer[email]" id="customer-email" value="${email}" /><br />
			<label for="customer-email"><?php 
    _e('Email', 'Shopp');
    ?>
</label>
		</p>
		<p>
			<input type="text" name="customer[phone]" id="customer-phone" value="${phone}" /><br />
			<label for="customer-phone"><?php 
    _e('Phone', 'Shopp');
    ?>
</label>
		</p>
		<?php 
    if ('wordpress' == shopp_setting('account_system')) {
        ?>
		<p class="loginname">
			<input type="text" name="customer[loginname]" id="customer-loginname" value="${loginname}" /><br />
			<label for="customer-loginname"><?php 
        _e('Login Name', 'Shopp');
        ?>
</label>
		</p>
		<?php 
    }
    ?>
		<div>
			<input type="submit" id="cancel-edit-customer" name="cancel-edit-customer" value="<?php 
    Shopp::esc_attr_e('Cancel');
    ?>
" class="button-secondary" />
			<input type="submit" name="save" value="<?php 
    Shopp::esc_attr_e('Save Customer');
    ?>
" class="button-primary alignright" />
		</div>
		<?php 
    if (!isset($_POST['select-customer'])) {
        ?>
		<p class="change-button"><br class="clear" /><input type="submit" id="change-customer" name="change-customer" value="<?php 
        _e('Change Customer', 'Shopp');
        ?>
" class="button-secondary" /></p>
		<?php 
    }
    ?>
	</div>
	<?php 
    $editcustomer = ob_get_contents();
    ob_end_clean();
    echo $editcustomer;
    $customer = array('${action}' => 'update-customer', '${firstname}' => $Purchase->firstname, '${lastname}' => $Purchase->lastname, '${company}' => $Purchase->company, '${email}' => $Purchase->email, '${phone}' => $Purchase->phone, '${marketing}' => isset($Purchase->marketing) ? $Purchase->marketing : false, '${login}' => 'wordpress' == shopp_setting('account_system'));
    $js = preg_replace('/\\${([-\\w]+)}/', '$1', json_encode($customer));
    shopp_custom_script('orders', 'var customer = ' . $js . ';');
    ?>
	</script>

	<script id="customer-s" type="text/x-jquery-tmpl">
	<?php 
    $s = isset($_REQUEST['s']) ? $_REQUEST['s'] : false;
    ob_start();
    if (isset($_POST['select-customer']) && empty($s)) {
        $searchurl = wp_nonce_url(ShoppAdminController::url(array('page' => $page, 'id' => $Purchase->id)), 'wp_ajax_shopp_select_customer');
    } else {
        $searchurl = wp_nonce_url(add_query_arg(array('action' => 'shopp_select_customer', 'page' => $page, 'id' => $Purchase->id), admin_url('admin-ajax.php')), 'wp_ajax_shopp_select_customer');
    }
    if (!isset($_POST['select-customer']) || isset($_POST['select-customer']) && !empty($s)) {
        $iframe = true;
    }
    if (!empty($s)) {
        $searchurl = add_query_arg('s', $s, $searchurl);
    }
    ?>
	<form id="customer-search" action="<?php 
    echo $searchurl;
    ?>
" method="post" <?php 
    if ($iframe) {
        ?>
target="customer-search-results"<?php 
    }
    ?>
><input type="hidden" name="change-customer" value="true" /><input type="hidden" name="action" value="shopp_select_customer" /><input type="hidden" name="page" value="<?php 
    echo esc_attr($page);
    ?>
" /><?php 
    wp_nonce_field('wp_ajax_shopp_select_customer');
    ?>
<p><input type="search" name="s" value="<?php 
    echo esc_attr($s);
    ?>
" placeholder="<?php 
    _e('Search...', 'Shopp');
    ?>
" /></p>
	</form>
	<?php 
    if ($iframe) {
        ?>
	<iframe id="customer-search-results" name="customer-search-results" src="<?php 
        echo esc_url($searchurl);
        ?>
"></iframe>
	<form action="<?php 
        echo ShoppAdminController::url(array('page' => $page, 'id' => (int) $Purchase->id));
        ?>
" method="POST">
	<div><input type="submit" id="cancel-change-customer" name="cancel-change-customer" value="<?php 
        _e('Cancel', 'Shopp');
        ?>
" class="button-secondary" /></div>
	</form>
	<?php 
    }
    ?>
	<?php 
    $search = ob_get_contents();
    ob_end_clean();
    echo $search;
    ?>
	</script>

	<script id="change-customer-ui" type="text/x-jquery-tmpl">
	<?php 
    ob_start();
    ?>
	<h4><?php 
    _e('Search for Customer', 'Shopp');
    ?>
</h4>
	<?php 
    echo ShoppUI::template($search);
    ?>
	<form id="change-customer" action="<?php 
    echo ShoppAdminController::url(array('id' => (int) $Purchase->id));
    ?>
" method="POST">
	<h4><?php 
    _e('Add New Customer', 'Shopp');
    ?>
</h4>
	<input type="hidden" name="change-customer" value="true" />
	<?php 
    echo ShoppUI::template($editcustomer, array('${action}' => 'new-customer', '${savelabel}' => __('Add New Customer', 'Shopp')));
    ?>
	</form>
	<?php 
    $changecustomer = ob_get_contents();
    ob_end_clean();
    echo $changecustomer;
    ?>
	</script>


	<?php 
    if (isset($_POST['select-customer'])) {
        $customer = array();
    }
    if (isset($_REQUEST['s']) && isset($_REQUEST['select-customer'])) {
        echo ShoppUI::template($search);
        return;
    } elseif (isset($_POST['select-customer'])) {
        echo ShoppUI::template($changecustomer);
        return;
    } elseif (isset($_REQUEST['edit-customer'])) {
        ?>
			<form action="<?php 
        echo ShoppAdminController::url(array('id' => (int) $Purchase->id));
        ?>
" method="POST">
			<?php 
        echo ShoppUI::template($editcustomer, $customer);
        ?>
			</form>
		<?php 
        return;
    }
    ?>
	<div id="change-customer-editor"></div>
	<form action="<?php 
    echo ShoppAdminController::url(array('id' => (int) $Purchase->id));
    ?>
" method="post" id="customer-editor-form"></form>
	<div class="display">
		<form action="<?php 
    echo ShoppAdminController::url(array('id' => $Purchase->id));
    ?>
" method="get">
		<?php 
    $targets = shopp_setting('target_markets');
    ?>
			<input type="hidden" id="edit-customer-data" value="<?php 
    echo esc_attr(json_encode($customer));
    ?>
" />
			<input type="hidden" name="page" value="<?php 
    echo $page;
    ?>
" />
			<input type="hidden" name="id" value="<?php 
    echo $Purchase->id;
    ?>
" />
			<input type="submit" id="edit-customer" name="edit-customer" value="<?php 
    _e('Edit', 'Shopp');
    ?>
" class="button-secondary button-edit" />
		</form>
	<?php 
    $avatar = get_avatar($Purchase->email, 64);
    $customer_url = add_query_arg(array('page' => 'shopp-customers', 'id' => $Purchase->customer), admin_url('admin.php'));
    $customer_url = apply_filters('shopp_order_customer_url', $customer_url);
    $email_url = 'mailto:' . $Purchase->email . '?subject=' . sprintf(__('RE: %s: Order #%s', 'Shopp'), get_bloginfo('sitename'), $Purchase->id);
    $email_url = apply_filters('shopp_order_customer_email_url', $email_url);
    $phone_url = 'callto:' . preg_replace('/[^\\d+]/', '', $Purchase->phone);
    $phone_url = apply_filters('shopp_order_customer_phone_url', $phone_url);
    $accounts = shopp_setting('account_system');
    $wp_user = false;
    if ('wordpress' == $accounts) {
        $Customer = new ShoppCustomer($Purchase->customer);
        $WPUser = get_userdata($Customer->wpuser);
        $edituser_url = add_query_arg('user_id', $Customer->wpuser, admin_url('user-edit.php'));
        $edituser_url = apply_filters('shopp_order_customer_wpuser_url', $edituser_url);
    }
    ?>
	<div class="alignleft"><?php 
    echo $avatar;
    ?>
</div>
	<div class="alignleft">
	<span class="fn"><a href="<?php 
    echo esc_url($customer_url);
    ?>
"><?php 
    echo esc_html("{$Purchase->firstname} {$Purchase->lastname}");
    ?>
</a></span>
	<?php 
    if ('wordpress' == $accounts && !empty($WPUser->user_login)) {
        ?>
<br /><span class="wplogin"><a href="<?php 
        echo esc_attr($edituser_url);
        ?>
"><?php 
        echo esc_html($WPUser->user_login);
        ?>
</a></span><?php 
    }
    ?>
	<?php 
    if (!empty($Purchase->company)) {
        echo '<br /> <div class="org">' . esc_html($Purchase->company) . '</div>';
    }
    ?>
	<?php 
    if (!empty($Purchase->email)) {
        echo '<br /><span class="email"><a href="' . esc_url($email_url) . '">' . esc_html($Purchase->email) . '</a></span>';
    }
    ?>
	<?php 
    if (!empty($Purchase->phone)) {
        echo '<br /><span class="phone"><a href="' . esc_attr($phone_url) . '">' . esc_html($Purchase->phone) . '</a></span>';
    }
    ?>
	<p class="customer <?php 
    echo $Purchase->Customer->marketing == "yes" ? 'marketing' : 'nomarketing';
    ?>
"><?php 
    $Purchase->Customer->marketing == "yes" ? _e('Agreed to marketing', 'Shopp') : _e('No marketing', 'Shopp');
    ?>
</p>
	</div>
	<br class="clear" />
	</div>
	<?php 
}
示例#3
0
		<label for="customer-loginname"><?php 
    _e('Login Name', 'Shopp');
    ?>
</label>
		<input type="text" name="customer[loginname]" id="customer-loginname" value="${loginname}" /><br />
	</p>
	<?php 
}
?>
	<div class="editing-controls">
		<input type="submit" id="cancel-edit-customer" name="cancel-edit-customer" value="<?php 
Shopp::esc_attr_e('Cancel');
?>
" class="button-secondary" />
		<input type="submit" name="save" value="<?php 
Shopp::esc_attr_e('Update');
?>
" class="button-primary alignright" />
	</div>
</div>
<?php 
$editcustomer = ob_get_clean();
echo $editcustomer;
$customer = array('${action}' => 'update-customer', '${id}' => $Purchase->customer, '${firstname}' => $Purchase->firstname, '${lastname}' => $Purchase->lastname, '${company}' => $Purchase->company, '${email}' => $Purchase->email, '${phone}' => $Purchase->phone, '${login}' => 'wordpress' == shopp_setting('account_system'));
$js = preg_replace('/\\${([-\\w]+)}/', '$1', json_encode($customer));
shopp_custom_script('orders', 'var customer = ' . $js . ';');
?>
</script>

<?php 
if (isset($_POST['select-customer'])) {