| Server IP : 46.202.172.170 / Your IP : 216.73.216.59 Web Server : LiteSpeed System : Linux fr-int-web1904.main-hosting.eu 5.14.0-503.34.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 27 06:00:50 EDT 2025 x86_64 User : u627918583 ( 627918583) PHP Version : 8.2.28 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u627918583/domains/techtime-om.com/public_html/controlPanel/ |
Upload File : |
<?php
include "master.php";
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.3.0/jquery.form.min.js"></script>
<script>
function myFunction() {
var x = document.getElementById("snackbar");
// x.classList.add("show");
x.className = "show";
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
}
</script>
<?php
$id = $_GET['id'];
$sql = "SELECT `price`, `decPrice` FROM `products` WHERE `id` = $id";
$rs = $db->dbQuery($sql);
$row = $db->dbFetchRecord($rs);
if(isset($_POST['btnAdd'])){
$price256 = $_POST['price256'];
$decPrice256 = $_POST['decPrice256'];
$price512 = $_POST['price512'];
$decPrice512 = $_POST['decPrice512'];
$price1024 = $_POST['price1024'];
$decPrice1024 = $_POST['decPrice1024'];
$sql = "UPDATE `products` SET `price`='$price256',`decPrice`='$decPrice256' WHERE `id` = $id";
$rs = $db->dbQuery($sql);
$sql = "INSERT INTO `memory`(`value`, `product_id`, `price`, `decPrice`) VALUES ('256 GB','$id', '$price256','$decPrice256')";
$rs = $db->dbQuery($sql);
$sql = "INSERT INTO `memory`(`value`, `product_id`, `price`, `decPrice`) VALUES ('512 GB','$id','$price512','$decPrice512')";
$rs = $db->dbQuery($sql);
$sql = "INSERT INTO `memory`(`value`, `product_id`, `price`, `decPrice`) VALUES ('1024 GB','$id','$price1024','$decPrice1024')";
$rs = $db->dbQuery($sql);
$err = "تم الاضافة بنجاح";
echo '
<script>
$(document).ready(function(){
$("#snackbar").addClass("show");
setTimeout(function(){
$("#snackbar").removeClass("show");
}, 3000);
});
</script>
';
echo "<meta http-equiv='refresh' content='3;URL=internal_memory.php'>";
}
?>
<div class="row">
<div class="col-sm-12">
<div class="card-box">
<h4 class="header-title m-t-0 m-b-30">اضافة ذاكرة جديدة</h4>
<div id="snackbar" class="">تم الاضافة بنجاح</div>
<div class="row" style="display: flex;justify-content: center;">
<div class="col-lg-6">
<form class="form-horizontal" method="post" enctype="multipart/form-data">
<div class="form-group">
<label class="" style="display: block;text-align: center;"> الحجم </label>
<input type="text" class="form-control" name="size256" value="256 GB" required disabled>
</div>
<div class="form-group">
<label class="" style="display: block;text-align: center;"> السعر </label>
<input type="text" class="form-control" name="price256" value="<?= $row['price'] ?>" required placeholder="السعر ">
</div>
<div class="form-group">
<label class="" style="display: block;text-align: center;"> الخصم </label>
<input type="text" class="form-control" name="decPrice256" value="<?= $row['decPrice'] ?>" required placeholder="الخصم ">
</div>
<div class="form-group">
<label class="" style="display: block;text-align: center;"> الحجم </label>
<input type="text" class="form-control" name="size512" value="512 GB" required disabled>
</div>
<div class="form-group">
<label class="" style="display: block;text-align: center;"> السعر </label>
<input type="text" class="form-control" name="price512" required placeholder="السعر ">
</div>
<div class="form-group">
<label class="" style="display: block;text-align: center;"> الخصم </label>
<input type="text" class="form-control" name="decPrice512" required placeholder="الخصم ">
</div>
<div class="form-group">
<label class="" style="display: block;text-align: center;"> الحجم </label>
<input type="text" class="form-control" name="size1024" value="1024 GB" required disabled>
</div>
<div class="form-group">
<label class="" style="display: block;text-align: center;"> السعر </label>
<input type="text" class="form-control" name="price1024" required placeholder="السعر ">
</div>
<div class="form-group">
<label class="" style="display: block;text-align: center;"> الخصم </label>
<input type="text" class="form-control" name="decPrice1024" required placeholder="الخصم ">
</div>
<div class="form-group center" >
<button type="submit" name="btnAdd" id="success-alert" class="btn btn-success btn-bordred waves-effect w-md waves-light m-b-5" >إضافة</button>
</div>
</form>
</div><!-- end col -->
</div><!-- end row -->
</div>
</div><!-- end col -->
</div>
<!-- end row -->
<script>
$(document).ready(function() {
});
// Add the following code if you want the name of the file appear on select
$(".custom-file-input").on("change", function() {
var fileName = $(this).val().split("\\").pop();
$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
});
</script>
<?php
include "footer.php";
?>