0) return $sizes[count($sizes)-1]; else return ''; } static function processAttributesNew(&$row, &$abbs, &$insoleOptions, &$comments, &$parts) { $modelAttribute = new vxcModelOrderAttribute(); $parts = array('left'=>array(),'right'=>array()); // $parts = array(); $comments = ''; $insoleOptions = array(); $addressData = array(); $mvcMiddlewareURL = LegacyHelper::getMiddlewareServiceURL(); $storageService = LegacyHelper::getStorageService(); $json = new Services_JSON(); $workshopParamsStr = ''; $orderedFeet = ''; $generateLabelInsoleImages = (isset($row->generateImages) && $row->generateImages) ? $row->generateImages : false; if (is_array($row->attributes)) for ($l=0;$lattributes);$l++) { $attribute = $row->attributes[$l]; switch($attribute->name) { case "workshop.params": $workshopParamsStr = $attribute->value; break; case "general.orderedFeet": $orderedFeet = $attribute->value; break; case "cad.insoleCADProject": if ($generateLabelInsoleImages) { $thumb = array('image_left' => array(), 'image_right' => array()); $modelAttribute->GetRelativeThumbs($attribute->id, $thumb['image_left'], $thumb['image_right']); $cadDesignThumbLeftURL = $mvcMiddlewareURL . "/getFile?path=" . urlencode($thumb['image_left']) . "&directResponse=true"; //."&rnd=".rand(); if ($storageService) $cadDesignThumbLeftURL .= "&storageService=" . urlencode($storageService); $cadDesignThumbRightURL = $mvcMiddlewareURL . "/getFile?path=" . urlencode($thumb['image_right']) . "&directResponse=true"; //."&rnd=".rand(); if ($storageService) $cadDesignThumbRightURL .= "&storageService=" . urlencode($storageService); $leftImageSizeResult = ManuReportHelper::getSslPage($cadDesignThumbLeftURL); $rightImageSizeResult = ManuReportHelper::getSslPage($cadDesignThumbRightURL); if (strlen($leftImageSizeResult) >= 2 && strpos($leftImageSizeResult, "\xFF\xD8\xFF") === 0) $parts['left']['cadDesignThumb'] = $cadDesignThumbLeftURL; else $parts['left']['cadDesignThumb'] = null; if (strlen($rightImageSizeResult) >= 2 && strpos($rightImageSizeResult, "\xFF\xD8\xFF") === 0) $parts['right']['cadDesignThumb'] = $cadDesignThumbRightURL; else $parts['right']['cadDesignThumb'] = null; } break; } } if (!$workshopParamsStr) return; $workshopParams = $json->decode($workshopParamsStr); $poolWorkshop = array(); ManuReportHelper::GeneratePoolFromParams($workshopParams,$poolWorkshop,''); $tags = array(); foreach($poolWorkshop as $key => $value) { $keyParts = explode(".",$key); if (count($keyParts)<3) continue; $section = $keyParts[0]; $tagName = $keyParts[1]; if (count($keyParts)>3) { $foot = $keyParts[2]; $tagPart = $keyParts[3]; } else { $foot = ''; $tagPart = $keyParts[2]; } if (($foot=="right" && $orderedFeet=="onlyleft") || ($foot=="left" && $orderedFeet=="onlyright")) continue; if ($foot) { if (!$tags[$foot]) $tags[$foot] = array(); if (!$tags[$foot][$section]) $tags[$foot][$section] = array(); if (!$tags[$foot][$section][$tagName]) $tags[$foot][$section][$tagName] = array(); $tags[$foot][$section][$tagName][$tagPart] = $value; } else { if (!$tags["left"]) $tags["left"] = array(); if (!$tags["left"][$section]) $tags["left"][$section] = array(); if (!$tags["left"][$section][$tagName]) $tags["left"][$section][$tagName] = array(); $tags["left"][$section][$tagName][$tagPart] = $value; if (!$tags["right"]) $tags["right"] = array(); if (!$tags["right"][$section]) $tags["right"][$section] = array(); if (!$tags["right"][$section][$tagName]) $tags["right"][$section][$tagName] = array(); $tags["right"][$section][$tagName][$tagPart] = $value; } } $labels = array(); foreach($tags as $foot => $footInfo) { foreach($footInfo as $section => $sectionInfo) { foreach($sectionInfo as $tagName => $tagInfo) { $label = $tagInfo["label"]; if (!$label) continue; if (isset($tagInfo["height"])) $label .= ".A".$tagInfo["height"]; if (isset($tagInfo["value"])) $label .= $tagInfo["value"]; if (isset($tagInfo["suffix"])) $label .= $tagInfo["suffix"]; if (!$parts[$foot]) $parts[$foot] = array(); if ($section != "remarks" && $section != "size") { if (!$parts[$foot][$section]) $parts[$foot][$section] = array(); $parts[$foot][$section][] = $label; } else { $parts[$foot][$section] = $label; } if (!$labels[$label]) $labels[$label] = array(); $labels[$label][] = $foot; } } } foreach($labels as $label=>$feet) { if (in_array("left",$feet) && in_array("right",$feet)) $ab = $label; else if (in_array("left",$feet)) $ab = $label . "_L"; else if (in_array("right",$feet)) $ab = $label . "_R"; $d = $ab; $insoleOptions[] = array('abb'=>$ab,'desc'=>$d); } } function GeneratePoolFromParams(&$cadParams,&$pool,$fullkey) { if (!$cadParams) return; if (!is_object($cadParams)) $pool[$fullkey] = $cadParams; else { if ($fullkey) $fullkey .= "."; foreach(get_object_vars($cadParams) as $key => $cadParam) ManuReportHelper::GeneratePoolFromParams($cadParam,$pool,$fullkey . $key); } } static function processAttributes(&$row, &$abbs, &$insoleOptions, &$comments, &$parts) { if ($row->uuid) { ManuReportHelper::processAttributesNew($row,$abbs,$insoleOptions,$comments,$parts); return; } $shippingAddress =''; $streetAddress =''; $provinceAddress =''; $pcodeAddress = ''; $countryAddress = ''; $parts = array(); $ats = array(); if (is_array($row->attributes)) for ($l=0;$lattributes);$l++) { $attribute = $row->attributes[$l]; // Guardamos informacion en array 'ats' para calcular las piezas if (!$ats[$attribute->tyname]) $ats[$attribute->tyname] = array(); $atValue = array(); $atValue['value_left'] = $attribute->valueleft; $atValue['value_right'] = $attribute->valueright; $atValue['mvalue_left'] = $attribute->mvalueleft; $atValue['mvalue_right'] = $attribute->mvalueright; $atValue['memo_left'] = $attribute->memoleft; $atValue['memo_right'] = $attribute->memoright; $ats[$attribute->tyname][] = $atValue; $abb = array(); $text=array(); switch($attribute->tyname) { case 'JJC_AddressStreet': $streetAddress = $attribute->valueleft; break; case 'JJC_AddressProvince': $provinceAddress = $attribute->valueleft; break; case 'JJC_AddressPCode': $pcodeAddress = $attribute->valueleft; break; case 'JJC_AddressCountry': $countryAddress = $attribute->valueleft; break; case 'Lafoot_BasisModel': if (!$attribute->mvalueright) { if ($abbs[$attribute->mvalueleft]['abb']) { $abb[] = $abbs[$attribute->mvalueleft]['abb']; $text[] = $abbs[$attribute->mvalueleft]['text']; } } else { if ($abbs[$attribute->mvalueleft]['abb'] && ($abbs[$attribute->mvalueleft]['abb'] == $abbs[$attribute->mvalueright]['abb'])) { $abb[] =$abbs[$attribute->mvalueleft]['abb']; $text[] = $abbs[$attribute->mvalueleft]['text']; } else { if ($abbs[$attribute->mvalueleft]['abb']) { $abb[] = $abbs[$attribute->mvalueleft]['abb'].'_L'; $text[] = JText::_('Left'). ": " .$abbs[$attribute->mvalueleft]['text']; } if ($abbs[$attribute->mvalueright]['abb']) { $abb[] = $abbs[$attribute->mvalueright]['abb'].'_R'; $text[] = JText::_('Right'). ": " .$abbs[$attribute->mvalueright]['text']; } } } break; case 'InsoleOptions': if ($abbs[$attribute->mvalueleft]['abb'] && ($abbs[$attribute->mvalueleft]['abb'] == $abbs[$attribute->mvalueright]['abb'])) { $abb[] =$abbs[$attribute->mvalueleft]['abb']; $text[] = $abbs[$attribute->mvalueleft]['text']; } else { if ($abbs[$attribute->mvalueleft]['abb']) { $abb[] = $abbs[$attribute->mvalueleft]['abb'].'_L'; $text[] = JText::_('Left'). ": " .$abbs[$attribute->mvalueleft]['text']; } if ($abbs[$attribute->mvalueright]['abb']) { $abb[] = $abbs[$attribute->mvalueright]['abb'].'_R'; $text[] = JText::_('Right'). ": " .$abbs[$attribute->mvalueright]['text']; } } break; case 'TI_PS_ShippingAddress': $shippingAddress = trim($attribute->memoleft); break; case 'InsoleOptionsComments': case 'Lafoot_AnotherRemarks': case 'PPR_Sonstiges': case 'PODO_Remarks': if ($comments) $comments.="\n"; if (!$attribute->memoright) $comments .= $attribute->memoleft; else $comments .= JText::_('Left'). ': '.$attribute->memoleft. ' '. JText::_('Right').': '.$attribute->memoright; break; case 'TI_PS_InsoleFoot': switch((int)($attribute->valueleft)) { case 1: $abb[] = 'SOLOIZQUIERDA'; break; case 2: $abb[] = 'SOLODERECHA'; break; } break; case 'TI_PS_Palmilla': if ($attribute->valueleft=='1') $abb[] = 'PALMILLA'; break; case 'IND_MatMono': case 'IND_Produkt': case 'PPR_Produkt': case 'PPR_MatMono': case 'PPR_MatCombi': case 'PPR_MatTri': case 'PPR_MatDecke': case 'PPR_ProductionBlock': case 'PPR_SurfaceMilling': $abb[] = $attribute->mvalueleft; $text[] = $attribute->mvalueleft; break; case 'PODO_NumInsoles': case 'PPR_NumberInsoles': case 'JJC_Quantity'; $abb[] = '#'. $attribute->valueleft; $text[] = JText::_('Quantity'). ': '.$attribute->valueleft; break; case 'PPR_Versand': $abb[] = $abbs[$attribute->mvalueleft]['abb']; $text[] = $abbs[$attribute->mvalueleft]['text']; break; case 'PPR_ShoeSize': case 'ShoeSizeEU': case 'ROT_AN_ShoeSizeEU': case 'JJC_ShoeSize': $ShoeSizeEU = $attribute->valueleft; if ($attribute->valueright && $attribute->valueright!= $attribute->valueleft) { $ShoeSizeEU = 'L'.$ShoeSizeEU.' SR'. $attribute->valueright; } $ShoeSizeEU = 'S'. $ShoeSizeEU; if ($ShoeSizeEU) { $abb[] = $ShoeSizeEU; $text[] = JText::_('Size').': '.$ShoeSizeEU; } break; default: // Cojo de la lista de materiales la opcion correspondiente $option = $abbs[$attribute->tyname]; if ($option) { switch($option['type']) { case 'multi': if ($option['single']==true) { if ($attribute->mvalueleft) { $abb[] = $option['abb'] ? ($option['abb'].' ('.JText::_($attribute->mvalueleft).')'): JText::_($attribute->mvalueleft); $text[] =$option['text'] ? ($option['text'].'('.JText::_($attribute->mvalueleft).')'): JText::_($attribute->mvalueleft); } } else { if ($attribute->mvalueleft && $attribute->mvalueright && ($attribute->mvalueleft==$attribute->mvalueright)) { $abb[] = $option['abb'] ? ($option['abb'].'('.JText::_($attribute->mvalueleft).')'): JText::_($attribute->mvalueleft); $text[] = $option['text'] ? ($option['text'].'('.JText::_($attribute->mvalueleft).')'): JText::_($attribute->mvalueleft); } else { if ($attribute->mvalueleft) { if ($option['abb']) $abb[] = $option['abb'].'_L'.'('.JText::_($attribute->mvalueleft).')'; else $abb[] = JText::_($attribute->mvalueleft).'_L'; if ($option['text']) $text[] = JText::_('Left'). ": ".$option['text'].'('.JText::_($attribute->mvalueleft).')'; else $text[] = JText::_('Left'). ": ".JText::_($attribute->mvalueleft); } elseif ($attribute->mvalueright) { if ($option['abb']) $abb[] = $option['abb'].'_R'.'('.JText::_($attribute->mvalueright).')'; else $abb[] = JText::_($attribute->mvalueright).'_R'; if ($option['text']) $text[] = JText::_('Right'). ": ".$option['text'].'('.JText::_($attribute->mvalueright).')'; else $text[] = JText::_('Right'). ": ".JText::_($attribute->mvalueright); } } } break; case 'degintdepend': { $grados = array(1000,1000); $intensidad = array(-1,-1); for($k = 0 ; $k< count($row->attributes); $k++) { $att =& $row->attributes[$k]; if ($att->tyname==$attribute->tyname.'Grados') { $grados[0] = $att->valueleft; $grados[1] = $att->valueright; }else if ($att->tyname==$attribute->tyname.'Int') { switch($att->valueleft) { case 1: $intensidad[0] = 'L'; break; case 2: $intensidad[0] = 'M'; break; case 3: $intensidad[0] = 'S'; break; } switch($att->valueright) { case 1: $intensidad[1] = 'L'; break; case 2: $intensidad[1] = 'M'; break; case 3: $intensidad[1] = 'S'; break; } } } $curAbb = ''; $curText = ''; if ($attribute->valueleft=='1') { $curAbb = $option['abb'].'_L'; $curText = JText::_('Left').': '.$option['text']; if ($grados[0]!=1000) { $curAbb.= ' '.$grados[0].'º'; $curText .= ' '.$grados[0].'º'; } if ($intensidad[0]!=-1) { $curAbb.= ' '.JText::_($intensidad[0]); $curText .= ' '.JText::_($intensidad[0]); } } if ($curAbb) { $abb[] = $curAbb; $text[] = $curText; } $curAbb = ''; $curText = ''; if ($attribute->valueright=='1') { $curAbb = $option['abb'].'_R'; $curText = JText::_('Right').': '.$option['text']; if ($grados[1]!=1000) { $curAbb.= ' '.$grados[1].'º'; $curText .= ' '.$grados[1].'º'; } if ($intensidad[1]!=-1) { $curAbb.= ' '.JText::_($intensidad[1]); $curText .= ' '.JText::_($intensidad[1]); } } if ($curAbb) { $abb[] = $curAbb; $text[] = $curText; } } break; case 'mmdegdepend': { $mm = array(1000,1000); $grados = array(1000,1000); for($k = 0 ; $k< count($row->attributes); $k++) { $att =& $row->attributes[$k]; if ($att->tyname==$attribute->tyname.'Grados') { $grados[0] = $att->valueleft; $grados[1] = $att->valueright; }else if ($att->tyname==$attribute->tyname.'MM') { $mm[0] = $att->valueleft; $mm[1] = $att->valueright; } } $curAbb = ''; $curText = ''; if ($attribute->valueleft=='1') { $curAbb = $option['abb'].'_L'; $curText = JText::_('Left').': '.$option['text']; if ($grados[0]!=1000) { $curAbb.= ' '.$grados[0].'º'; $curText .= ' '.$grados[0].'º'; } if ($mm[0]!=1000) { $curAbb.= ' '.$mm[0].' mm'; $curText .= ' '.$mm[0].' mm'; } } if ($curAbb) { $abb[] = $curAbb; $text[] = $curText; } $curAbb = ''; $curText = ''; if ($attribute->valueright=='1') { $curAbb = $option['abb'].'_R'; $curText = JText::_('Right').': '.$option['text']; if ($grados[1]!=1000) { $curAbb.= ' '.$grados[1].'º'; $curText .= ' '.$grados[1].'º'; } if ($mm[1]!=1000) { $curAbb.= ' '.$mm[1].' mm'; $curText .= ' '.$mm[1].' mm'; } } if ($curAbb) { $abb[] = $curAbb; $text[] = $curText; } } break; case 'mmdepend': { $found = false; if ($option['mmatname']) $mmAtName = $option['mmatname']; else $mmAtName = $attribute->tyname.'MM'; for($k = 0 ; $k< count($row->attributes); $k++) { $att =& $row->attributes[$k]; if ($att->tyname==$mmAtName) { $found = true; if ($attribute->valueleft=='1' && $attribute->valueright=='1' && $att->valueleft == $att->valueright ) { if ($att->valueleft!='') { $abb[] = $option['abb'].$att->valueleft.'MM'; $text[] = $option['text']. " ".$att->valueleft.' mm'; } else { $abb[] = $option['abb']; $text[] = $option['text']; } } else { if ($attribute->valueleft=='1') { if ($att->valueleft!='') { $abb[] = $option['abb'].$att->valueleft.'MM_L'; $text[] = JText::_('Left'). ": ".$option['text']. " ".$att->valueleft.' mm'; } else { $abb[] = $option['abb'].'_L'; $text[] = JText::_('Left'). ": ".$option['text']; } } if ($attribute->valueright=='1') { if ($att->valueright!='') { $abb[] = $option['abb'].$att->valueright.'MM_R'; $text[] = JText::_('Right'). ": ".$option['text']. " ".$att->valueright.' mm'; } else { $abb[] = $option['abb'].'_R'; $text[] = JText::_('Right'). ": ".$option['text']; } } } } } if (!$found) { // Si no encontramos el valor de los mm por lo menos sacamos que se ha seleccionado if ($attribute->valueleft=='1' && $attribute->valueright=='1') { $abb[] = $option['abb']; $text[] = $option['text']; } elseif ($attribute->valueleft=='1') { $abb[] = $option['abb'].'_L'; $text[] = JText::_('Left').': '.$option['text']; } elseif ($attribute->valueright=='1') { $abb[] = $option['abb'].'_R'; $text[] = JText::_('Right').': '.$option['text']; } } } break; case 'mm': if ($attribute->valueleft && $attribute->valueright && ($attribute->valueleft==$attribute->valueright)) { $abb[] = $option['abb'].$attribute->valueleft.'MM'; $text[] = $option['text']. " ".$attribute->valueleft.' mm'; } else { if ($attribute->valueleft) { $abb[] = $option['abb'].$attribute->valueleft.'MM_L'; $text[] = JText::_('Left'). ": ".$option['text']. " ".$attribute->valueleft.' mm'; } if ($attribute->valueright) { $abb[] = $option['abb'].$attribute->valueright.'MM_R'; $text[] = JText::_('Right'). ": ".$option['text']. " ".$attribute->valueright.' mm'; } } break; case 'pseudoint': $options = $option['options']; foreach($options as $key => $value) { if ($attribute->valueleft == $attribute->valueright) { if ($attribute->valueleft==$key) { $abb[] = $value['abb']; $text[] = $value['text']; } } else { if ($attribute->valueleft==$key) { $abb[] = $value['abb'].'_L'; $text[] = JText::_('Left').': '.$value['text']; } if ($attribute->valueright==$key) { $abb[] = $value['abb'].'_R'; $text[] = JText::_('Right').': '.$value['text']; } } } break; case 'string': if ($attribute->valueleft==$attribute->valueright || $attribute->valueright===null) { $abb[] = $option['abb'].'('.$attribute->valueleft.')'; $text[] = $option['text']. ' ('. $attribute->valueleft.')'; } else { if ($attribute->valueleft!== null) { $abb[] = $option['abb'].'('.$attribute->valueleft.')_L'; $text[] = JText::_('Left'). ': '.$option['text']. ' ('. $attribute->valueleft.')'; } if ($attribute->valueright!== null) { $abb[] = $option['abb'].'('.$attribute->valueright.')_R'; $text[] = JText::_('Right'). ': '.$option['text']. ' ('. $attribute->valueright.')'; } } break; default: if ($attribute->valueleft=='1' && $attribute->valueright=='1') { $abb[] = $option['abb']; $text[] = $option['text']; } elseif ($attribute->valueleft=='1') { $abb[] = $option['abb'].'_L'; $text[] = JText::_('Left').': '.$option['text']; } elseif ($attribute->valueright=='1') { $abb[] = $option['abb'].'_R'; $text[] = JText::_('Right').': '.$option['text']; } } } } foreach($abb as $key =>$ab) { if ($ab) { $d = $text[$key]; if (!$d) $d = $ab; $insoleOptions[] = array('abb'=>$ab,'desc'=>$d); } } } $addressData = array(); if (SiteOptionsHelper::getFranchiseName()=='jjcorne') { if ($streetAddress) $addressData[] = $streetAddress; if ($pcodeAddress) $addressData[] = $pcodeAddress; if ($provinceAddress) $addressData[] = $provinceAddress; if ($countryAddress) $addressData[] = $countryAddress; } else { if ($shippingAddress) $addressData[] = $shippingAddress; else { if ($row->shipping_address) { if ($row->shipping_address_company) $addressData[] = "\"". $row->shipping_address_company."\""; if ($row->shipping_address_address) $addressData[] = $row->shipping_address_address; if ($row->shipping_address_city) $addressData[] = $row->shipping_address_city; if ($row->shipping_address_province) $addressData[] = $row->shipping_address_province; if ($row->shipping_address_pcode) $addressData[] = $row->shipping_address_pcode; if ($row->shipping_address_country) $addressData[] = $row->shipping_address_country; if ($row->shipping_address_phone) $addressData[] = $row->shipping_address_phone; } else { if ($row->userlocation) $addressData[] = "\"". $row->userlocation."\""; if ($row->useraddress) $addressData[] = $row->useraddress; if ($row->userpcode) $addressData[] = $row->userpcode; if ($row->usercity) $addressData[] = $row->usercity; if ($row->userprovince) $addressData[] = "(".strtoupper($row->userprovince).")"; } } if ($row->userphone) $addressData[] = $row->userphone; } $shippingAddress = implode(" ",$addressData); if ($shippingAddress) { if ($comments) $comments.="
"; $comments .= $shippingAddress; } $parts['shippingAddress'] = $shippingAddress; // Calculamos las piezas para TecnoInsole if (SiteOptionsHelper::getFranchiseName()=='tecnoinsole' || SiteOptionsHelper::getFranchiseName()=='velasco') { $insoleFoot = $ats['TI_PS_InsoleFoot'][0]['value_left']; switch((int)$insoleFoot) { case 1: $startFoot = 0; $endFoot = 0; break; case 2: $startFoot = 1; $endFoot = 1; break; default: $startFoot = 0; $endFoot = 1; } $pair3DConfort = false; // Recorremos ambos pies for ($foot=$startFoot;$foot<=$endFoot;$foot++) { $footValue = ($foot==0)?'value_left':'value_right'; $footMValue = ($foot==0)?'mvalue_left':'mvalue_right'; $footMemo = ($foot==0)?'memo_left':'memo_right'; $footName = ($foot==0)?'left':'right'; $shoeSize = $ats['ShoeSizeEU'][0][$footValue]; $options = array(); if (count($ats['InsoleOptions'])>0) foreach($ats['InsoleOptions'] as $io) if ($io[$footMValue]) $options[] = $io[$footMValue]; $footArray = array(); $antepie = array(); $retropie = array(); $shell = array(); $forro = array(); $otros = array(); $footArray['remarks'] = $ats['InsoleOptionsComments'][0][$footMemo]; // Sección SHELL $isPositivo = in_array('POSITIVO',$options); $isPP = in_array('TERMOPOLIPRO2',$options) || in_array('TERMOPOLIPRO3',$options) || in_array('TERMOPOLIPRO4',$options) || in_array('TERMOPOLIPRO5',$options); $hasAletaInterna = $ats['TI_PS_MediopieAletaInterna'][0][$footValue] == 1; $hasAletaExterna = $ats['TI_PS_MediopieAletaExterna'][0][$footValue] == 1; $isEVA = in_array('EVAMONO30',$options) || in_array('EVAMONO40',$options) || in_array('EVAMONO50',$options) || in_array('EVABI3055',$options); $is3DConfort = in_array('3DCONFORTMONO30',$options) || in_array('3DCONFORTMONO40',$options) || in_array('3DCONFORTMONO50',$options) || in_array('3DCONFORTBI3055',$options) || in_array('3DCONFORTBI4055SPORT',$options); $isFV = in_array('TERMOCARBONO15',$options); $isResina = in_array('TERMORESINAHERFLEX',$options); $isMeca = in_array('MECAABS',$options) || in_array('MECAPOLIPRO',$options) || in_array('MECAPOLIEHD',$options) || in_array('MECAPOLIPRO3SIDED',$options); $isTermo = $isFV || $isResina || $isPP; if ($is3DConfort) $pair3DConfort = true; if ($isPositivo) { $shell[] = 'POSITIVO'; } // Shell polipropileno A(2,3,4,5) N(32,35,38,42,45,48) // Shell polipropileno con aleta interna A(2,3,4,5) N(38,42,45,48) else if ($isPP) { $espesor = 'X'; if (in_array('TERMOPOLIPRO2',$options)) $espesor =2; else if (in_array('TERMOPOLIPRO3',$options)) $espesor =3; else if (in_array('TERMOPOLIPRO4',$options)) $espesor =4; else if (in_array('TERMOPOLIPRO5',$options)) $espesor =5; if ($hasAletaInterna) $sizes = array(38,42,45,48); else $sizes = array(32,35,38,42,45,48); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $tag = 'PP'; if ($hasAletaInterna) $tag .='AI'; $tag .='.A'.$espesor.'.N'.$talla; $shell[] = $tag; } // Shell fibra de vidrio 1.4 mm (blanca) N(32,35,38,42,45,48) // Shell fibra de vidrio 2.2 mm (azul) N(32,35,38,42,45,48) // Shell fibra de vidrio 1.4 mm con aleta interna(blanca) N(38,42,45,48) // Shell fibra de vidrio 2.2 mm con aleta interna(azul) N(38,42,45,48) else if ($isFV) { $type ='X'; switch($ats['TI_PS_FiberMaterial'][0][$footMValue]) { case '1,4-1,8mm blanco': case '1,4-1,8mm azul': $type = 14; break; case '2,2-2,5mm azul marino': case '2,2-2,5mm azul': $type = 22; break; } if ($hasAletaInterna) $sizes = array(38,42,45,48); else $sizes = array(32,35,38,42,45,48); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $tag = 'FV'; if ($hasAletaInterna) $tag .='AI'; $tag .='.A'.$type.'.N'.$talla; $shell[] = $tag; } // Shell resina de 1.9mm +1.3 mm N(32,35,38,42,45,48) // Shell resina de 1.9mm +1.3 mm con aleta interna N(38,42,45,48) else if ($isResina) { if ($hasAletaInterna) $sizes = array(38,42,45,48); else $sizes = array(32,35,38,42,45,48); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $tag = 'RES'; if ($hasAletaInterna) $tag .='AI'; $tag .='.N'.$talla; $shell[] = $tag; } // Bloque EVA MONO(30,40,50) BIDENSIDAD else if ($isEVA || $is3DConfort) { $tag = 'EV.'; if ((in_array('EVAMONO30',$options))||(in_array('3DCONFORTMONO30',$options))) $tag .= 'M30'; else if ((in_array('EVAMONO40',$options))||(in_array('3DCONFORTMONO40',$options))) $tag .= 'M40'; else if ((in_array('EVAMONO50',$options))||(in_array('3DCONFORTMONO50',$options))) $tag .= 'M50'; else if ((in_array('EVABI3055',$options))||(in_array('3DCONFORTBI3055',$options))) $tag .= 'B3055'; else if (in_array('3DCONFORTBI4055SPORT',$options)) $tag .='B4055SPORT'; $shell[] = $tag; } else if ($isMeca) { $tag = 'MEC.'; if (in_array('MECAABS',$options)) $tag .= 'ABS'; else if (in_array('MECAPOLIPRO',$options)) $tag .= 'PP'; else if (in_array('MECAPOLIPRO3SIDED',$options)) $tag .= 'PP3SIDED'; else if (in_array('MECAPOLIEHD',$options)) $tag .= 'POLIE'; if ($ats['TI_PS_PolyMaterialColor'][0][$footMValue]) $tag .= ' ('.JText::_($ats['TI_PS_PolyMaterialColor'][0][$footMValue]).')'; $shell[] = $tag; } // Seccion RETROPIE if ($isTermo ||$isPositivo) { // Talonera larga A(3,4,5) N(39,42,45) if ($ats['TI_PS_RetropieAlza'][0][$footValue]==1) { $altura = $ats['TI_PS_RetropieAlzaMM'][0][$footValue]; $sizes = array(39,42,45); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $retropie[] = 'TAL.A'.$altura.'.N'.$talla; } // Talonera corta A(3,4,5,10) N(33,37) if ($ats['TI_PS_RetropieTaloCorta'][0][$footValue]==1) { $altura = $ats['TI_PS_RetropieTaloCortaMM'][0][$footValue]; $sizes = array(33,37); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $retropie[] = 'TAC.A'.$altura.'.N'.$talla; } // MHS A(10) N(32,37) if ($ats['TI_PS_RetropieMedialHS'][0][$footValue]==1) { $sizes = array(32,37); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $retropie[] = 'MHS.A10.N'.$talla; } $hasCACU = in_array('TERMOPOSTMEDICACU',$options); if ($hasCACU) { // LHS+CA-CU A(5,10) N(37) if ($ats['TI_PS_RetropieLateralHS'][0][$footValue]==1) { $altura = $ats['TI_PS_RetropieLateralHSMM'][0][$footValue]; $alturas = array(5,10); $altura = ManuReportHelper::getBestSize($altura,$alturas); $retropie[] = 'LHSCACU.A'.$altura.'.N37'; } // Talonera estabilizadora + CA/CU N(37) $taloEsta =(int) $ats['TI_PS_RetropiePostEsta'][0][$footValue]; if ($taloEsta!=0) { $retropie[] = 'TACACU.N37'; } } else { // LHS A(10) N(32,37) if ($ats['TI_PS_RetropieLateralHS'][0][$footValue]==1) { $sizes = array(32,37); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $retropie[] = 'LHS.A10.N'.$talla; } } } // Relleno subcalcaneo Poron diabetc memory 3 mm if ($ats['TI_PS_RetropieRecrecido'][0][$footValue]==1 && $ats['TI_PS_RetropieRecrecidoPoron'][0][$footValue]==1) { $retropie[] = 'TADIAB.A3.N40'; } // Talonera porón shockicell transpira 3 mm azul if ($ats['TI_PS_RetropieTaloPoron'][0][$footValue]==1) $retropie[] = 'TASHOCK.A3.N40'; if ($isTermo ||$isPositivo|| $isMeca) { // Sección ANTEPIE // Barra metatarsal M(24,25,13,35,15) N(38,42,45) if ($ats['TI_PS_AntepieBarraMetaExt'][0][$footValue]==1) { $metas = $ats['TI_PS_AntepieBarraMetaExtMetas'][0][$footMValue]; $sizes = array(38,42,45); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $antepie[] = 'BAR.'.$metas.'.N'.$talla; } // Almendra retrocapital if ($ats['TI_PS_AntepieAlmendraMetaExt'][0][$footValue]==1) { $antepie[] = 'ALM'; } // Descarga herradura M(2,23,4,5,1) N(38,42,45) if ($ats['TI_PS_AntepieDescargas'][0][$footValue]==2) // Descarga en herradura de materail semirigido { $metas = $ats['TI_PS_AntepieDescHerrEVAMetas'][0][$footMValue]; $poron = $ats['TI_PS_AntepieDescHerrEVAPoron'][0][$footValue]; $sizes = array(38,42,45); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $tag = 'HER'; if ($poron==1) $tag.='POR'; $tag .= '.'.$metas.'.N'.$talla; $antepie[] = $tag; } // Cuña cinética N(38,42,45) if ($ats['TI_PS_AntepieKineticWedge'][0][$footValue]==1) { $sizes = array(38,42,45); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $antepie[] = 'KIN.N'.$talla; } // Cuña pronadora de antepie A(3,4) N(32,35,38,42,45) if ($ats['TI_PS_AntepieCunaPro'][0][$footValue]==1) { $sizes = array(32,35,38,42,45); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $antepie[] = 'CUPRO.A3.N'.$talla; } // Cuña supinadora de antepie A(3,4) N(38,42,45) if ($ats['TI_PS_AntepieCunaSup'][0][$footValue]==1) { $sizes = array(38,42,45); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $antepie[] = 'CUSUP.A3.N'.$talla; } // Expansion de 2º-5º mtt N(38,42,45) if ($ats['TI_PS_AntepieExpansion'][0][$footValue]==1) { $sizes = array(38,42,45); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $antepie[] = 'EXP.M25.N'.$talla; } // Relleno subcapital de porón N(38,42,45) if ($ats['TI_PS_AntepieDescargas'][0][$footValue]==4) { $sizes = array(38,42,45); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $antepie[] = 'ANPOR.N'.$talla; } } // Seccion FORRO // Forro EVA A(1,2,3) N(32,35,38,42,45,48) if (in_array('FORRADOEVA2',$options) || in_array('FORRADOEVA3',$options)) { $sizes = array(32,35,38,42,45,48); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $espesor ='X'; $color = ''; if (in_array('FORRADOEVA2',$options)) { $color = $ats['TI_PS_FORRADOColorEVA2'][0][$footMValue]; $espesor = 2; } else if (in_array('FORRADOEVA3',$options)) { $color = $ats['TI_PS_FORRADOColorEVA3'][0][$footMValue]; $espesor = 3; } else if (in_array('FORRADOEVA1',$options)) { $color = $ats['TI_PS_FORRADOColorEVA1'][0][$footMValue]; $espesor = 1; } $forro[] = 'FEV.A'.$espesor.'.N'.$talla.'('.$color.')'; } // Forro Poron Shockicell Transpira A(1.5,3) N(38,42,45,48) if (in_array('FORRADOSHOCKICEL',$options)) { $sizes = array(38,42,45,48); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $espesor = 'X'; if ($ats['TI_PS_FORRADOColorShockIcel'][0][$footMValue]=='Verde 1,5 mm') $espesor = '15'; else if ($ats['TI_PS_FORRADOColorShockIcel'][0][$footMValue]=='Azul 3 mm') $espesor = '30'; $forro[] = 'FSHOCK.A'.$espesor.'.N'.$talla; } // Forro Poron Diabetic Memory A(3) N(38,42,45,48) if (in_array('FORRADOPORONMEMORY',$options)) { $sizes = array(38,42,45,48); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $forro[] = 'FDIAB.A30.N'.$talla; } // Forro Plastazote A(3) N(38,42,45,48) if (in_array('FORRADOPLASTAZOTE',$options)) { $sizes = array(38,42,45,48); $talla = ManuReportHelper::getBestSize($shoeSize,$sizes); $forro[] = 'FPLAS.A30.N'.$talla; } // Forro Técnico EVAGRIP 25 3mm. Color naranja if ($ats['TI_PS_FORRADOEvaGrip25_3mm'][0][$footValue]==1) $forro[] = 'FEVAGRIP25_NARANJA_3'; if ($ats['TI_PS_FORRADOTEC35RF25GRIS'][0][$footValue]==1) $forro[] = 'FEVARB25_GRIS_3,5'; if ($ats['TI_PS_FORRADOTEC2SANVERDE'][0][$footValue]==1) $forro[] = 'FEVASANIT_VERDE_2'; if ($ats['TI_PS_FORRADOTEC3SANVERDE'][0][$footValue]==1) $forro[] = 'FEVASANIT_VERDE_3'; if ($ats['TI_PS_FORRADOTEC3AZULCOB'][0][$footValue]==1) $forro[] = 'FEVASP25_COBALTO_3'; if ($ats['TI_PS_FORRADOTEC3VARIOS'][0][$footValue]==1) $forro[] = 'FEVATECNVARIOS_3'; if ($ats['TI_PS_FORRADOEST2VARIOS'][0][$footValue]==1) $forro[] = 'FEVAVARIOS_2'; if ($ats['TI_PS_FORRADOEST3VARIOS'][0][$footValue]==1) $forro[] = 'FEVAVARIOS_3'; if ($ats['TI_PS_FORRADOMICFCAMEL'][0][$footValue]==1) $forro[] = 'FTEXTCAMEL'; if ($ats['TI_PS_FORRADOMICFTABACO'][0][$footValue]==1) $forro[] = 'FTEXTTABACO'; if ($ats['TI_PS_FORRADOMICFCRUDO'][0][$footValue]==1) $forro[] = 'FTEXTCRUDO'; if ($ats['TI_PS_FORRADOMICFPERFBEIGE'][0][$footValue]==1) $forro[] = 'FTEXTPERFBEIGE'; if ($ats['TI_PS_FORRADOMICFVARIOS'][0][$footValue]==1) $forro[] = 'FTEXTVARIOS'; if ($ats['TI_PS_FORRADOPIEL'][0][$footValue]==1) $forro[] = 'FPIEL'; // Seccion OTROS // Forrado a 3/4 if ($ats['TI_PS_FORRADO34'][0][$footValue]==1) $otros[] = 'FORRADO34'; if ($ats['TI_PS_Unfinished'][0][$footValue]==1) $otros[] = 'SEMIACABADA'; if ($isTermo || $isMeca || $isPositivo) { // Extension de Morton de material rígido if ($ats['TI_PS_AntepieMortonRigid'][0][$footValue]==1) $otros[] = 'EXTMORTON.RIGID'; // Extension de Morton de EVA if ($ats['TI_PS_AntepieMortonEVA'][0][$footValue]==1) { $altura = $ats['TI_PS_AntepieMortonEVAMM'][0][$footValue]; $tag = 'EXTMORTON.EVA'; if ($altura) $tag.='.A'.$altura; $otros[] = $tag; } // Internal Heel Cup A(MM) if ($ats['TI_PS_RetropieInternalHeelCup'][0][$footValue]==1) { $altura = $ats['TI_PS_RetropieInternalHeelCupMM'][0][$footValue]; $otros[] = 'INCUP.A'.$altura; } // External Heel Cup A(MM) if ($ats['TI_PS_RetropieExternalHeelCup'][0][$footValue]==1) { $altura = $ats['TI_PS_RetropieExternalHeelCupMM'][0][$footValue]; $otros[] = 'EXCUP.A'.$altura; } // Total Heel Cup A(MM) if ($ats['TI_PS_RetropieTotalHeelCup'][0][$footValue]==1) { $altura = $ats['TI_PS_RetropieTotalHeelCupMM'][0][$footValue]; $otros[] = 'TOTCUP.A'.$altura; } // Sin cazoletas if (($ats['TI_PS_RetropieExternalHeelCup'][0][$footValue]==0) && ($ats['TI_PS_RetropieInternalHeelCup'][0][$footValue]==0) && ($ats['TI_PS_RetropieTotalHeelCup'][0][$footValue]==0)) { $otros[] = 'NOCAZ'; } if ($ats['TI_PS_MediopieRellenoAFascial'][0][$footValue] ==1) $otros[] = 'MEDPOR'; if ($ats['InsoleCADCoverProject'][0][$footValue] == 1) $otros[] = JText::_('MILLEDCOVER'); if ($isTermo) { // Talonera estabilizadora de EVA switch($ats['TI_PS_RetropiePostEsta'][0][$footValue]) { case 1: $otros[] = 'ESTAEVA'; break; case 2: $otros[] = 'FUSIONTECH'; break; } } } // Aleta interna if ($hasAletaInterna) $otros[] = 'ALETAI'; // Aleta externa if ($hasAletaExterna) $otros[] = 'ALETAEX'; // Estabilización ALI if (in_array('TERMOPOSTMEDIALI',$options)) $otros[] = 'ESTABALI'; // Estabilización CACU if (in_array('TERMOPOSTMEDICACU',$options)) $otros[] = 'ESTABCACU'; // 3D Confort if ($is3DConfort) $otros[] = '3DCONFORT'; $footArray['forefoot']= $antepie; $footArray['backfoot'] = $retropie; $footArray['general'] = $shell; $footArray['cover'] = $forro; $footArray['other'] = $otros; $footArray['size'] = $shoeSize; $parts[$footName] = $footArray; } if ($pair3DConfort) $insoleOptions[] = array('abb'=>'3DCONFORT','desc'=>'3DCONFORT'); } } static function calculateCashOnDelivery(&$row) { $price = round($row->batch_price,2); $taxes = round($price* ($row->batch_taxpercent+$row->batch_equivalence_charge)/100.0,2) + round($row->batch_shipping_cost*$row->batch_shipping_vat/100.0,2); $subtotal = round($price + $row->batch_shipping_cost + $taxes ,2); $payAmount = round($subtotal * $row->batch_payment_inc_cost /100.0,2); $almostTotal = round($subtotal + $payAmount,2); $discountAmount =round($almostTotal* $row->batch_discount,2); $totalPrice =round($almostTotal - $discountAmount,2); return $totalPrice; } } ?>