<?php 
require("php_con.php");
require("check_user.php");

if(isset($_POST['reset_table'])){
	
$reset_qury=mysqli_query($connation,"SHOW TABLES");
while($table_resalt=mysqli_fetch_assoc($reset_qury)){
	
$table_name1=$table_resalt['Tables_in_'.$databaseName];
mysqli_query($connation,"TRUNCATE $table_name1");
	
}

mysqli_query($connation,"INSERT INTO setting (setting_id, setting_text, setting_value) VALUES
(1, 'bill_start_count', '1'),
(2, 'bill_pint', '1'),
(3, 'bill_title', 'online software solution'),
(4, 'bill_mobile', '0712770924, 0763119292'),
(5, 'bill_footer_text', 'Thankyou! Come Again...'),
(6, 'bill_lan', '0'),
(7, 'backup_notification', '1'),
(8, 'product_suggestions', '1'),
(9, 'bill_address', 'D/10, Alawala, Thunthota'),
(10, 'next_backup_date', '".date("Y-m-d")."'),
(11, 'next_barcode', '100001'),
(12, 'bill_logo_display', '1'),
(13, 'bill_title_display', '1'),
(14, 'bill_address_display', '1'),
(15, 'bill_mobile_display', '1'),
(16, 'unit_display', '0'),
(17, 'ui_type', '1'),
(18, 'bill_font_size', '12'),
(19, 'logo_width', '50'),
(20, 'inventory_check', '0'),
(21, 'low_stock_popup', '1'),
(22, 'bill_email_display', '1'),
(23, 'bill_email', 'onlinesoftwarelk@gmail.com'),
(24, 'auto_add_item_list', '0'),
(25, 'auto_backup_status', '0'),
(26, 'bill_discount_issue', '0'),
(27, 'summery_send_phone', ''),
(28, 'auto_backup_from', ''),
(29, 'auto_backup_to', ''),
(31, 'customer_pin', '1000'),
(32, 'pos_product_edit', '0')");

mysqli_query($connation,"INSERT INTO user_details (user_id, user_username, user_password, user_fname, user_lname, user_type, user_reg_time) VALUES
(1, 'admin', '870528809d439efd7350cb7c660752d8', 'Malith', 'Madushan', 1, '".date("Y-m-d H:i:s")."'),
(2, 'user', '202cb962ac59075b964b07152d234b70', 'Admin', 'User', 1, '".date("Y-m-d H:i:s")."')");
	
mysqli_query($connation,"INSERT INTO catogary_list (catogary_id, catogary_text) VALUES
(1, 'Other Category')");
	
mysqli_query($connation,"INSERT INTO supplier_details (supplier_id, supplier_name, supplier_mobile, supplier_company, supplier_address) VALUES
(1, 'No Supplier', '1111111111', 'No Company', '')");
	
	
mysqli_query($connation,"INSERT INTO unit_list (unit_id, unit_text) VALUES
(1, 'Pcs')");
	
echo "<script>window.location='dashboard';</script>";
}
?>

<link rel="icon" href="favicon.ico">
<title><?php echo $system_name; ?></title>

<strong>All data clear and re-enter data</strong><br><br>
<form method="post" onClick="return confirm('Are your sure?');">
<input type="submit" name="reset_table" value="Reset and enter data">
</form>