?>
</td>
                                    </tr>
                                    <tr>
                                        <td width="9%" align="right"><b>Email</b></td>
                                        <td>&nbsp;:&nbsp;</td>
                                        <td width="88%"><?php 
echo stripslashes($_SESSION["sessShippingEmail"]);
?>
</td>
                                    </tr>
                                    <tr>
                                        <td width="9%" align="right"><b>Country</b></td>
                                        <td>&nbsp;:&nbsp;</td>
                                        <td width="88%"><?php 
echo getCountryName($_SESSION["sessShippingCountry"]);
?>
</td>
                                    </tr>
                                </table>
                            </fieldset>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="top">&nbsp;</td>
                    </tr>
                    <?php 
if ($_SESSION['shipping_enabled'] != "false") {
    // if($shipping_options_availabe==0) {$errFlag
    if ($errFlag == 1) {
        ?>
require_once '../functions.php';
require_once '../functions-2.php';
require_once '../functions-xml.php';
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
use_class('xml_tools');
use_class('depot_orders');
use_class('logger');
use_class('Product');
use_class('bins');
$logger = new logger('cron', 'depot-refill-local-xml-generator');
$class_do = new depot_orders();
$class_bins = new bins();
$today_datetime = date('Y-m-d H:i:s');
$today = date('Y-m-d', strtotime($today_datetime));
$country_name = getCountryName($server_local_code);
$logger->write("PREPARE XML DEPOT REFILL - START");
//GET TODAYS DEPOT REFILL CREATED
$q = "SELECT * FROM depot_orders" . " WHERE segments_id = {$segment_id_default} " . " AND trans_type = 'AR' AND trans_id = " . depot_orders::AUTO_REFILL_ID_DAILYCRON . " AND order_date >= '{$today} 00:00:00' AND order_date <= '{$today} 23:59:59'";
$r = tep_db_query($q);
if (tep_db_num_rows($r) > 0) {
    $segment = $class_bins->retrieveSegmentDetail($segment_id_default);
    //PREPARE FOR CREATE XML DEPOT REFILL LOCAL
    $xmlt = new xml_tools('1.0', 'UTF-8');
    //DEPOT_REFILL_LOCAL
    $depot_refill_local = $xmlt->drawTag($xmlt, 'DEPOT_REFILL_LOCAL');
    //LOCAL_INFO
    $local_info = $xmlt->drawTag($depot_refill_local, 'LOCAL_INFO');
    $xmlt->drawTag($local_info, 'SEGMENT_ID', $segment_id_default);
    $xmlt->drawTag($local_info, 'CREATED_DATE', date('Y-m-d H:i:s'));
    $group_name = "Manobo Local Orders ({$country_name})";
Example #3
0
            <div class="col-sm-10">
                <input type="text" name="title" class="form-control" id="title" placeholder="Title"
                       value="<?php 
if (isset($edit_adventure['title'])) {
    echo $edit_adventure['title'];
}
?>
">
            </div>
        </div>
        <div class="form-group">
            <label for="country" class="col-sm-2 control-label">Country</label>
            <div class="col-sm-10">
                <?php 
if (isset($edit_adventure['country_id'])) {
    $name = getCountryName($edit_adventure['country_id'], $mySQL);
} else {
    $name = "Unspecified";
}
renderCountrySelectControl($mySQL, $name);
?>
            </div>
        </div>
        <div class="form-group">
            <label for="title" class="col-sm-2 control-label">Description: </label>
            <div class="col-sm-10">
                <textarea class="form-control" rows="5" name="description" id="description" placeholder="Description"><?php 
if (isset($edit_adventure['description'])) {
    echo $edit_adventure['description'];
}
?>
Example #4
0
 function _buildMail()
 {
     global $npshop;
     $text = implode('', file(APP_ROOT . $npshop['skin']['path'] . $npshop['skin']['name'] . "/npshop/email_header.php"));
     $text .= sprintf(_("Hola %s"), $this->user->billingData['name']) . ",<br/><br/>";
     $text .= sprintf(_("Estos son los productos asociados al pedido %s:"), formatOrderId($this)) . "<br/>";
     $text .= "<ul>";
     foreach ($this->items as $item) {
         $text .= "<li><b>" . NP_get_i18n($item->name) . "</b> (" . _("Ref.") . " " . $item->id . "): " . _("Cantidad") . " [" . $item->quantity . "], " . _("Precio por unidad") . " [" . $item->prize . " &euro;]</li>";
     }
     $text .= "</ul>";
     $text .= "<blockquote>";
     $text .= _("Subtotal") . ": " . $this->getSubTotal() . " &euro;<br/>";
     $text .= _("Gastos de envío") . ": " . $this->getShippingCost(1) . " &euro;<br/>";
     $text .= "<br/><b>" . _("TOTAL") . ": " . $this->getTotal(1) . " &euro;</b><br/>";
     $text .= "</blockquote>";
     $text .= "<br/>";
     $text .= "<p>" . _("Datos personales") . ":</p>";
     $text .= "<center><table border='0' width='70%'>";
     $text .= "    <tr>";
     $text .= "        <td width='50%' valign='top'>";
     $text .= "        <b>" . _("Datos de facturación") . "</b><br/>";
     //$text .= "        <ul>";
     $text .= "            <br/>" . $this->user->billingData['name'] . " " . $this->user->billingData['surname'];
     $text .= "            <br/>";
     $text .= "            <br/>" . $this->user->billingData['address'] . " " . $this->user->billingData['address2'];
     $text .= "            <br/>" . $this->user->billingData['postalCode'] . " " . $this->user->billingData['city'];
     $text .= "            <br/>" . getProvinceName($this->user->billingData['province']);
     $text .= "            <br/>" . getCountryName($this->user->billingData['country']);
     //$text .= "            <br/>";
     //$text .= "            <li>Teléfono: ".$this->user->billingData['phone']." </li>";
     //$text .= "        </ul>";
     $text .= "        </td>";
     $text .= "        <td width='50%' valign='top'>";
     $text .= "        <b>Datos de envío</b><br/>";
     //$text .= "        <ul>";
     $text .= "            <br/>" . $this->user->shippingData['name'] . " " . $this->user->shippingData['surname'];
     $text .= "            <br/>";
     $text .= "            <br/>" . $this->user->shippingData['address'] . " " . $this->user->shippingData['address2'];
     $text .= "            <br/>" . $this->user->shippingData['postalCode'] . " " . $this->user->shippingData['city'];
     $text .= "            <br/>" . getProvinceName($this->user->shippingData['province']);
     $text .= "            <br/>" . getCountryName($this->user->shippingData['country']);
     //$text .= "            <br/>";
     //$text .= "            <li>Teléfono: ".$this->user->shippingData['phone']." </li>";
     //$text .= "        </ul>";
     $text .= "        </td>";
     $text .= "   </tr>";
     $text .= "</table></center><br/>";
     if ($this->orderStatus == $npshop['constants']['ORDER_STATUS']['PAYMENT_OK']) {
         $text .= _("El pedido <b>queda confirmado</b>.") . "<br/>";
     } else {
         if ($this->orderStatus == $npshop['constants']['ORDER_STATUS']['PAYMENT_TRANSFER']) {
             $text .= _("El pedido <b>queda confirmado</b> y pendiente de que realices una transferencia por la cantidad total del pedido a este número de cuenta: 2038-1576-52-6000042530 (Caja Madrid), Titular: David Benavente.") . "<br/>";
         } else {
             if ($this->orderStatus == $npshop['constants']['ORDER_STATUS']['PENDING_SENT_ONDELIVERY']) {
                 $text .= _("El pedido <b>queda confirmado</b> y será enviado contrareembolso a la dirección que has indicado.") . "<br/>";
             } else {
                 if ($this->orderStatus == $npshop['constants']['ORDER_STATUS']['PAYMENT_ERROR']) {
                     $text .= _("El pedido <b>no ha podido ser confirmado</b>.") . "<br/>";
                 } else {
                     $text .= sprintf(_("El pedido queda con estado <b>%s</b>."), $this->orderStatus) . "<br/>";
                 }
             }
         }
     }
     $text .= "<br/>";
     $text .= _("Un saludo");
     $text .= implode('', file(APP_ROOT . $npshop['skin']['path'] . $npshop['skin']['name'] . "/npshop/email_footer.php"));
     return $text;
 }
Example #5
0
?>




<h3>Users awaiting verification</h3>

    <?php 
$result = $mysql->query("SELECT * FROM users WHERE verified=0");
if ($result->num_rows == 0) {
    echo "No users are waiting for verification.";
} else {
    echo "<form action='usercp.php?tab=admin' method='POST'>";
    echo "<table class='table table-hover'><thead><tr><th>Username</th><th>Name</th><th>Country</th><th>Verify</th></tr></thead><tbody>";
    while ($user = $result->fetch_assoc()) {
        echo "<tr>";
        echo "<td><a href='/../profile.php?user={$user['user_id']}'>{$user['username']}</a></td>";
        echo "<td>{$user['name']}</td>";
        echo "<td>" . getCountryName($user['country_id'], $mysql) . "</td>";
        echo "<td><div class='checkbox' style='margin: 0 !important;'><label><input name='username[]' type='checkbox' value='{$user['username']}'></label></div></td>";
        echo "</tr>";
    }
    echo "<tr><td></td><td></td><td></td><td><button type='submit' class='btn btn-primary' name='verify'>Verify</button></td></tr>";
    echo "</tbody></table>";
    echo '<div></div>';
    echo "</form>";
}
?>


Example #6
0
<?php

define('APP_ROOT', "..");
require_once APP_ROOT . "/config/main.php";
require_once APP_ROOT . "/common/commonFunctions.php";
$cart = get_cart();
$billingData_province = null;
$billingData_country = null;
$shippingData_province = null;
$shippingData_country = null;
if (isset($cart->user)) {
    $action = "confirm";
    $billingData_province = getProvinceName($cart->user->billingData['province']);
    $billingData_country = getCountryName($cart->user->billingData['country']);
    $shippingData_province = getProvinceName($cart->user->shippingData['province']);
    $shippingData_country = getCountryName($cart->user->shippingData['country']);
    showSkin(basename(__FILE__), $action);
} else {
    redirect(APP_ROOT . "/flows/login.php");
}
Example #7
0
function event_espresso_invoice_payment_settings()
{
    global $espresso_premium, $active_gateways, $org_options;
    if (!$espresso_premium) {
        return;
    }
    if (isset($_POST['update_invoice_payment_settings'])) {
        $invoice_payment_settings['invoice_title'] = strip_tags($_POST['invoice_title']);
        $invoice_payment_settings['pdf_title'] = strip_tags($_POST['pdf_title']);
        $invoice_payment_settings['pdf_instructions'] = strip_tags($_POST['pdf_instructions']);
        $invoice_payment_settings['invoice_instructions'] = strip_tags($_POST['invoice_instructions']);
        $invoice_payment_settings['payable_to'] = strip_tags($_POST['payable_to']);
        $invoice_payment_settings['payment_address'] = strip_tags($_POST['payment_address']);
        $invoice_payment_settings['image_url'] = strip_tags($_POST['image_url']);
        $invoice_payment_settings['show'] = strip_tags($_POST['show']);
        update_option('event_espresso_invoice_payment_settings', $invoice_payment_settings);
        echo '<div id="message" class="updated fade"><p><strong>' . __('Invoice Payment settings saved.', 'event_espresso') . '</strong></p></div>';
    }
    $invoice_payment_settings = get_option('event_espresso_invoice_payment_settings');
    if (empty($invoice_payment_settings)) {
        $default_address = trim($org_options['organization_street1']);
        $default_address .= empty($org_options['organization_street2']) ? '' : '<br />' . trim($org_options['organization_street2']);
        $default_address .= '<br />' . trim($org_options['organization_city']);
        $default_address .= ',' . trim($org_options['organization_state']);
        $default_address .= '<br />' . trim(getCountryName($org_options['organization_country']));
        $default_address .= '<br />' . trim($org_options['organization_zip']);
        $invoice_payment_settings['invoice_title'] = __('Invoice Payments', 'event_espresso');
        $invoice_payment_settings['pdf_title'] = __('Invoice Payments', 'event_espresso');
        $invoice_payment_settings['pdf_instructions'] = __('Please send this invoice with payment attached to the address above, or use the payment link below. Payment must be received within 48 hours of event date.', 'event_espresso');
        $invoice_payment_settings['invoice_instructions'] = __('Please send Invoice to the address below. Payment must be received within 48 hours of event date.', 'event_espresso');
        $invoice_payment_settings['payable_to'] = trim($org_options['organization']);
        $invoice_payment_settings['payment_address'] = trim($default_address);
        $invoice_payment_settings['image_url'] = '';
        $invoice_payment_settings['show'] = 'Y';
        if (add_option('event_espresso_invoice_payment_settings', $invoice_payment_settings, '', 'no') == false) {
            update_option('event_espresso_invoice_payment_settings', $invoice_payment_settings);
        }
    }
    //Open or close the postbox div
    if (empty($_REQUEST['deactivate_invoice_payment']) && (!empty($_REQUEST['activate_invoice_payment']) || array_key_exists('invoice', $active_gateways))) {
        $postbox_style = '';
    } else {
        $postbox_style = 'closed';
    }
    ?>

	<div class="metabox-holder">
		<div class="postbox <?php 
    echo $postbox_style;
    ?>
">
			<div title="Click to toggle" class="handlediv"><br /></div>
			<h3 class="hndle">
				<?php 
    _e('Invoice Payment Settings', 'event_espresso');
    ?>
			</h3>
			<div class="inside">
				<div class="padding">
					<?php 
    if (!empty($_REQUEST['activate_invoice_payment'])) {
        $active_gateways['invoice'] = dirname(__FILE__);
        update_option('event_espresso_active_gateways', $active_gateways);
    }
    if (!empty($_REQUEST['deactivate_invoice_payment'])) {
        unset($active_gateways['invoice']);
        update_option('event_espresso_active_gateways', $active_gateways);
    }
    echo '<ul>';
    if (array_key_exists('invoice', $active_gateways)) {
        echo '<li id="deactivate_invoice" style="width:30%;" onclick="location.href=\'' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=payment_gateways&deactivate_invoice_payment=true\';" class="red_alert pointer"><strong>' . __('Deactivate Invoice Payments?', 'event_espresso') . '</strong></li>';
        event_espresso_display_invoice_payment_settings();
    } else {
        echo '<li id="activate_invoice" style="width:30%;" onclick="location.href=\'' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=payment_gateways&activate_invoice_payment=true\';" class="green_alert pointer"><strong>' . __('Activate Invoice Payments?', 'event_espresso') . '</strong></li>';
    }
    echo '</ul>';
    ?>
				</div>
			</div>
		</div>
	</div>
	<?php 
}
Example #8
0
                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
         $product = new Product($products_id);
         //COGS
         $cogs = $product->getCOGSValue();
         $total_cogs_to_hh += $cogs * $row['quantity'];
         $total_qty_to_hh += $row['quantity'];
         //MATEXP
         $date = $row['sent_date'];
         $mat_exp = Product::getClosestMaterialExpensesOnSpecificDate($products_id, $date);
         $total_matexp_to_hh += $mat_exp * $row['quantity'];
     }
 }
 //GET DATA SENT TO LOCAL INDONESIA
 $total_cogs_to_id = 0;
 $total_qty_to_id = 0;
 $total_matexp_to_id = 0;
 $country_name = getCountryName(SERVER_LOCAL_CODE_INDONESIA);
 $q = "SELECT do.depot_orders_id, do.products_id, MAX(dosh.update_time) AS update_time,";
 $q .= " dosh.status, do.group_name, SUM(do.quantity) as quantity, dosh.update_by FROM depot_orders do";
 $q .= " INNER JOIN depot_orders_status_history dosh ON dosh.depot_orders_id = do.depot_orders_id";
 $q .= " WHERE do.group_name = 'Manobo Local Orders ({$country_name})'" . " AND dosh.status = '11' " . " AND dosh.update_time >= '{$prev_month_day_start}'" . " AND dosh.update_time <= '{$prev_month_day_end}'";
 $q .= " GROUP BY do.products_id";
 $r = tep_db_query($q);
 if (tep_db_num_rows($r) > 0) {
     while ($row = tep_db_fetch_array($r)) {
         $products_id = $row['products_id'];
         $product = new Product($products_id);
         //COGS
         $cogs = $product->getCOGSValue();
         $total_cogs_to_id += $cogs * $row['quantity'];
         $total_qty_to_id += $row['quantity'];
         //MATEXP
Example #10
0
function countryFlag($s)
{
    if (is_numeric($s)) {
        $s = getCountryCode($s);
    } else {
        if (!is_alphanumeric($s)) {
            throw new \Exception('hey');
        }
        if (strlen($s) == 2) {
            $s = country_2_to_3_letters($s);
        }
        $s = strtoupper($s);
    }
    $locale = \cd\LocaleHandler::getInstance();
    $title = getCountryName($s);
    if (!$title) {
        throw new \Exception('unhandled country flag code ' . $s);
    }
    return '<img src="' . relurl('core_dev/gfx/flags/' . $s . '.png') . '" alt="' . $title . '" title="' . $title . '"/>';
}
     echo json_encode($toSend);
 }
 //Отправляем всю инфу об конкретном адвокате.
 if (isset($_POST['getLawyerInfo'])) {
     $lawyerId = $_POST['id'];
     for ($i = 0; $i < count($lawyersInfo['lawyers']); $i++) {
         if ($lawyersInfo['lawyers'][$i]['id'] == $lawyerId) {
             $countryId = $lawyersInfo['lawyers'][$i]['country_id'];
             $cityId = $lawyersInfo['lawyers'][$i]['city_id'];
             $lawyerId = $lawyersInfo['lawyers'][$i]['id'];
             $lawyerName = $lawyersInfo['lawyers'][$i]['name'];
             $lawyerSecondName = $lawyersInfo['lawyers'][$i]['second_name'];
             $lawyerSkype = $lawyersInfo['lawyers'][$i]['skype'];
             $lawyerEmail = $lawyersInfo['lawyers'][$i]['email'];
             $lawyerHangout = $lawyersInfo['lawyers'][$i]['hangout'];
             $lawyerCountry = getCountryName($countryId, $lawyersInfo);
             $lawyerCity = getCityName($cityId, $lawyersInfo);
             $lawyerResume = file_get_contents(SITE_URL . 'store/lawyers-info/resumes/resume_' . $lawyerId . '.html');
             $result = array('id' => $lawyerId, 'name' => $lawyerName, 'secondName' => $lawyerSecondName, 'skype' => $lawyerSkype, 'email' => $lawyerEmail, 'hangout' => $lawyerHangout, 'country' => $lawyerCountry, 'city' => $lawyerCity, 'resume' => $lawyerResume);
         }
     }
     echo json_encode($result);
 }
 //Когда приходит запрос на изменение информации о конкретном юристе.
 if (isset($_POST['changeLawyerInfo'])) {
     $database->connect();
     //Определяем значения для заполнения
     $lawyerId = $_POST["id"];
     $lawyerName = $_POST["name"];
     $lawyerSecondName = $_POST["second-name"];
     $lawyerSkype = $_POST["skype"];
Example #12
0
function getAdventure($id, $mysql)
{
    $stmt = $mysql->prepare("SELECT * FROM adventure WHERE adventure_id=?");
    $stmt->bind_param("i", $id);
    $stmt->execute();
    $result = $stmt->get_result();
    if ($result->num_rows == 1) {
        $row = $result->fetch_assoc();
        $adventure['adventure_id'] = $row['adventure_id'];
        $adventure['title'] = $row['title'];
        $adventure['description'] = $row['description'];
        $adventure['country'] = getCountryName($row['country_id'], $mysql);
        $adventure['main_picture'] = getPictureFilename($row['main_picture_id'], $mysql);
        $adventure['rating'] = $row['rating'];
        $adventure['user_id'] = $row['user_id'];
        $result = $mysql->query("SELECT username FROM users WHERE user_id={$row['user_id']}");
        $user_row = $result->fetch_assoc();
        $adventure['username'] = $user_row['username'];
        $result = $mysql->query("SELECT picture_id,name FROM picture where adventure_id={$id}");
        $i = 0;
        while ($picture = $result->fetch_assoc()) {
            if ($picture['picture_id'] != $row['main_picture_id']) {
                $adventure['picture'][$i] = "./uploads/" . $picture['name'];
            }
            $i++;
        }
        $result = $mysql->query("SELECT value FROM tags where adventure_id={$id}");
        $i = 0;
        while ($tag = $result->fetch_assoc()) {
            $adventure['tag'][$i] = $tag["value"];
            $i++;
        }
        $result = $mysql->query("SELECT * FROM comments WHERE adventure_id = {$id} ORDER BY comment_id ASC");
        $comments = array();
        while ($comment = $result->fetch_assoc()) {
            array_push($comments, $comment);
        }
        $adventure['comments'] = $comments;
        $title = $adventure['title'];
        return $adventure;
    } else {
        return null;
    }
}
     //Итоговый массив, который будет отправлен в ответе.
     $toSend = array();
     //Устанавливаем соединение с БД.
     $database->connect();
     //Получаем все города и страны в разные массивы.
     $cities = $database->getQuery("SELECT * FROM cities");
     $countries = $database->getQuery("SELECT * FROM countries");
     //Цикл выполнится пропорционально количеству существующих городов.
     for ($i = 0; $i < count($cities); $i++) {
         $cityId = $cities[$i]['id'];
         $countryId = $cities[$i]['country_id'];
         $cityName = $cities[$i]['city'];
         //Подсчет количества юристов, проживающих в городе
         $lawyersCount = count($database->getQuery("SELECT * FROM lawyers WHERE city_id = {$cityId}"));
         //Массив, который будет как значение в итоговый массив $toSend.
         $result = array("id" => $cityId, "country" => getCountryName($countryId, $countries), "city" => $cityName, "lawyersCount" => $lawyersCount);
         //Вставляем значение в итоговый массив и возвращаемся к началу цикла
         array_push($toSend, $result);
     }
     //Отправляем ответ ajax-скрипту в JSON формате.
     echo json_encode($toSend);
     //Разрываем соединение
     $database->disconnect();
 }
 //Если пришел запрос на добавление новой страны.
 if (isset($_POST['addNewCountry'])) {
     $database->connect();
     //Название страны берется из полученного POST-запроса от Ajax, и приводится к виду
     //имени собственного. Первая буква становится строчной, остальные прописными.
     $country = ucfirst(strtolower($_POST['country']));
     //Передаем запрос классу.
Example #14
0
 €</B></td>
	</tr>
	<tr>
	<?php 
if (is_null($cart->user) || is_null($cart->user->shippingData['country'])) {
    ?>
		<td class="t-03"><?php 
    echo _("Entre con su cuenta de usuario para conocer los gastos de envio a su país.");
    ?>
</td>
		<td class="t-03">-</td>
	<?php 
} else {
    ?>
        <td class="t-03"><?php 
    echo sprintf(_("Gastos de envío a %s (*):"), getCountryName($cart->user->shippingData['country']));
    ?>
</td>
		<td class="t-03"><?php 
    echo $cart->getShippingCost();
    ?>
 €</td>
	<?php 
}
?>
	</tr>
	<!--tr>
		<td class="t-03"><?php 
echo _("Gastos para envíos fuera de España");
?>
 <select class="fd5" name="portafolio" >
Example #15
0
        header('Location: ../index.php');
    }
} else {
    if (isset($_GET['data'])) {
        if ($_GET['data'] === "usercp") {
            if ($siteUser->isLoggedIn() == true) {
                $result = $mysql->query("SELECT username, type, country_id, verified, name FROM users WHERE username = '******'");
                $outp = "[";
                while ($rs = $result->fetch_array(MYSQLI_ASSOC)) {
                    if ($outp != "[") {
                        $outp .= ",";
                    }
                    $outp .= '{"Username":"******"username"] . '",';
                    $outp .= '"Name":"' . $rs["name"] . '",';
                    $outp .= '"Verified":"' . $rs["verified"] . '",';
                    $outp .= '"Country":"' . getCountryName($rs["country_id"], $mysql) . '",';
                    $outp .= '"Type":"' . $rs["type"] . '"}';
                }
                $outp .= "]";
                echo $outp;
            }
        }
    }
}
if (isset($_POST['val'])) {
    if ($siteUser->isLoggedIn() == false) {
        return;
    }
    if ($_POST['val'] == "cpupdate") {
        if (isset($_POST['change']) && $_POST['change'] === "name") {
            if (isset($_POST["data"])) {
Example #16
0
require "define.inc";
$conn = mysql_connect(HOSTNAME, DBUSER, DBPWD) or die('Could not connect: ' . mysql_error());
mysql_select_db(DBNAME, $conn) or die('Could not connect: ' . mysql_error());
mysql_query("SET character_set_client=utf8");
mysql_query("SET character_set_connection=utf8");
$task = '';
if (isset($_POST['action'])) {
    $task = $_POST['action'];
} else {
    if (isset($_GET['action'])) {
        $task = $_GET['action'];
    }
}
switch ($task) {
    case 'getCountryName':
        getCountryName($conn);
        break;
    case 'getYear':
        getYear($conn);
        break;
    case "getMonthList":
        getMonthList($conn);
        break;
    case 'getItemGroup':
        getItemGroup($conn);
        break;
    case 'getItemList':
        getItemList($conn);
        break;
    case 'getShipmentStatus':
        getShipmentStatus($conn);
 // The following SQL command will find all the individual items associated with this order
 $itemquery = "SELECT sales_flat_order_item.order_id AS orderid,\n\t\t\t\t\t\tsales_flat_order_item.product_type,\n\t\t\t\t\t\tsales_flat_order_item.quote_item_id,\n\t\t\t\t\t\tsales_flat_order_item.parent_item_id AS parentid,\n\t\t\t\t\t\tsales_flat_order_item.sku AS itemcode,\n\t\t\t\t\t\tsales_flat_order_item.name AS itemname,\n\t\t\t\t\t\tsales_flat_order_item.qty_ordered AS qty_ordered,\n\t\t\t\t\t\tsales_flat_order_item.qty_shipped AS qty_shipped,\n\t\t\t\t\t\tsales_flat_quote_address.email AS email,\n\t\t\t\t\t\tsales_flat_quote_address.prefix AS title,\n\t\t\t\t\t\tsales_flat_quote_address.firstname AS firstname,\n\t\t\t\t\t\tsales_flat_quote_address.lastname AS lastname,\n\t\t\t\t\t\tsales_flat_quote_address.street AS address,\n\t\t\t\t\t\tsales_flat_quote_address.city AS city,\n\t\t\t\t\t\tsales_flat_quote_address.region AS region,\n\t\t\t\t\t\tsales_flat_quote_address.country_id AS country,\n\t\t\t\t\t\tsales_flat_quote_address.postcode AS postcode,\n\t\t\t\t\t\tsales_flat_quote_address.telephone AS telephone,\n\t\t\t\t\t\tsales_flat_quote_address.shipping_description AS shipping_instructions\n\t\t\t\t\t\tFROM sales_flat_order_item \n\t\t\t\t\t\tINNER JOIN sales_flat_quote_item\n\t\t\t\t\t\tON sales_flat_order_item.quote_item_id = sales_flat_quote_item.item_id\n\t\t\t\t\t\tINNER JOIN sales_flat_quote_address\n\t\t\t\t\t\tON sales_flat_quote_item.quote_id = sales_flat_quote_address.quote_id\n\t\t\t\t\t\tWHERE sales_flat_order_item.order_id = {$orderid}\n\t\t\t\t\t\tAND sales_flat_quote_address.address_type = 'shipping' \n\t\t\t\t\t\tAND sales_flat_order_item.product_type <> 'configurable'\n\t\t\t\t\t\tAND sales_flat_order_item.qty_shipped < sales_flat_order_item.qty_ordered";
 $itemresult = mysql_query($itemquery);
 // Run the query
 $numitems = @mysql_num_rows($itemresult);
 // Check the number of items in the order
 for ($j = 0; $j < $numitems; $j++) {
     $item = @mysql_fetch_array($itemresult);
     // Place the item in an array for processing
     // Output the order item values in the same sequence set in the fieldlist to match headers
     for ($m = 0; $m < sizeof($fieldlist); $m++) {
         $fieldvalue = $fieldlist[$m];
         if (in_array($fieldvalue, $checklist)) {
             // check if on special processing list
             if ($fieldvalue == "country") {
                 $output .= getCountryName($item[$fieldvalue]);
             }
             if ($fieldvalue == "quantity") {
                 $parentid = $item['parentid'];
                 if ($parentid == 'NULL') {
                     // simple product sold on its own (no parent)
                     $qty_ordered = $item["qty_ordered"];
                     $qty_shipped = $item["qty_shipped"];
                 } else {
                     // simple product was part of bundle or configurable group
                     // If so, use the parent quanities to calculate
                     $parentitem = get_DB_row("SELECT * FROM sales_flat_order_item WHERE item_id = {$parentid}");
                     $qty_ordered = $parentitem["qty_ordered"];
                     $qty_shipped = $parentitem["qty_shipped"];
                 }
                 $output .= $qty_ordered - $qty_shipped;
 if ($publicAccess) {
     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 {
Example #19
0
    ?>
><?php 
    echo $pName;
    ?>
</option>
    				<?php 
}
?>
    						</select></td>
    				</tr>
    				<tr><td align="left"><?php 
echo _("País");
?>
</td><td><select disabled>
    						<option selected><?php 
echo getCountryName($user->shippingData['country']);
?>
</option>
    						</select></td>
    				</tr>
    				<tr><td align="left"><?php 
echo _("Teléfono fijo o móvil");
?>
</td><td><?php 
echo $user->shippingData['phone'];
?>
</td></tr>
    			</tbody>
			</table>
		</center>
Example #20
0
    if ($duplicateInfo) {
        $_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']) {
Example #21
0
/**
 * secondDelimiterBrowse function.
 *
 * @access public
 * @param mixed $w
 * @param mixed $query
 * @param mixed $settings
 * @param mixed $db
 * @param mixed $update_in_progress
 * @return void
 */
function secondDelimiterBrowse($w, $query, $settings, $db, $update_in_progress)
{
    $words = explode('▹', $query);
    $kind = $words[0];
    $all_playlists = $settings->all_playlists;
    $is_alfred_playlist_active = $settings->is_alfred_playlist_active;
    $radio_number_tracks = $settings->radio_number_tracks;
    $now_playing_notifications = $settings->now_playing_notifications;
    $max_results = $settings->max_results;
    $alfred_playlist_uri = $settings->alfred_playlist_uri;
    $alfred_playlist_name = $settings->alfred_playlist_name;
    $country_code = $settings->country_code;
    $last_check_update_time = $settings->last_check_update_time;
    $oauth_client_id = $settings->oauth_client_id;
    $oauth_client_secret = $settings->oauth_client_secret;
    $oauth_redirect_uri = $settings->oauth_redirect_uri;
    $oauth_access_token = $settings->oauth_access_token;
    $oauth_expires = $settings->oauth_expires;
    $oauth_refresh_token = $settings->oauth_refresh_token;
    $display_name = $settings->display_name;
    $userid = $settings->userid;
    $echonest_api_key = $settings->echonest_api_key;
    $country = $words[1];
    if ($country == 'Choose a Country') {
        // list taken from http://charts.spotify.com/docs
        $spotify_country_codes = array("ar", "at", "au", "be", "bg", "ch", "cl", "co", "cr", "cz", "de", "dk", "ec", "ee", "es", "fi", "fr", "gb", "gr", "gt", "hk", "hu", "ie", "is", "it", "li", "lt", "lu", "lv", "mx", "my", "nl", "no", "nz", "pe", "pl", "pt", "se", "sg", "sk", "sv", "tr", "tw", "us", "uy");
        foreach ($spotify_country_codes as $spotify_country_code) {
            if (strtoupper($spotify_country_code) != 'US' && strtoupper($spotify_country_code) != 'GB' && strtoupper($spotify_country_code) != strtoupper($country_code)) {
                $w->result(null, '', getCountryName(strtoupper($spotify_country_code)), 'Browse the Spotify categories in ' . getCountryName(strtoupper($spotify_country_code)), './images/browse.png', 'no', null, 'Browse▹' . strtoupper($spotify_country_code) . '▹');
            }
        }
    } else {
        try {
            $api = getSpotifyWebAPI($w);
            $offsetListCategories = 0;
            $limitListCategories = 50;
            do {
                // refresh api
                $api = getSpotifyWebAPI($w, $api);
                $listCategories = $api->getCategoriesList(array('country' => $country, 'limit' => $limitListCategories, 'locale' => '', 'offset' => $offsetListCategories));
                $offsetListCategories += $limitListCategories;
            } while ($offsetListCategories < $listCategories->categories->total);
            foreach ($listCategories->categories->items as $category) {
                $w->result(null, '', escapeQuery($category->name), "Browse this category", getCategoryArtwork($w, $category->id, $category->icons[0]->url, true, false), 'no', null, "Browse▹" . $country . "▹" . $category->id . "▹");
            }
        } catch (SpotifyWebAPI\SpotifyWebAPIException $e) {
            $w->result(null, 'help', "Exception occurred", "" . $e->getMessage(), './images/warning.png', 'no', null, '');
            echo $w->toxml();
            return;
        }
    }
}
Example #22
0
function render_trust($method, &$request, &$template)
{
    global $storage;
    Server_needAuth($request);
    $account = Server_getAccount();
    list($request_info, $sreg) = getRequestInfo();
    if (!$request_info) {
        Server_redirect(getServerURL());
    }
    $urls = $storage->getUrlsForAccount($account);
    if (!in_array($request_info->identity, $urls)) {
        Server_clearAccount();
        setRequestInfo($request_info, $sreg);
        Server_needAuth($request);
    }
    if ($method == 'POST') {
        $trusted = false;
        if (isset($request['trust_forever'])) {
            $storage->trustLog(Server_getAccount(), $request_info->trust_root, true);
            $trusted = true;
        } else {
            if (isset($request['trust_once'])) {
                $storage->trustLog(Server_getAccount(), $request_info->trust_root, false);
                $trusted = true;
            } else {
                $storage->trustLog(Server_getAccount(), $request_info->trust_root, false);
            }
        }
        if ($trusted) {
            $allowed_fields = array();
            if (array_key_exists('sreg', $request)) {
                $allowed_fields = array_keys($request['sreg']);
            }
            $response = $request_info->answer(true);
            addSregData($account, $response, $allowed_fields);
        } else {
            $response = $request_info->answer(false);
        }
        setRequestInfo();
        Server_handleResponse($response);
    }
    if ($sreg) {
        // Get the profile data and mark it up so it's easy to tell
        // what's required and what's optional.
        $profile = $storage->getPersona($account);
        list($optional, $required, $policy_url) = $sreg;
        $sreg_labels = array('nickname' => 'Nickname', 'fullname' => 'Full name', 'email' => 'E-mail address', 'dob' => 'Birth date', 'postcode' => 'Postal code', 'gender' => 'Gender', 'country' => 'Country', 'timezone' => 'Time zone', 'language' => 'Language');
        $profile['country'] = getCountryName($profile['country']);
        $profile['language'] = getLanguage($profile['language']);
        $new_profile = array();
        foreach ($profile as $k => $v) {
            if (in_array($k, $optional) || in_array($k, $required)) {
                $new_profile[] = array('name' => $sreg_labels[$k], 'real_name' => $k, 'value' => $v, 'optional' => in_array($k, $optional), 'required' => in_array($k, $required));
            }
        }
        $template->assign('profile', $new_profile);
        $template->assign('policy_url', $policy_url);
    }
    $template->assign('trust_root', $request_info->trust_root);
    $template->assign('identity', $request_info->identity);
    $template->display('trust.tpl');
}