<?php

// database connections test
    $host = 'localhost';
    $username = 'root';
    $password = '';
    $conn = new PDO("mysql:host=$host;dbname=asiashopdb",$username,$password,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4"));
    $site_url = "http://localhost/";

// database connections true
    // $host = 'localhost';
    // $username = 'root';
    // $password = '';
    // $conn = new PDO("mysql:host=$host;dbname=",$username,$password,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
    // $site_url = "http://localhost/avioschool/";


// Time modules
    include ("jdf.php");
    date_default_timezone_set("Asia/Tehran");
    $fa_date = tr_num(jdate('Y/m/d'));
    $en_time = date('Y-m-d');
    $current_time = date("H:i");


// Session control
    if(session_id()==''){
        session_start();
    }else{
    $user_info=$_SESSION['user_login'];
    }

?>





<?php
    // if(isset($_SESSION['user_login'])){
    // $user_access=$_SESSION['user_login'];
    // $user_id_sess = $user_access["id"];
    //   try{
    //     $user_show_me = $conn->prepare("select * from users where id = :id");
    //     $user_show_me->bindParam(':id', $user_id_sess);
    //     $user_show_me->execute();
    //     $users = $user_show_me->fetchAll(PDO::FETCH_OBJ);
    //   }catch(Exception $e){
    //     echo  $e->getMessage();
    //   }
    //   foreach($users as $users_info_show)
    //   $my_profile_id = $users_info_show->id;
    //   $my_profile_phone_number = $users_info_show->phone_number;
    //   $my_profile_name = $users_info_show->name;
    //   $my_profile_role = $users_info_show->role;
    //   $my_profile_nation_code = $users_info_show->nation_code;
    //   $my_profile_avatar = $users_info_show->avatar;
    //   $my_profile_place = $users_info_show->place;
    //   $my_profile_adress = $users_info_show->adress;
    // }

      ?>





<?php
    if(isset($_COOKIE['bjslcnr'])){
    $user_id_sess = $_COOKIE['bjslcnr'];
      try{
        $user_show_me = $conn->prepare("select * from users where id = :id");
        $user_show_me->bindParam(':id', $user_id_sess);
        $user_show_me->execute();
        $users = $user_show_me->fetchAll(PDO::FETCH_OBJ);
      }catch(Exception $e){
        echo  $e->getMessage();
      }
      foreach($users as $users_info_show)
      $my_profile_id = $users_info_show->id;
      $my_profile_phone_number = $users_info_show->phone_number;
      $my_profile_name = $users_info_show->name;
      $my_profile_role = $users_info_show->role;
      $my_profile_nation_code = $users_info_show->nation_code;
      $my_profile_avatar = $users_info_show->avatar;
      $my_profile_place = $users_info_show->place;
      $my_profile_adress = $users_info_show->adress;
    }

      ?>




<?php
try{
$users_show = $conn->query("select * from settings where id=1");
$users = $users_show->fetchAll(PDO::FETCH_OBJ);
}catch(Exception $e){
echo  $e->getMessage();
}
?>

<?php foreach($users as $settings_item) :?>
<?php 
  $setting_site_name = $settings_item->site_name;

  
  $setting_site_description = $settings_item->site_description;
 
  ?>
<?php endforeach; ?>