Account.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. $host = "blueris.beget.tech";
  3. $username = "blueris_base";
  4. $password = "Qwer123.";
  5. $database = "blueris_base";
  6. $mysql = new mysqli($host, $username, $password, $database);
  7. if($mysql->connect_error){
  8. die("Ошибка подключения". $mysql->connect_error);
  9. }
  10. if(!isset($_COOKIE['id']))
  11. {
  12. echo "<script>window.location.href = 'index.php';</script>";
  13. }
  14. else
  15. {
  16. ?>
  17. <html lang="ru">
  18. <head>
  19. <meta charset="UTF-8">
  20. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  21. <link rel="stylesheet" href="./styles/Account.css">
  22. <title>Методический центр "Технология"</title>
  23. </head>
  24. <body>
  25. <header class="header">
  26. <div class="header-logo">
  27. <img src="img/лого.png" alt="Логотип методического центра">
  28. </div>
  29. <div class="header-info">
  30. <h1 class="header-tech">ТЕХНОЛОГИЯ</h1>
  31. <div class="header-center">
  32. | Методический центр
  33. </div>
  34. <div class="header-location">
  35. г. Нижний Новгород, пр. Кирова, 12
  36. </div>
  37. <div class="header-phone">
  38. | +7 (831) 291-50-25
  39. </div>
  40. </div>
  41. <div class="header-nav">
  42. <button id="menu">Меню</button>
  43. <ul>
  44. <li><a href="index.php">Главная</a></li>
  45. <li><a href="about.php">О нас</a></li>
  46. <li><a href="videos.php">Видео пособия</a></li>
  47. <li><a href="obychenie.php">Обучение</a></li>
  48. <li><a href="contacts.php">Контакты</a></li>
  49. <li><a href="questions.php">Вопросы</a></li>
  50. </ul>
  51. </div>
  52. </header>
  53. <div class="container">
  54. <div class="container1">
  55. <?php
  56. session_start();
  57. $id = (int)$_COOKIE['id'];
  58. $result = mysqli_query($mysql, "SELECT * FROM login WHERE id_user = $id");
  59. $hello = mysqli_fetch_assoc($result);
  60. echo "<div class = 'hello';'>Здравствуйте, ". $hello['name'] . " " . $hello['lastname']."</div>";
  61. echo "<div class = 'loginn';'>Ваш логин: ". $hello['login'] ."</div>";
  62. echo "<div class = 'email';'>Ваш email: ". $hello['email'] ."</div>";
  63. ?>
  64. <div class="loginBut"><a href="changelogin.php"><button type="button">Сменить логин</button></a></div>
  65. <div class="loginBut"><a href="changepassword.php"><button type="button">Сменить пароль</button></a></div>
  66. </div>
  67. <div class="container2">
  68. <?php
  69. $result1 = mysqli_query($mysql, "SELECT id_service from buy_service WHERE id_user = $id");
  70. if(mysqli_num_rows($result1) > 0)
  71. {
  72. echo "<div class = 'hello';'>Ваши курсы</div>";
  73. While( $id_serv = mysqli_fetch_assoc($result1)){
  74. $id_servi = $id_serv['id_service'];
  75. $result2 = mysqli_query($mysql, "SELECT * FROM service WHERE id_service = $id_servi");
  76. $result3 = mysqli_query($mysql, "SELECT * FROM Teachers WHERE id_service = $id_servi");
  77. ?>
  78. <div class="course">
  79. <?php
  80. $rivews = mysqli_fetch_assoc($result2);
  81. $teach = mysqli_fetch_assoc($result3)
  82. ?>
  83. <div class="sevices-container" id="a">
  84. <div class="course-info">
  85. <h3 class="course-title"><?php echo $rivews['name']; ?></h3>
  86. <img src= <?php echo $rivews['image']; ?> class="course-image">
  87. <p class="course-description"> <?php echo $rivews['description'];?> </p>
  88. <p class="course-price">Время(часы): <?php echo $rivews['time'];?></p><br>
  89. <p class="course-price">Ваш преподаватель: <?php echo $teach['FullName'];?>
  90. <p class="course-price">Номер для связи с преподавателем: <?php echo $teach['PhoneNumber'];?>
  91. <p class="course-price">Email для связи с преподавателем: <?php echo $teach['Email'];?>
  92. </div>
  93. <?php
  94. ?>
  95. </div>
  96. </div>
  97. <?php
  98. }
  99. }
  100. else
  101. {
  102. echo "<div class = 'hello';'>У вас нет активных курсов</div>";
  103. }
  104. }
  105. ?>
  106. </body>
  107. </html>