<?php
require_once __DIR__.'/config.php';
$pdo=new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME.';charset=utf8mb4',DB_USER,DB_PASS,[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);
$email='zanagameyoutubbe@gmail.com'; $pass='admin123456';
$q=$pdo->prepare('UPDATE users SET password_hash=?, role="admin", is_active=1 WHERE email=?');$q->execute([password_hash($pass,PASSWORD_DEFAULT),$email]);
if(!$q->rowCount()) { $q=$pdo->prepare('INSERT INTO users(id,name,email,mobile,password_hash,role,is_active) VALUES(?,?,?,?,?,"admin",1)');$q->execute(['usr_admin','مدیر کل ZaccShop',$email,'',password_hash($pass,PASSWORD_DEFAULT)]); }
echo 'ZaccShop setup completed. Delete setup.php now.';
