PageRenderTime 21ms CodeModel.GetById 41ms RepoModel.GetById 1ms app.codeStats 0ms

/old/v2/src/cvhtml.php

https://github.com/YouWoTMA/brweb
PHP | 166 lines | 146 code | 20 blank | 0 comment | 5 complexity | 6286796c5f268550e36b8c223f3650ac MD5 | raw file
  1. <?php
  2. include_once "cv.php";
  3. define("ITEM_HEIGHT",20);
  4. define("TITLE_HEIGHT",27);
  5. function line($x1,$y1,$x2,$y2,$c){
  6. pprt("<line x1='$x1' y1='$y1' x2='$x2' y2='$y2' class='$c'/>");
  7. }
  8. $column_height = 0;
  9. $column_pos = 0;
  10. $column_n = 0;
  11. function column_height($h){
  12. global $column_pos, $column_height, $column_n;
  13. $column_pos += $h;
  14. if($column_pos >= $column_height){
  15. $column_pos = 0;
  16. $column_n++;
  17. pprtu("</div>");
  18. pprti("<div class='columna columna-$column_n'>");
  19. }
  20. }
  21. $accesible_texts = array();
  22. function text($x,$y,$t){
  23. pprt("<text x='$x' y='$y' text-anchor='middle'>$t</text>");
  24. global $accesible_texts;
  25. $accesible_texts[] = array("middle",$x,$y,$t,"");
  26. }
  27. $accesible_texts = array();
  28. function ratext($x,$y,$t,$c){
  29. $y += 3;
  30. $x -= 5;
  31. pprt("<text x='$x' y='$y' text-anchor='end' class='$c'>$t</text>");
  32. global $accesible_texts;
  33. $accesible_texts[] = array("end",$x,$y,$t,$c);
  34. }
  35. $htexts = array();
  36. function htext($x,$y,$w,$h,$t){
  37. global $htexts;
  38. $htexts[] = array($x,$y,$w,$h,$t);
  39. }
  40. function timeline_start(){?>
  41. <div class="timeline">
  42. <div class="column left">
  43. <?php
  44. }
  45. function timeline_end(){
  46. global $htexts;
  47. foreach($htexts as $k=>$v){
  48. pprt("<div class='htext' style='position:absolute; left: {$v[0]}px; top: {$v[1]}px; width: {$v[2]}px; height: {$v[3]}px;'>{$v[4]}</div>");
  49. }
  50. ?>
  51. </div>
  52. <?php
  53. }
  54. $isLeft = true;
  55. function timeline_right(){
  56. global $isLeft;
  57. $isLeft = false;
  58. ?>
  59. </div>
  60. <div class="timeline-dates">
  61. <div class="born_marker">
  62. <div>1991</div>
  63. <div>Born</div>
  64. </div>
  65. <div class="timeline-line"></div>
  66. </div>
  67. <div class="column right">
  68. <?php }
  69. function timeline_period($start, $end, $top, $title, $position, $description, $logo='') {
  70. ?>
  71. <div class="period">
  72. <div class="period-text">
  73. <?php if($logo){ echo "<img src='"; statico("img/$logo"); echo "' class='logo' alt='$title'/>"; } ?>
  74. <h4><?php t($title) ?></h4>
  75. <p class="position"><?php t($position) ?></p>
  76. <p><?php echo str_replace("\n", '</p><p>', tr($description)) ?></p>
  77. </div>
  78. <div class="period-date" style="top: <?php echo $top; ?>px">
  79. <div class="date-start"><?php echo $start; ?></div>
  80. <div class="date-end"><?php echo $end; ?></div>
  81. </div>
  82. </div>
  83. <?php }
  84. function skills_title(){ ?>
  85. <div class="clearfix"></div>
  86. <h1><?php t("Habilidades notables:"); ?></h1>
  87. <div id="arem">
  88. <?php }
  89. function skills_start($itemcount,$titlecount, $colcnt){
  90. global $column_pos, $column_height, $column_n;
  91. $column_pos = 0;
  92. $column_n = 0;
  93. $column_height = ($itemcount*ITEM_HEIGHT + $titlecount*TITLE_HEIGHT)/$colcnt;
  94. pprti("<div class='columna columna-0'>");
  95. }
  96. function item($name,$pc){
  97. pprti("<div class='item title'>");
  98. pprt("<div class='itemname'>$name</div>");
  99. if(is_numeric($pc)){
  100. $pc /= 2;
  101. pprt('<div class="metter"><div class="metter-inner" style="width: '.$pc.'px;"></div></div>');
  102. }else{
  103. pprt('<div class="itemdata">'.$pc.'</div>');
  104. }
  105. pprtu("</div>");
  106. pprt("<div class='clearfix'></div>");
  107. column_height(ITEM_HEIGHT);
  108. }
  109. function title($name,$pc){
  110. $pc /= 2;
  111. pprti('<div class="item">');
  112. pprt("<div class='itemname'><h2>$name</h2></div>");
  113. if($pc != 0) pprt('<div class="metter"><div class="metter-inner" style="width: '.$pc.'px;"></div></div>');
  114. pprtu("</div>");
  115. pprt("<div class='clearfix'></div>");
  116. column_height(TITLE_HEIGHT);
  117. }
  118. function ftitle(){}
  119. function skills_end(){
  120. pprtu("</div>");
  121. ?>
  122. </div>
  123. <?php
  124. }
  125. function cv_end(){ ?>
  126. <div class="clearfix"></div>
  127. <div id="fotter">David Bengoa - <a href="mailto:david@bengoa.me">david@bengoa.me</a> - <a href="http://twitter.com/DvdBng">@DvdBng</a> - Github: <a href="https://github.com/YouWoTMA">youwotma</a></div>
  128. <?php }
  129. function content(){ ?>
  130. <h1 id="maintitle"><?php t("David Bengoa - Currículum vítae"); ?></h1>
  131. <div id="nav">
  132. <a href="../../<?php t("en"); ?>/cv/"><?php t("English"); ?></a>
  133. <a href=".."><?php t("Página principal") ?></a>
  134. <a href="/david-bengoa-cv-<?php t("es"); ?>.pdf" class="last"><?php t("Descarga mi CV en PDF"); ?></a>
  135. </div>
  136. <div class="clearfix"></div>
  137. <?php
  138. do_cv();
  139. }
  140. function css(){
  141. ?>
  142. <link href="<?php statico("css/cv.css"); ?>" rel="stylesheet" />
  143. <?php
  144. }
  145. include_once "base.php";
  146. ?>