Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $tombbe_mentes = [];
- foreach($_SESSION["kosar"] as $index => $value) {
- //echo "tomb[" . $index . "] => " . $value . " \n";
- $darabszam = $value['darabszam'];
- array_push($tombbe_mentes_kosar, $value);
- $_SESSION["kosar"] = $tombbe_mentes;
- //var_dump($value);
- // Érték kinyerése a tömbből:
- $ertek = $value['termekazonosito'];
- //echo $ertek;
- echo $darabszam;
- $session_azonosito_kivett = $_SESSION['userazonosito'];
- $sql = "SELECT * FROM termek WHERE azonosito = $ertek";
- $eredmeny1 = mysqli_query($conn,$sql);
- while($sor = mysqli_fetch_assoc($eredmeny1)){
- $termek_azonosito = $sor['termekazonosito'];
- $kepneve = $sor['elsokep'];
- $leiras = $sor['leiras'];
- $ar = $sor['ar'];
- $replaceelt_leiras = str_replace('_', ' ', $leiras);
- $replaceelt = str_replace('_', '.', $kepneve);
- }
- ?>
- <div style="width: 200px; height: 300px; margin-top: 50px; ">
- <i onclick="felugro();" class="fa fa-trash-o" id="torlogomb" style="font-size:40px;color:red; z-index: 1; margin-left: 100px; margin-bottom: 150px;" value="<?php echo $ertek; ?>"></i>
- <input type="hidden" name="" id="rejtett" value="<?php echo $ertek; ?>">
- <div style=" width: 80%; height: 200px; margin-top: -300px; font-size:30px; margin-left: 80px;">
- <?php
- echo"
- <div style='font-size:15px; margin-left:50px;margin-top:20px;z-index: -1;'>$replaceelt_leiras</div>
- ";
- echo "<img style='width:90px; height:150px;float: left; margin-top:-5px; margin-left:-60px; border:0.8px solid black;' src='kezelofelulet/kepek/{$kepneve}'>
- ";
- ?>
- <div style='z-index:1; margin-left:210px; font-size:20px; letter-spacing:1px; display:inline-block; margin-top: 45px;'><strong><?php echo $ar."FT";?></strong></div>
- </div>
- <div style="width: 18px; height: 18px; background-color: white;margin-top: 10px; border:1px solid black; margin-left: 25px;">
- </div>
- <div style="width: 20px; height: 20px; background-color: pink; margin-top: -20px; margin-left: 50px;">
- </div>
- <div style="width: 20px; height: 20px; background-color: #5999d9;margin-left: 76px; margin-top: -20px;">
- </div>
- <div id="valtozo1" onclick="divszinezes();" style="width: 20px; height: 20px; background-color: white;margin-left: 105px; margin-top: -20px;border:0.5px solid black;">
- <p style="font-size: 10px; margin-left: 5px; margin-top: 5px;"><strong>XS</strong></p>
- </div>
- <div id="valtozo2" onclick="divszinezes2();" style="width: 20px; height: 20px; background-color: white;margin-left: 133px; margin-top: -21px;border:0.5px solid black;">
- <p style="font-size: 10px; margin-left: 8px; margin-top: 5px;"><strong>S</strong></p>
- </div>
- <div id="valtozo3" onclick="divszinezes3();" style="width: 20px; height: 20px; background-color: white;margin-left: 160px; margin-top: -20px;border:0.5px solid black;">
- <p style="font-size: 10px; margin-left: 5px; margin-top: 5px;"><strong>M</strong></p>
- </div>
- <div id="valtozo4" onclick="divszinezes4();" style="width: 20px; height: 20px; background-color: white;margin-left: 190px; margin-top: -21px;border:0.5px solid black;">
- <p style="font-size: 10px; margin-left: 8px; margin-top: 5px;"><strong>L</strong></p>
- </div>
- <div id="valtozo5" onclick="divszinezes5();" style="width: 20px; height: 20px; background-color: white;margin-left: 220px; margin-top: -20px;border:0.5px solid black;">
- <p style="font-size: 10px; margin-left: 5px; margin-top: 5px;"><strong>XL</strong></p>
- </div>
- <div style=" background-color: white;margin-left: 250px; margin-top: -25px;">
- <select style="width: 30px; height: 30px; font-size: 15px; z-index:99;" class="frissites" onclick="updatekosar();">
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4" >4</option>
- </select>
- </div>
- </div>
- <?php
- }
- ?>
- <script>
- function updatekosar(){
- var termekazonosito_update = '<?php echo $_SESSION['termekazonosito']; ?>';
- $('.frissites').on('click', function() {
- var value = $(this).val();
- var value_tovabb = value;
- $.ajax({
- url:"test.php",
- method:"POST",
- data:{valtozo_update:value_tovabb, termekazonosito_update:termekazonosito_update},
- success:function()
- {
- console.log($.ajax());
- //termekazonosito_update.remove();
- //location.reload();
- //alert(value_tovabb+"Darabszám frissítve");
- }
- })
- });
- }
- </script>
- <!--*************************************************Legalul a test.php kódja látható: ************************************ -->
- if(!empty($_POST)){
- foreach($_SESSION["kosar"] as $index => $value) {
- if($_SESSION['kosar'][$index]['termekazonosito'] == $_POST['termekazonosito_update']){
- $_SESSION['kosar'][$index]['darabszam'] = $_POST["valtozo_update"];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement