$subsection = $_REQUEST['subsection']; $shelfset = $_REQUEST['shelfset']; $shelf = $_REQUEST['shelf']; $location = $_REQUEST['location']; switch ($_REQUEST['ajax']) { case 'get': $output = lookupItem($store, $section, $subsection, $shelfset, $shelf, $location); echo json_encode($output); break; case 'set': if (!isset($_REQUEST['upc']) || !is_numeric($_REQUEST['upc'])) { echo json_encode(array('errors' => 'invalid request')); return; } saveItem($store, $section, $subsection, $shelfset, $shelf, $location, $_REQUEST['upc']); $output = lookupItem($store, $section, $subsection, $shelfset, $shelf, $location + 1); echo json_encode($output); break; case 'default': echo json_encode(array('errors' => 'invalid request')); break; } return; } function lookupItem($store, $sec, $subsec, $sh_set, $shelf, $loc) { global $FANNIE_OP_DB; $dbc = FannieDB::get($FANNIE_OP_DB); $q = $dbc->prepare_statement("SELECT l.upc,p.description FROM prodPhysicalLocation AS l\n " . DTrans::joinProducts('l') . "\n WHERE l.store_id=? AND section=? AND subsection=?\n AND shelf_set=? AND shelf=? AND location=?"); $args = array($store, $sec, $subsec, $sh_set, $shelf, $loc); $r = $dbc->exec_statement($q, $args);
header("Refresh: 3; url=" . $durl); } } } ob_end_flush(); // Flush the buffer, start displaying } else { ob_end_flush(); $login_output .= $login_preamble; $login_output .= "<div class='alert alert-warning'><button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button><p><strong>Whoops!</strong> " . $res['message'] . "</p><aside class='ssmall'>Did you mean to <a href='?q=create' class='alert-link'>create a new account instead?</a> Or did you need to <a href='#' class='alert-link do-password-reset'>reset your password?</a></aside>\n<p class='small'>As a reminder, we require a password of at least {$minimum_password_length} characters with at least <strong>one upper case</strong> letter, at least <strong>one lower case</strong> letter, and at least <strong>one digit or special character</strong>.</p>\n </div>"; $failcount = intval($_POST['failcount']) + 1; $loginform_whole = $loginform . "\n <input type='hidden' name='failcount' id='failcount' value='{$fail}'/>" . $loginform_close; if ($failcount < 10) { $login_output .= $loginform_whole; } else { $result = lookupItem($_POST['username'], 'username', null, null, false, true); if ($result !== false) { $userdata = mysqli_fetch_assoc($result); $id = $userdata['id']; } $query = "UPDATE `{$default_user_table}` SET dtime=" . $user->microtime_float() . " WHERE id={$id}"; $query2 = "UPDATE `{$default_user_table}` SET disabled=true WHERE id={$id}"; $l = openDB(); $result1 = mysqli_query($l, $query); if (!$result1) { echo "<div class='alert alert-warning'><button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button><p>" . mysqli_error($l) . "</p></div>"; } else { $result2 = execAndCloseDB($l, $query2); if (!$result2) { echo "<div class='alert alert-warning'><button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button><p>" . mysqli_error($l) . "</p></div>"; } else {
function arrify($items) { $obj = new stdClass(); $i = 0; foreach ($items->Item as $item) { $obj->Items->Item[$i]->ASIN = (string) $item->ASIN; if (isset($item->SmallImage)) { $obj->Items->Item[$i]->SmallImage = $item->SmallImage; } if (isset($item->MediumImage)) { $obj->Items->Item[$i]->MediumImage = $item->MediumImage; } if (isset($item->LargeImage)) { $obj->Items->Item[$i]->LargeImage = $item->LargeImage; } if (isset($item->ItemAttributes->ListPrice)) { $obj->Items->Item[$i]->ItemAttributes->ListPrice = $item->ItemAttributes->ListPrice; } else { $bool = lookupItem((string) $item->ASIN); if ($bool) { $obj->Items->Item[$i]->ItemAttributes->ListPrice = $bool; } } $obj->Items->Item[$i]->ItemAttributes->ProductGroup = (string) $item->ItemAttributes->ProductGroup; $obj->Items->Item[$i]->ItemAttributes->Title = (string) $item->ItemAttributes->Title; $obj->Items->Item[$i]->DetailPageURL = (string) $item->DetailPageURL; $i++; } return $obj; }