www
/
wwwroot
/
magazinmiorita.be
/
admin
➕ New
📤 Upload
✎ Editing:
edit_order.php
← Back
<?php include('../includes/inc.config.php'); include('check_session.php'); $get_prod_details = $database->execute("select * from products where id = '".$_POST['name']."'"); $pid = $database->assoc($get_prod_details); $get_order_details = $database->execute("select * from orders where id = '".$_POST['oid']."'"); $row = $database->assoc($get_order_details); $history = $row['history']; $hdata = unserialize($history); foreach($hdata as $val){ $arr = explode('|',$val); $prod_id = $arr[0]; $weight = $arr[1]; $type = $arr[2]; $price = $arr[3]; $qt = $arr[4]; $code = $arr[6]; if($arr[0] == $_POST['oldpid']){ if($_POST['type'] == 'Kg' || $_POST['type'] == 'KG' || $_POST['type'] == 'kg'){ $total_price = $_POST['price'] * $_POST['weight']; }else if($_POST['type'] == 'Gr' || $_POST['type'] == 'GR' || $_POST['type'] == 'gr'){ $weight = $_POST['weight']; $total_price = $_POST['price'] * ($_POST['weight']); }else if($_POST['type'] == 'Mg' || $_POST['type'] == 'MG' || $_POST['type'] == 'mg'){ $weight = $_POST['weight']; $total_price = $_POST['price'] * ($_POST['weight']/10000); }else if($_POST['type'] == 'Pc' || $_POST['type'] == 'PC' || $_POST['type'] == 'pc'){ $weight = 1; $total_price = $_POST['price']; } $item_data[] = $_POST['name'].'|'.$_POST['weight'].'|'.$_POST['type'].'|'.$_POST['price'].'|'.$_POST['qty'].'|'.$total_price*$_POST['qty'].'|'.$pid['code']; }else{ if($type == 'kg'){ $total_price = $price * $weight; }else if($type == 'gr'){ $weight = $weight; $total_price = $price * ($weight/1000); }else if($type == 'mg'){ $weight = $weight; $total_price = $price * ($weight/10000); }else if($type == 'pc'){ $weight = 1; $total_price = $price; } $item_data[] = $prod_id.'|'.$weight.'|'.$type.'|'.$price.'|'.$qt.'|'.$total_price*$qt.'|'.$code; } } $serialized = serialize($item_data); $update = $database->execute("update orders set history = '$serialized' where id = '".$_POST['oid']."'"); if($update){ header("Location: order_details.php?id=".$_POST['oid']); exit; } ?>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel