Server IP : 162.241.126.129 / Your IP : 3.133.120.64 Web Server : Apache System : Linux 162-241-126-129.cprapid.com 4.18.0-477.27.2.el8_8.x86_64 #1 SMP Fri Sep 29 08:21:01 EDT 2023 x86_64 User : rvway5nu4 ( 1018) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/rvway5nu4/www/ |
Upload File : |
<?php include("./config/data.config.php"); include("$LIB_DIR/functions.lib.php"); include("$LIB_DIR/db.php"); include("$LIB_DIR/db/mysqli.php"); include("$LIB_DIR/data.constant.php"); include("$LIB_DIR/sitemsgs.php"); include("$LIB_DIR/class.paging.php"); include("$LIB_DIR/functions.mailer.php"); $error=''; $msg=''; if( !isset( $_SESSION['SESS_id'] ) && ( $_SESSION['SESS_type'] == 'AD' ) ){ $_SESSION['msg'] = '<div class="alert alert-warning" >There is no login.</div>'; header('Location: '.SUB_DIR_PROJECT.'/ar_index.php'); exit; } global $SITE_URL, $IMG_DIR; $db = new Db( $DB_HOST, $DB_USERNAME, $DB_PASSWORD, $DB_NAME, $DB_REPORT_ERROR, $DB_PERSISTENT_CONN); $sqlpara = ''; $rvtype = ''; if( isset($_REQUEST['i_itemID']) ){ $i_itemID = $_REQUEST['i_itemID']; } if( isset($_REQUEST['action']) ){ $action = $_REQUEST['action']; } if(!empty($_GET["action"])) { $para = ''; if( isset($_REQUEST['para']) ){ $para = trim($_REQUEST['para']); } switch($_GET["action"]) { case "add": //unset($_SESSION["cart_item"]); $quantity = 1; if($quantity) { $query2 ="SELECT * FROM tbl_items WHERE i_itemID = '".$_REQUEST["i_itemID"]."' AND language_type='Yes' "; $result=$db->query($query2); if($result->num_rows) { foreach($result->rows AS $key=>$val ) { $i_itemID = $val['i_itemID']; $v_title = $val['v_title']; $quantity = $val['quantity']; $brand = $val['brand']; $curreny_type = $val['curreny_type']; $normal_price = $val['normal_price']; $sale_price = $val['sale_price']; $v_image = $val['v_image1']; } } $itemArray = array('i_itemID_'.$i_itemID.'_sale_type_'.$para => array('v_title'=>$v_title, 'i_itemID'=>$i_itemID, 'quantity'=>$quantity, 'price'=>$sale_price,'curreny_type'=>$curreny_type, 'normal_price'=>$normal_price, 'sale_price'=>$sale_price,'image'=>$v_image,'sale_type'=>$para )); // var_dump($_SESSION["cart_item"]); // die(); if(!empty($_SESSION["cart_item"])) { if(in_array('i_itemID_'.$i_itemID.'_sale_type_'.$para,array_keys($_SESSION["cart_item"]))) { foreach($_SESSION["cart_item"] as $k => $v) { if('i_itemID_'.$i_itemID.'_sale_type_'.$para == $k) { if(empty($_SESSION["cart_item"][$k]["quantity"])) { $_SESSION["cart_item"][$k]["quantity"] = 0; } $_SESSION["cart_item"][$k]["quantity"] += $quantity; } } } else { $_SESSION["cart_item"] = array_merge($_SESSION["cart_item"],$itemArray); } } else { $_SESSION["cart_item"] = $itemArray; } } //echo '<pre>'; print_r($_SESSION); echo '</pre>'; header('Location: '.SUB_DIR_PROJECT.'/ar_item_buy.php'); break; case "remove": if(!empty($_SESSION["cart_item"])) { foreach($_SESSION["cart_item"] as $k => $v) { if('i_itemID_'.$_REQUEST["i_itemID"].'_sale_type_'.$para == $k) unset($_SESSION["cart_item"][$k]); if(empty($_SESSION["cart_item"])) unset($_SESSION["cart_item"]); } } header('Location: '.SUB_DIR_PROJECT.'/ar_item_buy.php'); exit; break; case "empty": unset($_SESSION["cart_item"]); break; } } //echo '<pre>'; print_r($_SESSION["cart_item"]); echo '</pre>'; // exit; $sql = "SELECT * FROM tbl_setting WHERE i_settingID = '2' "; $result=$db->query($sql); if($result->num_rows) { foreach( $result->row AS $key=>$val){ $$key = stripslashes($val); } } ?> <!DOCTYPE html> <html lang="en"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>RV Way</title> <!-- mobile responsive meta --> <meta name="viewport" content="width=device-width, initial-scale=1"> <?php require_once($ROOT_DIR.'/page_content/ar/common/header_common_link1.php'); ?> <?php require_once($ROOT_DIR.'/page_content/ar/common/header_common_link2.php'); ?> <?php require_once($ROOT_DIR.'/page_content/ar/common/header_common_link3.php'); ?> <?php require_once($ROOT_DIR.'/page_content/ar/common/header_common_link4.php'); ?> </head> <body> <!-- <div class="preloader"></div> --> <div class="page-wrapper" > <!-- space for preloader --> <header class="site-header header-one" > <div class="top-header"> <?php require_once($ROOT_DIR.'/page_content/ar/common/header_top.php'); ?> </div><!-- /.top-header --> <nav class="navbar navbar-expand-lg navbar-light header-navigation stricky header-style-one" > <?php require_once($ROOT_DIR.'/page_content/ar/common/header_nav.php'); ?> </nav> </header><!-- /.site-header --> <?php // require_once($ROOT_DIR.'/page_content/minimal-bootstrap-carousel_h.php'); ?> <?php // require_once($ROOT_DIR.'/page_content/us/home/minimal-bootstrap-carousel.php'); ?> <!--Start AAAAAAAAAAAAAAAAAAAAAAAAAAAAA --> <div style="margin:20px 0px 20px 0px;"> <div class="container"> <div class="row"> <div class="col-lg-12"> <?php if( isset($_REQUEST['para']) ){ $para = $_REQUEST['para']; $para_key = $rv_array[$para]; $i_rv_settingID = $_REQUEST['i_rv_settingID']; $sql = "SELECT * FROM tbl_rv_setting WHERE i_rv_settingID = '2' "; $result=$db->query($sql); if($result->num_rows) { foreach( $result->row AS $key=>$val){ $$key = stripslashes($val); } } } ?> <h3 class=""><?php echo $rvtype; ?></h2> <h5 class=""><?php echo htmlentities($title_str); ?></h3> </div> </div> </div> </div> <div class=""> <div class="container"> <div class="row" style=""> <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 chkoutbar " >01. ملخص</div> <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 chkoutbar1 ">02. تسجيل الدخول</div> <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 chkoutbar1 ">03. الشحن</div> <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 chkoutbar1 " >05. طريقة الدفع او السداد</div> </div> <div class="row"> <div class="col-lg-12 col-sm-12 col-xs-12"> <div> </div> <div class="row"> <div class="col-lg-3 d-none d-sm-block"> <div class="blog-sidebar"> <form class="mb-30" method="get" action="<?php echo site_url.'used.php'; ?>" > <?php require_once($ROOT_DIR.'/page_content/ar_used_sidebar.php'); ?> </form> </div><!-- /.blog-sidebar --> </div><!-- /.col-lg-4 --> <div class="col-lg-9 col-sm-12 col-xs-12"> <div class="col-sm-12" style="margin-top:2px;" > <?php echo htmlentities($desc_str); ?> </div> <article class="product_loop"> <div class="row" style="background-color: #424741;padding:5px; color:#fff;"> <div class="col-lg-5 col-md-3 col-sm-12 col-xs-12">المنتج</div> <div class="col-lg-1 col-md-1 col-sm-12 col-xs-12">كمية</div> <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">سعر الوحده</div> <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">السعر</div> <div class="col-lg-2 col-md-1 col-sm-12 col-xs-12">إزالة</div> </div> <?php if( !empty($_SESSION["cart_item"])){ $count = 0; $subTotalPrice = 0; $totalPrice = 0; foreach($_SESSION["cart_item"] AS $key=>$val ){ $count++; $rem = ( $count % 2); if( $rem == 1){ $itemrow = 'itemrow1'; }else{ $itemrow = 'itemrow2'; } $v_tit1le = $val['v_title']; $i_itemID = $val['i_itemID']; $sale_type = $val['sale_type']; $quantity = (int)$val['quantity']; $curreny_type = $val['curreny_type']; $normal_price = (float)$val['normal_price']; $sale_price = (float)$val['sale_price']; $imgsrc = $val['image']; $target = "$DOCUMENT_ROOT$PIC_DIR/$imgsrc"; $imgSRC = ''; if ( $imgsrc != '' && file_exists("$target")) { $imgSRC = $SITE_URL.'/pic/'.$imgsrc; } $Price = ( $sale_price * $quantity ); $subTotalPrice = ( $subTotalPrice + $Price); ?> <div class="row <?php echo $itemrow; ?>" style="" > <div class="col-lg-5 col-md-3 col-sm-12 col-xs-12"> <div class="item-name"><?php echo $v_tit1le; ?></div> <div class="card col-lg-8 col-lg-8 col-sm-12"><?php echo $img_src; ?> <a href="<?php echo site_url.'item_detail.php?i_itemID='.$i_itemID; ?>" class="item-title"> <img class="img-fluid img-rounded lazyloaded" alt="<?php echo $v_title; ?>" title="<?php echo $v_title; ?>" src="<?php echo $imgSRC; ?>"> </a> </div> </div> <div class="col-lg-1 col-md-1 col-sm-12 col-xs-12"><?php echo $quantity; ?></div> <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12"><?php echo $curreny_type.''.$sale_price; ?></div> <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12"><?php echo $curreny_type.''.$Price; ?></div> <div class="col-lg-2 col-md-1 col-sm-12 col-xs-12"> <a href="<?php echo site_url.'item_buy.php?i_itemID='.$i_itemID; ?>¶=<?php echo $sale_type; ?>&action=remove" class="btn btn-primary tag-reduced ">إزالة</a> </div> </div> <?php } ?> <div class="row" style=""> <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12" align="right"><strong>المجموع الفرعي:</strong></div> <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" align="right"><strong><?php echo $curreny_type.''.$subTotalPrice; ?></strong></div> </div> <div class="row" style=""> <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12" align="right" ><strong>مجموع:</strong></div> <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" align="right" ><strong><?php $totalPrice = ( $subTotalPrice ); echo $curreny_type.''.$totalPrice; ?></strong></div> </div> <BR/> <a href="<?php echo site_url.'ar_checkout.php'; ?>" class="btn btn-primary " style="float:right; text-align:right;" >اكمل العملية</a> <?php }else{ echo " لا يوجد منتج للعربة."; } ?> </div> </article> <div class="col-sm-12" style="margin-top:2px;" > <?php echo $footer_desc_str; ?> </div> </div><!-- /.col-lg-8 --> </div><!-- /.row --> </div><!-- /.container --> </div><!-- /.blog blog-single --> <!--End AAAAAAAAAAAAAAAAAAAAAAAAAAAAA --> </div><!-- /.page-wrapper --> <footer class="crop"> <?php require_once($ROOT_DIR.'/page_content/ar/common/footer_middle.php'); ?> <?php require_once($ROOT_DIR.'/page_content/ar/common/footer_bottom.php'); ?> </footer> <a href="#" data-target="html" class="scroll-to-target scroll-to-top"><i class="fa fa-long-arrow-up"></i></a> <!-- /.scroll-to-top --> <?php require_once($ROOT_DIR.'/page_content/ar/common/footer_js.php'); ?> <script > $('#partner_tab_2').hide(); $(".tabparner").on("click", function(){ var tabparner_id = $(this).attr('id'); //alert("The paragraph was clicked." + tabparner_id); if( tabparner_id == 'tab_1' ){ $("#tab_1").addClass("activetab"); $("#tab_1").removeClass("deactivetab"); $("#tab_2").removeClass("activetab"); $("#tab_2").addClass("deactivetab"); $('#partner_tab_1').show(); $('#partner_tab_2').hide(); } if( tabparner_id == 'tab_2' ){ $("#tab_2").addClass("activetab"); $("#tab_2").removeClass("deactivetab"); $("#tab_1").removeClass("activetab"); $("#tab_1").addClass("deactivetab"); $('#partner_tab_1').hide(); $('#partner_tab_2').show(); } }); </script> </body> </html>