public function FormPost() { $out = array(); $out["map"] = array(); foreach (getpost() as $name => $value) { if (matches($name, "map")) { $map = json_decode(FormHelper::Decode($value)); foreach ($map as $mapped) { $parts = explode('|', $mapped); if (contains($parts[0], '__')) { $d = explode('__', $parts[0]); if (!isset($out["map"][$d[0]])) { $out["map"][$d[0]] = array(); } $out["map"][$d[0]][$d[1]] = AJAX::fp($parts[1]); } else { $mapped[$parts[0]] = AJAX::fp($parts[1]); } } } else { if (contains($name, '__')) { $d = explode("__", $name); if (!isset($out[$d[0]])) { $out[$d[0]] = array(); } $out[$d[0]][$d[1]] = base64_decode(urldecode($value)); } else { $out[$name] = FormHelper::Decode($value); } } } $out['signal'] = json_decode($out['signal'], true); return $out; }
function launch() { global $interface; global $configArray; global $library; global $locationSingleton; global $timer; global $user; if ($user) { $catalog = new CatalogConnection($configArray['Catalog']['driver']); $patron = $catalog->patronLogin($user->cat_username, $user->cat_password); $profile = $catalog->getMyProfile($patron); if (!PEAR_Singleton::isError($profile)) { $interface->assign('profile', $profile); } if (!isset($_POST['overDriveId']) || !isset($_POST['overDriveFormatId']) || !isset($_POST['loanPeriod'])) { header('Location: /'); } else { require_once ROOT_DIR . '/services/EcontentRecord/AJAX.php'; $_REQUEST['overDriveId'] = $_POST['overDriveId']; $_REQUEST['formatId'] = $_POST['loanPeriod']; $_REQUEST['lendingPeriod'] = $_POST['overDriveFormatId']; $service = new AJAX(); $status = json_decode($service->CheckoutOverDriveItem()); if ($status->result) { $msg = 'Your titles were checked out successfully. You may now download the titles from your Account.'; } else { $msg = $status->message; } $interface->assign('message', $msg); $interface->assign('result', $msg); $interface->setPageTitle('OverDrive Loan Period'); $interface->setTemplate('od-checkedOut.tpl'); } //Var for the IDCLREADER TEMPLATE $interface->assign('ButtonBack', false); $interface->assign('ButtonHome', true); $interface->assign('MobileTitle', 'OverDrive Loan Period'); } else { header('Location: /'); exit; } $interface->display('layout.tpl'); }
/** * Register hooks and load options. * * @since 1.0.0 * * @uses Registry::load() to load the options. * @uses Loader::register_hooks() to setup plugin management. * @uses System::register_hooks() to setup global functionality. * @uses Backend::register_hooks() to setup backend functionality. * @uses AJAX::register_hooks() to setup AJAX functionality. * @uses Manager::register_hooks() to setup admin screens. * @uses Documenter::register_hooks() to setup admin documentation. */ public static function setup() { // Setup the registry Registry::load(); // Register the Installer stuff Installer::register_hooks(); // Register global hooks self::register_hooks(); // Register the hooks of the subsystems Backend::register_hooks(); AJAX::register_hooks(); Manager::register_hooks(); Documenter::register_hooks(); }
public function run() { Util\Template::init(); Util\TemplateTags::init(); Util\Images::init(); Util\Shortcodes::init(); Util\BootstrapNavMenu::init(); Util\BootstrapGallery::init(); Assets::instance()->run(); Customizer::instance()->run(); AJAX::instance()->run(); PluginCompat::instance()->run(); add_action('after_setup_theme', array($this, 'after_setup_theme')); add_action('widgets_init', array($this, 'widgets_init')); }
function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function get_size($size_type_id) { $sql = "SELECT * from tbl_size WHERE size_type_id = '{$size_type_id}' ORDER BY size_order"; $query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $_get = new PRODUCTS_GET(); $_GET["product_alias"] = $_POST["product_alias"]; $data = $_get->get_product_details(); $size_type_id = filter_var($_POST["size_type_id"], FILTER_SANITIZE_STRING); $type_order = filter_var($_POST["type_order"], FILTER_SANITIZE_NUMBER_INT); $check_array = $_ajax->get_size($size_type_id); //if (mysql_num_rows($check)!=null){ //for($i=0;$i<mysql_num_rows($check);$i++){ //$check_array = mysql_fetch_array($check); //} //} $i = 0; foreach ($check_array as $key => $check_array) { $size_name = $check_array->size_name; if ($data['quantity'][$type_order][$size_name] == '') {
$query = $this->conn->query($sql); $result = $query->fetch_object(); return $result; } function get_stock($type_id) { $sql = "SELECT * FROM `tbl_product_stock` WHERE `type_id`= '{$type_id}' ORDER BY `stock_name`"; $query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $ajax_type_id = filter_var($_POST['type_id'], FILTER_SANITIZE_EMAIL); $count = $_ajax->count_stock($ajax_type_id); if ($count->rows > 0) { $data = $_ajax->get_stock($ajax_type_id); echo '<label class="control-label col-xs-3">Stock Name</label>'; echo '<div class="col-xs-9">'; echo '<select name="type" id="id-modal-stock" class="form-control">'; foreach ($data as $data) { echo '<option '; if ($data->stock_quantity == 0) { echo 'disabled="disabled"'; } echo ' value="' . $data->stock_id . '" data-total="' . $data->stock_quantity . '">' . $data->stock_name . '</option>'; } echo '</select>';
public function customize_localize_script() { wp_localize_script('wp-starter-theme-customize-preview', lcfirst('WPStarterTheme'), array('nonces' => AJAX::instance()->get_nonces())); }
function count_payment($api_id) { $sql = "SELECT COUNT(*) AS rows FROM tbl_paypal WHERE `api_id` = '{$api_id}'"; $query = $this->conn->query($sql); $result = $query->fetch_object(); return $result; } function get_payment($api_id) { $sql = "SELECT * FROM tbl_paypal WHERE `api_id` = '{$api_id}'"; $query = $this->conn->query($sql); $result = $query->fetch_object(); return $result; } } $_ajax = new AJAX(); $ajx_id = filter_var($_POST['bank'], FILTER_SANITIZE_STRING); $count = $_ajax->count_payment(1); if ($count->rows > 0) { $bank = $_ajax->get_payment(1); $api_mode = $bank->api_mode; $api_username = $bank->api_username; $api_password = $bank->api_password; $api_signature = $bank->api_signature; $api_return_url = $bank->api_return_url; $api_cancel_url = $bank->api_cancel_url; $api_status = $bank->api_status; } else { $api_mode = ''; $api_username = ''; $api_password = '';
/** * @brief Initializes the API Request Process. * * ## Overview * This will parse various request parameters and attemp to call the * respective action on an object controller. * * @uses spl_autoload_register() * @see index.php * * @return {Null} Always unless fatal error or exception is thrown. * * @author TronNet DevOps [Sean Murray] <*****@*****.**> * @date 02/19/2014 */ public static function Init($params = null) { try { if (count($_POST)) { // Auth always required $method = 'post'; $params = $_POST; } else { // Some auth may be required $method = 'get'; $params = $_GET; } DebugHandler::Log(var_export($params, true)); DebugHandler::Log(var_export($method, true)); DebugHandler::Log(var_export($_SERVER['REQUEST_URI'], true)); $noGet = explode('?', $_SERVER['REQUEST_URI']); $delReqParams = explode('/', $noGet[0]); DebugHandler::Log(var_export($delReqParams, true)); array_shift($delReqParams); DebugHandler::Log(var_export($delReqParams, true)); if (isset($delReqParams[0]) && !empty($delReqParams[0])) { $params['_action'] = $delReqParams[0]; if (isset($delReqParams[1]) && !empty($delReqParams[1])) { $params['_target'] = $delReqParams[1]; array_shift($delReqParams); } } if (!isset($params['_target'])) { throw new Exception('No target was provided'); } DebugHandler::Log(var_export($params, true)); $className = $params['_target']; $action = $params['_action']; $controller = $className . 'Controller'; DebugHandler::Log(var_export(SATANBARBARA_API_NAMESPACE . $controller . '::ValidRequestMethod::' . $action, true)); if (call_user_func(SATANBARBARA_API_NAMESPACE . $controller . '::ValidRequestMethod', $method, $action)) { $filteredParams = call_user_func(SATANBARBARA_API_NAMESPACE . $controller . '::FilterParams', $method, $action, $params); $data = call_user_func(SATANBARBARA_API_NAMESPACE . $controller . '::' . $action, $filteredParams); } else { throw new Exception('This action cannot be envoked through the get method!'); } AJAX::Response('json', $data); } catch (Exception $e) { AJAX::Response('json', array(), 1, $e->getMessage()); } }
{ private $conn; function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function get_province() { $sql = "SELECT * FROM province ORDER BY `province_name`"; $query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $_ajax_province = filter_var($_POST['province'], FILTER_SANITIZE_STRING); $_ajax_city = filter_var($_POST['city'], FILTER_SANITIZE_STRING); $getProvince = $_ajax->get_province(); echo "<select class=\"form-control\" id=\"id-province\" name=\"province\" onchange=\"getCity('" . $_ajax_city . "')\">"; foreach ($getProvince as $province) { echo '<option value="' . $province->province_name . '"'; if ($province->province_name == $_ajax_province) { echo ' selected="selected" '; } echo '>' . $province->province_name . '</option>'; } echo '</select>'; }
array_push($row, $result); } return $row; } function international($courier_name) { $sql = "SELECT * FROM tbl_courier_rate WHERE `courier_province` = 'international' AND `courier_name` = '{$courier_name}' ORDER BY `courier_city` ASC"; $query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $province = filter_var($_POST['post'], FILTER_SANITIZE_STRING); $weight = filter_var($_POST['weight'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); $country = $_ajax->international($province); ?> <div class="box row" id="international"> <div class="desc col-xs-3"> <h3>International Shipping</h3> <p>Details of international shipping cost.</p> </div> <div class="content col-xs-9"> <ul class="form-set"> <?php $row = 0;
return $row; } function count_stock($post_type_id) { $sql = "SELECT COUNT(*) AS rows FROM tbl_product_stock WHERE `type_id` = '{$post_type_id}'"; $query = $this->conn->query($sql); $result = $query->fetch_object(); return $result; } function update($post_stock_quantity, $post_stock_id) { $sql = "UPDATE tbl_product_stock SET `stock_quantity` = ? WHERE `stock_id` = ?"; $stmt = $this->conn->prepare($sql); if ($stmt === false) { trigger_error('Database error: ' . $sql . ' Error: ' . $this->conn->errno . ' ' . $this->conn->error, E_USER_ERROR); } else { $stmt->bind_param("ss", $post_stock_quantity, $post_stock_id); $stmt->execute(); } $stmt->close(); } } $_ajax = new AJAX(); $ajx_type_id = $_POST['type']; $ajx_stock_qty = $_POST['value']; $ajx_stock_id = $_POST['id']; foreach ($ajx_stock_id as $key => $stock_id) { filter_var($stock_id, FILTER_SANITIZE_STRING); $_ajax->update($ajx_stock_qty[$key], $stock_id); } }
function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function promo_get_banner($post_banner_id) { $sql = "SELECT * FROM tbl_promo_banner WHERE `id` = '{$post_banner_id}'"; $query = $this->conn->query($sql); $result = $query->fetch_object(); return $result; } function delete_banner($id) { $sql = "DELETE FROM tbl_promo_banner WHERE `id` = ?"; //$sql = "UPDATE tbl_promo_item SET `filename` = ? WHERE `id` = ?"; $stmt = $this->conn->prepare($sql); if ($stmt === false) { trigger_error('Database error: ' . $sql . ' Error: ' . $this->conn->errno . ' ' . $this->conn->error, E_USER_ERROR); } else { $stmt->bind_param("s", $id); $stmt->execute(); } $stmt->close(); } } $_ajax = new AJAX(); $ajx_id = filter_var($_POST['pid'], FILTER_SANITIZE_NUMBER_INT); $file_banner = $_ajax->promo_get_banner($ajx_id); $_ajax->delete_banner($ajx_id); //unlink(dirname(__FILE__).'/../../../../../../../'.$file_banner->filename); }
$query = $this->conn->query($sql); $result = $query->fetch_object(); return $result; } function get_type($product_id, $type_delete, $type_active) { $sql = "SELECT `type_`.`type_id`, `type_`.`type_name`, SUM(`stock_quantity`) AS `total_qty`, `type_delete` \n\t FROM `tbl_product_type` AS `type_` INNER JOIN `tbl_product_stock` AS `stock_` ON `type_`.`type_id` = `stock_`.`type_id`\n\t\t\t\t WHERE `product_id`= '{$product_id}' AND `type_delete` = '{$type_delete}' AND `type_active` = '{$type_active}'\n\t\t\t\t GROUP BY `type_`.`type_id`\n\t\t\t\t"; $query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $ajax_id = filter_var($_POST['product_id'], FILTER_SANITIZE_EMAIL); $count = $_ajax->count_type($ajax_id, 0); if ($count->rows > 0) { $data = $_ajax->get_type($ajax_id, 0, 1); echo '<label class="control-label col-xs-3">Type Name</label>'; echo '<div class="col-xs-9">'; echo '<select name="type" id="id-modal-type" class="form-control" tabindex="4">'; foreach ($data as $data) { echo '<option '; if ($data->total_qty == 0) { echo 'disabled="disabled"'; } else { if ($data->type_delete > 0) { echo 'class="hidden"'; }
# ---------------------------------------------------------------------- # AJAX: CHECK ALIAS # ---------------------------------------------------------------------- */ if ($_POST) { require_once '../../../static/_header.php'; class AJAX { private $conn; function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function count_alias($product_alias, $product_id) { $sql = "SELECT COUNT(*) AS rows FROM tbl_product WHERE `product_alias` = '{$product_alias}' AND id != '{$product_id}'"; $query = $this->conn->query($sql); $result = $query->fetch_object(); return $result; } } $_ajax = new AJAX(); $product_alias = filter_var($_POST["product_alias"], FILTER_SANITIZE_STRING); $product_id = filter_var($_POST["product_id"], FILTER_SANITIZE_NUMBER_INT); $count_alias = $_ajax->count_alias($product_alias, $product_id); if ($count_alias->rows > 0) { echo 'existed'; } else { echo 'ok'; } }
<?php /* * ajax/registerpost.php * This file responsible for handling the post data from register.php * This is where the AJAX post request is sent. * Handles errors, adding user etc. with register.class.php class. * Include ajax class to check unique nonce (string) */ session_start(); require_once '../libs/autoloader.php'; require_once '../libs/connect.class.php'; $register = new register($mysqli); $ajax = new AJAX(); $nonce = $_POST['nonce']; $username = $_POST['username']; $email1 = $_POST['email']; $email2 = $_POST['reemail']; $pass1 = $_POST['pass']; $pass2 = $_POST['repass']; // check if session is still alive. if (isset($_SESSION['current_page'])) { if ($ajax->checkAJAX($nonce, $_SESSION['current_page'])) { if (isset($_POST['submit'])) { $register->Username($username); $register->Email($email1, $email2); $register->Password($pass1, $pass2); if (empty($register->errors)) { //if no errors, add user. $register->addUser($username, $pass1, $email1); if (!isset($mysqli->errorno)) {
<?php session_start(); //get the name of the current page, (in this case register.php) if (!isset($_SESSION['loggedin'])) { //this session var should (loggedin) only be active if the user //is logged in, so we only want people who are not //logged in to be able to regiser $_SESSION['current_page'] = $_SERVER['SCRIPT_NAME']; } require_once 'libs/autoloader.php'; require_once 'libs/connect.class.php'; $ajax = new AJAX(); ?> <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="js/script.js"></script> <link rel="stylesheet" href="css/style.css" type="text/css"> <meta charset="UTF-8"> <title>Register</title> <div id="container"> <div id="header"> <h1>SAMPLE HEADER</h1> </div> <div id="navbar"> <ul> <li><a href="index.php">Home</a></li>
class AJAX { private $conn; function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function get_payment($post_payment_id) { $sql = "SELECT * FROM tbl_account WHERE id = '{$post_payment_id}'"; $query = $this->conn->query($sql); $result = $query->fetch_object(); return $result; } } $_ajax = new AJAX(); $ajx_id = filter_var($_POST['bank'], FILTER_SANITIZE_STRING); $bank = $_ajax->get_payment($ajx_id); } if (is_numeric($ajx_id)) { ?> <li class="form-group row" id="id-row-name"> <label class="control-label col-xs-3" for="">Bank Name</label> <div class="col-xs-9"> <input type="text" class="form-control" id="id-name" name="name" value="<?php echo $bank->account_bank; ?> "> <p class="help-block">The name of the bank, e.g. BCA, Mandiri</p> </div>
/* * ---------------------------------------------------------------------- * AJAX: REMOVE SALE * ---------------------------------------------------------------------- */ if ($_POST) { require_once "../../../../static/_header.php"; class AJAX { private $conn; function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function remove_promo($promo_item_id) { $sql = "DELETE FROM tbl_promo_item WHERE `promo_item_id` = ?"; $stmt = $this->conn->prepare($sql); if ($stmt === false) { trigger_error('Database error: ' . $sql . ' Error: ' . $this->conn->errno . ' ' . $this->conn->error, E_USER_ERROR); } else { $stmt->bind_param("s", $promo_item_id); $stmt->execute(); } $stmt->close(); } } $_ajax = new AJAX(); $promo_item_id = filter_var($_POST['item_id'], FILTER_SANITIZE_NUMBER_INT); $_ajax->remove_promo($promo_item_id); }
function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function get_all_color_group() { $sql = "SELECT * FROM tbl_color ORDER BY color_order ASC"; $query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $i = filter_var($_POST["i"], FILTER_SANITIZE_STRING); $data = $_POST["data"]; $all_color_group = $_ajax->get_all_color_group(); ?> <ul class="form-set" id="type_group_<?php echo $i; ?> " style="margin-bottom:15px; min-height:600px;"> <li class="form-group row hidden" id="lbl_color_id_<?php echo $i; ?> "> <label class="col-xs-3 control-label" for="color">Type Group *</label>
# ---------------------------------------------------------------------- */ if ($_POST) { require_once '../../../static/_header.php'; class AJAX { private $conn; function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function get_city($province) { $sql = "SELECT * FROM tbl_courier_rate WHERE `courier_province` = '{$province}' GROUP BY `courier_city` ORDER BY `courier_city`"; $query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $_ajax_province = filter_var($_POST['province'], FILTER_SANITIZE_STRING); $get_city = $_ajax->get_city($_ajax_province); echo '<select class="form-control" id="id-city" name="city">'; foreach ($get_city as $city) { echo '<option value="' . $city->courier_city . '">' . $city->courier_city . '</option>'; } echo '</select>'; }
} plog('--- detected ajax modes ' . vars($modes)); global $database; foreach ($modes as $mode) { switch ($mode) { default: Page::Redirect('dash?nosuchform'); break; case 1: if (!Session::logged_in()) { Page::Redirect('login'); } global $auth; $old = AJAX::Value($ajax, 'changeMyPassword', 'password', 'old'); $change = AJAX::Value($ajax, 'changeMyPassword', 'password', 'new'); $repeat = AJAX::Value($ajax, 'changeMyPassword', 'password', 'confirm'); if (strlen($auth['password']) === 0 || Auth::PasswordMatches(ourcrypt($old), $auth['password'])) { if (matches($change, $repeat, TRUE)) { global $auth_model; $auth_model->Update(array('password' => ourcrypt($change), 'password_expiry' => strtotime('+1 year')), array('ID' => $auth['ID'])); echo js('Notifier.success("Password changed!");'); die; } else { echo js('Notifier.error("Passwords did not match.");'); die; } } else { echo js('Notifier.error("You got your password wrong.","Logging you out."); setTimeout( function() { window.location="logout"; }, 2000 );'); die; }
* AJAX: REMOVE SLIDESHOW * ---------------------------------------------------------------------- */ if ($_POST) { require_once "../../../static/_header.php"; class AJAX { private $conn; function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function delete_banner($id) { $sql = "DELETE FROM tbl_slideshow WHERE `id` = ?"; $stmt = $this->conn->prepare($sql); if ($stmt === false) { trigger_error('Database error: ' . $sql . ' Error: ' . $this->conn->errno . ' ' . $this->conn->error, E_USER_ERROR); } else { $stmt->bind_param("s", $id); $stmt->execute(); } $stmt->close(); } } $_ajax = new AJAX(); $ajx_id = filter_var($_POST['bid'], FILTER_SANITIZE_NUMBER_INT); //$banner_file = get_banner($ajx_id); //unlink("../../../../".$banner_file['filename']); $_ajax->delete_banner($ajx_id); }
<?php //!!!!include_once($CFG->dirroot."/lib/classes/" . 'ajax/AJAX.Class.php5'); $ajaxlistObj = new AJAX(); //!!!include_once($CFG->dirroot."/lib/classes/" . 'ajax/AjaxAdd.Class.php5'); $ajaxaddObj = new AjaxAdd(); $getParam = ''; //if($_REQUEST['file']=='product') //{ //echo "<pre/>";print_r($_REQUEST);EXIT; //} $file = $_REQUEST['file']; #echo $file;exit; if ($_REQUEST['file'] == 'LoginHistory') { $getParam = " AND log_history.iUserId = '" . $_REQUEST['iId'] . "' AND eUserType='Admin' "; } if ($_REQUEST['file'] == 'faq_category') { $getParam = " AND language.ePrimary = 'yes' "; } if ($_REQUEST['file'] == 'Attribute') { $getParam = " AND language.ePrimary = 'yes' "; } if ($_REQUEST['file'] == 'News') { $getParam = " AND language.ePrimary = 'yes' "; } if ($_REQUEST['file'] == 'ProductGarments') { $getParam = " AND language.ePrimary = 'yes' "; } if ($_REQUEST['file'] == 'SubAttribute') { $getParam = " AND language.ePrimary = 'yes' "; }
$query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } function count_alias($size_type_id) { $sql = "SELECT COUNT(*) AS rows FROM tbl_size WHERE size_type_id = '{$size_type_id}' ORDER BY size_order"; $query = $this->conn->query($sql); $result = $query->fetch_object(); return $result; } } $_ajax = new AJAX(); $size_type_id = filter_var($_POST["size_type_id"], FILTER_SANITIZE_STRING); $type_order = filter_var($_POST["type_order"], FILTER_SANITIZE_NUMBER_INT); $count = $_ajax->count_alias($size_type_id); $check_array = $_ajax->get_alias($size_type_id); if ($count->rows > 0) { foreach ($check_array as $key => $check_array) { ?> <div class="form-group row" id="lbl_size_qty"> <label class="col-xs-3 control-label" for="Stock"> <?php if ($key == 0) { ?> Sizes<?php
function delete_new_arrival($post_new_arrival, $post_id) { $sql = "UPDATE tbl_product_type SET `type_new_arrival` = ? WHERE `type_id` = ?"; $stmt = $this->conn->prepare($sql); if ($stmt === false) { trigger_error('Database error: ' . $sql . ' Error: ' . $this->conn->errno . ' ' . $this->conn->error, E_USER_ERROR); } else { $stmt->bind_param("ss", $post_new_arrival, $post_id); $stmt->execute(); } $stmt->close(); } function delete_new_arrivals($new_type_id) { $sql = "DELETE FROM tbl_curated_2 WHERE `cur2_type_id` = ?"; $stmt = $this->conn->prepare($sql); if ($stmt === false) { trigger_error('Database error: ' . $sql . ' Error: ' . $this->conn->errno . ' ' . $this->conn->error, E_USER_ERROR); } else { $stmt->bind_param("s", $new_type_id); $stmt->execute(); } $stmt->close(); } } $_ajax = new AJAX(); $item_id = filter_var($_POST['item_id'], FILTER_SANITIZE_NUMBER_INT); $product = $_ajax->get_type_id($item_id); //$_ajax->delete_new_arrival(0, $product->type_id); $_ajax->delete_new_arrivals($product->type_id); }
ORDER BY `courier_city` "; $query = $this->conn->query($sql); $row = array(); while($result = $query->fetch_object()){ array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $provinces = $_ajax->get_province(); ?> <div class="box row" id="local"> <div class="desc col-xs-3"> <h3>Local Shipping</h3> <p>Details of local shipping.</p> </div> <div class="content col-xs-9"> <ul class="form-set"> <?php $row = 0; foreach($provinces as $provinces){
array_push($row, $result); } return $row; } function get_provinces() { $sql = "SELECT * FROM `province` ORDER BY `province_name`"; $query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $ajax_email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL); $count = $_ajax->count_user($ajax_email); if ($count->rows > 0) { $data = $_ajax->get_user($ajax_email); $country = $_ajax->get_country(); $province = $_ajax->get_provinces(); if ($data->user_country == 'Indonesia') { $city = $_ajax->get_province($data->user_province); } else { $city = $data->user_city; } ?> <li class="form-group p_t_25 m_t_30 upperlined"> <h5 class="m_b_20"><strong>BILLING ADDRESS</strong></h5>
} } else { if (strtolower($_GET['_g']) == 'plugin' && isset($_GET['name'])) { // Include plugins $GLOBALS['main']->wikiNamespace('Plugins'); foreach ($GLOBALS['hooks']->load('admin.' . strtolower($_GET['name'])) as $hook) { include $hook; } } else { if ($_GET['_g'] == '401') { $GLOBALS['gui']->setError($lang['navigation']['error_401']); } else { if (strtolower($_GET['_g']) == 'xml') { $suppress_output = true; // Process an XMLHTTPRequest $json = AJAX::load(); @ob_end_clean(); die($json); } else { // Everything else $include = $GLOBALS['main']->importNode($_GET['_g'], $node); if (file_exists($include)) { require $include; } else { trigger_error(sprintf('Unable to load content for %s:%s', $_GET['_g'], $node), E_USER_WARNING); } } } } } } else {
function __construct() { $this->conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); } function get_country() { $sql = "SELECT * FROM countries ORDER BY `country_name`"; $query = $this->conn->query($sql); $row = array(); while ($result = $query->fetch_object()) { array_push($row, $result); } return $row; } } $_ajax = new AJAX(); $country = $_ajax->get_country(); ?> <div class="box row" id="international"> <div class="desc col-xs-3"> <h3>International Shipping</h3> <p>Details of international shipping cost.</p> </div> <div class="content col-xs-9"> <ul class="form-set"> <?php $row = 0; foreach ($country as $country) { ?>