cv.php 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <h3 class='section_title'><?=text($con, "PROFILE_CV", $lang);?></h3>
  2. <ul class='cv_download'>
  3. <li>
  4. <a target='_blank' href='TODO' title='<?=text($con, "USER_NAME", $lang);?> - <?=text($con, "PROFILE_CV", $lang);?>'><?=text($con, "PROFILE_DOWNLOAD_CURRENT", $lang);?></a>
  5. </li>
  6. <li>
  7. <a href='TODO' title='<?=text($con, "PROFILE_CV_DOWNLOAD_LANG", $lang);?>'><?=text($con, "PROFILE_DOWNLOAD_OTHER", $lang);?></a>
  8. </li>
  9. </ul>
  10. <?php
  11. $q_section = mysqli_query($con, "SELECT * FROM cv_category WHERE visible = 1 ORDER BY priority;");
  12. while ($r_section = mysqli_fetch_array($q_section)){
  13. ?>
  14. <div id='cv' class='cv_entry'>
  15. <h4 class='cv_entry_title'><?=text($con, $r_section["title"], $lang)?></h4>
  16. <?php
  17. if (strlen($r_section["summary"]) > 0){
  18. ?>
  19. <h5><?=text($con, $r_section["summary"], $lang)?></h5>
  20. <?php
  21. }
  22. $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");
  23. while ($r_item = mysqli_fetch_array($q_item)){
  24. switch ($r_item["date_precission"]){
  25. case "Y":
  26. if (strlen($r_item["end"]) <= 0){ // Since 2016
  27. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_YEAR", $lang));
  28. }
  29. else{
  30. if ($r_item["start_y"] == $r_item["end_y"]){ // 2016
  31. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_DURING_YEAR", $lang));
  32. }
  33. else{ // From 2015 until 2017
  34. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_TO_YEAR", $lang));
  35. $str_date = str_replace("#YEAR_END#", $r_item["end_y"], $str_date);
  36. }
  37. }
  38. break;
  39. case "M":
  40. if (strlen($r_item["end"]) <= 0){ // Since March 2016
  41. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_MONTH", $lang));
  42. $str_date = str_replace("#MONTH_START#", text($con, "MONTH_" . $r_item["start_m"], $lang), $str_date);
  43. }
  44. else{
  45. if ($r_item["start_y"] == $r_item["end_y"]){
  46. if ($r_item["start_m"] == $r_item["end_m"]){ // March 2016
  47. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_DURING_MONTH", $lang));
  48. $str_date = str_replace("#MONTH_START#", text($con, "MONTH_" . $r_item["start_m"], $lang), $str_date);
  49. }
  50. else{ // From February until March 2016
  51. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_TO_MONTH_YEAR", $lang));
  52. $str_date = str_replace("#MONTH_START#", text($con, "MONTH_" . $r_item["start_m"], $lang), $str_date);
  53. $str_date = str_replace("#MONTH_END#", text($con, "MONTH_" . $r_item["end_m"], $lang), $str_date);
  54. }
  55. }
  56. else{
  57. // From February 2015 until March 2016
  58. $str_date = str_replace("#YEAR_START#", $r_item["start_y"], text($con, "CV_DATE_FROM_TO_MONTH", $lang));
  59. $str_date = str_replace("#YEAR_END#", $r_item["end_y"], $str_date);
  60. $str_date = str_replace("#MONTH_START#", text($con, "MONTH_" . $r_item["start_m"], $lang), $str_date);
  61. $str_date = str_replace("#MONTH_END#", text($con, "MONTH_" . $r_item["end_m"], $lang), $str_date);
  62. }
  63. }
  64. break;
  65. } // switch ($r_item["date_precission"])
  66. ?>
  67. <div class='role'>
  68. <h4><?=text($con, $r_item["role"], $lang)?></h4>
  69. <h5><?=$str_date?>. <?=$r_item["company"]?> (<?=text($con, $r_item["city"], $lang)?>)</h5>
  70. <p><?=text($con, $r_item["summary"], $lang)?></p>
  71. </div>
  72. <?php
  73. } // while ($r_item = mysqli_fetch_array($q_item))
  74. ?>
  75. </div> <!-- .cv_entry -->
  76. <?php
  77. }
  78. ?>