diff --git a/src/Controller/TYPProfileController.php b/src/Controller/TYPProfileController.php --- a/src/Controller/TYPProfileController.php +++ b/src/Controller/TYPProfileController.php @@ -1,82 +1,84 @@ redirect(""); }*/ public function profilePage($bizid){ + $address_id = ""; $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); $data = \Drupal::service("typ.search")->getProfile($bizid ,AUTO); if (!$data) { return $this->redirect(""); } /*if($data['landingpage'] == ""){ $address_id = $data['addressid']; } if(is_numeric($address_id)){ $result = \Drupal::service('typ.unvservice')->loadListing($data['customerid']); $rs_details = (!empty($result['address'][$data['headingcod']][$address_id]['frontviews']))?$result['address'][$headingcode][$data['headingcod']]['frontviews']:array(); } else { $result = \Drupal::service('typ.unvservice')->loadService($data['customerid']); }*/ $address_id = $data['addressid']; $result = \Drupal::service('typ.unvservice')->loadService($data['customerid']); $rs_detail = (!empty($result['landingpages'][$data['headingcod']]))?$result['landingpages'][$data['headingcod']]:array(); $type = ''; if(empty($rs_detail)){ $type = 'FL'; }else{ $result_olc = \Drupal::service('typ.catalog')->listData($data['customerid']); } unset($rs_detail); $pos = strpos(html_entity_decode($data['proddesc']),"

"); if($pos !== false){ $tempdesc = substr(html_entity_decode($data['proddesc']),3); }else{ $tempdesc = html_entity_decode($data['proddesc']); } $temp = '

'; $tempdesc = $temp.$tempdesc; $type = $data['customertyp']; if($type == "FL") { $dataproddesct = iconv_substr($tempdesc,0,123,"UTF-8"); $dataproddesct .= '...'; }else{ $dataproddesct = $tempdesc; } if($type != "FL" && !empty($result_olc)){ $olcdata = $result_olc[0]; } + // echo "

";
-//        var_export($data);
+        //var_export($data);
 //        exit;
         $display[] = array(
             '#theme' => 'typ_profile',
             '#profile' => $data,
             '#prodescription' => $dataproddesct,
             '#catalog' => $olcdata,
             '#type' => $type
             );
         return $display;
 	}
 }
\ No newline at end of file
diff --git a/templates/typ-profile.html.twig b/templates/typ-profile.html.twig
--- a/templates/typ-profile.html.twig
+++ b/templates/typ-profile.html.twig
@@ -1,252 +1,252 @@
 {% set base_images = 'http://media.yellowpages.co.th/yellowpages'%}
 

{{ profile.custname|raw }}

หมวดหมู่ : {{ profile.headingname|raw }}
ไม่สามารถคะแนนได้

{% trans %} Address {% endtrans %} [ {% trans %}View map{% endtrans %}{{ profile.custname|raw }} ]
{{ [profile.addr,profile.soi,profile.road,profile.subdistrictname, profile.districtname,profile.cityname,profile.postcode]|join(' ') }}

{% if not profile.telno %}{% else %}{% trans %} Tel {% endtrans %}
{% endif %} {% if not profile.fax %}{% else %}{% trans %} Fax {% endtrans %}
{% endif %} {% if not profile.email %}{% else %}{% trans %} Email {% endtrans %}
{% endif %} {% if not profile.website %}{% else %}{% trans %} Website {% endtrans %}
{% endif %} {% if not profile.workinghours %}{% else %}{% trans %} Work-Time {% endtrans %}{% endif %}
{% if not profile.telno %} {% else %} {% if type == 'FL' %} {{ profile.telno.0 }}
{% else %} {% for key, tel in profile.telno %} {% if loop.last != key+1 %}{{ tel }}{{ " ," }} {% else %}{{ tel }}{% endif %} {% endfor %}
{% endif %} {% endif %} {% if not profile.fax %} {% else %} {% if type == 'FL' %} {{ profile.telno.0 }}
{% else %} {% for key, tel in profile.telno %} {% if loop.last != key+1 %}{{ tel }}{{ " ," }} {% else %}{{ tel }}{% endif %} {% endfor %}
{% endif %} {% endif %} {% if not profile.email %} {% else %} {% if type == 'FL' %} {{ profile.email }}
{% else %} {{ profile.email }}
{% endif %} {% endif %} {% if not profile.website %} {% else %} {{ profile.website }}
{% endif %} {% if not profile.workinghours %} {% else %} {{ profile.workinghours }}
{% endif %}
{% if not prodescription %} {% else %}
{% trans %} Product And Service {% endtrans %}

{{ prodescription|raw }}
{% endif %} {% if not profile.brandname %} {% else %}
{% trans %} Branner {% endtrans %} : {{ profile.brandname|replace({"

":" ","

":" "}) }} {% endif %}


{# TAB #} {% if type == 'FL' %}{% else %}
{% if not profile.picturet1 %} {% else %} {% endif %} {% if not profile.location.lat %}{% else %} {% endif %} - - {% if not profile.printads %}{% else %} + + {% if not profile.printadst %}{% else %} {% endif %} {% if not profile.promotion %} {% else %} {% endif %} {% if not profile.map %} {% else %} {% endif %}
{% endif %} {#


#} {#{% if not profile.custname %}#} {#{% else %}#} {#{{ profile.custname|raw }} : แสดงความคิดเห็น#} {#{% endif %}#} {#

#} {# TAB #} {#
#} {##} {#
#} {##} {##} {#{##}#} {#
#} {#
#} {# END TAB #}