Notes
Notes - notes.io |
$gg="SELECT id,products_id,variation_id FROM cart_options WHERE result='' and item_id>'$ID' LIMIT 1000";
$query = mysql_query($gg);
$variation22 = [];
$results = [];
$i = 0;
while ($printRow = mysql_fetch_array($query)) {
$i++;
$id = $printRow["id"];
$results[$i]["id"] = $id;
$products_id = $printRow["products_id"];
$results[$i]["products_id"] = $products_id;
$ProductVariationID = $printRow["variation_id"];
$results[$i]["variation_id"] = $ProductVariationID;
$variationSql2 = "SELECT ValuesTR FROM ProductVariationBuffer WHERE ProductVariationID='$ProductVariationID' LIMIT 1";
$variationRow2 = mysql_query($variationSql2);
$varyasyon = [];
while ($variation = mysql_fetch_array($variationRow2)) {
$various = "#@" . $variation["ValuesTR"];
$parcala = explode("#@", $various);
$it = 0;
foreach ($parcala as $anh => $value) {
if (!empty($value)) {
$it++;
//$sira = $k * 2;
//$key2 = $value;
$deger = explode(".", $value);
if (!isset($deger[1])) {
$qq = "SELECT * FROM VariationValue WHERE VariationValueID='{$value}'";
$variationKey = mysql_query($qq);
$variationKeyRow = mysql_fetch_array($variationKey);
if (isset($variationKeyRow["VariationKeyID"]) and $variationKeyRow["VariationKeyID"] != "") {
$key = "SELECT Parameter1 FROM VariationKey WHERE VariationKeyID='{$variationKeyRow["VariationKeyID"]}'";
$variationKey2 = mysql_query($key);
$variationKeyRow2 = mysql_fetch_array($variationKey2);
if (!empty($variationKeyRow2["Parameter1"])) {
if (!in_array($variationKeyRow2["Parameter1"], $variation22[$id]["Keys"][$anh])) {
if ($variationKeyRow2["Parameter1"] == "18") {
$variationKeyRow2["Parameter1"] = "Renk";
}
if ($variationKeyRow2["Parameter1"] == "19") {
$variationKeyRow2["Parameter1"] = "Dia";
}
if ($variationKeyRow2["Parameter1"] == "20") {
$variationKeyRow2["Parameter1"] = "BC";
}
if ($variationKeyRow2["Parameter1"] == "21") {
$variationKeyRow2["Parameter1"] = "Sph(Pwr)";
}
if ($variationKeyRow2["Parameter1"] == "Torrikk Lens@#Dia") {
$variationKeyRow2["Parameter1"] = "Dia";
}
if ($variationKeyRow2["Parameter1"] == "Torrikk Lens@#BC") {
$variationKeyRow2["Parameter1"] = "BC";
}
if ($variationKeyRow2["Parameter1"] == "Torrikk Lens@#PWS") {
$variationKeyRow2["Parameter1"] = "Sph(Pwr)";
}
if ($variationKeyRow2["Parameter1"] == "Torrikk Lens@#CYL") {
$variationKeyRow2["Parameter1"] = "CYL";
}
if ($variationKeyRow2["Parameter1"] == "Torrikk Lens@#Aks") {
$variationKeyRow2["Parameter1"] = "Aks";
}
if ($variationKeyRow2["Parameter1"] == "Astigmat(Cyl)") {
$variationKeyRow2["Parameter1"] = "CYL";
}
if ($variationKeyRow2["Parameter1"] == "Aks(Axis)") {
$variationKeyRow2["Parameter1"] = "Aks";
}
//$variation22[$id]["Keys"][$anh][]=$variationKeyRow2["Parameter1"];
$variation22[$id]["Keys"][$variationKeyRow2["Parameter1"]] = $it;
}
} else {
if (!in_array($value, $variation22[$id]["Values"][$anh])) {
$variation22[$id]["Values"][$anh][] = $value;
}
}
} else {
if (!in_array($value, $variation22[$id]["Values"][$anh])) {
$variation22[$id]["Values"][$anh][] = $value;
}
}
} else {
if (!in_array($value, $variation22[$id]["Values"][$anh])) {
$variation22[$id]["Values"][$anh][] = $value;
}
}
}
}
}
$results[$i]["variation"] = $variation22;
}
foreach ($results as $print) {
$id = $print["id"];
$products_id = $print["products_id"];
$variation_id = $print["variation_id"];
$variation2 = $print["variation_id"];
$variation = $print["variation"];
//die;
$artirma = 1;
foreach ($variation as $key => $value) {
if (!empty($value)) {
$pid = $key;
$keys = $value["Keys"];
$aks_deger = "";
if (isset($value["Keys"]["Aks"])) {
$aks_keys = $value["Keys"]["Aks"];
$aks_degerler = $value["Values"][$aks_keys + $artirma];
foreach ($aks_degerler as $aks_value) {
$aks_value = trim($aks_value);
$aks = mysql_fetch_assoc(mysql_query("SELECT id FROM aks WHERE name='$aks_value' LIMIT 1"));
$aks_deger= $aks["id"];
}
}
$dia_deger = "";
if (isset($value["Keys"]["Dia"])) {
$dia_keys = $value["Keys"]["Dia"];
$dia_degerler = $value["Values"][$dia_keys + $artirma];
foreach ($dia_degerler as $dia_value) {
$dia_value = trim($dia_value);
$dia = mysql_fetch_assoc(mysql_query("SELECT id FROM dia WHERE name='$dia_value' LIMIT 1"));
$dia_deger= $dia["id"];
}
}
$cyl_deger = "";
if (isset($value["Keys"]["CYL"])) {
$cyl_keys = $value["Keys"]["CYL"];
$cyl_degerler = $value["Values"][$cyl_keys + $artirma];
foreach ($cyl_degerler as $dia_value) {
$dia_value = trim($dia_value);
$cyl = mysql_fetch_assoc(mysql_query("SELECT id FROM cyl WHERE name='$dia_value' LIMIT 1"));
$cyl_deger= $cyl["id"];
}
}
$bc_deger = "";
if (isset($value["Keys"]["BC"])) {
$bc_keys = $value["Keys"]["BC"];
$bc_degerler = $value["Values"][$bc_keys + $artirma];
foreach ($bc_degerler as $bc_value) {
$bc_value = trim($bc_value);
$bc_value = number_format($bc_value, 2);
$bc_q = "SELECT id FROM bc WHERE name='$bc_value' LIMIT 1";
$bc = mysql_fetch_assoc(mysql_query($bc_q));
$bc_deger= $bc["id"];
}
}
if (isset($value["Keys"]["Sph(Pwr)"])) {
$sph_deger = "";
$sph_keys = $value["Keys"]["Sph(Pwr)"];
$sph_degerler = $value["Values"][$sph_keys + $artirma];
foreach ($sph_degerler as $sph_value) {
$sph_value = trim($sph_value);
$sph = mysql_fetch_assoc(mysql_query("SELECT id FROM sph WHERE name='$sph_value' LIMIT 1"));
$sph_deger= $sph["id"];
}
}
if (isset($value["Keys"]["PWR"])) {
$sph_deger = "";
$sph_keys = $value["Keys"]["PWR"];
$sph_degerler = $value["Values"][$sph_keys + $artirma];
foreach ($sph_degerler as $sph_value) {
$sph_value = trim($sph_value);
$sph = mysql_fetch_assoc(mysql_query("SELECT id FROM sph WHERE name='$sph_value' LIMIT 1"));
$sph_deger= $sph["id"];
}
}
$colors_deger = "";
if (isset($value["Keys"]["Renk"])) {
$colors_keys = $value["Keys"]["Renk"];
$colors_degerler = $value["Values"][$colors_keys + $artirma];
foreach ($colors_degerler as $colors_value) {
$colors_value = trim($colors_value);
$colorsBas = mysql_fetch_array(mysql_query("SELECT id FROM colors WHERE name='$colors_value' LIMIT 1"));
$colors_deger= $colorsBas["id"];
}
}
if (!isset($value["Keys"])) {
$renk = $value["Values"][2];
foreach ($renk as $colors_value2) {
$colorsBas2 = mysql_fetch_array(mysql_query("SELECT id FROM colors WHERE name='$colors_value2' LIMIT 1"));
if (!empty($colorsBas2["id"]))
{
$colors_deger= $colorsBas2["id"];
}
}
}
}
}
$last_query = "UPDATE cart_options SET
aks_id='$aks_deger',
bc_id='$bc_deger',
sph_id='$sph_deger',
cyl_id='$cyl_deger',
colors_id='$colors_deger',
dia_id='$dia_deger',
dioptri_id='$dioptri_deger'
WHERE id='$id' and item_id='$item_id';";
echo $last_query;
echo "n";
}
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team