ok

Mini Shell

Direktori : /home2/selectio/www/ramali.in/ui-api/
Upload File :
Current File : /home2/selectio/www/ramali.in/ui-api/size-api.php

<?php
session_start();
include"../config/config.php";

if(isset($_POST['type']) && $_POST['type']=='add_size') 
{
    
    try
    {
        
        $product_id = $_POST['pro_id'];

        $statementp=$pdo->prepare("SELECT * FROM `product_variant` WHERE id=".$product_id);
        $statementp->execute(array($product_id));
        $resultp=$statementp->fetchAll(PDO::FETCH_ASSOC);
        $totalp=$statementp->rowCount();
        if($totalp>0){
            
            $datas="";
            $datas.='<div class="product-gallery product-gallery-sticky">
                                        <div class="swiper-container product-single-swiper swiper-theme nav-inner" data-swiper-options="{
                                            "navigation": {
                                                "nextEl": ".swiper-button-next",
                                                "prevEl": "".swiper-button-prev"
                                            }
                                        }">
                                            <div class="swiper-wrapper row cols-1 gutter-no">';
                                                foreach ($resultp as $row) {
    
                                                  $images =  $resultp[0]['other_images'];
                                                    $rs=json_decode($images);
                                                    
                                                    foreach($rs as $img){

                                                $url= "dashboard/".$img;
                                               $datas.='<div class="swiper-slide">
                                                    <figure class="product-image">
                                                        <img  src="dashboard/<?=$img?>" data-zoom-image="dashboard/<?=$img?>" alt="Ramali Textiles" width="800" height="900">
                                                    </figure>
                                                </div>';
                                                
                                                 } 
                                                
                                                
                                                
                                              }
                                            
                                            $datas.='</div>
                                            <button class="swiper-button-next"></button>
                                            <button class="swiper-button-prev"></button>
                                            <a href="#" class="product-gallery-btn product-image-full"><i class="w-icon-zoom"></i></a>
                                        </div>
                                        <div class="product-thumbs-wrap swiper-container" data-swiper-options="{
                                            "navigation": {
                                                "nextEl": ".swiper-button-next",
                                                "prevEl": ".swiper-button-prev"
                                            }
                                        }">
                                            
                                            <div class="product-thumbs swiper-wrapper row cols-4 gutter-sm">';
                                          
                                                  $images =  $resultp[0]['other_images'];
                                                    $rs=json_decode($images);
                                                    foreach($rs as $img){
                                                    
                                                 $url= "dashboard/".$img ;
                                                $datas.='<div class="product-thumb swiper-slide" onclick="changed('.$url.')">
                                                    <img id="dashboard/'.$img.'"  class="imgone" src="dashboard/'.$img.'" alt="Product Thumb" width="800" height="900" style="height: 105px;" />
                                                </div>';
                                                
                                                } 
                                                
                                           $datas.='</div>
                                            <button class="swiper-button-next"></button>
                                            <button class="swiper-button-prev"></button>
                                        </div>
                                    </div>';
             
            $return_arr['product_images'] = $datas;
             $return_arr['catalogue_prices'] = $resultp[0]['catelogue_pieces'];
            $return_arr['discount_price'] = '<i class="bi bi-currency-rupee"></i> '.$resultp[0]['discounted_price'];
            $return_arr['product_variant09'] ='<input type="hidden" value="'.$resultp[0]['id'].'" id="product_variant_id">';
            $return_arr['price'] ='<i class="bi bi-currency-rupee"></i> '.$resultp[0]['price'];
            $return_arr['status']=200;
        }else{ 
            $return_arr['message']="Something went wrong";
            $return_arr['status']=500;
        }
           
         echo json_encode($return_arr);
    }
    catch(Exception $e){
                    $return_arr['message']='0987'.$e;
                    $return_arr['status']=500;
                    echo json_encode($return_arr);
    }   
    }


?>

Zerion Mini Shell 1.0