Page MenuHomePhabricator

TYPProfileController.php
No OneTemporary

TYPProfileController.php

<?php
/**
* @file
* Contains \Drupal\page_example\Controller\TableSortExampleController.
*/
/**/
namespace Drupal\typ_profile\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\Core\Database\Query;
use Drupal\Core\Url;
/**
* Controller routines for tablesort example routes.
*/
class TYPProfileController extends ControllerBase
{
/*public function profile_redirect(){
return $this->redirect("<front>");
}*/
public function profilePage($bizid){
$address_id = "";
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();
$data = \Drupal::service("typ.search")->getProfile($bizid ,AUTO);
if (!$data) {
return $this->redirect("<front>");
}
/*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']),"<p>");
if($pos !== false){
$tempdesc = substr(html_entity_decode(html_entity_decode($data['proddesc']),3));
}else{
$tempdesc = html_entity_decode(html_entity_decode($data['proddesc'])) ;
//$tempdesc = $data['proddesc'];
}
$temp = '<p style="color:#000;">';
$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 "<pre>";
//var_export($data);
// exit;
$display[] = array(
'#theme' => 'typ_profile',
'#profile' => $data,
'#prodescription' => $dataproddesct,
'#catalog' => $olcdata,
'#type' => $type
);
return $display;
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Dec 25, 12:26 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
193527

Event Timeline