Supermarket Sync API - Online Server

Status: Running

Server Time: 2026-06-17 08:19:26

API Endpoint: /api/sync.php


Recent Logs:

[2026-06-13 01:37:41] === New Request ===
[2026-06-13 01:37:41] Method: POST
[2026-06-13 01:37:41] Raw Input: {"action":"sync_record","table":"sales_details","record_id":"12","action_type":"INSERT","data":{"sale_id":"EjKPdCXU","mid":"P5871","qty":"3","buying_price":"600","sold_price":"1000","total_price":3000,"total_cost":1800,"batch_ph_id":"8868","seller_id":"3","sale_date":"2026-06-13","customerName":"","customertype":"Cash"},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-13 01:37:41] API Key: GooddaySupermarket20...
[2026-06-13 01:37:41] Database connected successfully to: icbmemor_gooddaysupermarket
[2026-06-13 01:37:41] Action: sync_record
[2026-06-13 01:37:41] Table: sales_details
[2026-06-13 01:37:41] Record Data: {"sale_id":"EjKPdCXU","mid":"P5871","qty":"3","buying_price":"600","sold_price":"1000","total_price":3000,"total_cost":1800,"batch_ph_id":"8868","seller_id":"3","sale_date":"2026-06-13","customerName":"","customertype":"Cash"}
[2026-06-13 01:37:41] Primary Key: sd_id = 
[2026-06-13 02:23:37] === New Request ===
[2026-06-13 02:23:37] Method: POST
[2026-06-13 02:23:37] Raw Input: {"action":"sync_record","table":"sales_details","record_id":"12","action_type":"INSERT","data":{"sale_id":"EjKPdCXU","mid":"P5871","qty":"3","buying_price":"600","sold_price":"1000","total_price":3000,"total_cost":1800,"batch_ph_id":"8868","seller_id":"3","sale_date":"2026-06-13","customerName":"","customertype":"Cash"},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-13 02:23:37] API Key: GooddaySupermarket20...
[2026-06-13 02:23:37] Database connected successfully to: icbmemor_gooddaysupermarket
[2026-06-13 02:23:37] Action: sync_record
[2026-06-13 02:23:37] Table: sales_details
[2026-06-13 02:23:37] Record ID from param: 12
[2026-06-13 02:23:37] Record Data: {"sale_id":"EjKPdCXU","mid":"P5871","qty":"3","buying_price":"600","sold_price":"1000","total_price":3000,"total_cost":1800,"batch_ph_id":"8868","seller_id":"3","sale_date":"2026-06-13","customerName":"","customertype":"Cash"}
[2026-06-13 02:23:37] Record exists: No
[2026-06-13 02:23:37] Insert result: Success
[2026-06-13 02:29:03] === New Request ===
[2026-06-13 02:29:03] Method: POST
[2026-06-13 02:29:03] Raw Input: {"action":"sync_record","table":"users","record_id":"4","action_type":"INSERT","data":{"user_fname":"JULIANA","user_mname":"CHARLSE","user_lname":"LWAHO","user_dob":"2026-06-12","user_mobile":"0743459069","user_email":"binossyj@gmail.com","user_wardID":null,"user_village":"Ntyuka","admin":"0","user_profile":"logo.png","user_password":"25d55ad283aa400af464c76d713c07ad","userID":4},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-13 02:29:03] API Key: GooddaySupermarket20...
[2026-06-13 02:29:03] Database connected successfully to: icbmemor_gooddaysupermarket
[2026-06-13 02:29:03] Action: sync_record
[2026-06-13 02:29:03] Table: users
[2026-06-13 02:29:03] Record ID from param: 4
[2026-06-13 02:29:03] Record Data: {"user_fname":"JULIANA","user_mname":"CHARLSE","user_lname":"LWAHO","user_dob":"2026-06-12","user_mobile":"0743459069","user_email":"binossyj@gmail.com","user_wardID":null,"user_village":"Ntyuka","admin":"0","user_profile":"logo.png","user_password":"25d55ad283aa400af464c76d713c07ad","userID":4}
[2026-06-13 02:29:03] Record exists: No
[2026-06-13 02:29:03] Insert result: Success
[2026-06-16 07:04:25] [INFO] === New Request ===
[2026-06-16 07:04:25] [INFO] Method: POST
[2026-06-16 07:04:25] [INFO] Raw Input: {"action":"sync_record","table":"purchase_history","record_id":"8876","action_type":"INSERT","data":{"pur_id":"PUR-20260613-6750","mid":"P15251","qty":"10","qty_instock_before":"0","in_stock":10,"expire_date":"","buying_price":"3000","selling_price":"4000","total_amount":30000,"entrydate":"2026-06-13","ph_id":8876},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-16 07:04:25] [INFO] Database connected successfully
[2026-06-16 07:04:25] [INFO] Action: sync_record
[2026-06-16 07:04:25] [INFO] Table: purchase_history, ID: 8876
[2026-06-16 07:04:25] [INFO] Record Data: {"pur_id":"PUR-20260613-6750","mid":"P15251","qty":"10","qty_instock_before":"0","in_stock":10,"expire_date":"","buying_price":"3000","selling_price":"4000","total_amount":30000,"entrydate":"2026-06-13","ph_id":8876}
[2026-06-16 07:04:25] [INFO] Record exists check: purchase_history ID 8876 = Yes
[2026-06-16 07:04:25] [INFO] UPDATE SQL: UPDATE `purchase_history` SET `pur_id` = ?, `mid` = ?, `qty` = ?, `qty_instock_before` = ?, `in_stock` = ?, `expire_date` = ?, `buying_price` = ?, `selling_price` = ?, `total_amount` = ?, `entrydate` = ? WHERE `ph_id` = ?
[2026-06-16 07:04:25] [INFO] Update result: Success
[2026-06-16 07:04:25] [INFO] Purchase saved: Success
[2026-06-16 07:04:25] [INFO] Updated stock for P15251: 10 -> 20 (+10)
[2026-06-16 07:04:26] [INFO] === New Request ===
[2026-06-16 07:04:26] [INFO] Method: POST
[2026-06-16 07:04:26] [INFO] Raw Input: {"action":"sync_record","table":"track_stock_change","record_id":"408","action_type":"INSERT","data":{"track_stock_changeID":408,"track_stock_changeDate":"2026-06-13","old_stock":"0","new_stock":10,"medicine_ID":"P15251","userID":"6","reason":"Purchase added: 10 units"},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-16 07:04:26] [INFO] Database connected successfully
[2026-06-16 07:04:26] [INFO] Action: sync_record
[2026-06-16 07:04:26] [INFO] Table: track_stock_change, ID: 408
[2026-06-16 07:04:26] [INFO] Record Data: {"track_stock_changeID":408,"track_stock_changeDate":"2026-06-13","old_stock":"0","new_stock":10,"medicine_ID":"P15251","userID":"6","reason":"Purchase added: 10 units"}
[2026-06-16 07:04:26] [INFO] Record exists check: track_stock_change ID 408 = Yes
[2026-06-16 07:04:26] [INFO] UPDATE SQL: UPDATE `track_stock_change` SET `track_stock_changeDate` = ?, `old_stock` = ?, `new_stock` = ?, `medicine_ID` = ?, `userID` = ?, `reason` = ? WHERE `track_stock_changeID` = ?
[2026-06-16 07:04:26] [INFO] Update result: Success
[2026-06-16 07:04:28] [INFO] === New Request ===
[2026-06-16 07:04:28] [INFO] Method: POST
[2026-06-16 07:04:28] [INFO] Raw Input: {"action":"sync_record","table":"medicine","record_id":"P15251","action_type":"INSERT","data":{"product_id":"P15251","supplier_id":"sup001","product_name":"SAVANA","generic_name":"SAVANA","form":"Pc","product_type":"Fresh Produce","product_details":"","side_effect":"","product_image":"default.jpg","available_stock":"0","short_stock":"10"},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-16 07:04:28] [INFO] Database connected successfully
[2026-06-16 07:04:28] [INFO] Action: sync_record
[2026-06-16 07:04:28] [INFO] Table: medicine, ID: P15251
[2026-06-16 07:04:28] [INFO] Record Data: {"product_id":"P15251","supplier_id":"sup001","product_name":"SAVANA","generic_name":"SAVANA","form":"Pc","product_type":"Fresh Produce","product_details":"","side_effect":"","product_image":"default.jpg","available_stock":"0","short_stock":"10"}
[2026-06-16 07:04:28] [INFO] Updated medicine stock: P15251 -> 0
[2026-06-16 07:04:29] [INFO] === New Request ===
[2026-06-16 07:04:29] [INFO] Method: POST
[2026-06-16 07:04:29] [INFO] Raw Input: {"action":"sync_record","table":"purchase_history","record_id":"8877","action_type":"INSERT","data":{"pur_id":"PUR-20260616-4709","mid":"P0001","supp_id":null,"qty":"10","qty_instock_before":0,"in_stock":10,"expire_date":"","buying_price":"10000","selling_price":"20000","total_amount":100000,"entrydate":"2026-06-16","ph_id":8877},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-16 07:04:29] [INFO] Database connected successfully
[2026-06-16 07:04:29] [INFO] Action: sync_record
[2026-06-16 07:04:29] [INFO] Table: purchase_history, ID: 8877
[2026-06-16 07:04:29] [INFO] Record Data: {"pur_id":"PUR-20260616-4709","mid":"P0001","supp_id":null,"qty":"10","qty_instock_before":0,"in_stock":10,"expire_date":"","buying_price":"10000","selling_price":"20000","total_amount":100000,"entrydate":"2026-06-16","ph_id":8877}
[2026-06-16 07:04:29] [INFO] Record exists check: purchase_history ID 8877 = No
[2026-06-16 07:04:29] [INFO] INSERT SQL: INSERT INTO `purchase_history` (`pur_id`, `mid`, `supp_id`, `qty`, `qty_instock_before`, `in_stock`, `expire_date`, `buying_price`, `selling_price`, `total_amount`, `entrydate`, `ph_id`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[2026-06-16 07:04:29] [INFO] Insert success. New ID: 8877
[2026-06-16 07:04:29] [INFO] Purchase saved: Success
[2026-06-16 07:04:29] [INFO] Updated stock for P0001: 0 -> 10 (+10)
[2026-06-16 07:04:29] [INFO] Updated selling price for P0001: 20000
[2026-06-16 07:04:30] [INFO] === New Request ===
[2026-06-16 07:04:30] [INFO] Method: POST
[2026-06-16 07:04:30] [INFO] Raw Input: {"action":"sync_record","table":"medicine","record_id":"P0001","action_type":"UPDATE","data":{"product_id":"P0001","available_stock":10,"selling_price":"20000"},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-16 07:04:30] [INFO] Database connected successfully
[2026-06-16 07:04:30] [INFO] Action: sync_record
[2026-06-16 07:04:30] [INFO] Table: medicine, ID: P0001
[2026-06-16 07:04:30] [INFO] Record Data: {"product_id":"P0001","available_stock":10,"selling_price":"20000"}
[2026-06-16 07:04:30] [INFO] Updated medicine stock: P0001 -> 10
[2026-06-16 07:04:30] [INFO] Updated medicine price: P0001 -> 20000
[2026-06-16 07:04:32] [INFO] === New Request ===
[2026-06-16 07:04:32] [INFO] Method: POST
[2026-06-16 07:04:32] [INFO] Raw Input: {"action":"sync_record","table":"track_stock_change","record_id":"409","action_type":"INSERT","data":{"track_stock_changeDate":"2026-06-16","old_stock":0,"new_stock":10,"medicine_ID":"P0001","userID":"3","reason":"Purchase added: 10 units","track_stock_changeID":409},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-16 07:04:32] [INFO] Database connected successfully
[2026-06-16 07:04:32] [INFO] Action: sync_record
[2026-06-16 07:04:32] [INFO] Table: track_stock_change, ID: 409
[2026-06-16 07:04:32] [INFO] Record Data: {"track_stock_changeDate":"2026-06-16","old_stock":0,"new_stock":10,"medicine_ID":"P0001","userID":"3","reason":"Purchase added: 10 units","track_stock_changeID":409}
[2026-06-16 07:04:32] [INFO] Record exists check: track_stock_change ID 409 = No
[2026-06-16 07:04:32] [INFO] INSERT SQL: INSERT INTO `track_stock_change` (`track_stock_changeDate`, `old_stock`, `new_stock`, `medicine_ID`, `userID`, `reason`, `track_stock_changeID`) VALUES (?, ?, ?, ?, ?, ?, ?)
[2026-06-16 07:04:32] [INFO] Insert success. New ID: 409
[2026-06-16 07:04:33] [INFO] === New Request ===
[2026-06-16 07:04:33] [INFO] Method: POST
[2026-06-16 07:04:33] [INFO] Raw Input: {"action":"sync_record","table":"track_price_change","record_id":"20","action_type":"INSERT","data":{"track_price_changeDate":"2026-06-16","what_changed":"Selling Price","old_price":0,"new_price":"20000","medicine_ID":"P0001","userID":"3","reason":"Price updated during purchase","track_price_changeID":20},"api_key":"GooddaySupermarket2026SecureKey@123"}
[2026-06-16 07:04:33] [INFO] Database connected successfully
[2026-06-16 07:04:33] [INFO] Action: sync_record
[2026-06-16 07:04:33] [INFO] Table: track_price_change, ID: 20
[2026-06-16 07:04:33] [INFO] Record Data: {"track_price_changeDate":"2026-06-16","what_changed":"Selling Price","old_price":0,"new_price":"20000","medicine_ID":"P0001","userID":"3","reason":"Price updated during purchase","track_price_changeID":20}
[2026-06-16 07:04:33] [INFO] Record exists check: track_price_change ID 20 = No
[2026-06-16 07:04:33] [INFO] INSERT SQL: INSERT INTO `track_price_change` (`track_price_changeDate`, `what_changed`, `old_price`, `new_price`, `medicine_ID`, `userID`, `reason`, `track_price_changeID`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
[2026-06-16 07:04:33] [INFO] Insert success. New ID: 20