PageRenderTime 43ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/sites/all/themes/titan/node--request_item.tpl.php

https://bitbucket.org/hjain/trinet
PHP | 253 lines | 125 code | 42 blank | 86 comment | 7 complexity | 97da7c2319184d2390436fe85bf79aae MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0, AGPL-1.0
  1. <?php
  2. // $Id: node.tpl.php,v 1.4 2011/01/10 13:46:19 jarek Exp $
  3. /**
  4. * @file
  5. * Default theme implementation to display a node.
  6. *
  7. * Available variables:
  8. * - $title: the (sanitized) title of the node.
  9. * - $content: An array of node items. Use render($content) to print them all, or
  10. * print a subset such as render($content['field_example']). Use
  11. * hide($content['field_example']) to temporarily suppress the printing of a
  12. * given element.
  13. * - $user_picture: The node author's picture from user-picture.tpl.php.
  14. * - $date: Formatted creation date. Preprocess functions can reformat it by
  15. * calling format_date() with the desired parameters on the $created variable.
  16. * - $name: Themed username of node author output from theme_username().
  17. * - $node_url: Direct url of the current node.
  18. * - $terms: the themed list of taxonomy term links output from theme_links().
  19. * - $display_submitted: whether submission information should be displayed.
  20. * - $classes: String of classes that can be used to style contextually through
  21. * CSS. It can be manipulated through the variable $classes_array from
  22. * preprocess functions. The default values can be one or more of the following:
  23. * - node: The current template type, i.e., "theming hook".
  24. * - node-[type]: The current node type. For example, if the node is a
  25. * "Blog entry" it would result in "node-blog". Note that the machine
  26. * name will often be in a short form of the human readable label.
  27. * - node-teaser: Nodes in teaser form.
  28. * - node-preview: Nodes in preview mode.
  29. * The following are controlled through the node publishing options.
  30. * - node-promoted: Nodes promoted to the front page.
  31. * - node-sticky: Nodes ordered above other non-sticky nodes in teaser listings.
  32. * - node-unpublished: Unpublished nodes visible only to administrators.
  33. * - $title_prefix (array): An array containing additional output populated by
  34. * modules, intended to be displayed in front of the main title tag that
  35. * appears in the template.
  36. * - $title_suffix (array): An array containing additional output populated by
  37. * modules, intended to be displayed after the main title tag that appears in
  38. * the template.
  39. *
  40. * Other variables:
  41. * - $node: Full node object. Contains data that may not be safe.
  42. * - $type: Node type, i.e. story, page, blog, etc.
  43. * - $comment_count: Number of comments attached to the node.
  44. * - $uid: User ID of the node author.
  45. * - $created: Time the node was published formatted in Unix timestamp.
  46. * - $classes_array: Array of html class attribute values. It is flattened
  47. * into a string within the variable $classes.
  48. * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
  49. * teaser listings.
  50. * - $id: Position of the node. Increments each time it's output.
  51. *
  52. * Node status variables:
  53. * - $view_mode: View mode, e.g. 'full', 'teaser'...
  54. * - $teaser: Flag for the teaser state (shortcut for $view_mode == 'teaser').
  55. * - $page: Flag for the full page state.
  56. * - $promote: Flag for front page promotion state.
  57. * - $sticky: Flags for sticky post setting.
  58. * - $status: Flag for published status.
  59. * - $comment: State of comment settings for the node.
  60. * - $readmore: Flags true if the teaser content of the node cannot hold the
  61. * main body content.
  62. * - $is_front: Flags true when presented in the front page.
  63. * - $logged_in: Flags true when the current user is a logged-in member.
  64. * - $is_admin: Flags true when the current user is an administrator.
  65. *
  66. * Field variables: for each field instance attached to the node a corresponding
  67. * variable is defined, e.g. $node->body becomes $body. When needing to access
  68. * a field's raw values, developers/themers are strongly encouraged to use these
  69. * variables. Otherwise they will have to explicitly specify the desired field
  70. * language, e.g. $node->body['en'], thus overriding any language negotiation
  71. * rule that was previously applied.
  72. *
  73. * @see template_preprocess()
  74. * @see template_preprocess_node()
  75. * @see template_process()
  76. */
  77. // echo "<pre>"; print_r($node); exit;
  78. ?>
  79. <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix<?php if ($display_submitted): ?> indent<?php endif; ?>" <?php print $attributes; ?>>
  80. <div class="item-content">
  81. <div class="title-and-meta">
  82. <?php print render($title_prefix); ?>
  83. <?php if ($page): ?>
  84. <h1 class="node-title" <?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h1>
  85. <?php endif; ?>
  86. <?php if (!$page): ?>
  87. <h2 class="node-title" <?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
  88. <?php endif; ?>
  89. <?php if ($display_submitted): ?>
  90. <div class="meta">
  91. <?php if ($display_submitted): ?>
  92. <span class="submitted">
  93. <?php print t('--By ') . $name; ?>
  94. </span>
  95. <?php endif; ?>
  96. </div>
  97. <?php endif; ?>
  98. <div class="item-picture">
  99. <?php
  100. $variables=array(
  101. 'path'=> $content['field_request_photos']['#object']->field_request_photos['und']['0']['uri'],
  102. 'width'=>'300px',
  103. 'height'=>'340px',
  104. );
  105. $item_pic=theme('image',$variables);
  106. //echo "<pre>"; print_r($item_pic); exit;
  107. print render($item_pic);
  108. ?>
  109. </div>
  110. <div class="item-user-details">
  111. <div class="item-owner-pic">
  112. <?php print $user_picture;?>
  113. </div>
  114. <div class="owner-icon-div">
  115. <img class="owner-icon" src=" <?php echo base_path(); ?>sites/default/files/dude2.jpg" />
  116. </div>
  117. <div class="item-owner-name">
  118. <?php print $name; ?>
  119. </div>
  120. <div class="phone-icon-div">
  121. <img class="owner-icon" src=" <?php echo base_path(); ?>sites/default/files/telephone1.jpg" />
  122. </div>
  123. <div class="item-owner-phone">
  124. <?php
  125. //echo "<pre>"; print_r($content); exit;
  126. $user_uid=$content['field_request_category']['#object']->uid;
  127. //echo "<pre>"; print_r($user_uid); exit;
  128. $query = db_select('profile','p')
  129. ->fields('p',array('pid'))
  130. ->condition('p.uid',$user_uid,'=')
  131. ->execute();
  132. $query_obj_pid=$query->fetchObject();
  133. //echo "<pre>"; print_r($query_obj_pid->pid); exit;
  134. $query1=db_select('field_data_field_mobile','m')
  135. ->fields('m',array('field_mobile_value'))
  136. ->condition('m.entity_id',$query_obj_pid->pid,'=')
  137. ->execute();
  138. $query_obj_mobile=$query1->fetchObject();
  139. // echo "<pre>"; print_r($query_obj_mobile); exit;
  140. if($query_obj_mobile!=NULL)
  141. {
  142. print render($query_obj_mobile->field_mobile_value);
  143. }else
  144. {
  145. $custom_text="N/A";
  146. print render($custom_text);
  147. }
  148. ?>
  149. </div>
  150. <div class="other-ads-icon-div">
  151. <img class="owner-icon" src=" <?php echo base_path(); ?>sites/default/files/group.png" />
  152. </div>
  153. <div class="item-owner-other-ads">
  154. <?php
  155. //echo "<pre>"; print_r($content); exit;
  156. $user_uid=$content['field_request_category']['#object']->uid;
  157. //echo "<pre>"; print_r($user_uid); exit;
  158. $query = db_select('profile','p')
  159. ->fields('p',array('pid'))
  160. ->condition('p.uid',$user_uid,'=')
  161. ->execute();
  162. $query_obj_pid=$query->fetchObject();
  163. //echo "<pre>"; print_r($query_obj_pid->pid); exit;
  164. $query1=db_select('field_data_field_group','m')
  165. ->fields('m',array('field_group_value'))
  166. ->condition('m.entity_id',$query_obj_pid->pid,'=')
  167. ->execute();
  168. $query_obj_group=$query1->fetchObject();
  169. //echo "<pre>"; print_r($query_obj_mobile); exit;
  170. print render($query_obj_group->field_group_value);
  171. ?>
  172. </div>
  173. <div class="item-price">
  174. <?php //echo "<pre>"; print_r($content['field_request_price']['#object']->field_request_price['und']['0']['value']); exit;
  175. if(isset($content['field_request_price']['#object']->field_request_price)){
  176. $priced = 'Rs ' .$content['field_request_price']['#object']->field_request_price['und']['0']['value'];
  177. print render($priced);
  178. }else {
  179. $na="N/A";
  180. print render($na);
  181. }
  182. ?>
  183. </div>
  184. <div class="item-details">
  185. <?php
  186. //echo "<pre>"; print_r($content); exit;
  187. $item_catgy='<strong>Category: </strong>' .l($content['field_request_category']['#object']->field_request_category['und']['0']['taxonomy_term']->name,'taxonomy/term/'. $content['field_request_category']['#object']->field_request_category['und']['0']['taxonomy_term']->tid) . '<br/>';
  188. print render($item_catgy);
  189. $item_type='<strong>Type: </strong>' .$content['field_request_type']['#object']->field_request_type['und']['0']['value'] . '<br/>';
  190. print render($item_type);
  191. $item_posted='<strong>Posted On: </strong>'. date("M d,Y",$content['field_request_category']['#object']->created). '<br/>';
  192. print render($item_posted);
  193. ?>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="item-description">
  199. <h5 class="description">Description</h5>
  200. <div class="main-description">
  201. <?php //echo "<pre>";print_r($content ['field_request_description']['#object']->field_request_description['und']['0']['value']); exit;
  202. $item_description=$content ['field_request_description']['#object']->field_request_description['und']['0']['value'];
  203. print $item_description;
  204. ?>
  205. </div>
  206. </div>
  207. <div class="links-wrapper">
  208. <?php print render($content['links']); ?>
  209. </div>
  210. <?php /*echo "<pre>"; print_r($content['comments']); exit;*/print render($content['comments']); ?>
  211. </div>