OXIESEC PANEL
- Current Dir:
/
/
home
/
u432548786
/
domains
/
it-tas.com
/
public_html
Server IP: 191.96.63.230
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/14/2019 08:26:14 AM
rwxr-xr-x
📄
.htaccess
297 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
PHPMailer
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
about-us.php
1.9 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
add-sell-product.php
18.32 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
admin
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
ajax_city.php
3.33 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
ajax_get_subsub_cat.php
1.35 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
ajax_prd_get_price.php
438 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
ajax_prd_price.php
411 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
android-invoice.php
15.16 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
autosearch.php
1.7 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
book_payment.php
2.41 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
brands.php
2.07 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
cart.php
19.61 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
carts.php
17.97 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
change-password.php
5.66 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
check-login.php
5.66 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
checkout.php
29.95 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
cod_email_send.php
8.62 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
config.php
534 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
constant.php
120 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
contact-insert.php
1.96 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
contact-us.php
9.07 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
create.php
1 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
css
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
db_config.php
215 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
dddd.php
19.43 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
delete_cart.php
298 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
delete_carts.php
302 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
delete_chcart.php
302 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
delete_wishlist.php
305 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
document
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
edit-address.php
10.29 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
edit-profile.php
7.99 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
fonts
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
forgot-password.php
6.87 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
fpdf
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
free_product.php
7.19 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
google559cbc7861e1a83d.html
53 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
googleapi
135 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
googlebdc637812fd99722.html
53 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
handler.php
5.07 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
hw.php
1.64 KB
08/13/2025 03:36:42 PM
rw-r--r--
📁
images
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📁
img
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📁
includes
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
index.php
3.66 KB
05/19/2025 03:00:38 AM
rw-r--r--
📄
insert_tocart.php
1.19 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
insert_towishlist.php
1.13 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
invoice-pdf.php
3.72 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
invoice.php
14.41 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
item-search.php
20.74 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
item.php
5.15 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
js
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
login-check.php
2.02 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
login.php
9.44 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
logout.php
162 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
mad.php
5.96 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
manage-address.php
7.16 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
menu.min.css
431.11 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
my-coins.php
5.49 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
my-order-details.php
8.64 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
my-order.php
7.96 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
my-profile.php
6.79 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
neeee
-
07/14/2025 01:18:55 PM
rwxr-xr-x
📄
new-address.php
5.94 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
offline-payment.php
10.52 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
opayment.php
14.07 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
pay
12.41 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
paymail_android.php
5.65 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
payment.php
11.42 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
payment_offline.php
5.75 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
pdf-invoice
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📄
preowned_product.php
7.17 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
privacy-policy.php
1.95 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
product-brand.php
17.65 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
product-detail.php
20.05 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
product-detail2.php
20.75 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
product-search.php
17.98 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
product.php
21.18 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
products
-
01/20/2024 07:32:19 AM
rwxr-xr-x
📁
razorpay-php
-
01/20/2024 07:33:04 AM
rwxr-xr-x
📄
referral-code.php
4.1 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
reg_validation.php
971 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
return-order.php
7 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
return-refund-policy.php
1.88 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
robots.txt
72 bytes
04/18/2025 06:55:08 AM
rw-r--r--
📄
sell-product.php
6.9 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
shipping-policy.php
1.87 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
shop-item.php
7.44 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
signup-insert.php
5.85 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
signup.php
14.25 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
stripe-payment.php
8.13 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
style.css
49.03 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
terms-conditions.php
1.88 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
thank-you.php
1.57 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
upd_cart.php
258 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
update_qty.php
319 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
update_qtys.php
627 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📁
uploads
-
01/20/2024 07:33:04 AM
rwxr-xr-x
📄
verify-strip.php
4.41 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
verify.php
9.39 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
web.config
221 bytes
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
wish_tocart.php
1.49 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
📄
wishlist.php
8.96 KB
01/20/2024 07:32:19 AM
rw-rw-rw-
Editing: cart.php
Close
<?php session_start(); include("includes/db_config.php"); //error_reporting(E_ALL); //ini_set('display_errors', '1'); if (isset($_POST['makepayment'])) { extract($_POST); date_default_timezone_set('America/New_York'); $datetime = date('Y-m-d'); $promo=$_POST['promo_code']; $sql1="select * from promo_code where promo_code='".$promo."'"; $result_code = mysqli_query($conn, $sql1); } ?> <!DOCTYPE html> <html lang="en"> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=" "> <meta name="author" content=""> <title>TAS Vision</title> <?php include("includes/css.php");?> <style> .ty-discount-info { position: relative; margin-top: 7px; padding: 10px; border: 1px solid #bdc3c7; background: #fff; font-size: 12px; line-height: 12px; } .search-form { margin-bottom: 8px; } .btn-aply { background-color: #e3e0e0; height: 36px; border: 1px solid #c5c0c0 !important; color: #000; } .ty-caret-info { position: absolute; top: -7px; left: 12px; float: left; overflow: hidden; width: 12px; height: 7px; } .closebtns { color: #f00; font-weight: 600; background-color: red; color: #fff; border-radius: 5px; font-size: 14px; padding: 2px 6px 10px 5px; } .ty-reward-points__points-in-use { display: block; overflow: hidden; padding-top: 5px; } .breadcrumb { display: flex; flex-wrap: wrap; color: #333; font-size: 1.3rem; line-height: 1.5; } .breadcrumb.shop-breadcrumb { padding: 2rem 0; margin: 1.5rem 0 2.3rem; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; background-color: #fff; } .breadcrumb.shop-breadcrumb li { padding-left: 0.5rem; padding-right: 0.5rem; font-size: 2rem; font-weight: 700; letter-spacing: -0.025em; opacity: 1; color: #666; } .breadcrumb.shop-breadcrumb li.active a { color: #336699 !important; } @media (min-width: 320px) and (max-width: 640px) { .breadcrumb.shop-breadcrumb { padding: 1rem 0; margin: 0rem 0 0.3rem; } .breadcrumb.shop-breadcrumb li { font-size: 1rem; } .cart_summary .table td { padding: 0.15rem; } .anajcart .product-name a { font-size: 12px; line-height: 15px; letter-spacing: 0.5px } } </style> </head> <body> <?php include("includes/header.php");?> <section class="page-info section-padding border-bottom topthumb"> <nav class="breadcrumb-nav"> <div class="container"> <ul class="breadcrumb shop-breadcrumb bb-no"> <li class="active"><a href="cart.php">Shopping Cart ></a></li> <li><a href="#">Checkout ></a></li> <li><a href="#">Order Complete</a></li> </ul> </div> </nav> </section> <?php $user_id=$_SESSION['id']; $session_id=$_SESSION['prd_session_id']; $sql_qrys="select count(*) as catprd from addto_cart where (user_id='".$user_id."' OR session_id='".$session_id."') and invoice_id='1'"; $resuss = mysqli_query($conn, $sql_qrys); $res_datass= mysqli_fetch_assoc($resuss); if($res_datass['catprd'] == 0){ ?> <section class="shop-list section-padding"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <h4> Your Cart Is Empty Please </h4> </div> <div class="col-md-3"> <a href="index.php" class="text-white"><button type="button" name="submit" class="btn btn-lg text-center" style="background:#036e3b;color: white;margin-top:10px;font-size:18px; cursor: pointer;color:#fff">Continue Shopping</button></a> </div> </div> </div> </section> <?php }else{ ?> <section class="shop-list section-padding"> <div class="container"> <div class="row"> <div class="col-md-9"> <div class="card card-body cart-table anajcart mb-5"> <div class="table-responsive"> <table class="table cart_summary"> <thead> <tr> <th class="cart_product" colspan="2">Product Details</th> <!--<th>Product Size</th>--> <th>Price</th> <th style="padding-left:30px;">Qty</th> <th>Total</th> <th class="action"> </th> </tr> </thead> <tbody> <?php $session=$_SESSION['prd_session_id']; if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) { $user_id=$_SESSION['id']; }else{ $user_id ="0"; } $sql_qry="select addto_cart.*,product.prod_img1 from addto_cart join product on addto_cart.prod_id=product.id where (addto_cart.user_id='".$user_id."' OR addto_cart.session_id='".$session_id."') and invoice_id='1'"; $resu = mysqli_query($conn, $sql_qry); while($res_data= mysqli_fetch_assoc($resu)){ $prd_did=$res_data['prod_details_id']; $prd_id=$res_data['prod_id']; $sql_prdd="SELECT * from product_detail where id='$prd_did'"; $exe_prdd=mysqli_query($conn,$sql_prdd); $res_prdd=mysqli_fetch_array($exe_prdd); $sql_prd="select sub_category.sub_category_name,category.cat_name,sub_sub_category.sub_sub_cat_name,product.* from product join category on product.category_id=category.id join sub_category on product.sub_category_id=sub_category.id join sub_sub_category on product.sub_sub_cat_id=sub_sub_category.id where product.id='$prd_id'"; $result_prd = mysqli_query($conn, $sql_prd); $res_prd= mysqli_fetch_array($result_prd); $cat_name=$res_prd['cat_name']; $scat_name=$res_prd['sub_category_name']; $sub_sub_cat_name=$res_prd['sub_sub_cat_name']; $prod_name=$res_prd['prod_name']; $category = strtolower(str_replace(" ", "-", $cat_name)); $sub_category = strtolower(str_replace(" ", "-", $scat_name)); $ssub_category = strtolower(str_replace(" ", "-", $sub_sub_cat_name)); $product_name = strtolower(str_replace(" ", "-", $prod_name)); $ttl= (int)$res_data['price'] * (int)$res_data['quantity']; ?> <tr class="container"> <td class="cart_product" width="10%"> <a class="category-item" href=""><img class="img-fluid" style="border:1px solid #919904;" src="admin/product/<?php echo $res_data['prod_img1'];?>" alt="<?php echo $res_data['prod_name'];?>"></a> </td> <td class="cart_description" width="30%"> <h4 class="product-name"><a href="https://www.it-tas.com/<?php echo "$category/$sub_category/$ssub_category/$product_name.php"; ?>"><?php echo $res_data['prod_name'];?></a></h4> </td> <!-- <td class="availability in-stock text-black f-16" width="15%"><//?php echo $res_prdd['prod_quantity']." ".$res_prdd['prod_quantity_type'];?></td>--> <td class="availability in-stock text-black f-16" width="15%">SAR <?php echo $res_data['price'];?></td> <td class="qty" width="10%"> <input type="hidden" name="price" id="price" value="<?php echo $res_data['price']; ?>"> <input type="hidden" name="id" id="id" value="<?php echo $res_data['id']; ?>"> <div class="quantity" style="padding-top:1px; width:150px; height:40px;"> <input type="button" class="dec button" onclick="decrementValue()" value="-" style="border:none;padding:6px 5px;width:40px;font-size:20px;background-color:#eeeeee;color:#000;height:40px;text-align:center;float: left" /> <input type="text" name="quantity" value="<?php echo $res_data['quantity']; ?>" data-qty="<?= $res_prdd['total_no_prod_quantity'];?>" maxlength="2" max="10" size="1" class="quantity" id="number" style="border:1px solid #ccc;font-size: 15px;width:40px;padding:13px 10px 14px 10px;height:40px; float: left" /> <input type="button" class="inc button" style="border:none;padding:6px 5px;width:40px;font-size:20px;background-color:#eeeeee;color:#000;height:40px;text-align:center;display:inherit;margin-top:0px;float: left" value="+" /> </div> </td> <td class="price text-black f-16" width="25%" style="padding-left:0px;padding-right:0px"><span class="currency-sign" id="price_576"><input type="text" id="total" value="<?php echo $ttl; ?>" name="total" class="form-control " readonly style="background-color:transparent; color:#0091ae;text-align:center; border:0px solid #ccc; box-shadow: inset 0 0px 0px rgba(0,0,0,.075);"></span></td> <td class="action" width="10%"> <a class="btn btn-sm" data-original-title="Remove" href="javascript:delete_cart_by_ID('<?php echo $res_data['id'] ?>');" title="" data-placement="top"><img src="img/delete-icons.png" style="width:30px; height:37px"></a> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-md-3"> <a href="index.php" class="text-white"><button type="button" name="submit" class="btn btn-lg text-center" style="background:#036e3b;margin-top:10px;font-size:18px; cursor: pointer;color:#fff">Continue Shopping</button></a> </div> </div> <div class="col-md-3"> <div class="row" style="margin-top:0px;"> <div class="carts"> <div class="summary"> <h5 class="summary-total-items text-center text-uppercase" style="color: #60127d">Payment Details</h5> <hr /> <div class="summary-promo"> <?php $session_id=$_SESSION['prd_session_id']; if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) { $user_id=$_SESSION['id']; }else{ $user_id ="0"; } $sql_qryss="select Sum(product_detail.prod_cross_price * addto_cart.quantity) as prcs from addto_cart join product_detail on addto_cart.prod_details_id=product_detail.id where (addto_cart.user_id='".$user_id."' OR addto_cart.session_id='".$session_id."') and addto_cart.invoice_id='1' and product_detail.prod_cross_price !=''"; $resuss = mysqli_query($conn, $sql_qryss); $res_prdss= mysqli_fetch_assoc($resuss); $mpr= $res_prdss['prcs']; $price_cross= $mpr; $sql_ttl="select SUM(quantity * price) as ttl from addto_cart where (addto_cart.user_id='".$user_id."' OR addto_cart.session_id='".$session_id."') and addto_cart.invoice_id='1'"; $resu_ttl = mysqli_query($conn, $sql_ttl); $res_ttl= mysqli_fetch_assoc($resu_ttl); if(!empty($price_cross)){ $discount=$price_cross - $res_ttl['ttl']; }else{ $discount="0"; } ?> <?php $dis_price=$res_ttl['ttl']; if(!empty($result_code)){ $res_code= mysqli_fetch_array($result_code); $discounts=$res_code['discount']; $total_quan= $dis_price; $dis_price = $total_quan - ($total_quan * ($discount / 100)); $rmttl=$total_quan-$dis_price; } ?> <div class="subtotal-title">Sub Total :</div> <div class="promo-value">SAR <?php echo $dis_price; ?></div> </div> </div> <div class="summary-total mt-4"> <div class="subtotal-title text-reds" style="font-size:16px"><strong>Total Cost</strong></div> <div class="promo-value text-reds" style="font-size:16px"><strong>SAR <?php echo $dis_price; ?></strong></div> </div> </div> <div class="col-md-12"> <h5 class="text-reds" style="text-align:right;padding-top:10px;"> You Save:SAR <?php echo $rmttl; if(!empty($discount)){ $dis=$discounts; }else{ $dis=""; } if(!empty($coins)){ $cins=$coins; }else{ $cins=""; } ?></h5> </div> <?php $result="";?> <div class="col-md-12"> <div class="row"> <?php //if($dis_price >= 800){ if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true){ ?> <a href="checkout.php?dis=<?= $dis; ?>" style="width:100%;"><button type="button" name="submit" value="" class="list-group-item list-group-item-action text-center btn-lg" style="background:#036e3b;color: white;margin-top:20px;font-size:18px; cursor: pointer;">Proceed To Payment</button></a><?php }else{ ?> <a href="check-login.php?dis=<?= $dis; ?>" style="width:100%;"><button type="button" class="list-group-item list-group-item-action text-center btn-lg" style="background:#036e3b;color: white;margin-top:20px;font-size:18px; cursor: pointer;">Proceed To Payment</button></a><?php } ?> <!-- <form method="post" action="" style="width:100%;"> <input type="hidden" name="message" value="<?php // "Add Items Worth $ $rpr More To Place Order" ?>"> <button type="submit" name="showbtn" class="list-group-item list-group-item-action text-center btn-lg" style="width:100%;background:#036e3b;color: white;margin-top:20px;font-size:18px; cursor: pointer;">Proceed To Payment</button> </form> --> <?php // } ?> </div> </div> </div> </div> </div> </section> <?php } ?> <?php include("includes/footer.php");?> <?php include("includes/js.php");?> <script type="text/javascript"> function delete_cart_by_ID(id) { if (confirm('Do You Want to Deleting This \nContinue anyway?')) { window.location.href = 'delete_cart.php?id=' + id; } } </script> <script type="text/javascript"> $(document).ready(function() { $("#showbtn").click(function() { $.ajax({ type: 'POST', url: 'script.php', success: function(data) { alert(data); $("p").text(data); } }); }); }); </script> <script> (function() { "use strict"; $("table").on("keyup", "input", function() { var row = $(this).closest("tr"); var qty = parseFloat(row.find("#qty").val()); var price = parseFloat(row.find("#price").val()); var total = qty * price; row.find("#total").val(isNaN(total) ? "" : total); }); })(); $(function() { $('body').on('click', '.button', function() { var $container = $(this).closest(".container"); var id = $container.find("#id").val(); var qty = $container.find("#number").val(); var tqty = $container.find("#number").data('qty'); if (tqty >= qty) { $.ajax({ type: 'POST', url: 'update_qty.php', // --> server side code to insert data into db data: { id: $container.find("#id").val(), val: $container.find("#number").val() }, success: function(msg) { window.location.href = window.location.href; } }); } window.location.href = window.location.href; }); }); </script> <script type="text/javascript"> incrementVar = 0; $('.inc.button').click(function() { var $this = $(this), $input = $this.prev('input'), $parent = $input.closest('div'), newValue = parseInt($input.val()) + 1; $parent.find('.inc').addClass('a' + newValue); $input.val(newValue); incrementVar += newValue; }); $('.dec.button').click(function() { var $this = $(this), $input = $this.next('input'), $parent = $input.closest('div'), newValue = parseInt($input.val()) - 1; console.log($parent); $parent.find('.inc').addClass('a' + newValue); $input.val(newValue); incrementVar += newValue; }); </script> </body> </html>