Esempio n. 1
0
/**
 * show list of locations
 *
 * @param array $params array of parameters
 *
 * @return string HTML of <select> list of locations
 */
function Core_locationsGetUi($params = array())
{
    require_once dirname(__FILE__) . '/api-funcs.php';
    $locations = Core_locationsGetFull();
    $ui = '<select id="core-location">';
    foreach ($locations as $k => $v) {
        $ui .= '<option value="' . $v . '"';
        if ($v == @$_SESSION['location']['id']) {
            $ui .= ' selected="selected"';
            WW_addInlineScript('pagedata.locationName="' . addslashes($k) . '";');
        }
        $ui .= '>' . htmlspecialchars($k) . '</option>';
    }
    $ui .= '</select>';
    WW_addScript('/j/locations-selector.js');
    WW_addInlineScript('var locationSelectorOpts=' . json_encode($params) . ';');
    return $ui;
}
Esempio n. 2
0
$user_id = (int) @$pdata['user_id'];
if (!$user_id) {
    $user_id = (int) $_SESSION['userdata']['id'];
}
$sql = 'select name from user_accounts where id=' . $user_id;
$user_name = dbOne($sql, 'name', 'user_accounts');
echo '<td><strong>Owner:</strong> <select name="user_id"><option value="' . $user_id . '">' . $user_name . '</option></select></td>';
// }
echo '</tr><tr>';
// { EAN
echo '<th>EAN-13 barcode</th><td><input name="ean" value="' . htmlspecialchars(@$pdata['ean']) . '" /></td>';
// }
// { Location
echo '<th>' . __('Location') . '</th><td><select name="location">' . '<option value="0"> -- </option>';
require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/api-admin.php';
$opts = Core_locationsGetFull();
foreach ($opts as $k => $v) {
    echo '<option value="' . $v . '"';
    if ($v == $pdata['location']) {
        echo 'selected="selected"';
    }
    echo '>' . htmlspecialchars($k) . '</option>';
}
echo '</select></td>';
// }
// { view on front-end
echo '<td>';
if ($id) {
    if ($product->vals['enabled']) {
        echo '<a href="' . $product_url . '" target="_blank">view on front-end</a>';
    } else {