예제 #1
0
파일: ajax.php 프로젝트: Jasabd/Plumms
                $existqry = "SELECT productid, price, mainimg FROM products WHERE productid={$existingProductId}";
                $dstmt = $dbcon->prepare($existqry);
                if (!$dstmt->execute()) {
                    die('getproduct Error : (' . $dbcon->errno . ') ' . $dbcon->error);
                }
                $dstmt->store_result();
                $dstmt->bind_result($p, $pr, $im);
                while ($dstmt->fetch()) {
                    $prod_price = $pr;
                    $prodid = $p;
                    $customImgName = $im;
                }
                $result = "SUCCESS";
                $dstmt->close();
                $earObj = array("pid" => $prodid, "imgName" => $customImgName, "price" => $prod_price);
                if (count($custEarrings) == 0 || !existsInArray($earObj, $custEarrings)) {
                    $custEarrings[] = $earObj;
                    $_SESSION['customEarrings'] = $custEarrings;
                }
            }
        } else {
            $result = "ERROR";
        }
        $jsondata = array("result" => $result, "pprice" => $prod_price, "pid" => $prodid, "pimg" => $customImgName, "customizedEarrings" => $custEarrings, "matlist" => $matlist);
        echo json_encode($jsondata);
        exit;
    }
}
if (isset($_GET["despicks"])) {
    if (isset($_SERVER["CONTENT_TYPE"]) && strpos($_SERVER["CONTENT_TYPE"], "application/json") !== false) {
        $_POST = array_merge($_POST, (array) json_decode(trim(file_get_contents('php://input')), true));
 function getFunkIdCombo($name, $leerEintrag = false, $default = null)
 {
     $cobArr = array();
     if ($leerEintrag) {
         $cobArr[''] = " ";
     }
     $usedFunkIds = $this->getUsedFunkIds();
     // Wenn BT-Switch aktiv stehen 80 IDs mehr zur Verfuegung
     $maxFunkId = getPageConfigParam($_SESSION['config']->DBCONNECT, "btSwitchActive") == "J" ? 386 : 306;
     for ($i = 1; $i <= $maxFunkId; $i++) {
         if (!existsInArray($i, $usedFunkIds) || $default == $i) {
             $code = $i;
             $value = $i;
             $cobArr[$code] = $value;
         }
     }
     $cob = new Combobox($name, $cobArr, $default);
     return $cob;
 }