<?php
declare(strict_types=1);
http_response_code(410);
exit('Setup completed.');
/*
function pss(mysqli $con,string $sql):mysqli_stmt{$s=$con->prepare($sql);if(!$s)throw new RuntimeException('Setup query failed.');return $s;}
try{
  $con->begin_transaction();$parent=0;$s=pss($con,"SELECT id FROM jos_admin_menus WHERE (LOWER(TRIM(menu_name))='salary config' OR LOWER(TRIM(menu_link))='#salary-config') AND status=1 ORDER BY id LIMIT 1");$s->execute();$parent=(int)($s->get_result()->fetch_assoc()['id']??0);$s->close();if(!$parent)throw new RuntimeException('Salary Config parent menu was not found.');
  $name='Pay Scale Master';$link='salary-config/pay-scales.php';$s=pss($con,'SELECT id FROM jos_admin_menus WHERE LOWER(TRIM(menu_link))=LOWER(?) OR LOWER(TRIM(url))=LOWER(?) OR (LOWER(TRIM(menu_name))=LOWER(?) AND parent_id=?) ORDER BY id LIMIT 1');$s->bind_param('sssi',$link,$link,$name,$parent);$s->execute();$menu=(int)($s->get_result()->fetch_assoc()['id']??0);$s->close();
  if($menu){$icon='fa-solid fa-layer-group';$remarks='Configure payroll Pay Scales.';$sort=25;$s=pss($con,'UPDATE jos_admin_menus SET menu_name=?,parent_id=?,menu_link=?,url=?,icon=?,remarks=?,status=1,show_in_menu=1,sort_order=? WHERE id=?');$s->bind_param('sissssii',$name,$parent,$link,$link,$icon,$remarks,$sort,$menu);}else{$icon='fa-solid fa-layer-group';$remarks='Configure payroll Pay Scales.';$sort=25;$s=pss($con,'INSERT INTO jos_admin_menus(menu_name,parent_id,menu_link,url,icon,remarks,status,show_in_menu,sort_order) VALUES(?,?,?,?,?,?,1,1,?)');$s->bind_param('sissssi',$name,$parent,$link,$link,$icon,$remarks,$sort);}$s->execute();if(!$menu)$menu=(int)$s->insert_id;$s->close();
  $role=1;$s=pss($con,'SELECT id FROM jos_admin_rolemenus WHERE role_id=? AND menu_id=? LIMIT 1');$s->bind_param('ii',$role,$menu);$s->execute();$rm=(int)($s->get_result()->fetch_assoc()['id']??0);$s->close();if($rm){$s=pss($con,'UPDATE jos_admin_rolemenus SET can_view=1,can_add=1,can_edit=1,can_delete=1,status=1 WHERE id=?');$s->bind_param('i',$rm);}else{$s=pss($con,'INSERT INTO jos_admin_rolemenus(role_id,menu_id,can_view,can_add,can_edit,can_delete,status) VALUES(?,?,1,1,1,1,1)');$s->bind_param('ii',$role,$menu);}$s->execute();$s->close();$con->commit();$_SESSION['flash_pay_scale']='Pay Scale Master installed successfully.';redirect('/salary-config/pay-scales.php');
}catch(Throwable $e){$con->rollback();http_response_code(500);console_header('Pay Scale Setup','dashboard.php');?><div class="rounded-2xl border border-red-100 bg-red-50 p-6 font-semibold text-red-700">Pay Scale setup could not be completed.</div><?php console_footer();}*/
