index.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. session_start();
  3. $http_host = $_SERVER["HTTP_HOST"];
  4. $doc_root = $_SERVER["DOCUMENT_ROOT"];
  5. include $doc_root . "functions.php";
  6. $proto = get_protocol();
  7. $con = start_db();
  8. $server = $proto . $http_host;
  9. $lang = select_language();
  10. $cur_section = "me";
  11. $cur_entry = "";
  12. ?>
  13. <!DOCTYPE html>
  14. <html>
  15. <head>
  16. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  17. <meta charset='utf-8'/>
  18. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  19. <title><?=text($con, "ME_TITLE", $lang)?> - I&ntilde;igo Valentin</title>
  20. <link rel='shortcut icon' href='<?=$server?>/img/logo/favicon.ico'/>
  21. <!-- CSS files -->
  22. <style>
  23. <?php
  24. include $doc_root . "css/ui.css";
  25. include $doc_root . "css/me.css";
  26. ?>
  27. </style>
  28. <!-- CSS for mobile version -->
  29. <style media='(max-width : 990px)'>
  30. <?php
  31. include $doc_root . "css/m/ui.css";
  32. include $doc_root . "css/m/me.css";
  33. ?>
  34. </style>
  35. <!-- Script files -->
  36. <script type='text/javascript'>
  37. <?php
  38. include $doc_root . "script/ui.js";
  39. include $doc_root . "script/me.js";
  40. ?>
  41. </script>
  42. <!-- Meta tags -->
  43. <link rel='canonical' href='<?=$server?>/me/'/>
  44. <link rel='author' href='<?=$server?>'/>
  45. <link rel='publisher' href='<?=$server?>'/>
  46. <meta name='description' content='<?=text($con, "ME_DESCRIPTION", $lang)?>'/>
  47. <meta property='og:title' content='<?=text($con, "ME_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
  48. <meta property='og:url' content='<?=$server?>/me'/>
  49. <meta property='og:description' content='<?=text($con, "ME_DESCRIPTION", $lang)?>'/>
  50. <meta property='og:image' content='<?=$server?>/img/logo/favicon.ico''/>
  51. <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
  52. <meta property='og:type' content='website'/>
  53. <meta property='og:locale' content='<?=$lang?>'/>
  54. <meta name='twitter:card' content='summary'/>
  55. <meta name='twitter:title' content='<?=text($con, "ME_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
  56. <meta name='twitter:description' content='<?=text($con, "ME_DESCRIPTION", $lang)?>'/>
  57. <meta name='twitter:image' content='<?=$server?>/img/logo/favicon.ico''/>
  58. <meta name='twitter:url' content='<?=$server?>'/>
  59. <meta name='robots' content='index follow'/>
  60. </head>
  61. <body>
  62. <?php
  63. include $doc_root . "header.php";
  64. ?>
  65. <div id='content'>
  66. <div class='section section_no_title'>
  67. <div class='entry' id='profile'>
  68. <div class='table_row'>
  69. <div class='table_cell'>
  70. <img id='profile' src='<?=$server?>/img/profile/preview/0.png' alt='I&ntilde;igo Valentin' title='I&ntilde;igo Valentin' />
  71. </div> <!-- .table_cell -->
  72. <div class='table_cell'>
  73. <h3 id='name'>I&ntilde;igo Valentin</h3>
  74. <h4 id='tagline'>TR#Developer</h4>
  75. <p id='bio'>TR#Bio</p>
  76. </div> <!-- .table_cell -->
  77. </div> <!-- .table_row -->
  78. </div> <!-- #profile -->
  79. </div> <!-- .section -->
  80. <div class='section'>
  81. <h3 class='section_title'>TR#Curriculum Vitae</h3>
  82. <ul class='cv_download'>
  83. <li>
  84. <a target='_blank' href='TODO' title='I&ntilde;igo Valentin - TR#Curriculum Vitae'>TR#Download in currlang</a>
  85. </li>
  86. <li>
  87. <a href='TODO' title='TR#Curriculum Vitae - Other languages'>TR#Download in other languages</a>
  88. </li>
  89. </ul>
  90. <?php
  91. $q_section = mysqli_query($con, "SELECT * FROM cv_category WHERE visible = 1 ORDER BY priority;");
  92. while ($r_section = mysqli_fetch_array($q_section)){
  93. ?>
  94. <div id='cv' class='entry cv_entry'>
  95. <h4><?=text($con, $r_section["title"], $lang)?></h4>
  96. <?php
  97. if (strlen($r_section["summary"]) > 0){
  98. ?>
  99. <h5><?=text($con, $r_section["summary"], $lang)?></h5>
  100. <?php
  101. }
  102. $q_item = mysqli_query($con, "SELECT id, role, company, summary, city, start, end, year(start) AS start_y, DATE_FORMAT(start, '%m') AS start_m, year(end) AS end_y, DATE_FORMAT(end, '%m') AS end_m, date_precission FROM cv_entry WHERE category = $r_section[id] AND visible = 1 ORDER BY start DESC");
  103. while ($r_item = mysqli_fetch_array($q_item)){
  104. switch ($r_item["date_precission"]){
  105. case "Y":
  106. if (strlen($r_item["end"]) <= 0){ // Since 2016
  107. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_YEAR", $lang));
  108. }
  109. else{
  110. if ($r_item["start_y"] == $r_item["end_y"]){ // 2016
  111. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_DURING_YEAR", $lang));
  112. }
  113. else{ // From 2015 until 2017
  114. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_TO_YEAR", $lang));
  115. $str_date = str_replace("#YEAR_END#", $r_item["end_y"], $str_date);
  116. }
  117. }
  118. break;
  119. case "M":
  120. if (strlen($r_item["end"]) <= 0){ // Since March 2016
  121. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_MONTH", $lang));
  122. $str_date = str_replace("#MONTH_START#", text($con, "MONTH_" . $r_item["start_m"], $lang), $str_date);
  123. }
  124. else{
  125. if ($r_item["start_y"] == $r_item["end_y"]){
  126. if ($r_item["start_m"] == $r_item["end_m"]){ // March 2016
  127. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_DURING_MONTH", $lang));
  128. $str_date = str_replace("#MONTH_START#", text($con, "MONTH_" . $r_item["start_m"], $lang), $str_date);
  129. }
  130. else{ // From February until March 2016
  131. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_TO_MONTH_YEAR", $lang));
  132. $str_date = str_replace("#MONTH_START#", text($con, "MONTH_" . $r_item["start_m"], $lang), $str_date);
  133. $str_date = str_replace("#MONTH_END#", text($con, "MONTH_" . $r_item["end_m"], $lang), $str_date);
  134. }
  135. }
  136. else{
  137. // From February 2015 until March 2016
  138. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_TO_MONTH", $lang));
  139. $str_date = str_replace("#YEAR_END#", $r_item["end_y"], $str_date);
  140. $str_date = str_replace("#MONTH_START#", text($con, "MONTH_" . $r_item["start_m"], $lang), $str_date);
  141. $str_date = str_replace("#MONTH_END#", text($con, "MONTH_" . $r_item["end_m"], $lang), $str_date);
  142. }
  143. }
  144. break;
  145. } // switch ($r_item["date_precission"])
  146. ?>
  147. <div class='role'>
  148. <h4><?=text($con, $r_item["role"], $lang)?></h4>
  149. <h5><?=$str_date?>. <?=$r_item["company"]?> (<?=text($con, $r_item["city"], $lang)?>)</h5>
  150. <p><?=text($con, $r_item["summary"], $lang)?></p>
  151. </div>
  152. <?php
  153. } // while ($r_item = mysqli_fetch_array($q_item))
  154. ?>
  155. </div>
  156. <?php
  157. }
  158. ?>
  159. </div> <!-- .section -->
  160. </div> <!-- #content -->
  161. <?php
  162. include $doc_root . "footer.php";
  163. stats($con, $cur_section, $cur_entry);
  164. ?>
  165. </body>
  166. </html>