//--No direct access
defined('_JEXEC') or die('=;)');
define('NUM_ATTRIBUTE_FOLDERS',255);
define('NUM_RESOURCE_FOLDERS',255);
jimport('joomla.utilities.date');
jimport('joomla.application.component.controller');
include_once(JPATH_BASE."/components/com_vxc/helpers/db.php");
include_once(JPATH_BASE."/components/com_vxc/helpers/siteoptionshelper.php");
include_once(JPATH_BASE."/components/com_vxc/helpers/manureporthelper.php");
include_once(JPATH_BASE.'/components/com_vxc/helpers/numbertoletterhelper.php');
include_once(JPATH_BASE.'/components/com_vxc/controllers/myaccount.php');
include_once(JPATH_BASE.'/components/com_vxc/helpers/rtf.php');
include_once(JPATH_BASE."/components/com_vxc/helpers/legacy.php");
include_once(JPATH_BASE."/components/com_vxc/helpers/json.php");
include_once(JPATH_BASE.'/components/com_vxc/helpers/commonpath.php');
class vxcControllerVoxelService extends vxcControllerMyAccount {
var $TICKET =array();
var $_SESSION = array();
var $curTicket;
function __construct(&$config=array())
{
parent::__construct($config);
define('COMM_NONE', 0);
define('COMM_CRYPT', 1);
define('COMM_ZIP', 2);
define('COMM_DECRYPT', 4);
define('COMM_UNZIP', 8);
}
function display()
{
$document =& JFactory::getDocument();
$viewType = $document->getType();
$viewName = JRequest::getCmd( 'view', $this->getName() );
$view = & $this->getView( $viewName, $viewType, '', array( 'base_path'=>$this->_basePath));
$this->avoidDisplay=true;
parent::display();
}
///////////////////////////////////////////////////////////////////////
// funciones helper de manejo de FTP... Las copio aqui del fichero ftp.php segun sugerencia de JUAN
// asi se evita hacer includes innecesarios.
function ftpget(&$userId,$localfile,$remotefile) {
$resourceLibraryConnection=LegacyHelper::getPHPGlobalVar('resourceLibraryConnection');
if(!$resourceLibraryConnection)
return false;
$ftpserver = $resourceLibraryConnection['host'];
$ftplogin = $resourceLibraryConnection['login'];
$ftppass = $resourceLibraryConnection['password'];
$ftpport = $resourceLibraryConnection['port'];
$ftpremotePath = $resourceLibraryConnection['basePath'] . "$userId/$remotefile";
/*
$ftpserver ="reconstruct-perpedes.rothballer.de";
$ftplogin = "perpedes";
$ftppass = "ftpreconstruct";
$ftpport = 21;
$ftpremotePath = "/httpdocs/upload/$userId/$remotefile"; */
$res = true;
$ftpcon = @ftp_connect($ftpserver,$ftpport);
if ($ftpcon===FALSE)
{
$this->VLog('ftp_connect failed...');
return false;
}
if (!@ftp_login($ftpcon, $ftplogin,$ftppass))
{
$this->VLog('ftp_login failed...');
return false;
}
@ftp_pasv ($ftpcon, true);
//$this->VLog('ftp_get: remotefile: ' .print_r($remotefile,true));
//$this->VLog('ftp_get: localfile: ' .print_r($localfile,true));
//$this->VLog('ftp_get: remotePath: ' .print_r($ftpremotePath,true));
// compruebo si existe el fichero
if(@ftp_size($ftpcon, $ftpremotePath)!=-1)
{
if (!@ftp_get($ftpcon, $localfile, $ftpremotePath,FTP_BINARY))
{
$this->VLog('ftp_get failed...');
$res = false;
}
}
else
{
$this->VLog('ftp_get: not find ' .print_r($ftpremotePath,true));
$res=false;
}
@ftp_close($ftpcon);
//$this->VLog('ftp_get OK...');
return $res;
}
function ftpput(&$userId,$filename) {
return false;
/*$ftpserver ="reconstruct-perpedes.rothballer.de";
$ftplogin = "perpedes";
$ftppass = "ftpreconstruct";
$ftpport = 21;
$ftpremotePath = "/httpdocs/upload/$userId/$filename";
$ftpcon = @ftp_connect($ftpserver,$ftpport);
if ($ftpcon===FALSE)
return false;
if (!@ftp_login($ftpcon, $ftplogin,$ftppass))
return false;
@ftp_pasv($ftpcon, true);
if (!@ftp_put($ftpcon, $remotePath, $filename, FTP_BINARY))
return false;
@ftp_close($ftpcon);
return true;*/
}
function ftp_is_dir($ftpcon, $dir) {
if (@ftp_chdir($ftpcon, $dir)) {
@ftp_chdir($ftpcon, '..');
return true;
} else {
return false;
}
}
function ftplistDir($ftpcon,$path){
// funcion recursiva para la generacion del listado de ficheros...
$list = @ftp_nlist($ftpcon, $path);
$res = array();
foreach($list as $f){
if($this->ftp_is_dir($ftpcon,$f)==true)
{
$recurRes=$this->ftplistDir($ftpcon,$f);
foreach($recurRes as $r)
$res[]=$r;
}
else $res[]=$f;
}
return $res;
}
function ftplist(&$userId) {
$resourceLibraryConnection=LegacyHelper::getPHPGlobalVar('resourceLibraryConnection');
if(!$resourceLibraryConnection)
return false;
$ftpserver = $resourceLibraryConnection['host'];
$ftplogin = $resourceLibraryConnection['login'];
$ftppass = $resourceLibraryConnection['password'];
$ftpport = $resourceLibraryConnection['port'];
$ftpremotePath = $resourceLibraryConnection['basePath'] . "$userId/";
/* $ftpserver ="reconstruct-perpedes.rothballer.de";
$ftplogin = "perpedes";
$ftppass = "ftpreconstruct";
$ftpremotePath = "/httpdocs/upload/{$userId}/";
$ftpport = 21;*/
$ftpcon = @ftp_connect($ftpserver,$ftpport);
if ($ftpcon===FALSE)
{
$this->VLog('ftpconnect failed...');
return array();
}
if (!@ftp_login($ftpcon, $ftplogin,$ftppass))
{
$this->VLog('ftplogin failed...');
return array();
}
@ftp_pasv($ftpcon, true);
// compruebo si existe el directorio
$fulllist = array();
if($this->ftp_is_dir($ftpcon,$ftpremotePath)==true)
{
$fulllist = $this->ftplistDir($ftpcon, $ftpremotePath);
}
else
{
$this->VLog('ftp_list : directory ' .print_r($ftpremotePath,true) .' not exists');
}
// miro lo que me devuelve el list...
$list=array();
if(count($fulllist)>0)
{
// Elimino de la lista el basePath...
$basel=strlen($ftpremotePath);
foreach($fulllist as $f)
{
$list[]=substr($f,$basel);
}
}
// cerrar la conexi?n ftp
@ftp_close($ftpcon);
return $list;
}
function ftpdelete(&$userId,$remotefile) {
$resourceLibraryConnection=LegacyHelper::getPHPGlobalVar('resourceLibraryConnection');
if(!$resourceLibraryConnection)
return false;
$ftpserver = $resourceLibraryConnection['host'];
$ftplogin = $resourceLibraryConnection['login'];
$ftppass = $resourceLibraryConnection['password'];
$ftpport = $resourceLibraryConnection['port'];
$ftpremotePath = $resourceLibraryConnection['basePath'] . "$userId/$remotefile";
/* $ftpserver ="reconstruct-perpedes.rothballer.de";
$ftplogin = "perpedes";
$ftppass = "ftpreconstruct";
$ftpport = 21;
$ftpremotePath = "/httpdocs/upload/$userId/$remotefile"; */
$ftpcon = @ftp_connect($ftpserver,$ftpport);
if ($ftpcon===FALSE)
{
$this->VLog('ftp_connect failed...');
return false;
}
if (!@ftp_login($ftpcon, $ftplogin,$ftppass))
{
$this->VLog('ftp_login failed...');
return false;
}
$res = true;
//$this->VLog('ftp_delete: remotePath: ' .print_r($ftpremotePath,true));
// compruebo si existe el fichero
if(@ftp_size($ftpcon, $ftpremotePath)!=-1)
{
if (!@ftp_delete($ftpcon, $ftpremotePath))
{
$this->VLog('ftp_delete failed...');
$res=false;
}
}
else
{
$this->VLog('ftp_delete: not find ' .print_r($ftpremotePath,true));
$res=false;
}
@ftp_close($ftpcon);
return $res;
}
///////////////////////////////////////////////////////////////////////
function DeleteUserRBResource(&$msg) {
/*
Host: reconstruct-perpedes.rothballer.de
FTP-User: perpedes
Password: ftpreconstruct
Directory: upload
npars.setValue("Who","datauploader2plugin");
npars.setValue("ResourceToDelete_L",m_rbSelectedResource_L.c_str());
npars.setValue("ResourceToDelete_R",m_rbSelectedResource_R.c_str());
*/
// Esta funcion sera solo para la conexion con el ftp secreto de rothballer
// y me borrara los recursos seleccionados y guardados desde el pluging
$model =&$this->getModel('voxelservice');
$userId = $msg['Request.Params.CustomerID'];
$who = $msg['Request.Params.Who'];
$remoteFile_L=$msg['Request.Params.ResourceToDelete_L'];
$remoteFile_R=$msg['Request.Params.ResourceToDelete_R'];
$res_L=$this->ftpdelete($userId, $remoteFile_L);
$res_R=$this->ftpdelete($userId, $remoteFile_R);
$this->SetData("Result_L",$res_L);
$this->SetData("Result_R",$res_R);
}
function InitDataUploader(&$msg) {
// obtenemos el orderUUID... y con eso y mediante tecnicas ocultas el customerID.
// de las globals el resourceLibrary
$orderUUID = $msg['Request.Params.orderUUID'];
//$this->VLog('initDataUploader: orderUUID: ' .print_r($orderUUID,true));
$resourceLibrary=LegacyHelper::getPHPGlobalVar('resourceLibrary');
$customerID="NOID";
//$this->VLog('initDataUploader: resourceLibrary: ' .print_r($resourceLibrary,true));
$modelOrder =& $this->getModel('order');
$modelUser =& $this->getModel('user');
$modelUser->SetId(LegacyHelper::getUserId());
$userData = $modelUser->getData();
$orderId = $modelOrder->getOrderIdFromUUID($orderUUID);
if ($orderId) {
//$this->VLog('initDataUploader: orderId: ' .print_r($orderId,true));
$modelOrder->SetId($orderId);
switch($userData->username) {
case "rockadmin":
case "rothballer": break;
default:
$resourceLibrary = FALSE;
}
if ($resourceLibrary) {
$atts =& $modelOrder->getAttributes();
foreach($atts as $at) {
//$this->VLog('initDataUploader: orderId: ' .print_r($at->name,true));
switch($at->name) {
// busco el parametro del customerID
case 'patient.localid':
if ($at->value) {
$customerID = $at->value;
}
break;
}
}
}
}
$this->SetData("resourceLibrary",$resourceLibrary);
$this->SetData("customerID",$customerID);
}
function GetUserRBResource(&$msg) {
/*
Host: reconstruct-perpedes.rothballer.de
FTP-User: perpedes
Password: ftpreconstruct
Directory: upload
npars.setValue("Who","datauploader2plugin");
npars.setValue("Type",""); // quiza resource??
npars.setValue("Path",rbSelectedResource);
npars.setValueInt("RequestFoot",foot);
*/
// Esta funcion sera solo para la conexion con el ftp secreto de rothballer
// y me devolvera el fichero seleccionado.
$model =&$this->getModel('voxelservice');
$userId = $msg['Request.Params.CustomerID'];
$requestFoot=$msg['Request.Params.RequestFoot'];
$remotefile=$msg['Request.Params.Path'];
// obtenemos un nombre temporal de fichero
$localfile = tempnam(sys_get_temp_dir(), 'FOO'); // good
// pedimos al ftp el fichero y que se guarde en el temporal
$content = '';
if($this->ftpget($userId, $localfile, $remotefile)==true) {
$model->GetFile($localfile, $content, COMM_CRYPT | COMM_ZIP);
}
// aqui obtenemos el recurso.
//$content = file_get_contents($localfile);
@unlink($localfile);
//y listo.
$type='FootPrint';
$this->SetData("RequestFoot",$requestFoot);
$this->SetData('Type',$type);
if ($content!==FALSE)
{
//$model->EncodeBase64($content);
$this->SetData('Data_B',$content);
}
}
function GetUserRBTree(&$msg) {
/*
Host: reconstruct-perpedes.rothballer.de
FTP-User: perpedes
Password: ftpreconstruct
Directory: upload
*/
// Esta funcion sera solo para la conexion con el ftp secreto de rothballer
// y me devolvera el listado recursivo desde el directorio del userId
$model =&$this->getModel('voxelservice');
$userId = $msg['Request.Params.CustomerID'];
$requestFoot=$msg['Request.Params.RequestFoot'];
$list = $this->ftplist($userId);
//$this->VLog('list: ' .print_r($list,true));
//$this->VLog('userId: ' .print_r($userId,true));
//$this->VLog('requestFoot: ' .print_r($requestFoot,true));
$nfiles=count($list);
$this->SetData("RequestFoot",$requestFoot);
if($nfiles==0)
$this->SetData("FileList_B","");
else
{
sort($list);
// recorro el array y voy generando la cadena fileList
$slist="";
$findex=0;
foreach($list as $lentry)
{
//$this->VLog('lentry: ' .print_r($lentry,true));
$slist=$slist.$lentry;
if($findex<$nfiles-1)
$slist=$slist.':';
$findex++;
}
//$this->VLog('slist: ' .print_r($slist,true));
$model->EncodeBase64($slist);
//$this->VLog('slist64: ' .print_r($slist,true));
$this->SetData("FileList_B",$slist);
}
}
function GetDirectoryList(&$msg) {
$model =&$this->getModel('voxelservice');
//$this->VLog("GetDirectoryList");
//$this->VLog($commondir);
$relpath = $msg['Request.Params.Path'];
$calculateCRC = ($msg['Request.Params.CalculateCRC32'] == 'true');
//$this->VLog('msg: ' .print_r($msg,true));
// $this->VLog($path);
$contents = array();
$useCommonInS3 = LegacyHelper::getPHPGlobalVar("useCommonInS3");
if ($useCommonInS3) {
$model->GetVxCommonDirectoryList($relpath,$contents, $calculateCRC);
}
else {
$commondir = $model->GetCommonDir();
$path = LegacyHelper::getCommonParentFolder().$commondir."/".$relpath;
$model->GetDirectoryList($path,$contents,$calculateCRC);
}
//$this->VLog('contents: ' .print_r($contents,true));
$fileCount = count($contents['files']);
$dirCount = count($contents['dirs']);
$this->SetData('FileCount',$fileCount);
$this->SetData('DirCount',$dirCount);
// $this->VLog($fileCount . ' '. $dirCount);
for ($i=0;$i<$fileCount;$i++)
{
$name = $contents['files'][$i]['name'];
$crc = $contents['files'][$i]['crc'];
$size = $contents['files'][$i]['size'];
$etag = $contents['files'][$i]['etag'];
$fullname = $path . '/'.$name;
$model->EncodeBase64($name);
$model->EncodeBase64($fullname);
$this->SetData('File'.$i.'.Name_B',$name);
$this->SetData('File'.$i.'.FullName_B',$fullname);
if ($calculateCRC)
$this->SetData('File'.$i.'.CRC32',$crc);
if($etag)
$this->SetData('File'.$i.'.ETag',$etag);
$this->SetData('File'.$i.'.Size',$size);
}
for ($i=0;$i<$dirCount;$i++) {
$name = $contents['dirs'][$i]['name'];
$model->EncodeBase64($name);
$this->SetData('Dir'.$i.'.Name_B',$name);
}
}
function VideoAnalysisInit(&$msg)
{
$this->GetLanguage($msg);
$orderId = $msg['Request.Params.OrderId'];
if ($orderId)
{
$modelOrder =& $this->getModel('order');
$modelOrder->SetId($orderId);
$atts =& $modelOrder->getAttributes();
$count =0;
foreach( $atts as $att)
{
if ($att->typename != 'BB1Scan' && $att->typename!= 'FootPrint') continue;
$this->SetData("Resource$count.Id",$att->id);
$this->SetData("Resource$count.Type",$att->typename);
$count ++;
}
$this->SetData('ResourceCount',$count);
}
}
function GetLanguage(&$msg) {
$jsonObj = $this->getMVCParams($msg);
if (LegacyHelper::getNewMode() && $jsonObj && $jsonObj->user && $jsonObj->user->lang) {
$lang = LegacyHelper::getOldLanguageCode($jsonObj->user->lang);
}else {
$modelUser =& $this->getModel('user');
$lang = $modelUser->getLanguage();
}
if ($lang) {
$lang = explode('-',$lang);
$lang = $lang[0];
}
$language = 'english';
switch($lang)
{
case 'en': $language = 'english'; break;
case 'es': $language = 'spanish'; break;
case 'de': $language = 'german'; break;
case 'nl': $language = 'dutch'; break;
case 'jp': $language = 'japanese'; break;
}
$this->SetData('language',$language);
}
function SetResourceTranslation(&$msg)
{
$resid = $msg['Request.Params.Id'];
$language = $msg['Request.Params.Language'];
$translation = $msg['Request.Params.Translation_B'];
$model =&$this->getModel('voxelservice');
$model->DecodeBase64($translation);
$modelResources =& $this->getModel('resourcetranslations');
$modelResources->setTranslation($resid, $language, $translation);
}
function GetLanguages() {
$modelLanguages =& $this->getModel('languages');
$model =&$this->getModel('voxelservice');
$languages =& $modelLanguages->getData();
$this->SetData('Count', count($languages));
$i=0;
foreach($languages as $lang)
{
$this->SetData("Language$i.Id",$lang->id);
$model->EncodeBase64($lang->name);
$this->SetData("Language$i.Name_B",$lang->name);
$i++;
}
}
function GetResourceTranslations(&$msg) {
$resId = $msg['Request.Params.Id'];
$model =&$this->getModel('voxelservice');
$modelResourcesT =& $this->getModel('resourcetranslations');
$translations =& $modelResourcesT->getDataByResId($resId);
$this->SetData('Count',count($translations));
$i=0;
foreach($translations as $trans)
{
$this->SetData("Translation$i.Language",$trans->language);
$model->EncodeBase64($trans->value);
$this->SetData("Translation$i.Value_B",$trans->value);
$i++;
}
$this->SetData('Id',$resId);
}
// Pasamos los orderIds separados por comas
function GetOrderCAMProperties($orderIds)
{
$data = array();
$orderArray = explode(',',$orderIds);
$casts = array();
$franchiseName = SiteOptionsHelper::getFranchiseName();
switch($franchiseName)
{
case 'tecnoinsole':
$casts[] = 'PU-Strip';
$casts[] = 'Molde 33.5 Fenix VAC';
break;
}
$data['AvailableCastCount'] = count($casts);
$i=0;
foreach($casts as $item)
{
$data["AvailableCast$i"] = $item;
$i++;
}
$this->GetMillingOrderData($orderArray,$data,true);
$model =& $this->getModel('voxelservice');
// Enviamos los atributos en la estructura $poolToBeSent
$this->SetData('Info.Count',count($data));
$i=0;
foreach($data as $key=>$item)
{
$prefix = 'Info.Item'.$i;
$model->EncodeBase64($key);
$this->SetData($prefix.'.Key_B',$key);
$model->EncodeBase64($item);
$this->SetData($prefix.'.Value_B',$item);
$i++;
}
}
function GetMillingOrderData(&$orderArray,&$data,$isCAM)
{
$franchiseName = SiteOptionsHelper::getFranchiseName();
$modelOrder =& $this->getModel('order');
// Recorremos los pedidos
foreach($orderArray as $orderId)
{
$orderData = array();
$orderData[0] = array();
$orderData[1] = array();
for ($foot = 0;$foot<2;$foot++)
{
$orderData[$foot]['Disabled'] = null;
$orderData[$foot]['Material'] = null;
$orderData[$foot]['Sore'] = null;
$orderData[$foot]['PathPrecision'] = null;
$orderData[$foot]['TwoSidesMilling'] = null;
$orderData[$foot]['Block'] = null;
}
$modelOrder->SetId($orderId);
$atts =& $modelOrder->getAttributes();
switch($franchiseName)
{
case 'rotterdam':
case 'ppr':
$type = "";
foreach($atts as $att)
{
if ($att->typename=='PPR_EinlagenVarianten')
{
$type = $att->mvalueleft;
}
}
if ($type == 'Positive cast')
{
}
else
{
foreach($atts as $att)
{
switch($att->typename)
{
case 'PPR_MatMono':
$value = $att->mvalueleft;
switch($value)
{
case '40 Sh;Grau;EVA':
$orderData[0]['Material'] = 'EVA';
$orderData[0]['Sore'] = '40';
$orderData[0]['Block'] = 'OvalMonoGray';
break;
case '50 Sh;Blau;EVA':
$orderData[0]['Material'] = 'EVA';
$orderData[0]['Sore'] = '50';
$orderData[0]['Block'] = 'OvalMonoBlue';
break;
case '30 Sh;Rot;EVA':
$orderData[0]['Material'] = 'EVA';
$orderData[0]['Sore'] = '30';
$orderData[0]['Block'] = 'OvalMonoRed';
break;
}
break;
case 'PPR_MatCombi':
$value = $att->mvalueleft;
switch($value)
{
case '30/50 Sh;Schwarz/Kork;EVA/Kork' :
$orderData[0]['Material'] = 'EVA';
$orderData[0]['Sore'] = '30/50';
$orderData[0]['Block'] = 'OvalCombiBlackCork';
break;
case '40/60 Sh;Grau/Schwarz;EVA/EVA' :
$orderData[0]['Material'] = 'EVA';
$orderData[0]['Sore'] = '40/60';
$orderData[0]['Block'] = 'OvalCombiGrayBlack';
break;
case '30/50 Sh;Grau/Blau;EVA/EVA' :
$orderData[0]['Material'] = 'EVA';
$orderData[0]['Sore'] = '30/50';
$orderData[0]['Block'] = 'OvalCombiGrayBlue';
break;
}
break;
case 'PPR_MatTri':
$value = $att->mvalueleft;
switch($value)
{
case '40/25 Sh;Grau/Orange;EVA/EVA':
$orderData[0]['Material'] = 'EVA';
$orderData[0]['Sore'] = '40/25/55';
$orderData[0]['Block'] = 'OvalTriGrayOrangeBlue';
break;
case '50/20 Sh;Blau/Hellblau;EVA/EVA':
$orderData[0]['Material'] = 'EVA';
$orderData[0]['Sore'] = '50/20/60';
$orderData[0]['Block'] = 'OvalTriBlueLightBlueBlack';
break;
case '50/30 Sh;Blau/Rot;EVA/EVA':
$orderData[0]['Material'] = 'EVA';
$orderData[0]['Sore'] = '50/30/60';
$orderData[0]['Block'] = 'OvalTriBlueRedBlack';
break;
}
break;
}
}
}
break;
case 'tecnoinsole':
case 'velasco':
foreach($atts as $att)
{
switch($att->typename)
{
case 'InsoleOptions':
for ($foot = 0;$foot<2;$foot++)
{
$value = ($foot==0)?$att->mvalueleft:$att->mvalueright;
switch($value)
{
case 'MECAABS':
$orderData[$foot]['Material'] = 'ABS';
break;
case 'MECAPOLIEHD':
$orderData[$foot]['Material'] = 'Polyethylene';
break;
case 'MECAPOLIPRO':
case 'MECAPOLIPRO3SIDED':
$orderData[$foot]['Material'] = 'Polypropylene';
break;
case 'TERMOPOLIPRO2':
case 'TERMOPOLIPRO3':
case 'TERMOPOLIPRO4':
case 'TERMOPOLIPRO5':
case 'TERMOPOLIET3':
case 'TERMOPOLIET4':
$orderData[$foot]['Material'] = 'Polypropylene';
break;
case 'TERMOCARBONO15':
case 'TERMORESINAFLUX':
case 'TERMORESINAFLEX':
case 'TERMORESINAFLUXFLEX':
case 'TERMORESINAHERFLEX':
case 'POSITIVO':
$orderData[$foot]['Material'] = 'Polyurethane';
break;
case '3DCONFORTMONO30':
case 'EVAMONO30':
$orderData[$foot]['Material'] = 'EVA';
$orderData[$foot]['Sore'] = '30';
// $orderData[$foot]['Block'] = 'OvalMonoWhite';
break;
case '3DCONFORTMONO40':
case 'EVAMONO40':
$orderData[$foot]['Material'] = 'EVA';
$orderData[$foot]['Sore'] = '40';
// $orderData[$foot]['Block'] = 'OvalCork';
break;
case 'EVAMONO55':
$orderData[$foot]['Material'] = 'EVA';
$orderData[$foot]['Sore'] = '55';
// $orderData[$foot]['Block'] = 'OvalMonoWhite';
break;
case '3DCONFORTBI4055SPORT':
$orderData[$foot]['Material'] = 'EVA';
$orderData[$foot]['Sore'] = '40/55';
break;
case '3DCONFORTBI3055':
case 'EVABI3055':
$orderData[$foot]['Material'] = 'EVA';
$orderData[$foot]['Sore'] = '30/55';
// $orderData[$foot]['Block'] = 'OvalCombiGrayWhite';
break;
}
}
break;
case 'TI_PS_InsoleFoot':
switch($att->value_left)
{
case '1':
$orderData[0]['Disabled'] = 'false';
$orderData[1]['Disabled'] = 'true';
break;
case '2':
$orderData[0]['Disabled'] = 'true';
$orderData[1]['Disabled'] = 'false';
break;
default:
$orderData[0]['Disabled'] = $orderData[1]['Active'] = 'false';
}
break;
}
}
break;
}
// Si alguna variable del segundo pie no esta especificada, lo tomamos del pie izquierdo
foreach($orderData[1] as $key=>$item)
if ($key!='Disabled' && $item===null)
$orderData[1][$key] = $orderData[0][$key];
// Relleno la estructura a mandar al cliente
for ($foot = 0;$foot<2;$foot++)
{
$footS = ($foot==0)?'_L':'_R';
foreach($orderData[$foot] as $key=>$item)
if ($item!==null)
$data["$orderId{$footS}.{$key}"] = $item;
}
$data["$orderId.letter"] = NumberToLetterHelper::GetLetterFromId($orderId);
}
}
function NewGetOrderSummary(&$msg)
{
// $this->VLog('NewGetOrderSummary: '.print_r($msg,true));
$orderUUID = $msg['Request.Params.OrderId'];
$modelOrder =& $this->getModel('order');
$orderId = $modelOrder->getOrderIdFromUUID($orderUUID);
if (!$orderId) return;
// $this->VLog('tenemos orderid: '.$orderId);
$model =& $this->getModel('voxelservice');
$modelOrder->SetId($orderId);
$order =& $modelOrder->getData();
$orderData = array();
$orderData['id'] = $order->id;
$orderData['username'] = $order->username;
$orderData['patientname'] = $order->customerfullname;
$orderData['manuopts'] = array();
$insoleOptions = array();
$comments = '';
$parts = array();
$atts =& $modelOrder->getAttributes();
// $this->VLog('Attributes: '.print_r($atts,true));
$cadParams = new stdClass();
$doctorParams = new stdClass();
$json = new Services_JSON();
foreach($atts as $at) {
switch($at->name) {
case 'cad.params':
if ($at->value)
$cadParams = $json->decode($at->value);
break;
case 'doctor.params':
if ($at->value)
$doctorParams =$json->decode($at->value);
break;
}
}
// $this->VLog('cadParams: ' .print_r($cadParams,true));
$template = $cadParams->TemplateName;
$cadParams->Template = '';
if ($template) {
$modelResource =& $this->getModel('resource');
$resId = $modelResource->getTemplateFromName($template);
if ($resId)
$cadParams->Template ='r'. $resId;
}
// $this->VLog('TEmplate:'. $template);
$orderArray = array($orderId);
$millingOrderData = array();
$this->GetMillingOrderData($orderArray,$millingOrderData,false);
// $this->VLog('MillingOrderData: '. print_r($millingOrderData,true));
// Enviamos los atributos en la estructura $poolToBeSent
$pool = array();
$poolDoctor = array();
$this->GeneratePoolFromParams($cadParams,$pool,'');
$this->GeneratePoolFromParams($doctorParams,$poolDoctor,'');
// $this->VLog('Generado pool');
if (!$orderData['tratamientos'])
$orderData['tratamientos']= array();
function startswith1($haystack, $needle) {
return substr($haystack, 0, strlen($needle)) === $needle;
}
$comments = '';
$tags = array('left'=>array() , 'right'=>array());
$sections = array(
'forefoot'=>array('text'=>'ieForefoot'),
'backfoot'=>array('text'=>'ieBackfoot'),
'other'=>array('text'=>'ieOther'),
'midfoot'=>array('text'=>'ieMidfoot'),
'general'=>array('text'=>'ieGeneral'),
'remarks'=>array('text'=>'ieRemarks'),
'cover'=>array('text'=>'ieCover')
);
// $this->VLog('Procesando pool doctor');
foreach($poolDoctor as $key=>$value) {
if (substr($key, 0, strlen("remarks")) === "remarks") {
if (strpos($key, "left")!==FALSE)
$comments .= "left: $value ";
else
$comments .= "right: $value ";
}
else {
$keyParts = explode(".",$key);
$foot = '';
$section ='';
$tagName = '';
$tagPart = '';
if (count($keyParts)>0)
$section =$keyParts[0];
if (count($keyParts)>1) {
$tagName = $keyParts[1];
if (count($keyParts)>2) {
if ($keyParts[2]=="left" || $keyParts[2] == "right") {
$foot = $keyParts[2];
if (count($keyParts)>3) {
$tagPart =$keyParts[3];
}
}
else {
$tagPart =$keyParts[2];
}
}
}
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;
}
}
// $this->VLog('Procesando tags');
// $this->VLog('Procesando tags2');
if (is_array($tags)) {
// $this->VLog('Procesando tags3');
foreach($tags as $foot => $footInfo) {
// $this->VLog('Procesando tags4');
$footText = '';
switch($foot) {
case "left": $footText = "ieLeft"; break;
case "right": $footText = "ieRight"; break;
}
if (is_array($footInfo) && count($footInfo)>0) {
// $this->VLog('Procesando tags5'.$foot);
foreach($footInfo as $section => $sectionInfo) {
// $this->VLog('Procesando tags6');
if (is_array($sectionInfo)) {
// $this->VLog('Procesando tags67'.$section);
foreach($sectionInfo as $tagName => $tagInfo) {
// $this->VLog('Procesando tags68'.$tagName);
if (!is_array($tagInfo))
continue;
// $this->VLog('Procesando tags69'.print_r($tagInfo['label'],true));
$label = LegacyHelper::translate($tagInfo["label"]);
if (!$label) continue;
// $this->VLog('Procesando tags610');
if (isset($tagInfo["mm"]))
$label .= " ".$tagInfo["mm"]. " mm";
if (isset($tagInfo["degrees"]))
$label .= " ".$tagInfo["degrees"]. " º";
if (isset($tagInfo["metas"]))
$label .= " M".$tagInfo["metas"];
if (isset($tagInfo["intensity"])) {
$int ='';
$intensity = (int) $tagInfo["intensity"];
switch($intensity) {
case 1:
$int = "ieLight";
break;
case 2:
$int = "ieMedium";
break;
case 3:
$int = "ieSevere";
break;
}
if ($int)
$label .= " Int: ".LegacyHelper::translate($int);
}
if (isset($tagInfo["header"]))
$label = LegacyHelper::translate($tagInfo["header"]) . " (". $label.")";
$realSection = LegacyHelper::translate($sections[$section]["text"]);
if ($foot)
$realSection .= " (". LegacyHelper::translate($footText).")";
// $this->VLog('Procesando tags611');
$orderData['tratamientos'][] = "$realSection: $label";
// $this->VLog('Procesando tags612');
}
}
}
}
}
}
// $this->VLog('Procesando tags7');
// $this->VLog('Recopilando');
$orderData['manuremarks'] = $comments;
$richContent = $msg['Request.Params.RichContent'];
$cadInfo = array();
$cadInfo[] = array( JText::_('Id') , $orderData['id']);
$cadInfo[] = array( JText::_('User') , $orderData['username']);
$cadInfo[] = array( JText::_('Patient') , $orderData['patientname']);
// $cadInfo[] = array( JText::_('MANUFACTURING OPT.') , $orderData['manuopts']);
$cadInfo[] = array( JText::_('Exploration') , $orderData['tratamientos']);
$cadInfo[] = array( JText::_('Remarks') , $orderData['manuremarks']);
$text = '';
// $this->VLog('Procesando');
if ($richContent == 'true') {
$rtf = new RTFFile();
foreach($cadInfo as $line)
{
$rtf->SetOtherFormatTextFile(1,0,0);
$rtf->AddText($line[0].': ');
$rtf->SetOtherFormatTextFile(0,0,0);
if (is_array($line[1]))
{
$typeContent = array();
$typeContent[''] = array();
foreach($line[1] as $lineContent) {
$lineArray = explode(':',$lineContent);
if (count($lineArray)!=2)
{
$typeContent[''][] = $lineContent;
}
else
{
if (!$typeContent[$lineArray[0]])
$typeContent[$lineArray[0]] = array();
$typeContent[$lineArray[0]][] = $lineArray[1];
}
}
foreach($typeContent as $key => $value)
{
$rtf->SetOtherFormatTextFile(0,0,1);
$rtf->AddText(JText::_($key));
$rtf->InsertLine();
foreach($value as $vl)
{
$rtf->SetOtherFormatTextFile(0,0,0);
$rtf->AddText(JText::_($vl));
$rtf->InsertLine();
}
$rtf->InsertLine();
}
}
else
$rtf->AddText(JText::_($line[1]));
$rtf->InsertLine();
}
$rtf->CloseFile();
$text = $rtf->GetFile();
}
else
{
foreach($cadInfo as $line)
{
if (is_array($line[1]))
{
$opts = '';
foreach($line[1] as $vl)
{
if ($opts) $opts.= "\n";
$vl = JText::_($vl);
$opts .= $vl;
}
$text .= JText::_($line[0]) . ': '. $opts . "\n";
}
else
$text .= JText::_($line[0]) . ': '. JText::_($line[1]) . "\n";
}
}
// $this->VLog('Codificamos repuesta');
$model->EncodeBase64($text);
// $this->VLog('SetDAta');
$this->SetData('Data_B',$text);
// $this->VLog('Pool '.print_r($pool,true));
$pool['DeleteUnspecifiedOperations'] = 'true';
$i=0;
foreach($pool as $key=>$item) {
$prefix = 'Info.Item'.$i;
$model->EncodeBase64($key);
$model->EncodeBase64($item);
$this->SetData($prefix.'.Key_B',$key);
$this->SetData($prefix.'.Value_B',$item);
$i++;
}
$this->SetData('Info.Count',$i);
}
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)
$this->GeneratePoolFromParams($cadParam,$pool,$fullkey . $key);
}
}
function GetOrderSummary(&$msg)
{
$orderId = $msg['Request.Params.OrderId'];
if (!(int)$orderId) return;
$atType = $msg['Request.Params.AtType'];
$model =& $this->getModel('voxelservice');
$modelOrder =& $this->getModel('order');
$modelOrder->SetId($orderId);
$manorders =& $this->getModel('manufacturingorders');
$order =& $modelOrder->getData();
$atts =& $modelOrder->getAttributes();
$mats =& $manorders->getMaterials(true);
$orderData = array();
$orderData['id'] = $order->id;
$orderData['username'] = $order->username;
$orderData['patientname'] = $order->customerfullname;
$orderData['manuopts'] = array();
$poolToBeSent = array();
$franchiseName = SiteOptionsHelper::getFranchiseName();
$checks= array();
$mms= array();
$ops = array();
switch($franchiseName)
{
case 'velasco':
case 'tecnoinsole':
{
$poolToBeSent['template.AdicionLateral.left.on'] =
$poolToBeSent['template.AdicionLateral.right.on'] =
$poolToBeSent['template.AdicionLateral.left.on'] =
$poolToBeSent['template.AdicionLateral.right.on'] =
$poolToBeSent['template.AdicionMedial.left.on'] =
$poolToBeSent['template.AdicionMedial.right.on'] =
$poolToBeSent['template.AdicionPosteroLateral.left.on'] =
$poolToBeSent['template.AdicionPosteroLateral.right.on'] =
$poolToBeSent['template.MedialHeelSkive.left.on'] =
$poolToBeSent['template.MedialHeelSkive.right.on'] =
$poolToBeSent['template.LateralHeelSkive.left.on'] =
$poolToBeSent['template.LateralHeelSkive.right.on'] =
$poolToBeSent['template.BalanceInvertido.left.on'] =
$poolToBeSent['template.BalanceInvertido.right.on'] =
$poolToBeSent['template.Balance.left.on'] =
$poolToBeSent['template.Balance.right.on'] =
$poolToBeSent['template.BalanceEvertido.left.on'] =
$poolToBeSent['template.BalanceEvertido.right.on'] =
$poolToBeSent['template.Almendra.left.on'] =
$poolToBeSent['template.Almendra.right.on'] =
$poolToBeSent['template.BarraMetatarsal.left.on'] =
$poolToBeSent['template.BarraMetatarsal.right.on'] =
$poolToBeSent['template.DescargaM1.left.on'] =
$poolToBeSent['template.DescargaM1.right.on'] =
$poolToBeSent['template.DescargaM2.left.on'] =
$poolToBeSent['template.DescargaM2.right.on'] =
$poolToBeSent['template.DescargaM3.left.on'] =
$poolToBeSent['template.DescargaM3.right.on'] =
$poolToBeSent['template.DescargaM4.left.on'] =
$poolToBeSent['template.DescargaM4.right.on'] =
$poolToBeSent['template.DescargaM5.left.on'] =
$poolToBeSent['template.DescargaM5.right.on'] =
$poolToBeSent['template.DescargaTotalAntepie.left.on'] =
$poolToBeSent['template.DescargaTotalAntepie.right.on'] =
$poolToBeSent['template.AcomodacionFascial.left.on'] =
$poolToBeSent['template.AcomodacionFascial.right.on'] =
$poolToBeSent['template.DescargaSubcalcanea.left.on'] =
$poolToBeSent['template.DescargaSubcalcanea.right.on'] =
$poolToBeSent['template.Alza.left.on'] =
$poolToBeSent['template.Alza.right.on'] =
$poolToBeSent['template.AlzaMetas.left.on'] =
$poolToBeSent['template.AlzaMetas.right.on'] =
$poolToBeSent['template.AlzaCalcaneo.left.on'] =
$poolToBeSent['template.AlzaCalcaneo.right.on'] =
$poolToBeSent['template.CunyaAntepie.left.on'] =
$poolToBeSent['template.CunyaAntepie.right.on'] =
$poolToBeSent['template.CunyaAntepiePro.left.on'] =
$poolToBeSent['template.CunyaAntepiePro.right.on'] =
$poolToBeSent['template.CunyaAntepieSup.left.on'] =
$poolToBeSent['template.CunyaAntepieSup.right.on'] =
$poolToBeSent['template.CunyaRetropie.left.on'] =
$poolToBeSent['template.CunyaRetropie.right.on'] =
$poolToBeSent['template.BarraMetatarsalP.left.on'] =
$poolToBeSent['template.BarraMetatarsalP.right.on'] =
$poolToBeSent['template.HerraduraP.left.on'] =
$poolToBeSent['template.HerraduraP.right.on'] =
$poolToBeSent['template.DescargaM1P.left.on'] =
$poolToBeSent['template.DescargaM1P.right.on'] =
$poolToBeSent['template.DescargaM2P.left.on'] =
$poolToBeSent['template.DescargaM2P.right.on'] =
$poolToBeSent['template.DescargaM3P.left.on'] =
$poolToBeSent['template.DescargaM3P.right.on'] =
$poolToBeSent['template.DescargaM4P.left.on'] =
$poolToBeSent['template.DescargaM4P.right.on'] =
$poolToBeSent['template.DescargaM5P.left.on'] =
$poolToBeSent['template.DescargaM5P.right.on'] =
$poolToBeSent['template.DescensoMedialALI.left.on'] =
$poolToBeSent['template.DescensoMedialALI.right.on'] =
$poolToBeSent['template.DescensoLateralALE.left.on'] =
$poolToBeSent['template.DescensoLateralALE.right.on'] =
$poolToBeSent['template.AnyadirBorde.left.on'] =
$poolToBeSent['template.AnyadirBorde.right.on'] =
$poolToBeSent['template.AlmendraP.left.on'] =
$poolToBeSent['template.AlmendraP.right.on'] =
$poolToBeSent['template.AlzaP.left.on'] =
$poolToBeSent['template.AlzaP.right.on'] =
$poolToBeSent['template.BajarALI.left.on'] =
$poolToBeSent['template.BajarALI.right.on'] =
$poolToBeSent['template.RefuerzoArco.left.on'] =
$poolToBeSent['template.RefuerzoArco.right.on'] =
$poolToBeSent['template.RefuerzoArcoExterno.left.on'] =
$poolToBeSent['template.RefuerzoArcoExterno.right.on'] =
$poolToBeSent['template.RefuerzoLateral.left.on'] =
$poolToBeSent['template.RefuerzoLateral.right.on'] =
$poolToBeSent['template.TaloneraRecta.left.on'] =
$poolToBeSent['template.TaloneraRecta.right.on'] =
$poolToBeSent['template.TaloneraCorta.left.on'] =
$poolToBeSent['template.TaloneraCorta.right.on'] =
$poolToBeSent['template.Herradura.left.on'] =
$poolToBeSent['template.Herradura.right.on'] =
$poolToBeSent['template.TaloneraIntCorta.left.on'] =
$poolToBeSent['template.TaloneraIntCorta.right.on'] =
$poolToBeSent['template.TaloneraIntMedia.left.on'] =
$poolToBeSent['template.TaloneraIntMedia.right.on'] =
$poolToBeSent['template.TaloneraIntLarga.left.on'] =
$poolToBeSent['template.TaloneraIntLarga.right.on'] =
$poolToBeSent['template.TaloneraExtCorta.left.on'] =
$poolToBeSent['template.TaloneraExtCorta.right.on'] =
$poolToBeSent['template.TaloneraExtMedia.left.on'] =
$poolToBeSent['template.TaloneraExtMedia.right.on'] =
$poolToBeSent['template.TaloneraExtLarga.left.on'] =
$poolToBeSent['template.TaloneraExtLarga.right.on'] =
$poolToBeSent['template.AlineaMoldeSuelo.left.on'] =
$poolToBeSent['template.AlineaMoldeSuelo.right.on'] =
$poolToBeSent['template.BrandsoleMan.left.on'] =
$poolToBeSent['template.BrandsoleMan.right.on'] =
$poolToBeSent['template.InnerBrandsoleMan.left.on'] =
$poolToBeSent['template.InnerBrandsoleMan.right.on'] =
$poolToBeSent['template.BrandsoleWoman.left.on'] =
$poolToBeSent['template.BrandsoleWoman.right.on'] =
$poolToBeSent['template.InnerBrandsoleWoman.left.on'] =
$poolToBeSent['template.InnerBrandsoleWoman.right.on'] =
$poolToBeSent['template.Agujeros.left.on'] =
$poolToBeSent['template.Agujeros.right.on'] =
$poolToBeSent['template.VaciadoTalonN.left.on'] =
$poolToBeSent['template.VaciadoTalonN.right.on'] =
$poolToBeSent['template.VaciadoTalonS.left.on'] =
$poolToBeSent['template.VaciadoTalonS.right.on'] =
'false';
break;
}
case 'rotterdam':
{
$poolToBeSent['template.JJ_PelotII.left.on'] =
$poolToBeSent['template.JJ_PelotII.right.on'] =
$poolToBeSent['template.JJ_TPelot.left.on'] =
$poolToBeSent['template.JJ_TPelot.right.on'] =
$poolToBeSent['template.JJ_Rctb.left.on'] =
$poolToBeSent['template.JJ_Rctb.right.on'] =
$poolToBeSent['template.JJ_pronation.left.on'] =
$poolToBeSent['template.JJ_pronation.right.on'] =
$poolToBeSent['template.JJ_HeelSupport.left.on'] =
$poolToBeSent['template.JJ_HeelSupport.right.on'] =
$poolToBeSent['template.JJ_RaiseMiddle.left.on'] =
$poolToBeSent['template.JJ_RaiseMiddle.right.on'] =
$poolToBeSent['template.JJ_WedgeVarus.left.on'] =
$poolToBeSent['template.JJ_WedgeVarus.right.on'] =
$poolToBeSent['template.JJ_WedgeValgus.left.on'] =
$poolToBeSent['template.JJ_WedgeValgus.right.on'] =
$poolToBeSent['template.JJ_Wedge.left.on'] =
$poolToBeSent['template.JJ_Wedge.right.on'] =
$poolToBeSent['template.JJ_HeelSpurHole.left.on'] =
$poolToBeSent['template.JJ_HeelSpurHole.right.on'] =
$poolToBeSent['template.JJ_RaiseMedialArch.left.on'] =
$poolToBeSent['template.JJ_RaiseMedialArch.right.on'] =
$poolToBeSent['template.Brandsole_sport_outer.left.on'] =
$poolToBeSent['template.Brandsole_sport_outer.right.on'] =
$poolToBeSent['template.Brandsole_sport_inner.left.on'] =
$poolToBeSent['template.Brandsole_sport_inner.right.on'] =
$poolToBeSent['template.Brandsole_216_outer.left.on'] =
$poolToBeSent['template.Brandsole_216_outer.right.on'] =
$poolToBeSent['template.Brandsole_216_inner.left.on'] =
$poolToBeSent['template.Brandsole_216_inner.right.on'] =
$poolToBeSent['template.Brandsole_trendy_outer.left.on'] =
$poolToBeSent['template.Brandsole_trendy_outer.right.on'] =
$poolToBeSent['template.Brandsole_trendy_inner.left.on'] =
$poolToBeSent['template.Brandsole_trendy_inner.right.on'] =
'false';
break;
}
case 'jjcorne':
{
$orderType = '';
$shoeType = '';
$footType = '';
$activity = '';
$poolToBeSent['template.MP1.left.on'] =
$poolToBeSent['template.MP1.right.on'] =
$poolToBeSent['template.MP5.left.on'] =
$poolToBeSent['template.MP5.right.on'] =
$poolToBeSent['template.TUPM5.left.on'] =
$poolToBeSent['template.TUPM5.right.on'] =
$poolToBeSent['template.Pelot234.left.on'] =
$poolToBeSent['template.Pelot234.right.on'] =
$poolToBeSent['template.Heel.left.on'] =
$poolToBeSent['template.Heel.right.on'] =
$poolToBeSent['template.M-Arch.left.on'] =
$poolToBeSent['template.M-Arch.right.on'] =
$poolToBeSent['template.L-Arch.left.on'] =
$poolToBeSent['template.L-Arch.right.on'] =
$poolToBeSent['template.Brandsole_sport_outer.left.on'] =
$poolToBeSent['template.Brandsole_sport_outer.right.on'] =
$poolToBeSent['template.Brandsole_sport_inner.left.on'] =
$poolToBeSent['template.Brandsole_sport_inner.right.on'] =
$poolToBeSent['template.Brandsole_ladytrendy_outer.left.on'] =
$poolToBeSent['template.Brandsole_ladytrendy_outer.right.on'] =
$poolToBeSent['template.Brandsole_ladytrendy_inner.left.on'] =
$poolToBeSent['template.Brandsole_ladytrendy_inner.right.on'] =
$poolToBeSent['template.Brandsole_trendy_outer.left.on'] =
$poolToBeSent['template.Brandsole_trendy_outer.right.on'] =
$poolToBeSent['template.Brandsole_trendy_inner.left.on'] =
$poolToBeSent['template.Brandsole_trendy_inner.right.on'] =
'false';
}
case 'india':
case 'voxelcare':
case 'ppr':
{
$poolToBeSent['template.PPR_Pelot.left.on'] =
$poolToBeSent['template.PPR_Pelot.right.on'] =
$poolToBeSent['template.PPR_PelotII.left.on'] =
$poolToBeSent['template.PPR_PelotII.right.on'] =
$poolToBeSent['template.PPR_TPelot.left.on'] =
$poolToBeSent['template.PPR_TPelot.right.on'] =
$poolToBeSent['template.PPR_Rctb.left.on'] =
$poolToBeSent['template.PPR_Rctb.right.on'] =
$poolToBeSent['template.PPR_HeelSupport.left.on'] =
$poolToBeSent['template.PPR_HeelSupport.right.on'] =
$poolToBeSent['template.PPR_RaiseMiddle.left.on'] =
$poolToBeSent['template.PPR_RaiseMiddle.right.on'] =
$poolToBeSent['template.PPR_WedgeVarus.left.on'] =
$poolToBeSent['template.PPR_WedgeVarus.right.on'] =
$poolToBeSent['template.PPR_WedgeValgus.left.on'] =
$poolToBeSent['template.PPR_WedgeValgus.right.on'] =
$poolToBeSent['template.PPR_ToeElement.left.on'] =
$poolToBeSent['template.PPR_ToeElement.right.on'] =
$poolToBeSent['template.PPR_Wedge.left.on'] =
$poolToBeSent['template.PPR_Wedge.right.on'] =
$poolToBeSent['template.PPR_HeelSpurHole.left.on'] =
$poolToBeSent['template.PPR_HeelSpurHole.right.on'] =
$poolToBeSent['template.PPR_RaiseMedialArch.left.on'] =
$poolToBeSent['template.PPR_RaiseMedialArch.right.on'] =
$poolToBeSent['template.InnerBrandsole.left.on'] =
$poolToBeSent['template.InnerBrandsole.right.on'] =
$poolToBeSent['template.PPR_BottomFinishing.left.on'] =
$poolToBeSent['template.PPR_BottomFinishing.right.on'] =
$poolToBeSent['template.PPR_Toegrip.left.on'] =
$poolToBeSent['template.PPR_Toegrip.right.on'] =
$poolToBeSent['template.PPR_Sensopelotte.left.on'] =
$poolToBeSent['template.PPR_Sensopelotte.right.on'] =
$poolToBeSent['template.PPR_Rearpelot_Links.left.on'] =
$poolToBeSent['template.PPR_Rearpelot_Links.right.on'] =
$poolToBeSent['template.PPR_Rearpelot_Right.left.on'] =
$poolToBeSent['template.PPR_Rearpelot_Right.right.on'] =
'false';
break;
}
case 'jjpodo':
{
$poolToBeSent['template.RCMS.left.on'] =
$poolToBeSent['template.RCMS.right.on'] =
$poolToBeSent['template.RCTB.left.on'] =
$poolToBeSent['template.RCTB.right.on'] =
$poolToBeSent['template.PronerendeRCTB.left.on'] =
$poolToBeSent['template.PronerendeRCTB.right.on'] =
$poolToBeSent['template.SupinerendeRCTB.left.on'] =
$poolToBeSent['template.SupinerendeRCTB.right.on'] =
$poolToBeSent['template.ACT.left.on'] =
$poolToBeSent['template.ACT.right.on'] =
$poolToBeSent['template.RCTC.left.on'] =
$poolToBeSent['template.RCTC.right.on'] =
$poolToBeSent['template.SubAntro.left.on'] =
$poolToBeSent['template.SubAntro.right.on'] =
$poolToBeSent['template.SubAntroII_IV.left.on'] =
$poolToBeSent['template.SubAntroII_IV.right.on'] =
$poolToBeSent['template.SupinerendeSubAntro.left.on'] =
$poolToBeSent['template.SupinerendeSubAntro.right.on'] =
$poolToBeSent['template.PronerendeSubAntro.left.on'] =
$poolToBeSent['template.PronerendeSubAntro.right.on'] =
$poolToBeSent['template.SA_kort.left.on'] =
$poolToBeSent['template.SA_kort.right.on'] =
$poolToBeSent['template.SA_lang_bol.left.on'] =
$poolToBeSent['template.SA_lang_bol.right.on'] =
$poolToBeSent['template.PA.left.on'] =
$poolToBeSent['template.PA.right.on'] =
$poolToBeSent['template.PASC_a.left.on'] =
$poolToBeSent['template.PASC_a.right.on'] =
$poolToBeSent['template.PASC_b.left.on'] =
$poolToBeSent['template.PASC_b.right.on'] =
$poolToBeSent['template.SD.left.on'] =
$poolToBeSent['template.SD.right.on'] =
$poolToBeSent['template.PT.left.on'] =
$poolToBeSent['template.PT.right.on'] =
$poolToBeSent['template.MiC.left.on'] =
$poolToBeSent['template.MiC.right.on'] =
$poolToBeSent['template.SN.left.on'] =
$poolToBeSent['template.SN.right.on'] =
$poolToBeSent['template.HAi_kort.left.on'] =
$poolToBeSent['template.HAi_kort.right.on'] =
$poolToBeSent['template.HAi_lang.left.on'] =
$poolToBeSent['template.HAi_lang.right.on'] =
$poolToBeSent['template.SS.left.on'] =
$poolToBeSent['template.SS.right.on'] =
$poolToBeSent['template.SC_bol.left.on'] =
$poolToBeSent['template.SC_bol.right.on'] =
$poolToBeSent['template.SC_hol.left.on'] =
$poolToBeSent['template.SC_hol.right.on'] =
$poolToBeSent['template.StabPosterior.left.on'] =
$poolToBeSent['template.StabPosterior.right.on'] =
$poolToBeSent['template.PPSa.left.on'] =
$poolToBeSent['template.PPSa.right.on'] =
$poolToBeSent['template.SPSa.left.on'] =
$poolToBeSent['template.SPSa.right.on'] =
$poolToBeSent['template.CV.left.on'] =
$poolToBeSent['template.CV.right.on'] =
$poolToBeSent['template.AnP.left.on'] =
$poolToBeSent['template.AnP.right.on'] =
$poolToBeSent['template.SPSi.left.on'] =
$poolToBeSent['template.SPSi.right.on'] =
$poolToBeSent['template.JJ_HeelThickness.left.on'] =
$poolToBeSent['template.JJ_HeelThickness.right.on'] =
$poolToBeSent['template.JJ_PelotII.left.on'] =
$poolToBeSent['template.JJ_PelotII.right.on'] =
$poolToBeSent['template.JJ_TPelot.left.on'] =
$poolToBeSent['template.JJ_TPelot.right.on'] =
$poolToBeSent['template.JJ_Distal_pronation.left.on'] =
$poolToBeSent['template.JJ_Distal_pronation.right.on'] =
$poolToBeSent['template.JJ_HeelSupport.left.on'] =
$poolToBeSent['template.JJ_HeelSupport.right.on'] =
$poolToBeSent['template.JJ_HeelSupportII.left.on'] =
$poolToBeSent['template.JJ_HeelSupportII.right.on'] =
$poolToBeSent['template.JJ_WedgeVarus.left.on'] =
$poolToBeSent['template.JJ_WedgeVarus.right.on'] =
$poolToBeSent['template.JJ_WedgeValgus.left.on'] =
$poolToBeSent['template.JJ_WedgeValgus.right.on'] =
$poolToBeSent['template.JJ_Wedge.left.on'] =
$poolToBeSent['template.JJ_Wedge.right.on'] =
$poolToBeSent['template.JJ_HeelSpurHole.left.on'] =
$poolToBeSent['template.JJ_HeelSpurHole.right.on'] =
$poolToBeSent['template.JJ_RaiseMiddle.left.on'] =
$poolToBeSent['template.JJ_RaiseMiddle.right.on'] =
$poolToBeSent['template.PPR_BottomFinishing.left.on'] =
$poolToBeSent['template.PPR_BottomFinishing.right.on'] =
$poolToBeSent['template.Brandsole_sport_outer.left.on'] =
$poolToBeSent['template.Brandsole_sport_outer.right.on'] =
$poolToBeSent['template.Brandsole_sport_inner.left.on'] =
$poolToBeSent['template.Brandsole_sport_inner.right.on'] =
$poolToBeSent['template.Brandsole_216_outer.left.on'] =
$poolToBeSent['template.Brandsole_216_outer.right.on'] =
$poolToBeSent['template.Brandsole_216_inner.left.on'] =
$poolToBeSent['template.Brandsole_216_inner.right.on'] =
$poolToBeSent['template.Brandsole_trendy_outer.left.on'] =
$poolToBeSent['template.Brandsole_trendy_outer.right.on'] =
$poolToBeSent['template.Brandsole_trendy_inner.left.on'] =
$poolToBeSent['template.Brandsole_trendy_inner.right.on'] =
$poolToBeSent['template.Brandsole_ladytrendy_outer.left.on'] =
$poolToBeSent['template.Brandsole_ladytrendy_outer.right.on'] =
$poolToBeSent['template.Brandsole_ladytrendy_inner.left.on'] =
$poolToBeSent['template.Brandsole_ladytrendy_inner.right.on'] =
$poolToBeSent['template.Brandsole_F_outer.left.on'] =
$poolToBeSent['template.Brandsole_F_outer.right.on'] =
$poolToBeSent['template.Brandsole_F_inner.left.on'] =
$poolToBeSent['template.Brandsole_F_inner.right.on'] =
$poolToBeSent['template.Brandsole_H_outer.left.on'] =
$poolToBeSent['template.Brandsole_H_outer.right.on'] =
$poolToBeSent['template.Brandsole_H_inner.left.on'] =
$poolToBeSent['template.Brandsole_H_inner.right.on'] =
'false';
$ats = array( array('PODO_F_RCMS','RCMS'),
array('PODO_F_RCTB','RCTB'),
array('PODO_F_ProRCTB','PronerendeRCTB'),
array('PODO_F_SupRCTB','SupinerendeRCTB'),
array('PODO_F_ACT','ACT'),
array('PODO_F_RCTC','RCTC'),
array('PODO_F_SubAntro','SubAntro'),
array('PODO_F_SubAntroII_IV','SubAntroII_IV'),
array('PODO_F_SupSubAntro','SupinerendeSubAntro'),
array('PODO_F_ProSubAntro','PronerendeSubAntro'),
array('PODO_F_SAkort','SA_kort'),
array('PODO_F_SAlang','SA_lang_bol'),
array('PODO_F_PA','PA'),
// PASC va aparte
array('PODO_F_SD','SD'),
array('PODO_F_PT','PT'),
array('PODO_F_MiC','MiC'),
array('PODO_F_SN','SN'),
array('PODO_F_HAikort','HAi_kort'),
array('PODO_F_HAilang','HAi_lang'),
array('PODO_F_SS','SS'),
array('PODO_F_SCbol','SC_bol'),
array('PODO_F_SChol','SC_hol'),
array('PODO_F_StabPosterior','StabPosterior'),
array('PODO_F_PPSa','PPSa'),
array('PODO_F_SPSa','SPSa'),
array('PODO_F_CV','CV'),
array('PODO_F_AnP','AnP'),
array('PODO_F_SPSi','SPSi'),
array('PODO_F_HeelThickness','JJ_HeelThickness'),
array('PODO_3D_PelotII','JJ_PelotII'),
array('PODO_3D_TPelot','JJ_TPelot'),
array('PODO_3D_RCTB','RCTB'),
array('PODO_3D_MiC','MiC'),
array('PODO_3D_DistalPro','JJ_Distal_pronation'),
array('PODO_3D_HeelSupport','JJ_HeelSupport'),
array('PODO_3D_HeelSupportII','JJ_HeelSupportII'),
array('PODO_3D_WedgeVarus','JJ_WedgeVarus'),
array('PODO_3D_WedgeValgus','JJ_WedgeValgus'),
array('PODO_3D_Wedge','JJ_Wedge'),
array('PODO_3D_HeelSpurHole','JJ_HeelSpurHole'),
array('PODO_3D_HeelThickness','JJ_HeelThickness')
);
$i=0;
foreach($ats as $at)
{
$checks[$i] = $at[0];
$mms[$i] = $at[0].'MM';
$ops[$i] = $at[1];
$poolToBeSent['template.'.$ops[$i].'.left.on'] = 'false';
$poolToBeSent['template.'.$ops[$i].'.right.on'] = 'false';
$i++;
}
break;
}
}
$poolToBeSent['HeightLimit.left'] = $poolToBeSent['HeightLimit.right'] ='';
$pprEinlageVarianten ='';
$pprModel ='';
$pprCustomModel='';
$pprBrandsole ='';
$pprIsLowCup =false;
$pprInsoleCup ='';
$antepieCunaProActive_L = $antepieCunaSupActive_L = $retropieCunaProActive_L = $retropieCunaSupActive_L = false;
$antepieCunaProActive_R = $antepieCunaSupActive_R = $retropieCunaProActive_R = $retropieCunaSupActive_R = false;
$isEVA = $isEVAL = $isEVAR= false;
$isMeca = $isMecaL = $isMecaR = false;
$isMeca3Sided = $isMeca3SidedL = $isMeca3SidedR = false;
$isPalmilla = false;
$shoeSizeL = $shoeSizeR = -1;
$tipoTaloneraL = -1; $tipoTaloneraR = -1;
$femaleSizeCorrection = false;
$descargaMetasL = $descargaMetasR = false;
$balanceLOn= $balanceROn = false;
$balanceL = $balanceR = -1;
$balanceAngleL = $balanceAngleR = 0;
$balanceBiasL = $balanceBiasR = 0;
$modelSettings =& $this->getModel('settings');
$descensoArcoALIOffset = $modelSettings->getVar('descensoArcoALIOffset',-1.5);
foreach($atts as $att)
{
switch($franchiseName)
{
case 'velasco':
case 'tecnoinsole':
switch($att->typename)
{
case 'TI_PS_MakeHoles':
$poolToBeSent['template.Agujeros.left.on'] =($att->value_left == '1')?'true':'false';
$poolToBeSent['template.Agujeros.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_MediopieBalanceEVA':
$poolToBeSent['template.Balance.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.Balance.right.on'] =($att->value_right == '1')?'true':'false';
if ($poolToBeSent['template.Balance.left.on']=='true')
$balanceLOn = true;
if ($poolToBeSent['template.Balance.right.on']=='true')
$balanceROn = true;
break;
case 'TI_PS_MediopieBalanceEVATipo':
$poolToBeSent['template.Balance.left.fromInner'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.Balance.right.fromInner'] =($att->value_right == '1')?'true':'false';
if ($att->value_left == '1')
$balanceL = 1;
else
$balanceL = 2;
if ($att->value_right == '1')
$balanceR = 1;
else
$balanceR = 2;
break;
case 'TI_PS_MediopieBalanceEVAGrados':
$poolToBeSent['template.Balance.left.angle'] = $balanceAngleL = $att->value_left;
$poolToBeSent['template.Balance.right.angle'] =$balanceAngleR = $att->value_right;
break;
case 'TI_PS_MediopieBalanceEVAInt':
$balanceBiasL = $att->value_left;
$balanceBiasR = $att->value_right;
break;
case 'TI_PS_MediopieDescensoArcoALI':
$poolToBeSent['template.DescensoMedialALI.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescensoMedialALI.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_MediopieDescensoArcoALIMM':
for ($i=0;$i<2;$i++)
{
$value = ($i==0)?$att->value_left:$att->value_right;
$foot = ($i==0)?'left':'right';
$poolToBeSent["template.DescensoMedialALI.$foot.height"] = $value + $descensoArcoALIOffset;
}
break;
case 'TI_PS_MediopieDescensoArcoALEMM':
for ($i=0;$i<2;$i++)
{
$value = ($i==0)?$att->value_left:$att->value_right;
$foot = ($i==0)?'left':'right';
$poolToBeSent["template.DescensoLateralALE.$foot.height"] = $value;
}
break;
/*
case 'TI_PS_MediopieDescensoArcoALIInt':
for ($i=0;$i<2;$i++)
{
$value = ($i==0)?$att->value_left:$att->value_right;
$foot = ($i==0)?'left':'right';
$percent ='';
switch($value)
{
case 1:
$percent = "95";
break;
case 2:
$percent = "90";
break;
case 3:
$percent = "85";
break;
}
$poolToBeSent["template.DescensoMedialALI.$foot.gradingFactor"] = $percent;
}
break;*/
case 'TI_PS_MediopieDescensoArcoALE':
$poolToBeSent['template.DescensoLateralALE.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescensoLateralALE.right.on'] =($att->value_right == '1')?'true':'false';
break;
/*
case 'TI_PS_MediopieDescensoArcoALEInt':
for ($i=0;$i<2;$i++)
{
$value = ($i==0)?$att->value_left:$att->value_right;
$foot = ($i==0)?'left':'right';
$percent ='';
switch($value)
{
case 1:
$percent = "95";
break;
case 2:
$percent = "90";
break;
case 3:
$percent = "85";
break;
}
$poolToBeSent["template.DescensoLateralALE.$foot.gradingFactor"] = $percent;
}
break;*/
case 'TI_PS_RetropiePostEsta':
if (((int)$att->value_left)!=0)
$tipoTaloneraL = ((int)$att->value_left);
if (((int)$att->value_right)!=0)
$tipoTaloneraR = ((int)$att->value_right);
break;
case 'TI_PS_RetropieTaloCorta':
$poolToBeSent['template.TaloneraCorta.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.TaloneraCorta.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_RetropieTaloCortaMM':
$poolToBeSent['template.TaloneraCorta.left.height'] = $att->value_left;
$poolToBeSent['template.TaloneraCorta.right.height'] = $att->value_right;
$poolToBeSent['template.EstabilizadorTalon.left.heelHeightOffset'] = $att->value_left;
$poolToBeSent['template.EstabilizadorTalon.right.heelHeightOffset'] = $att->value_right;
break;
case 'TI_PS_MediopieRefArco':
$numWaves = $modelSettings->getVar('refArchALINumWaves',4);
if (((int)$att->value_left)!=0)
{
$poolToBeSent['template.RefuerzoArco.left.on'] = 'true';
if (((int)$att->value_left)==2)
$poolToBeSent['template.RefuerzoArco.left.numWaves'] = $numWaves;
else
$poolToBeSent['template.RefuerzoArco.left.numWaves'] = '0';
}
if (((int)$att->value_right)!=0)
{
$poolToBeSent['template.RefuerzoArco.right.on'] = 'true';
if (((int)$att->value_right)==2)
$poolToBeSent['template.RefuerzoArco.right.numWaves'] = $numWaves;
else
$poolToBeSent['template.RefuerzoArco.right.numWaves'] = '0';
}
break;
case 'TI_PS_MediopieRefArcoSolMM':
case 'TI_PS_MediopieRefArcoWaveMM':
if ($att->value_left)
$poolToBeSent['template.RefuerzoArco.left.height'] = $att->value_left;
if ($att->value_right)
$poolToBeSent['template.RefuerzoArco.right.height'] = $att->value_right;
break;
case 'TI_PS_MediopieEstALEMM':
if ($att->value_left)
$poolToBeSent['template.RefuerzoArcoExterno.left.height'] = $att->value_left;
if ($att->value_right)
$poolToBeSent['template.RefuerzoArcoExterno.right.height'] = $att->value_right;
break;
case 'TI_PS_MediopieRefArcoWaveNOndas':
if ($att->value_left)
$poolToBeSent['template.RefuerzoArco.left.numWaves'] = $att->value_left;
if ($att->value_right)
$poolToBeSent['template.RefuerzoArco.right.numWaves'] = $att->value_right;
break;
case 'ShoeSizeEU':
$shoeSizeL = $att->value_left;
$shoeSizeR = $att->value_right;
$poolToBeSent['template.Brandsole.left.size'] = $att->value_left;
$poolToBeSent['template.Brandsole.right.size'] = $att->value_right;
$poolToBeSent['template.BrandsoleMan.left.size'] = $att->value_left;
$poolToBeSent['template.BrandsoleMan.right.size'] = $att->value_right;
$poolToBeSent['template.BrandsoleWoman.left.size'] = $att->value_left;
$poolToBeSent['template.BrandsoleWoman.right.size'] = $att->value_right;
break;
case 'TI_PS_Gender':
if ($att->mvalueleft=='Female')
{
$femaleSizeCorrection = true;
}
break;
case 'TI_PS_Palmilla':
$isPalmilla = $att->value_left == '1';
break;
case 'TI_PS_PartesBlandasLateral':
$poolToBeSent['template.AdicionLateral.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.AdicionLateral.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PartesBlandasLateralMM':
$poolToBeSent['template.AdicionLateral.left.distance'] = $att->value_left;
$poolToBeSent['template.AdicionLateral.right.distance'] = $att->value_right;
break;
case 'TI_PS_PartesBlandasMedial':
$poolToBeSent['template.AdicionMedial.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.AdicionMedial.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PartesBlandasMedialMM':
$poolToBeSent['template.AdicionMedial.left.distance'] = $att->value_left;
$poolToBeSent['template.AdicionMedial.right.distance'] = $att->value_right;
break;
case 'TI_PS_PartesBlandasTalonLateral':
$poolToBeSent['template.AdicionPosteroLateral.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.AdicionPosteroLateral.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PartesBlandasTalonLateralMM':
$poolToBeSent['template.AdicionPosteroLateral.left.distance'] = $att->value_left;
$poolToBeSent['template.AdicionPosteroLateral.right.distance'] = $att->value_right;
break;
case 'TI_PS_RetropieMedialHS':
$poolToBeSent['template.MedialHeelSkive.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.MedialHeelSkive.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_RetropieMedialHSMM':
$poolToBeSent['template.MedialHeelSkive.left.height'] = $att->value_left;
$poolToBeSent['template.MedialHeelSkive.right.height'] = $att->value_right;
break;
case 'TI_PS_RetropieMedialHSGrados':
$poolToBeSent['template.MedialHeelSkive.left.angle'] = $att->value_left;
$poolToBeSent['template.MedialHeelSkive.right.angle'] = $att->value_right;
break;
case 'TI_PS_RetropieLateralHS':
$poolToBeSent['template.LateralHeelSkive.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.LateralHeelSkive.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_RetropieLateralHSMM':
$poolToBeSent['template.LateralHeelSkive.left.height'] = $att->value_left;
$poolToBeSent['template.LateralHeelSkive.right.height'] = $att->value_right;
break;
case 'TI_PS_RetropieLateralHSGrados':
$poolToBeSent['template.LateralHeelSkive.left.angle'] = $att->value_left;
$poolToBeSent['template.LateralHeelSkive.right.angle'] = $att->value_right;
break;
case 'TI_PS_AntepieBalanceInv':
$poolToBeSent['template.BalanceInvertido.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.BalanceInvertido.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_AntepieBalanceEver':
$poolToBeSent['template.BalanceEvertido.left.on'] =($att->value_left == '1')?'true':'false';
$poolToBeSent['template.BalanceEvertido.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_AntepieBalanceEverGrados':
$poolToBeSent['template.BalanceEvertido.left.angle'] = $att->value_left;
$poolToBeSent['template.BalanceEvertido.right.angle'] = $att->value_right;
break;
case 'TI_PS_AntepieBalanceEverInt':
// 1-> leve 2-> moderado 3->severa
for ($i=0;$i<2;$i++)
{
$value = ($i==0)?$att->value_left:$att->value_right;
$foot = ($i==0)?'left':'right';
$bias ='';
switch($value)
{
case 1:
$bias = "25,25,30,30,35,50";
break;
case 2:
$bias = "30,35,40,40,45,55";
break;
case 3:
$bias = "35,40,45,45,50,65";
break;
}
$poolToBeSent["template.BalanceEvertido.$foot.bias"] = $bias;
}
break;
case 'TI_PS_AntepieBajarALI':
$poolToBeSent['template.BajarALI.left.on'] =($att->value_left == '1')?'true':'false';
$poolToBeSent['template.BajarALI.right.on'] = ($att->value_right == '1')?'true':'false';
$poolToBeSent['template.BajarALI.left.angle'] = 0;
$poolToBeSent['template.BajarALI.right.angle'] = 0;
break;
case 'TI_PS_AntepieBajarALIInt':
// 1-> leve 2-> moderado 3->severa
for ($i=0;$i<2;$i++)
{
$value = ($i==0)?$att->value_left:$att->value_right;
$foot = ($i==0)?'left':'right';
$bias ='';
switch($value)
{
case 1:
$bias = "25,25,20,20,25,35";
break;
case 2:
$bias = "30,35,40,40,45,55";
break;
case 3:
$bias = "35,40,45,45,50,65";
break;
}
$poolToBeSent["template.BajarALI.$foot.bias"] = $bias;
}
break;
case 'TI_PS_AntepieBalanceInvGrados':
$poolToBeSent['template.BalanceInvertido.left.angle'] = $att->value_left;
$poolToBeSent['template.BalanceInvertido.right.angle'] = $att->value_right;
break;
case 'TI_PS_AntepieBalanceInvInt':
// 1->leve 2->moderado 3->severa
for ($i=0;$i<2;$i++)
{
$value = ($i==0)?$att->value_left:$att->value_right;
$foot = ($i==0)?'left':'right';
$bias ='';
switch($value)
{
case 1:
$bias = "25,25,20,20,25,35";
break;
case 2:
$bias = "30,35,40,40,45,55";
break;
case 3:
$bias = "35,40,45,45,50,65";
break;
}
$poolToBeSent["template.BalanceInvertido.$foot.bias"] = $bias;
}
break;
case 'TI_PS_AntepieAlmendra':
$poolToBeSent['template.Almendra.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.Almendra.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_AntepieAlmendraMM':
$poolToBeSent['template.Almendra.left.height'] = $att->value_left;
$poolToBeSent['template.Almendra.right.height'] = $att->value_right;
break;
case 'TI_PS_PolycupThicknessMM':
$poolToBeSent['template.Polycup.left.thickness'] = $att->value_left;
$poolToBeSent['template.Polycup.right.thickness'] = $att->value_right;
break;
case 'TI_PS_AntepieBarra':
$poolToBeSent['template.BarraMetatarsal.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.BarraMetatarsal.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_AntepieBarraMM':
$poolToBeSent['template.BarraMetatarsal.left.height'] = $att->value_left;
$poolToBeSent['template.BarraMetatarsal.right.height'] = $att->value_right;
break;
case 'TI_PS_AntepieDescHerraEVA':
$poolToBeSent['template.Herradura.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.Herradura.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PalmillaAlmendra':
$poolToBeSent['template.AlmendraP.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.AlmendraP.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PalmillaAlmendraMM':
$poolToBeSent['template.AlmendraP.left.height'] = $att->value_left;
$poolToBeSent['template.AlmendraP.right.height'] = $att->value_right;
break;
case 'TI_PS_PalmillaBarra':
$poolToBeSent['template.BarraMetatarsalP.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.BarraMetatarsalP.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PalmillaBarraMM':
$poolToBeSent['template.BarraMetatarsalP.left.height'] = $att->value_left;
$poolToBeSent['template.BarraMetatarsalP.right.height'] = $att->value_right;
break;
case 'TI_PS_AntepieDescSubDecMM':
$poolToBeSent['template.DescargaM1.left.height'] = $att->value_left;
$poolToBeSent['template.DescargaM2.left.height'] = $att->value_left;
$poolToBeSent['template.DescargaM3.left.height'] = $att->value_left;
$poolToBeSent['template.DescargaM4.left.height'] = $att->value_left;
$poolToBeSent['template.DescargaM5.left.height'] = $att->value_left;
$poolToBeSent['template.AlzaMetas.left.value'] = $att->value_left;
$poolToBeSent['template.DescargaM1.right.height'] = $att->value_right;
$poolToBeSent['template.DescargaM2.right.height'] = $att->value_right;
$poolToBeSent['template.DescargaM3.right.height'] = $att->value_right;
$poolToBeSent['template.DescargaM4.right.height'] = $att->value_right;
$poolToBeSent['template.DescargaM5.right.height'] = $att->value_right;
$poolToBeSent['template.AlzaMetas.right.value'] = $att->value_right;
break;
case 'TI_PS_AntepieCabezaM1':
$poolToBeSent['template.DescargaM1.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM1.right.on'] = ($att->value_right == '1')?'true':'false';
if ($poolToBeSent['template.DescargaM1.left.on']=='true')
$descargaMetasL = true;
if ($poolToBeSent['template.DescargaM1.right.on']=='true')
$descargaMetasR = true;
break;
case 'TI_PS_AntepieCabezaM2':
$poolToBeSent['template.DescargaM2.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM2.right.on'] = ($att->value_right == '1')?'true':'false';
if ($poolToBeSent['template.DescargaM2.left.on']=='true')
$descargaMetasL = true;
if ($poolToBeSent['template.DescargaM2.right.on']=='true')
$descargaMetasR = true;
break;
case 'TI_PS_AntepieCabezaM3':
$poolToBeSent['template.DescargaM3.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM3.right.on'] = ($att->value_right == '1')?'true':'false';
if ($poolToBeSent['template.DescargaM3.left.on']=='true')
$descargaMetasL = true;
if ($poolToBeSent['template.DescargaM3.right.on']=='true')
$descargaMetasR = true;
break;
case 'TI_PS_AntepieCabezaM4':
$poolToBeSent['template.DescargaM4.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM4.right.on'] = ($att->value_right == '1')?'true':'false';
if ($poolToBeSent['template.DescargaM4.left.on']=='true')
$descargaMetasL = true;
if ($poolToBeSent['template.DescargaM4.right.on']=='true')
$descargaMetasR = true;
break;
case 'TI_PS_AntepieCabezaM5':
$poolToBeSent['template.DescargaM5.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM5.right.on'] =($att->value_right == '1')?'true':'false';
if ($poolToBeSent['template.DescargaM5.left.on']=='true')
$descargaMetasL = true;
if ($poolToBeSent['template.DescargaM5.right.on']=='true')
$descargaMetasR = true;
break;
case 'TI_PS_PalmillaDescargaM1':
$poolToBeSent['template.DescargaM1P.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM1P.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PalmillaDescargaM2':
$poolToBeSent['template.DescargaM2P.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM2P.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PalmillaDescargaM3':
$poolToBeSent['template.DescargaM3P.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM3P.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PalmillaDescargaM4':
$poolToBeSent['template.DescargaM4P.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM4P.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PalmillaDescargaM5':
$poolToBeSent['template.DescargaM5P.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaM5P.right.on'] =($att->value_right == '1')?'true':'false';
break;
case 'InsoleOptions':
switch($att->mvalueleft)
{
case 'EVAMONO30':
case 'EVAMONO40':
case 'EVAMONO55':
case 'EVABI3055':
case '3DCONFORTMONO30':
case '3DCONFORTMONO40':
case '3DCONFORTBI3055':
case '3DCONFORTBI4055SPORT':
$isEVAL = true;
break;
case 'MECAPOLIEHD':
case 'MECAABS':
case 'MECAPOLIPRO':
$isMecaL = true;
break;
case 'MECAPOLIPRO3SIDED':
$isMeca3SidedL = true;
break;
}
switch($att->mvalueright)
{
case 'EVAMONO30':
case 'EVAMONO40':
case 'EVAMONO55':
case 'EVABI3055':
case '3DCONFORTMONO30':
case '3DCONFORTMONO40':
case '3DCONFORTBI3055':
case '3DCONFORTBI4055SPORT':
$isEVAR = true;
break;
case 'MECAPOLIEHD':
case 'MECAABS':
case 'MECAPOLIPRO':
$isMecaR = true;
break;
case 'MECAPOLIPRO3SIDED':
$isMeca3SidedR = true;
break;
}
if ($att->mvalueleft == 'TERMOPOSTMEDIFASCIAL')
$poolToBeSent['template.AcomodacionFascial.left.on'] ='true';
if ($att->mvalueright == 'TERMOPOSTMEDIFASCIAL')
$poolToBeSent['template.AcomodacionFascial.right.on'] ='true';
if ($att->mvalueleft == 'TERMOPOSTMEDICACU')
{
$poolToBeSent['template.RefuerzoArcoExterno.left.on'] ='true';
$poolToBeSent['template.RefuerzoArcoExterno.left.numWaves'] ='0';
}
if ($att->mvalueright == 'TERMOPOSTMEDICACU')
{
$poolToBeSent['template.RefuerzoArcoExterno.right.on'] ='true';
$poolToBeSent['template.RefuerzoArcoExterno.right.numWaves'] ='0';
}
break;
case 'TI_PS_RetropieRecrecido':
$poolToBeSent['template.DescargaSubcalcanea.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.DescargaSubcalcanea.right.on'] = ($att->value_right == '1')?'true':'false';
if ($poolToBeSent['template.DescargaSubcalcanea.left.on']=='true')
{
$poolToBeSent['template.AlzaCalcaneo.left.on'] = 'true';
$poolToBeSent['template.AlzaCalcaneo.left.applicationMode'] = 'ValueMinusThicknessPlusMinThickness';
}
if ($poolToBeSent['template.DescargaSubcalcanea.right.on']=='true')
{
$poolToBeSent['template.AlzaCalcaneo.right.on'] = 'true';
$poolToBeSent['template.AlzaCalcaneo.right.applicationMode'] = 'ValueMinusThicknessPlusMinThickness';
}
break;
case 'TI_PS_RetropieRecrecidoMM':
$poolToBeSent['template.DescargaSubcalcanea.left.height'] = $att->value_left;
$poolToBeSent['template.AlzaCalcaneo.left.value'] = $att->value_left;
$poolToBeSent['template.DescargaSubcalcanea.right.height'] = $att->value_right;
$poolToBeSent['template.AlzaCalcaneo.right.value'] = $att->value_right;
break;
case 'TI_PS_RetropieAlza':
$poolToBeSent['template.Alza.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.Alza.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_RetropieAlzaMM':
$poolToBeSent['template.Alza.left.height'] = $att->value_left;
$poolToBeSent['template.Alza.right.height'] = $att->value_right;
break;
case 'TI_PS_PalmillaAlza':
$poolToBeSent['template.AlzaP.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.AlzaP.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_PalmillaAlzaMM':
$poolToBeSent['template.AlzaP.left.height'] = $att->value_left;
$poolToBeSent['template.AlzaP.right.height'] = $att->value_right;
break;
case 'TI_PS_PalmillaHerradura':
$poolToBeSent['template.HerraduraP.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.HerraduraP.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_AntepieCunaPro':
$antepieCunaProActive_L = ($att->value_left == '1');
$antepieCunaProActive_R = ($att->value_right == '1');
$poolToBeSent['template.CunyaAntepiePro.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.CunyaAntepiePro.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_AntepieCunaSup':
$antepieCunaSupActive_L = ($att->value_left == '1');
$antepieCunaSupActive_R = ($att->value_right == '1');
$poolToBeSent['template.CunyaAntepieSup.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.CunyaAntepieSup.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'TI_PS_AntepieCunaProMM':
$poolToBeSent['template.CunyaAntepie.left.innerHeight'] = $att->value_left;
$poolToBeSent['template.CunyaAntepie.right.innerHeight'] = $att->value_right;
$poolToBeSent['template.CunyaAntepiePro.left.height'] = $att->value_left;
$poolToBeSent['template.CunyaAntepiePro.right.height'] = $att->value_right;
break;
case 'TI_PS_AntepieCunaSupMM':
$poolToBeSent['template.CunyaAntepie.left.outterHeight'] = $att->value_left;
$poolToBeSent['template.CunyaAntepie.right.outterHeight'] = $att->value_right;
$poolToBeSent['template.CunyaAntepieSup.left.height'] = $att->value_left;
$poolToBeSent['template.CunyaAntepieSup.right.height'] = $att->value_right;
break;
case 'TI_PS_InsoleThickness':
$poolToBeSent['template.Insole.left.height'] = $att->value_left;
$poolToBeSent['template.Insole.right.height'] = $att->value_right;
break;
}
break;
case 'rotterdam':
switch($att->typename)
{
case 'ROT_PR_InsoleModel':
$pprModel = $att->mvalueleft;
break;
case 'ROT_PR_Brandsole':
$pprBrandsole = $att->mvalueleft;
break;
case 'ROT_PR_TPelot':
$poolToBeSent['template.JJ_TPelot.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_TPelot.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_TPelotMM':
$poolToBeSent['template.JJ_TPelot.left.height'] = $att->value_left;
$poolToBeSent['template.JJ_TPelot.right.height'] = $att->value_right;
break;
case 'ROT_PR_PelotII':
$poolToBeSent['template.JJ_PelotII.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_PelotII.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_PelotIIMM':
$poolToBeSent['template.JJ_PelotII.left.height'] = $att->value_left;
$poolToBeSent['template.JJ_PelotII.right.height'] = $att->value_right;
break;
case 'ROT_PR_Rctb':
$poolToBeSent['template.JJ_Rctb.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_Rctb.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_RctbMM':
$poolToBeSent['template.JJ_Rctb.left.height'] = $att->value_left;
$poolToBeSent['template.JJ_Rctb.right.height'] = $att->value_right;
break;
case 'ROT_PR_DistalPronation':
$poolToBeSent['template.JJ_pronation.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_pronation.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_DistalPronationMM':
$poolToBeSent['template.JJ_pronation.left.OutterHeight'] = $att->value_left*3.3;
$poolToBeSent['template.JJ_pronation.right.OutterHeight'] = $att->value_right*3.3;
break;
case 'ROT_PR_HeelSupport':
$poolToBeSent['template.JJ_HeelSupport.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_HeelSupport.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_HeelSupportMM':
$poolToBeSent['template.JJ_HeelSupport.left.height'] = $att->value_left;
$poolToBeSent['template.JJ_HeelSupport.right.height'] = $att->value_right;
break;
case 'ROT_PR_RaiseInsoleMiddle':
$poolToBeSent['template.JJ_RaiseMiddle.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_RaiseMiddle.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_RaiseInsoleMiddleMM':
$poolToBeSent['template.JJ_RaiseMiddle.left.height'] = $att->value_left;
$poolToBeSent['template.JJ_RaiseMiddle.right.height'] = $att->value_right;
break;
case 'ROT_PR_WedgeVarus':
$poolToBeSent['template.JJ_WedgeVarus.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_WedgeVarus.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_WedgeVarusMM':
$poolToBeSent['template.JJ_WedgeVarus.left.OutterHeight'] = $att->value_left;
$poolToBeSent['template.JJ_WedgeVarus.right.OutterHeight'] = $att->value_right;
break;
case 'ROT_PR_WedgeValgus':
$poolToBeSent['template.JJ_WedgeValgus.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_WedgeValgus.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_WedgeValgusMM':
$poolToBeSent['template.JJ_WedgeValgus.left.InnerHeight'] = $att->value_left;
$poolToBeSent['template.JJ_WedgeValgus.right.InnerHeight'] = $att->value_right;
break;
case 'ROT_PR_Wedge':
$poolToBeSent['template.JJ_Wedge.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_Wedge.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_WedgeMM':
$poolToBeSent['template.JJ_Wedge.left.InnerHeight'] = $poolToBeSent['template.JJ_Wedge.left.OutterHeight'] = $att->value_left;
$poolToBeSent['template.JJ_Wedge.right.InnerHeight'] = $poolToBeSent['template.JJ_Wedge.right.OutterHeight'] = $att->value_right;
break;
case 'ROT_PR_HeelSpurHole':
$poolToBeSent['template.JJ_HeelSpurHole.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_HeelSpurHole.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_HeelSpurHoleMM':
$poolToBeSent['template.JJ_HeelSpurHole.left.height'] = -$att->value_left;
$poolToBeSent['template.JJ_HeelSpurHole.right.height'] = -$att->value_right;
break;
case 'ROT_PR_MedialArchRaise':
$poolToBeSent['template.JJ_RaiseMedialArch.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.JJ_RaiseMedialArch.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'ROT_PR_MedialArchRaiseMM':
$poolToBeSent['template.JJ_RaiseMedialArch.left.height'] = $att->value_left;
$poolToBeSent['template.JJ_RaiseMedialArch.right.height'] = $att->value_right;
break;
case 'ROT_PR_InsoleThickness':
$poolToBeSent['template.JJ_InsoleThickness.left.height'] = $att->value_left;
$poolToBeSent['template.JJ_InsoleThickness.right.height'] = $att->value_right;
break;
case 'ROT_PR_HeelHeight':
$poolToBeSent['template.JJ_HeelHeight.left.height'] =$att->value_left;
$poolToBeSent['template.JJ_HeelHeight.right.height'] = $att->value_right;
break;
case 'ROT_PR_HeelThickness':
$poolToBeSent['template.JJ_HeelThickness.left.height'] = $att->value_left;
$poolToBeSent['template.JJ_HeelThickness.right.height'] = $att->value_right;
break;
case 'ROT_AN_ShoeSizeEU':
$shoeSizeL = $shoeSizeR = $att->value_left;
break;
}
break;
case 'india':
switch($att->typename)
{
case 'ShoeSizeEU':
$shoeSizeL = $att->value_left;
$shoeSizeR = $att->value_right;
break;
case 'IND_InsoleThickness':
$poolToBeSent['template.PPR_InsoleThickness.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_InsoleThickness.right.height'] = $att->value_right;
break;
case 'IND_HeelHeight':
$poolToBeSent['template.PPR_HeelHeight.left.height'] =$att->value_left;
$poolToBeSent['template.PPR_HeelHeight.right.height'] = $att->value_right;
break;
case 'IND_HeelThickness':
$poolToBeSent['template.PPR_HeelThickness.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_HeelThickness.right.height'] = $att->value_right;
break;
case 'IND_Pelot':
$poolToBeSent['template.PPR_Pelot.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Pelot.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_PelotMM':
$poolToBeSent['template.PPR_Pelot.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_Pelot.right.height'] = $att->value_right;
break;
case 'IND_TPelot':
$poolToBeSent['template.PPR_TPelot.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_TPelot.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_TPelotMM':
$poolToBeSent['template.PPR_TPelot.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_TPelot.right.height'] = $att->value_right;
break;
case 'IND_PelotII':
$poolToBeSent['template.PPR_PelotII.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_PelotII.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_PelotIIMM':
$poolToBeSent['template.PPR_PelotII.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_PelotII.right.height'] = $att->value_right;
break;
case 'IND_Rctb':
$poolToBeSent['template.PPR_Rctb.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Rctb.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_RctbMM':
$poolToBeSent['template.PPR_Rctb.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_Rctb.right.height'] = $att->value_right;
break;
case 'IND_HeelSupport':
$poolToBeSent['template.PPR_HeelSupport.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_HeelSupport.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_HeelSupportMM':
$poolToBeSent['template.PPR_HeelSupport.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_HeelSupport.right.height'] = $att->value_right;
break;
case 'IND_RaiseMiddle':
$poolToBeSent['template.PPR_RaiseMiddle.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_RaiseMiddle.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_RaiseMiddleMM':
$poolToBeSent['template.PPR_RaiseMiddle.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_RaiseMiddle.right.height'] = $att->value_right;
break;
case 'IND_WedgeVarus':
$poolToBeSent['template.PPR_WedgeVarus.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_WedgeVarus.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_WedgeVarusMM':
$poolToBeSent['template.PPR_WedgeVarus.left.OutterHeight'] = $att->value_left;
$poolToBeSent['template.PPR_WedgeVarus.right.OutterHeight'] = $att->value_right;
break;
case 'IND_WedgeValgus':
$poolToBeSent['template.PPR_WedgeValgus.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_WedgeValgus.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_WedgeValgusMM':
$poolToBeSent['template.PPR_WedgeValgus.left.InnerHeight'] = $att->value_left;
$poolToBeSent['template.PPR_WedgeValgus.right.InnerHeight'] = $att->value_right;
break;
case 'IND_ToeElement':
$poolToBeSent['template.PPR_ToeElement.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_ToeElement.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_ToeElementMM':
$poolToBeSent['template.PPR_ToeElement.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_ToeElement.right.height'] = $att->value_right;
break;
case 'IND_Wedge':
$poolToBeSent['template.PPR_Wedge.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Wedge.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_WedgeMM':
$poolToBeSent['template.PPR_Wedge.left.InnerHeight'] = $poolToBeSent['template.PPR_Wedge.left.OutterHeight'] = -$att->value_left;
$poolToBeSent['template.PPR_Wedge.right.InnerHeight'] = $poolToBeSent['template.PPR_Wedge.right.OutterHeight'] = -$att->value_right;
break;
case 'IND_HeelSpurHole':
$poolToBeSent['template.PPR_HeelSpurHole.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_HeelSpurHole.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_HeelSpurHoleMM':
$poolToBeSent['template.PPR_HeelSpurHole.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_HeelSpurHole.right.height'] = $att->value_right;
break;
case 'IND_RaiseMedialArch':
$poolToBeSent['template.PPR_RaiseMedialArch.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_RaiseMedialArch.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'IND_RaiseMedialArchMM':
$poolToBeSent['template.PPR_RaiseMedialArch.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_RaiseMedialArch.right.height'] = $att->value_right;
break;
case 'IND_Model':
$pprModel = $att->mvalueleft;
break;
case 'IND_BrandsoleType':
$pprBrandsole = $att->mvalueleft;
break;
case 'IND_Produkt':
switch($att->mvalueleft)
{
case 'Einlage - Einseitig':
$poolToBeSent['InsoleType'] = 'oneside';
break;
case 'Einlage - Beidseitig':
$poolToBeSent['template.InnerBrandsole.left.on'] =
$poolToBeSent['template.InnerBrandsole.right.on'] = 'true';
$poolToBeSent['template.PPR_BottomFinishing.left.on'] =
$poolToBeSent['template.PPR_BottomFinishing.right.on'] = 'true';
$poolToBeSent['InsoleType'] = 'bothsides';
break;
}
break;
}
break;
case 'jjpodo':
switch($att->typename)
{
case 'PODO_Brandsole':
$pprBrandsole = $att->mvalueleft;
break;
case 'PPR_ShoeSize':
$shoeSizeL = $att->value_left;
$shoeSizeR = $att->value_right;
break;
case 'PODO_InsoleType':
$pprModel = $att->mvalueleft;
break;
case 'PODO_InsoleThickness':
/*$poolToBeSent['template.JJ_InsoleThickness.left.height'] = $att->value_left -1.5;
$poolToBeSent['template.JJ_InsoleThickness.right.height'] = $att->value_right -1.5;
*/
$poolToBeSent['template.Insole.left.height'] = $att->value_left;
$poolToBeSent['template.Insole.right.height'] = $att->value_right;
break;
case 'PODO_HeelHeight':
$poolToBeSent['template.JJ_HeelHeight.left.height'] = $att->value_left;
$poolToBeSent['template.JJ_HeelHeight.right.height'] = $att->value_right;
break;
case 'PODO_F_PASC':
$poolToBeSent['template.PASC_a.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PASC_a.right.on'] = ($att->value_right == '1')?'true':'false';
$poolToBeSent['template.PASC_b.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PASC_b.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PODO_F_PASCMM':
$poolToBeSent['template.PASC_a.left.height'] = $att->value_left;
$poolToBeSent['template.PASC_a.right.height'] = $att->value_right;
$poolToBeSent['template.PASC_b.left.height'] = $att->value_left*0.5;
$poolToBeSent['template.PASC_b.right.height'] = $att->value_right*0.5;
break;
case 'PPR_Produkt':
switch($att->mvalueleft)
{
case 'Einlage - Einseitig':
$poolToBeSent['InsoleType'] = 'oneside';
break;
case 'Einlage - Beidseitig':
$poolToBeSent['template.PPR_BottomFinishing.left.on'] =
$poolToBeSent['template.PPR_BottomFinishing.right.on'] = 'true';
$poolToBeSent['InsoleType'] = 'bothsides';
break;
}
break;
default:
if (($key = array_search($att->typename,$checks))!==FALSE)
{
$poolToBeSent['template.'.$ops[$key].'.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.'.$ops[$key].'.right.on'] = ($att->value_right == '1')?'true':'false';
}else if (($key = array_search($att->typename,$mms))!==FALSE)
{
$poolToBeSent['template.'.$ops[$key].'.left.height'] = $att->value_left;
$poolToBeSent['template.'.$ops[$key].'.right.height'] = $att->value_right;
}
}
break;
case 'jjcorne':
switch($att->typename)
{
case 'JJC_ShoeSize':
if ($att->value_left && $att->value_left!='SKIP')
{
$shoeSizeL = $att->value_left;
$shoeSizeR = $att->value_left;
}
break;
case 'JJC_OrderType':
$orderType = $att->value_left;
break;
case 'JJC_ShoeType':
$shoeType = $att->value_left;
break;
case 'JJC_FootType':
$footType = $att->value_left;
break;
case 'JJC_Activity':
$activity = $att->value_left;
break;
}
break;
case 'voxelcare':
case 'ppr':
switch($att->typename)
{
case 'PPR_ShoeSize':
$shoeSizeL = $att->value_left;
$shoeSizeR = $att->value_right;
break;
case 'PPR_InsoleCup':
$pprInsoleCup = $att->mvalueleft;
if ($att->mvalueleft == 'No')
$pprIsLowCup = true;
break;
case 'PPR_InsoleThickness':
$poolToBeSent['template.PPR_InsoleThickness.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_InsoleThickness.right.height'] = $att->value_right;
break;
case 'PPR_ThicknessRemovalMM':
$poolToBeSent['template.PPR_ThicknessRemoval.left.thickness'] = $att->value_left;
$poolToBeSent['template.PPR_ThicknessRemoval.right.thickness'] = $att->value_right;
break;
case 'PPR_HeelHeight':
$poolToBeSent['template.PPR_HeelHeight.left.height'] =$att->value_left;
$poolToBeSent['template.PPR_HeelHeight.right.height'] = $att->value_right;
break;
case 'PPR_HeelThickness':
$poolToBeSent['template.PPR_HeelThickness.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_HeelThickness.right.height'] = $att->value_right;
break;
case 'PPR_Pelot':
$poolToBeSent['template.PPR_Pelot.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Pelot.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_PelotMM':
$poolToBeSent['template.PPR_Pelot.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_Pelot.right.height'] = $att->value_right;
break;
case 'PPR_TPelot':
$poolToBeSent['template.PPR_TPelot.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_TPelot.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_TPelotMM':
$poolToBeSent['template.PPR_TPelot.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_TPelot.right.height'] = $att->value_right;
break;
case 'PPR_PelotII':
$poolToBeSent['template.PPR_PelotII.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_PelotII.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_PelotIIMM':
$poolToBeSent['template.PPR_PelotII.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_PelotII.right.height'] = $att->value_right;
break;
case 'PPR_Rctb':
$poolToBeSent['template.PPR_Rctb.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Rctb.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_RctbMM':
$poolToBeSent['template.PPR_Rctb.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_Rctb.right.height'] = $att->value_right;
break;
case 'PPR_HeelSupport':
$poolToBeSent['template.PPR_HeelSupport.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_HeelSupport.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_HeelSupportMM':
$poolToBeSent['template.PPR_HeelSupport.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_HeelSupport.right.height'] = $att->value_right;
break;
case 'PPR_RaiseMiddle':
$poolToBeSent['template.PPR_RaiseMiddle.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_RaiseMiddle.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_RaiseMiddleMM':
$poolToBeSent['template.PPR_RaiseMiddle.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_RaiseMiddle.right.height'] = $att->value_right;
break;
case 'PPR_WedgeVarus':
$poolToBeSent['template.PPR_WedgeVarus.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_WedgeVarus.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_WedgeVarusMM':
$poolToBeSent['template.PPR_WedgeVarus.left.OutterHeight'] = $att->value_left;
$poolToBeSent['template.PPR_WedgeVarus.right.OutterHeight'] = $att->value_right;
break;
case 'PPR_WedgeValgus':
$poolToBeSent['template.PPR_WedgeValgus.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_WedgeValgus.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_WedgeValgusMM':
$poolToBeSent['template.PPR_WedgeValgus.left.InnerHeight'] = $att->value_left;
$poolToBeSent['template.PPR_WedgeValgus.right.InnerHeight'] = $att->value_right;
break;
case 'PPR_ToeElement':
$poolToBeSent['template.PPR_ToeElement.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_ToeElement.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_ToeElementMM':
$poolToBeSent['template.PPR_ToeElement.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_ToeElement.right.height'] = $att->value_right;
break;
case 'PPR_Zehensteg':
$poolToBeSent['template.PPR_Toegrip.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Toegrip.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_ZehenstegMM':
$poolToBeSent['template.PPR_Toegrip.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_Toegrip.right.height'] = $att->value_right;
break;
case 'PPR_MittelPelotte':
$poolToBeSent['template.PPR_Sensopelotte.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Sensopelotte.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_MittelPelotteMM':
$poolToBeSent['template.PPR_Sensopelotte.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_Sensopelotte.right.height'] = $att->value_right;
break;
case 'PPR_RuckPelotMedial':
$poolToBeSent['template.PPR_Rearpelot_Links.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Rearpelot_Links.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_RuckPelotMedialMM':
$poolToBeSent['template.PPR_Rearpelot_Links.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_Rearpelot_Links.right.height'] = $att->value_right;
break;
case 'PPR_RuckPelotLateral':
$poolToBeSent['template.PPR_Rearpelot_Right.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Rearpelot_Right.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_RuckPelotLateralMM':
$poolToBeSent['template.PPR_Rearpelot_Right.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_Rearpelot_Right.right.height'] = $att->value_right;
break;
case 'PPR_Wedge':
$poolToBeSent['template.PPR_Wedge.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_Wedge.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_WedgeMM':
$poolToBeSent['template.PPR_Wedge.left.InnerHeight'] = $poolToBeSent['template.PPR_Wedge.left.OutterHeight'] = -$att->value_left;
$poolToBeSent['template.PPR_Wedge.right.InnerHeight'] = $poolToBeSent['template.PPR_Wedge.right.OutterHeight'] = -$att->value_right;
break;
case 'PPR_HeelSpurHole':
$poolToBeSent['template.PPR_HeelSpurHole.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_HeelSpurHole.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_HeelSpurHoleMM':
$poolToBeSent['template.PPR_HeelSpurHole.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_HeelSpurHole.right.height'] = $att->value_right;
break;
case 'PPR_RaiseMedialArch':
$poolToBeSent['template.PPR_RaiseMedialArch.left.on'] = ($att->value_left == '1')?'true':'false';
$poolToBeSent['template.PPR_RaiseMedialArch.right.on'] = ($att->value_right == '1')?'true':'false';
break;
case 'PPR_RaiseMedialArchMM':
$poolToBeSent['template.PPR_RaiseMedialArch.left.height'] = $att->value_left;
$poolToBeSent['template.PPR_RaiseMedialArch.right.height'] = $att->value_right;
break;
case 'PPR_Model':
$pprModel = $att->mvalueleft;
break;
case 'PPR_CustomModel':
$pprCustomModel = $att->value_left;
break;
case 'PPR_BrandsoleType':
$pprBrandsole = $att->mvalueleft;
break;
case 'PPR_EinlagenVarianten':
$pprEinlageVarianten = $att->mvalueleft;
$cadMode = '';
switch($att->mvalueleft)
{
case 'Prefab Standard':
$cadMode = 'standard';
break;
case 'Prefab Advanced':
$cadMode = 'advanced';
$poolToBeSent['HeightLimit.left'] =
$poolToBeSent['HeightLimit.right'] = 40;
break;
case 'Foambox positive':
$cadMode = 'foambox';
$poolToBeSent['HeightLimit.left'] =
$poolToBeSent['HeightLimit.right'] = 60;
break;
case 'Positive cast':
$cadMode = 'positive';
$poolToBeSent['HeightLimit.left'] =
$poolToBeSent['HeightLimit.right'] = 40;
break;
case 'Individuell':
$cadMode = 'individual';
$poolToBeSent['HeightLimit.left'] =
$poolToBeSent['HeightLimit.right'] = 60;
break;
}
$poolToBeSent['CADMode'] = $cadMode;
break;
case 'PPR_Produkt':
switch($att->mvalueleft)
{
case 'Einlage - Einseitig':
$poolToBeSent['InsoleType'] = 'oneside';
break;
case 'Einlage - Beidseitig':
$poolToBeSent['template.InnerBrandsole.left.on'] =
$poolToBeSent['template.InnerBrandsole.right.on'] = 'true';
$poolToBeSent['template.PPR_BottomFinishing.left.on'] =
$poolToBeSent['template.PPR_BottomFinishing.right.on'] = 'true';
$poolToBeSent['InsoleType'] = 'bothsides';
break;
}
break;
}
break;
}
switch($att->typename)
{
case 'TratamientosInst':
$orderData['tratamientos'] = $att->memo_left;
break;
}
}
$insoleOptions = array();
$comments = '';
$parts = array();
$order->attributes =& $manorders->getAttributes(array($order->id));
ManuReportHelper::processAttributes($order,$mats, $insoleOptions, $comments,$parts);
foreach($insoleOptions as $option)
$orderData['manuopts'][] = $option['desc'];
sort($orderData['manuopts'],SORT_LOCALE_STRING);
$orderData['manuremarks'] = $comments;
$richContent = $msg['Request.Params.RichContent'];
$cadInfo = array();
$cadInfo[] = array( JText::_('Id') , $orderData['id']);
$cadInfo[] = array( JText::_('User') , $orderData['username']);
$cadInfo[] = array( JText::_('Patient') , $orderData['patientname']);
$cadInfo[] = array( JText::_('MANUFACTURING OPT.') , $orderData['manuopts']);
$cadInfo[] = array( JText::_('Exploration') , $orderData['tratamientos']);
$cadInfo[] = array( JText::_('Remarks') , $orderData['manuremarks']);
$text = '';
if ($richContent == 'true')
{
$rtf = new RTFFile();
foreach($cadInfo as $line)
{
$rtf->SetOtherFormatTextFile(1,0,0);
$rtf->AddText($line[0].': ');
$rtf->SetOtherFormatTextFile(0,0,0);
if (is_array($line[1]))
{
$typeContent = array();
$typeContent[''] = array();
foreach($line[1] as $lineContent)
{
$lineArray = explode(':',$lineContent);
if (count($lineArray)!=2)
{
$typeContent[''][] = $lineContent;
}
else
{
if (!$typeContent[$lineArray[0]])
$typeContent[$lineArray[0]] = array();
$typeContent[$lineArray[0]][] = $lineArray[1];
}
}
foreach($typeContent as $key => $value)
{
$rtf->SetOtherFormatTextFile(0,0,1);
$rtf->AddText(JText::_($key));
$rtf->InsertLine();
foreach($value as $vl)
{
$rtf->SetOtherFormatTextFile(0,0,0);
$rtf->AddText(JText::_($vl));
$rtf->InsertLine();
}
$rtf->InsertLine();
}
}
else
$rtf->AddText(JText::_($line[1]));
$rtf->InsertLine();
}
$rtf->CloseFile();
$text = $rtf->GetFile();
}
else
{
foreach($cadInfo as $line)
{
if (is_array($line[1]))
{
$opts = '';
foreach($line[1] as $vl)
{
if ($opts) $opts.= "\n";
$vl = JText::_($vl);
$opts .= $vl;
}
$text .= JText::_($line[0]) . ': '. $opts . "\n";
}
else
$text .= JText::_($line[0]) . ': '. JText::_($line[1]) . "\n";
}
}
$model->EncodeBase64($text);
$this->SetData('Data_B',$text);
$template = '';
switch($franchiseName)
{
case 'velasco':
case 'tecnoinsole':
if ($shoeSizeL != -1 || $shoeSizeR != -1)
{
if ($shoeSizeR == -1)
$shoeSizeR = $shoeSizeL;
$poolToBeSent['template.foot.left.size'] = $shoeSizeL;
$poolToBeSent['template.foot.right.size'] = $shoeSizeR;
}
for ($i=0;$i<2;$i++)
{
$angle = ($i==0)?$balanceAngleL:$balanceAngleR;
$biasCombo = ($i==0)?$balanceBiasL:$balanceBiasR;
$opOn = ($i==0)?$balanceLOn:$balanceROn;
$type = ($i==0)?$balanceL:$balanceR;
$foot = ($i==0)?'left':'right';
if ($opOn && $type != -1)
{
if ($type==2)
{
$poolToBeSent["template.BalanceInvertido.$foot.on"] = 'true';
$poolToBeSent["template.BalanceInvertido.$foot.angle"] = $angle;
switch($biasCombo)
{
case 1:
$bias ="15,18,15,20,20,30";
break;
case 3:
$bias = "25,28,25,30,30,40";
break;
default:
$bias = "20,23,20,25,25,35";
}
$poolToBeSent["template.BalanceInvertido.$foot.bias"] = $bias;
}
else
{
$poolToBeSent["template.BalanceEvertido.$foot.on"] = 'true';
$poolToBeSent["template.BalanceEvertido.$foot.angle"] = $angle;
switch($biasCombo)
{
case 1:
$bias = "15,20,20,20,35,55";
break;
case 3:
$bias = "25,30,30,30,45,65";
break;
default:
$bias = "20,25,25,25,40,60";
}
$poolToBeSent["template.BalanceEvertido.$foot.bias"] = $bias;
}
}
}
if ($poolToBeSent['template.BalanceInvertido.left.on']!='true' && $poolToBeSent['template.BalanceEvertido.left.on']!='true')
{
$poolToBeSent['template.AlineaMoldeSuelo.left.on'] = 'true';
}
if ($poolToBeSent['template.BalanceInvertido.right.on']!='true' && $poolToBeSent['template.BalanceEvertido.right.on']!='true')
{
$poolToBeSent['template.AlineaMoldeSuelo.right.on'] = 'true';
}
if ($descargaMetasL)
{
$poolToBeSent['template.AlzaMetas.left.on'] = 'true';
$poolToBeSent['template.AlzaMetas.left.applicationMode'] = 'ValueMinusThicknessPlusMinThickness';
}
if ($descargaMetasR)
{
$poolToBeSent['template.AlzaMetas.right.on'] = 'true';
$poolToBeSent['template.AlzaMetas.right.applicationMode'] = 'ValueMinusThicknessPlusMinThickness';
}
$isEVA = $isEVAL || $isEVAR;
$isMeca = $isMecaL || $isMecaR;
$isMeca3Sided = $isMeca3SidedL || $isMeca3SidedR;
for ($i =0;$i<2;$i++)
{
$tipoTalonera = ($i==0)?$tipoTaloneraL:$tipoTaloneraR;
$foot = ($i==0)?'left':'right';
$shoeSize = ($i==0)?$shoeSizeL:$shoeSizeR;
if (($isMeca || $isMeca3Sided) && $poolToBeSent["template.TaloneraCorta.$foot.on"]=='true')
{
$poolToBeSent["template.VaciadoTalonN.$foot.on"] = 'true';
/*if ($shoeSize > 31)
$poolToBeSent["template.VaciadoTalonN.$foot.on"] = 'true';
else
$poolToBeSent["template.VaciadoTalonS.$foot.on"] = 'true';*/
}
$poolToBeSent["template.EstabilizadorTalon.$foot.heelCup"] = ($tipoTalonera == 2)?'true':'false';
$poolToBeSent["template.AnyadirBorde.$foot.on"] = ($tipoTalonera == 2)?'true':'false';
if ($tipoTalonera == 1)
$poolToBeSent["template.TaloneraRecta.$foot.on"] = 'true';
elseif ($tipoTalonera== 2)
$poolToBeSent["template.TaloneraIntCorta.$foot.on"] = 'true';
elseif ($tipoTalonera== 3)
$poolToBeSent["template.TaloneraExtCorta.$foot.on"] = 'true';
}
$poolToBeSent['template.CunyaAntepie.left.on'] = ($antepieCunaSupActive_L || $antepieCunaProActive_L)?'true':'false';
$poolToBeSent['template.CunyaAntepie.right.on'] = ($antepieCunaSupActive_R || $antepieCunaProActive_R)?'true':'false';
$poolToBeSent['template.CunyaRetropie.left.on'] = ($retropieCunaProActive_L || $retropieCunaSupActive_L)?'true':'false';
$poolToBeSent['template.CunyaRetropie.right.on'] = ($retropieCunaProActive_R || $retropieCunaSupActive_R)?'true':'false';
$isCover = ($atType=='InsoleCADCoverProject');
if ($isEVA || $isCover)
{
if ($isPalmilla)
$template = 'templatePalmilla';
else
{
if ($isCover)
{
$template = 'templateCover';
$poolToBeSent['template.useMesh.left.on'] = 'false';
$poolToBeSent['template.useMesh.right.on'] = 'false';
}
else
$template = 'templateEVA4';
for ($i=0;$i<2;$i++)
{
$foot = ($i==0)?'left':'right';
if ($poolToBeSent["template.DescargaM1.$foot.on"]=='true'&&
$poolToBeSent["template.DescargaM2.$foot.on"]=='true'&&
$poolToBeSent["template.DescargaM3.$foot.on"]=='true'&&
$poolToBeSent["template.DescargaM4.$foot.on"]=='true'&&
$poolToBeSent["template.DescargaM5.$foot.on"]=='true')
{
$poolToBeSent["template.DescargaM1.$foot.on"]='false';
$poolToBeSent["template.DescargaM2.$foot.on"]='false';
$poolToBeSent["template.DescargaM3.$foot.on"]='false';
$poolToBeSent["template.DescargaM4.$foot.on"]='false';
$poolToBeSent["template.DescargaM5.$foot.on"]='false';
$poolToBeSent["template.DescargaTotalAntepie.$foot.on"]='true';
$poolToBeSent["template.DescargaTotalAntepie.$foot.height"] = $poolToBeSent["template.DescargaM1.$foot.height"];
}
}
if ($femaleSizeCorrection)
{
$poolToBeSent['template.BrandsoleWoman.left.on'] = 'true';
$poolToBeSent['template.BrandsoleWoman.right.on'] = 'true';
$poolToBeSent['template.InnerBrandsoleWoman.left.on'] = 'true';
$poolToBeSent['template.InnerBrandsoleWoman.right.on'] = 'true';
$poolToBeSent['template.InnerBrandsoleWoman.right.master'] = 'false';
$poolToBeSent['template.InnerBrandsoleWoman.left.master'] = 'false';
$poolToBeSent['template.BrandsoleWoman.left.master'] = 'true';
$poolToBeSent['template.BrandsoleWoman.right.master'] = 'true';
}
else
{
$poolToBeSent['template.BrandsoleMan.left.on'] = 'true';
$poolToBeSent['template.BrandsoleMan.right.on'] = 'true';
$poolToBeSent['template.InnerBrandsoleMan.left.on'] = 'true';
$poolToBeSent['template.InnerBrandsoleMan.right.on'] = 'true';
$poolToBeSent['template.InnerBrandsoleMan.right.master'] = 'false';
$poolToBeSent['template.InnerBrandsoleMan.left.master'] = 'false';
$poolToBeSent['template.BrandsoleMan.left.master'] = 'true';
$poolToBeSent['template.BrandsoleMan.right.master'] = 'true';
}
}
}
elseif ($isMeca|| $isMeca3Sided)
{
$template = 'templateMeca';
if ($isMeca3Sided)
{
$poolToBeSent['template.DescargaSubcalcanea.left.on'] = 'false';
$poolToBeSent['template.DescargaSubcalcanea.right.on'] = 'false';
}
}
else
$template = 'templatePOS';
break;
case 'rotterdam':
$copyFoambox =true;
$disableUserFoambox = false;
$poolToBeSent['global.copyFoambox'] = $copyFoambox?'true':'false';
$poolToBeSent['global.disableUserFoambox'] = $disableUserFoambox?'true':'false';
switch($pprModel)
{
case 'D3D':
$template = 'templateD3D';
break;
case 'TDT':
$template = 'templateTDT';
break;
case 'DPI':
$template = 'templateDPI';
break;
case 'TDT wide':
$template = 'templateTDTwide';
break;
case 'DPI high':
$template = 'templateDPIhigh';
break;
}
switch($pprBrandsole)
{
case 'Sport':
$poolToBeSent['template.Brandsole_sport_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_inner.right.master'] = 'false';
$poolToBeSent['template.Brandsole_sport_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_sport_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_sport_outer.right.master'] = 'true';
break;
case '216':
$poolToBeSent['template.Brandsole_216_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_216_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_216_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_216_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_216_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_216_outer.right.master'] = 'true';
$poolToBeSent['template.Brandsole_216_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_216_inner.right.master'] = 'false';
break;
case 'Trendy':
$poolToBeSent['template.Brandsole_trendy_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_trendy_outer.right.master'] = 'true';
$poolToBeSent['template.Brandsole_trendy_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_trendy_inner.right.master'] = 'false';
break;
}
if ($shoeSizeL != -1 || $shoeSizeR != -1)
{
if ($shoeSizeR == -1)
$shoeSizeR = $shoeSizeL;
//if ($cadMode != 'positive' && $cadMode != 'foambox')
{
$poolToBeSent['template.Grading.left.size'] = $shoeSizeL;
$poolToBeSent['template.Grading.right.size'] =$shoeSizeR;
}
/*
else
{
$poolToBeSent['template.Brandsole.left.size'] = $shoeSizeL;
$poolToBeSent['template.Brandsole.right.size'] =$shoeSizeR;
}*/
}
break;
case 'india':
$cadMode = 'foambox';
$template = 'templateFoambox';
$copyFoambox =false;
$disableUserFoambox = false;
if ($shoeSizeL != -1 || $shoeSizeR != -1)
{
if ($shoeSizeR == -1)
$shoeSizeR = $shoeSizeL;
if ($cadMode != 'positive' && $cadMode != 'foambox')
{
$poolToBeSent['template.Grading.left.size'] = $shoeSizeL;
$poolToBeSent['template.Grading.right.size'] =$shoeSizeR;
}
else
{
$poolToBeSent['template.Brandsole.left.size'] = $shoeSizeL;
$poolToBeSent['template.Brandsole.right.size'] =$shoeSizeR;
}
}
$poolToBeSent['template.Insole.left.paintMode'] = 'wireFrame';
$poolToBeSent['template.Insole.right.paintMode'] = 'wireFrame';
$poolToBeSent['template.Brandsole.left.sceneVisible'] = 'true';
$poolToBeSent['template.Brandsole.right.sceneVisible'] = 'true';
$poolToBeSent['template.InnerBrandsole.left.sceneVisible'] = 'true';
$poolToBeSent['template.InnerBrandsole.right.sceneVisible'] = 'true';
$poolToBeSent['global.copyFoambox'] = $copyFoambox?'true':'false';
$poolToBeSent['global.disableUserFoambox'] = $disableUserFoambox?'true':'false';
$poolToBeSent['toGlobals.pathModule.defaultColor'] = '0x00FF00';
$poolToBeSent['toGlobals.radialModule.defaultColor'] = '0x00FF00';
$poolToBeSent['toGlobals.doubleLineModule.defaultColor'] = '0x00FF00';
break;
case 'jjpodo':
$copyFoambox =true;
$disableUserFoambox = false;
$poolToBeSent['global.copyFoambox'] = $copyFoambox?'true':'false';
$poolToBeSent['global.disableUserFoambox'] = $disableUserFoambox?'true':'false';
$poolToBeSent['template.Insole.left.paintMode'] = 'wireFrame';
$poolToBeSent['template.Insole.right.paintMode'] = 'wireFrame';
$poolToBeSent['template.Insole.left.density'] = 1.5;
$poolToBeSent['template.Insole.right.density'] = 1.5;
switch($pprModel)
{
case 'Vlak':
$template = 'templateVlak';
break;
case '3D':
$template = 'template3D';
break;
}
switch($pprBrandsole)
{
case 'Zoolmodel sport':
$poolToBeSent['template.Brandsole_sport_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_sport_outer.right.master'] = 'true';
if ($poolToBeSent['InsoleType'] == 'bothsides')
{
$poolToBeSent['template.Brandsole_sport_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_inner.right.master'] = 'false';
$poolToBeSent['template.Brandsole_sport_inner.left.master'] = 'false';
}
break;
case 'Zoolmodel 216':
$poolToBeSent['template.Brandsole_216_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_216_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_216_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_216_outer.right.master'] = 'true';
if ($poolToBeSent['InsoleType'] == 'bothsides')
{
$poolToBeSent['template.Brandsole_216_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_216_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_216_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_216_inner.right.master'] = 'false';
}
break;
case 'Zoolmodel trendy':
$poolToBeSent['template.Brandsole_trendy_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_trendy_outer.right.master'] = 'true';
if ($poolToBeSent['InsoleType'] == 'bothsides')
{
$poolToBeSent['template.Brandsole_trendy_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_trendy_inner.right.master'] = 'false';
}
break;
case 'Zoolmodel dames trendy':
$poolToBeSent['template.Brandsole_ladytrendy_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_outer.right.master'] = 'true';
if ($poolToBeSent['InsoleType'] == 'bothsides')
{
$poolToBeSent['template.Brandsole_ladytrendy_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_ladytrendy_inner.right.master'] = 'false';
}
break;
case 'Zoolmodel F-leest':
$poolToBeSent['template.Brandsole_F_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_F_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_F_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_F_outer.right.master'] = 'true';
if ($poolToBeSent['InsoleType'] == 'bothsides')
{
$poolToBeSent['template.Brandsole_F_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_F_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_F_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_F_inner.right.master'] = 'false';
}
break;
case 'Zoolmodel H':
$poolToBeSent['template.Brandsole_H_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_H_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_H_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_H_outer.right.master'] = 'true';
if ($poolToBeSent['InsoleType'] == 'bothsides')
{
$poolToBeSent['template.Brandsole_H_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_H_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_H_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_H_inner.right.master'] = 'false';
}
break;
}
if ($shoeSizeL != -1 || $shoeSizeR != -1)
{
if ($shoeSizeR == -1)
$shoeSizeR = $shoeSizeL;
//if ($cadMode != 'positive' && $cadMode != 'foambox')
{
$poolToBeSent['template.Grading.left.size'] = $shoeSizeL;
$poolToBeSent['template.Grading.right.size'] =$shoeSizeR;
}
/*
else
{
$poolToBeSent['template.Brandsole.left.size'] = $shoeSizeL;
$poolToBeSent['template.Brandsole.right.size'] =$shoeSizeR;
}*/
}
break;
case 'jjcorne':
$copyFoambox =true;
$disableUserFoambox = true;
$template = 'templateIndividual';
if ($activity == 'sports')
{
$poolToBeSent['template.Brandsole_sport_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_sport_outer.right.master'] = 'true';
$poolToBeSent['template.Brandsole_sport_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_sport_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_sport_inner.right.master'] = 'false';
}
else if ($shoeType == 'woman')
{
$poolToBeSent['template.Brandsole_ladytrendy_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_outer.right.master'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_ladytrendy_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_ladytrendy_inner.right.master'] = 'false';
}
else
{
$poolToBeSent['template.Brandsole_trendy_outer.left.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_outer.right.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_outer.left.master'] = 'true';
$poolToBeSent['template.Brandsole_trendy_outer.right.master'] = 'true';
$poolToBeSent['template.Brandsole_trendy_inner.left.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_inner.right.on'] = 'true';
$poolToBeSent['template.Brandsole_trendy_inner.left.master'] = 'false';
$poolToBeSent['template.Brandsole_trendy_inner.right.master'] = 'false';
}
switch($footType)
{
case 'planus':
$poolToBeSent['template.MP1.left.on'] = 'true';
$poolToBeSent['template.MP1.right.on'] = 'true';
$poolToBeSent['template.M-Arch.left.on'] = 'true';
$poolToBeSent['template.M-Arch.right.on'] = 'true';
$poolToBeSent['template.L-Arch.left.on'] = 'true';
$poolToBeSent['template.L-Arch.right.on'] = 'true';
$poolToBeSent['template.Pelot234.left.on'] = 'true';
$poolToBeSent['template.Pelot234.right.on'] = 'true';
$poolToBeSent['template.Heel.left.on'] = 'true';
$poolToBeSent['template.Heel.right.on'] = 'true';
break;
case 'cavus':
$poolToBeSent['template.MP1.left.on'] = 'true';
$poolToBeSent['template.MP1.right.on'] = 'true';
$poolToBeSent['template.MP5.left.on'] = 'true';
$poolToBeSent['template.MP5.right.on'] = 'true';
$poolToBeSent['template.TUPM5.left.on'] = 'true';
$poolToBeSent['template.TUPM5.right.on'] = 'true';
$poolToBeSent['template.Pelot234.left.on'] = 'true';
$poolToBeSent['template.Pelot234.right.on'] = 'true';
$poolToBeSent['template.Heel.left.on'] = 'true';
$poolToBeSent['template.Heel.right.on'] = 'true';
break;
default:
$poolToBeSent['template.Heel.left.on'] = 'true';
$poolToBeSent['template.Heel.right.on'] = 'true';
}
if ($shoeSizeL != -1 || $shoeSizeR != -1)
{
if ($shoeSizeR == -1)
$shoeSizeR = $shoeSizeL;
$poolToBeSent['template.Grading.left.size'] = $shoeSizeL;
$poolToBeSent['template.Grading.right.size'] =$shoeSizeR;
}
$poolToBeSent['global.copyFoambox'] = $copyFoambox?'true':'false';
$poolToBeSent['global.disableUserFoambox'] = $disableUserFoambox?'true':'false';
break;
case 'voxelcare':
case 'ppr':
$copyFoambox =false;
$disableUserFoambox = false;
switch($cadMode)
{
case 'standard':
case 'advanced':
case 'individual':
$copyFoambox =true;
$disableUserFoambox = true;
if ($cadMode == 'standard' && $pprCustomModel)
{
$modelCustomModel =& $this->getModel('prefabmodel');
$modelCustomModel->SetId($pprCustomModel);
$customModel =& $modelCustomModel->getData();
$template = $customModel->templatename;
}
else
{
switch($pprBrandsole)
{
case 'Finn':
switch($pprModel)
{
case 'Pronation foot':
case 'Equines foot':
case 'Cavus varus foot':
case 'Cavus valgus foot':
case 'Planus/Pronation foot':
case 'Heel spur insole':
case 'Cup insole':
case 'Comfort shoe insole':
case 'Pronation-equines':
$template = 'templateFinnStandard';
if ($pprIsLowCup)
$template = 'templateFinnStandardLowCup';
break;
case 'Senso basic':
$template = 'templateSensoBasic';
break;
}
break;
case 'Küper':
switch($pprModel)
{
case 'Pronation foot':
case 'Equines foot':
case 'Cavus varus foot':
case 'Cavus valgus foot':
case 'Planus/Pronation foot':
case 'Heel spur insole':
case 'Cup insole':
case 'Comfort shoe insole':
case 'Pronation-equines':
$template = 'templateKuperStandard';
if ($pprIsLowCup)
$template = 'templateKuperStandardLowCup';
break;
}
break;
case 'Sport':
switch($pprModel)
{
case 'Walking':
case 'Racket sport':
$template = 'templateRacketRunning';
break;
case 'Ball sports':
$template = 'templateBallSport';
break;
case 'Senso basic':
$template = 'templateSensoBasic';
break;
}
break;
}
}
break;
case 'positive':
$template = 'templatePositive';
break;
case 'foambox':
$template = 'templateFoamboxNew';
$currentBrandsole = $pprBrandsole .' ('.strtolower($pprInsoleCup) . ')';
$poolToBeSent['template.Brandsoles.left.value'] = $currentBrandsole;
$poolToBeSent['template.Brandsoles.right.value'] = $currentBrandsole;
break;
}
if ($shoeSizeL != -1 || $shoeSizeR != -1)
{
if ($shoeSizeR == -1)
$shoeSizeR = $shoeSizeL;
if ($cadMode != 'positive' && $cadMode != 'foambox')
{
$poolToBeSent['template.Grading.left.size'] = $shoeSizeL;
$poolToBeSent['template.Grading.right.size'] =$shoeSizeR;
}
else
{
$poolToBeSent['template.Brandsole.left.size'] = $shoeSizeL;
$poolToBeSent['template.Brandsole.right.size'] =$shoeSizeR;
$poolToBeSent['template.Brandsoles.left.size'] = $shoeSizeL;
$poolToBeSent['template.Brandsoles.right.size'] =$shoeSizeR;
$poolToBeSent['template.BrandsoleHighCup.left.size'] = $shoeSizeL;
$poolToBeSent['template.BrandsoleHighCup.right.size'] =$shoeSizeR;
}
}
$poolToBeSent['template.Insole.left.paintMode'] = 'wireFrame';
$poolToBeSent['template.Insole.right.paintMode'] = 'wireFrame';
$poolToBeSent['template.Brandsole.left.sceneVisible'] = 'true';
$poolToBeSent['template.Brandsole.right.sceneVisible'] = 'true';
$poolToBeSent['template.InnerBrandsole.left.sceneVisible'] = 'true';
$poolToBeSent['template.InnerBrandsole.right.sceneVisible'] = 'true';
$poolToBeSent['template.BrandsoleHighCup.left.sceneVisible'] = 'true';
$poolToBeSent['template.BrandsoleHighCup.right.sceneVisible'] = 'true';
$modelUser =& $this->getModel('user');
$betaUser = $modelUser->checkPrivilege('Can access beta functions');
$poolToBeSent['global.UseExtendedFoamBox'] = $betaUser?'true':'false';
$poolToBeSent['global.copyFoambox'] = $copyFoambox?'true':'false';
$poolToBeSent['global.disableUserFoambox'] = $disableUserFoambox?'true':'false';
$poolToBeSent['toGlobals.pathModule.defaultColor'] = '0x00FF00';
$poolToBeSent['toGlobals.radialModule.defaultColor'] = '0x00FF00';
$poolToBeSent['toGlobals.doubleLineModule.defaultColor'] = '0x00FF00';
break;
}
$poolToBeSent['Template'] = '';
if ($template)
{
$modelResourceTemplate =& $this->getModel('resourcetemplate');
$resId = $modelResourceTemplate->getResourceFromTemplate($template);
if ($resId)
$poolToBeSent['Template'] ='r'. $resId;
}
$orderArray = array($orderId);
$this->GetMillingOrderData($orderArray,$poolToBeSent,false);
// Enviamos los atributos en la estructura $poolToBeSent
$this->SetData('Info.Count',count($poolToBeSent));
$i=0;
foreach($poolToBeSent as $key=>$item)
{
$prefix = 'Info.Item'.$i;
$model->EncodeBase64($key);
$this->SetData($prefix.'.Key_B',$key);
$model->EncodeBase64($item);
$this->SetData($prefix.'.Value_B',$item);
$i++;
}
}
function GetAttributeByName(&$msg)
{
$orderId = $msg['Request.Params.OrderId'];
$attributeName = trim($msg['Request.Params.Name']);
$model =& $this->getModel('voxelservice');
$modelOrder =& $this->getModel('order');
$modelOrder->SetId($orderId);
$atts =& $modelOrder->getAttributes();
foreach($atts as $att)
if ($att->typename==$attributeName)
{
$valueLeft = $att->value_left;
$valueRight = $att->value_right;
$memoLeft = $att->memo_left;
$memoRight = $att->memo_right;
$mvalueLeft = $att->mvalueleft;
$mvalueRight = $att->mvalueright;
$this->SetData('Id',$att->id);
$this->SetData('DataType',$att->datatypename);
if ($valueLeft !== null)
{
$model->EncodeBase64($valueLeft);
$this->SetData('ValueLeft_B',$valueLeft);
}
if ($valueRight !== null)
{
$model->EncodeBase64($valueRight);
$this->SetData('ValueRight_B',$valueRight);
}
if ($memoLeft !== null)
{
$model->EncodeBase64($memoLeft);
$this->SetData('MemoLeft_B',$memoLeft);
}
if ($memoRight !== null)
{
$model->EncodeBase64($memoRight);
$this->SetData('MemoRight_B',$memoRight);
}
if ($mvalueLeft !== null)
{
$model->EncodeBase64($mvalueLeft);
$this->SetData('MValueLeft_B',$mvalueLeft);
}
if ($mvalueRight !== null)
{
$model->EncodeBase64($mvalueRight);
$this->SetData('MValueRight_B',$mvalueRight);
}
}
}
function SetConfirmationAnswer(&$msg)
{
$messageId = $msg['Request.Params.MessageId'];
$orderId = (int)$msg['Request.Params.OrderId'];
if (!$orderId || !$messageId)
return;
$modelOrder =& $this->getModel('order');
$modelOrder->SetId($orderId);
$modelOrder->setAction($messageId);
if ($messageId == 'FINISHPREDESIGN')
{
$orderData = array();
$orderData['id'] = $orderId;
$myDate = new JDate();
$orderData['predesigned_date'] = $myDate->toMySQL();
$userId = LegacyHelper::getUserId();
$orderData['predesigning_user'] = $userId;
$modelOrder->store($orderData);
}
}
function SetMilledOrders(&$orderIds)
{
$orderIds = explode('+',$orderIds);
$modelOrder =& $this->getModel('order');
if (is_array($orderIds))
{
foreach($orderIds as $orderId)
{
if (strlen($orderId)>0)
{
$lastChar = $orderId[strlen($orderId)-1];
if (ctype_alpha($lastChar))
{
$orderId = substr($orderId,0,-1);
}
}
$modelOrder->SetId($orderId);
$modelOrder->setManuAction('MILL');
}
}
}
function GetConfirmationMessage(&$msg) {
$userId = LegacyHelper::getUserId();
$orderId = $msg['Request.Params.OrderId'];
$modelOrder =& $this->getModel('order');
if (strpos($orderId,'.')===FALSE)
$orderId = (int)$orderId;
else {
$orderId = $modelOrder->getOrderIdFromUUID($orderId);
}
if (!$orderId) {
return;
}
$model =& $this->getModel('voxelservice');
$modelUser =& $this->getModel('user');
$modelOrder->SetId($orderId);
$order =& $modelOrder->getData();
$messageHTML ='';
$messageId='';
switch($order->statenameid)
{
case 'PREDESIGNING':
case 'COMPLETED':
if ($order->delegatedesign==1 && $modelUser->checkPrivilege('Can predesign')) {
$messageId = 'FINISHPREDESIGN';
$messageHTML = JText::_('MESSAGE_FINISH_PREDESIGN');
}
break;
case 'PENDING_APPROVAL':
if ($userId == $order->user) {
$messageId = 'APPROVEDESIGN';
$messageHTML = JText::_('MESSAGE_APPROVE_PREDESIGN');
}
break;
}
if ($messageId) {
$this->SetData('MessageId',$messageId);
$model->EncodeBase64($messageHTML);
$this->SetData('MessageHTML_B',$messageHTML);
}
}
function SetResource(&$msg) {
$myUserId = LegacyHelper::getUserId();
$db =&VoxelCareDB::getDatabase();
$model =& $this->getModel('voxelservice');
$modelResource =& $this->getModel('resource');
$mvcMiddlewareURL = LegacyHelper::getMiddlewareServiceURL();
$id = $msg['Request.Params.Id'];
$name = $msg['Request.Params.Name'];
if (!$name)
{
$name = $msg['Request.Params.Name_B'];
$model->DecodeBase64($name);
}
$category = $msg['Request.Params.Category'];
$type = $msg['Request.Params.Type'];
$father = $msg['Request.Params.Father'];
if ($father && $father[0]=='r')
$realFather = substr($father,1);
else
$realFather = $father;
if (!$realFather || $realFather=='vUser' || $realFather =='vGeneral' || $realFather=='vOrder')
$realFather ='NULL';
else if ($realFather=='vTemplates')
$realFather = -2;
if ($category == 'rvUser')
$userId = $myUserId;
if (!$userId)
$userId = 'NULL';
if ($id && $id[0]=='r')
$realId = substr($id,1);
else
$realId = $id;
if (!$realId || (int)$realId==-1)
$realId =0;
$modelResource->SetId($realId);
$obj = $modelResource->getData();
$data = array();
$data['id'] = $realId;
$data['name'] = $name;
if (!$obj) {
// NEW RESOURCE
$sql = "SELECT id
FROM #__vxc_attributetype
WHERE name = ".$db->Quote($type);
$db->setQuery($sql);
$typeId = $db->loadResult();
$data['type'] = $typeId;
$data['user'] = $userId;
$data['father'] = $realFather;
}
$modelResource->store($data);
$realId = $modelResource->_id;
$dataLeft =& $msg['Request.Params.DataLeft_B'];
$dataRight =& $msg['Request.Params.DataRight_B'];
$dataExtra =& $msg['Request.Params.DataExtra_B'];
$fileleft ='';
$fileright = '';
$fileextra ='';
if ($mvcMiddlewareURL) {
$modelResource->GetRFilenames($realId,$fileleft,$fileright,$fileextra);
}
else {
$modelResource->GetFilenames($realId,$fileleft,$fileright,$fileextra);
}
$dataToStore = array(
array($fileleft,$dataLeft),
array($fileright,$dataRight),
array($fileextra,$dataExtra)
);
foreach( $dataToStore as $packet) {
if ($mvcMiddlewareURL) {
if(strlen($packet[1])>0) {
$model->SetMVCFile($packet[0],$packet[1],COMM_DECRYPT|COMM_UNZIP);
}
else {
$model->DeleteMVCFile($packet[0]);
}
}
else {
if(strlen($packet[1])>0)
$model->SetFile($packet[0],$packet[1],COMM_DECRYPT|COMM_UNZIP);
else
@unlink($packet[0]);
}
}
}
function DeleteResource(&$msg) {
$id = $msg['Request.Params.Id'];
$foot = $msg['Request.Params.Foot'];
if ($id && $id[0]=='r')
$realId = substr($id,1);
else
$realId = $id;
if (!$realId) $realId = 0;
$model =& $this->getModel('voxelservice');
$modelResource =& $this->getModel('resource');
// Borramos el registro de la BBDD
$modelResource->Delete($realId);
// Borramos los ficheros asociados al recurso
$mvcMiddlewareURL = LegacyHelper::getMiddlewareServiceURL();
$fileLeft=$fileRight=$fileExtra='';
if (!$mvcMiddlewareURL) {
$modelResource->GetFilenames($realId,$fileLeft,$fileRight,$fileExtra);
@unlink($fileLeft);
@unlink($fileRight);
@unlink($fileExtra);
}
else {
$modelResource->GetRFilenames($realId,$fileLeft,$fileRight,$fileExtra);
$model->DeleteMVCFile($fileLeft);
$model->DeleteMVCFile($fileRight);
$model->DeleteMVCFile($fileExtra);
}
}
function GetResource($resId,$foot) {
// $this->VLog('resId: '.$resId. ' foot'.$foot);
$resId= trim($resId);
if (!$resId)
return;
if ($resId[0] == 'a')
{
$this->GetAttribute($resId,$foot);
return;
}
if ($resId[0] == 'r')
$realId = substr($resId,1);
else
$realId = $resId;
if (!$resId)
return;
$modelResource =& $this->getModel('resource');
$modelResource->SetId($realId);
$row =& $modelResource->getData();
$datatype = stripslashes($row->dtname);
$type = stripslashes($row->tyname);
$dataLeft =null;
$dataRight =null;
$dataExtra = null;
if ($datatype=="FILE" || $datatype=="IMAGE") {
$mvcMiddlewareURL = LegacyHelper::getMiddlewareServiceURL();
$fileLeft ='';
$fileRight = '';
$fileExtra ='';
if ($mvcMiddlewareURL)
$modelResource->GetRFilenames($realId,$fileLeft,$fileRight,$fileExtra);
else
$modelResource->GetFilenames($realId,$fileLeft,$fileRight,$fileExtra);
$model=& $this->getModel('voxelservice');
// Los atributos que se lean de archivos van siempre comprimidos y encriptado
if ($mvcMiddlewareURL) {
if (!$foot || $foot == 'L')
$model->GetMVCFile($fileLeft,$dataLeft,COMM_CRYPT|COMM_ZIP);
if (!$foot || $foot == 'R')
$model->GetMVCFile($fileRight,$dataRight,COMM_CRYPT|COMM_ZIP);
$model->GetMVCFile($fileExtra,$dataExtra,COMM_CRYPT|COMM_ZIP);
} else {
if (!$foot || $foot == 'L')
$model->GetFile($fileLeft,$dataLeft,COMM_CRYPT|COMM_ZIP);
if (!$foot || $foot == 'R')
$model->GetFile($fileRight,$dataRight,COMM_CRYPT|COMM_ZIP);
$model->GetFile($fileExtra,$dataExtra,COMM_CRYPT|COMM_ZIP);
}
}
// $this->VLog('id:'.$resId. ' type:'.$type. ' datatype: '. $datatype. ' foot:' . $foot. ' dleft:'. $dataLeft.' dleftpath:'. $fileLeft);
$this->SetData('Id',$resId);
$this->SetData('Type',$type);
$this->SetData('DataType',$datatype);
$this->SetData('Foot',$foot);
if ($dataLeft!==null)
$this->SetData('DataLeft_B',$dataLeft);
if ($dataRight!==null)
$this->SetData('DataRight_B',$dataRight);
if ($dataExtra!==null)
$this->SetData('DataExtra_B',$dataExtra);
}
function GetResourceTree(&$msg,&$xml)
{
$db =& VoxelCareDB::getDatabase();
$model =& $this->getModel('voxelservice');
$modelAttribute =& $this->getModel('orderattribute');
$modelResource =& $this->getModel('resource');
$modelUser =& $this->getModel('user');
$modelResourceTranslations =& $this->getModel('resourcetranslations');
$mvcMiddlewareURL = LegacyHelper::getMiddlewareServiceURL();
$orderId = $msg['Request.Params.OrderId'];
$modelOrder =& $this->getModel('order');
if (LegacyHelper::getNewMode()) {
$userid = $msg['Request.Params.userId'];
$orderUUID = $msg['Request.Params.OrderId'];
if($orderUUID && $modelOrder->getOrderIdFromUUID($orderUUID))
$orderId = $modelOrder->getOrderIdFromUUID($orderUUID);
$isAdmin = LegacyHelper::isAdminUser($userid);
}
else
{
$user =& JFactory::getUser();
$userid = $user->id;
$isAdmin = ($user->usertype=='Super Administrator' ||
$user->usertype=='Administrator');
}
if (!$userid) $userid = 0;
$canSaveInGeneral = $modelUser->checkPrivilege('Can save in General Tab');
$canSeeTemplates = $modelUser->checkPrivilege('Can save templates');
if (!$orderId)
$orderId = 0;
$rows =& $modelResource->getResources();
$userrow = new stdClass();
$userrow->id ='vUser';
$userrow->father='ROOT';
$userrow->name= JText::_('User');
$userrow->tyname = 'ResourceFolder';
$userrow->dtname = 'FOLDER';
$userrow->user = $userid;
$userrow->translation = $modelResourceTranslations->getTranslation('r'.$userrow->id);
$writableGeneral = ($isAdmin||$canSaveInGeneral)?1:0;
$generalrow = new stdClass();
$generalrow->id ='vGeneral';
$generalrow->father='ROOT';
$generalrow->name= 'General';
$generalrow->tyname = 'ResourceFolder';
$generalrow->dtname = 'FOLDER';
$generalrow->user = null;
$generalrow->translation = $modelResourceTranslations->getTranslation('r'.$generalrow->id);
$demorow = new stdClass();
$demorow->id ='vDemo';
$demorow->father='ROOT';
$demorow->name= 'Demo';
$demorow->tyname = 'ResourceFolder';
$demorow->dtname = 'FOLDER';
$demorow->user = null;
$demorow->translation = $modelResourceTranslations->getTranslation('r'.$demorow->id);
if ($canSeeTemplates)
{
$templaterow = new stdClass();
$templaterow->id ='vTemplates';
$templaterow->father='ROOT';
$templaterow->name= 'Templates';
$templaterow->tyname = 'ResourceFolder';
$templaterow->dtname = 'FOLDER';
$templaterow->user = null;
$templaterow->translation = $modelResourceTranslations->getTranslation('r'.$templaterow->id);
array_push($rows,$templaterow);
}
array_push($rows,$demorow);
array_push($rows,$userrow);
array_push($rows,$generalrow);
$resourcesStr ='';
foreach($rows as $res) {
if ($res->father)
{
if ($res->father==-1)
$father='vDemo';
else if ($res->father==-2)
$father='vTemplates';
else
$father = $res->father;
}
else
{
if ($res->user)
$father='vUser';
else
$father='vGeneral';
}
if ($res->user)
$writable = 'true';
else
$writable = $writableGeneral?'true':'false';
if ($res->translation)
$res->name = $res->translation;
$foots = array();
switch($res->tyname)
{
case 'ResourceFolder':
case 'InsoleCADData':
case 'InsoleGeometry':
$foots[] ='';
break;
case 'VideoAnalysisData':
if ($mvcMiddlewareURL) {
$folder = $modelResource->GetRFolder($res->id);
$existsL = $model->CheckMVCFile($folder."/".$res->id."/pressure0.xml");
$existsR = $model->CheckMVCFile($folder."/".$res->id."/pressure1.xml");
}
else {
$folder = $modelResource->GetFolder($res->id);
$existsL = @file_exists($folder."/".$res->id."/pressure0.xml");
$existsR = @file_exists($folder."/".$res->id."/pressure1.xml");
}
if ($existsL && $existsR) {
$foots[] = 'L';
$foots[] = 'R';
} else if ($existsR)
$foots[] = 'R';
else if ($existsL)
$foots[] = 'L';
break;
case 'BB1Scan':
case 'FoamBox':
case 'FootPrint':
case 'APD':
$fileLeft ='';
$fileRight ='';
$fileExtra ='';
if ($mvcMiddlewareURL) {
$modelResource->GetRFilenames($res->id,$fileLeft,$fileRight,$fileExtra);
$existsL = $model->CheckMVCFile($fileLeft);
$existsR = $model->CheckMVCFile($fileRight);
}
else {
$modelResource->GetFilenames($res->id,$fileLeft,$fileRight,$fileExtra);
$existsL = @file_exists($fileLeft);
$existsR = @file_exists($fileRight);
}
if ($existsL && $existsR) {
$foots[] = 'L';
$foots[] = 'R';
} else if ($existsR)
$foots[] = 'R';
else if ($existsL)
$foots[] = 'L';
break;
}
foreach($foots as $foot) {
$resourcesStr.="\t\t\n".
"\t\t\t\n".
"\t\t\t\t\n";
if ($foot)
$resourcesStr.="\t\t\t\t\n";
$resourcesStr.= "\t\t\t\t\n".
"\t\t\t\t\n".
"\t\t\t\t\n".
"\t\t\t\t\n".
"\t\t\t\t\n".
"\t\t\t\n".
"\t\t\n";
}
}
$rows =& $modelAttribute->getOrderAttributes($orderId);
$orderrow = new stdClass();
$orderrow->id ='vOrder';
$orderrow->father='ROOT';
$orderrow->name= JText::_('Order');
$orderrow->tyname = 'ResourceFolder';
$orderrow->dtname = 'FOLDER';
array_push($rows,$orderrow);
$attributesStr = '';
foreach($rows as $res)
{
if ($res->id =='vOrder')
$father='rROOT';
else
$father='avOrder';
if (!$res->name)
$name = $res->tyname;
else
$name = $res->name;
$writable = 'false';
$foots = array();
switch($res->tyname)
{
case 'ResourceFolder':
case 'InsoleCADData':
$foots[] ='';
break;
case 'VideoAnalysisData':
if ($mvcMiddlewareURL) {
$folder = $modelAttribute->GetRelativeFolder($res->id);
$existsL = $model->CheckMVCFile($folder."/".$res->id."/pressure0.xml");
$existsR = $model->CheckMVCFile($folder."/".$res->id."/pressure1.xml");
}
else {
$folder = $modelAttribute->GetFolder($res->id);
$existsL = @file_exists($folder."/".$res->id."/pressure0.xml");
$existsR = @file_exists($folder."/".$res->id."/pressure1.xml");
}
if ($existsL && $existsR) {
$foots[] = 'L';
$foots[] = 'R';
}
else if ($existsR)
$foots[] = 'R';
else if ($existsL)
$foots[] = 'L';
break;
case 'BB1Scan':
case 'FoamBox':
case 'FootPrint':
case 'APD':
if ($mvcMiddlewareURL) {
$modelAttribute->GetRelativeFilenames($res->id,$fileLeft,$fileRight,$fileExtra);
$existsL = $model->CheckMVCFile($fileLeft);
$existsR = $model->CheckMVCFile($fileRight);
}
else {
$modelAttribute->GetFilenames($res->id,$fileLeft,$fileRight,$fileExtra);
$existsL = @file_exists($fileLeft);
$existsR = @file_exists($fileRight);
}
// $this->VLog('existsL'.($existsR?'true':'false').' '.'existsR'.($existsL?'true':'false'));
if ($existsL && $existsR) {
$foots[] = 'L';
$foots[] = 'R';
}
else if ($existsR)
$foots[] = 'R';
else if ($existsL)
$foots[] = 'L';
break;
}
foreach($foots as $foot)
{
$attributesStr.="\t\t\n".
"\t\t\t\n".
"\t\t\t\t\n";
if ($foot)
$attributesStr.="\t\t\t\t\n";
$attributesStr.= "\t\t\t\t\n".
"\t\t\t\t\n".
"\t\t\t\t\n".
"\t\t\t\t\n".
"\t\t\t\t\n".
"\t\t\t\n".
"\t\t\n";
}
}
$xml = "\n".
"\n".
"\t\n".
$resourcesStr.
$attributesStr.
"\t\n".
"";
//$xml = file_get_contents("D:\\test.xml");
//file_put_contents("D:\\test.xml",$xml);
$model->EncodeBase64($xml);
}
function StartProcessing()
{
$this->_SESSION['NewData'] = array();
$this->_SESSION['DataToInvalidate']=array();
}
function SetData($key,$value)
{
if ($this->curTicket)
$this->TICKET[$this->curTicket][$key]=$value;
}
function ChangeValueResponse(&$response,$key,$value)
{
if ($key)
$response[$key] = $value;
}
function GetResponse(&$response)
{
if (!$this->TICKET)
$this->TICKET=array();
$dat =array();
if ($this->_SESSION['Special.ClearDataModel'] == 1)
$this->ChangeValueResponse($dat,'Special.ClearDataModel','1');
foreach($this->_SESSION['NewData'] as $key => $value)
$this->ChangeValueResponse($dat,$key,$value);
foreach($this->TICKET as $curTicket=> $ticket)
{
$res = "";
foreach($ticket as $key=>$value)
{
if ($res) $res.=";";
$res .= "$key=$value";
}
$this->ChangeValueResponse($dat,"Tickets.$curTicket.res",$res);
}
$this->encodeMessage($dat,$response);
}
function EndProcessing()
{
foreach($this->_SESSION['NewData'] as $key => $value)
$this->_SESSION['Data'][$key] = $value;
}
function print_var($a,$level,&$html)
{
if ($level>0)
{
$v=$a['_VA'];
$v=str_replace('"','\\\"',$v);
$v=str_replace("'","\'",$v);
$v=str_replace("\n","\\n",$v);
$v=str_replace("\t","\\t",$v);
$v=str_replace("\r","\\r",$v);
$html.="{\"_VA\":\"$v\"";
}
foreach($a as $child => $value)
{
if ($child[0]!="_")
{
if ($html=="")
$html.="{\"".$child."\":";
else
$html.=",\"$child\":";
$this->print_var($a[$child],$level+1,$html);
}
}
$html.="}";
}
function encodeMessage(&$msg, &$html)
{
$model=array();
foreach($msg as $k => $v)
{
$accum=str_replace(".","']['",$k);
$accum="['".$accum."']";
$v=addslashes($v);
$cad='$model'.$accum."['_VA']='".$v."';";
eval($cad);
}
$html="";
$this->print_var($model,0,$html);
}
function GetAttribute($atId,$foot)
{
// $this->VLog('GetAttribute atId: '.$atId.' foot:'.$foot);
$atId= trim($atId);
if (!$atId)
return;
$modelAttribute =& $this->getModel('orderattribute');
if (strpos($atId,'_')!==FALSE || strpos($atId,'~')!==FALSE || strpos($atId,';')!==FALSE) // Es un dbname + orderGuid
{
if (strpos($atId,'~')!==FALSE)
$infoArray = explode('~',$atId);
else if (strpos($atId,';')!==FALSE)
$infoArray = explode(';',$atId);
else
$infoArray = explode('_',$atId);
$orderUUID = $infoArray[1];
$dbname = $infoArray[0];
$realId = $modelAttribute->getIdFromDBName($orderUUID, $dbname);
// $this->VLog('GetattributeNew atId: '.$atId.' realid:'.$realId. ' dbname:'.$dbname);
if (!$realId)
return;
}
else
{
if ($atId[0] == 'r')
{
$this->GetResource($atId,$foot);
return;
}
if ($atId[0] == 'a')
$realId = substr($atId,1);
else
$realId = $atId;
}
$model =& $this->getModel('voxelservice');
$modelAttribute->SetId($realId);
$row =& $modelAttribute->getData();
$datatype = stripslashes($row->datatype);
$type = stripslashes($row->type);
$name = stripslashes($row->name);
$dbname = stripslashes($row->dbname);
$valueleft = stripslashes($row->valueleft);
$valueright = stripslashes($row->valueright);
$dataLeft = null;
$dataRight = null;
$dataExtra = null;
//!! SAM: Esto es una ñapa porque no se cómo comrpobarlo de otra manera.
// $this->VLog('Getattribute dbname: "'.$dbname.'"');
if($dbname=="cad.insoleCADProject") {
$datatype="FILE";
$type = $name = "InsoleCADProject";
}
// $this->VLog('Getattribute datatype: '.$datatype);
$mvcMiddlewareURL = LegacyHelper::getMiddlewareServiceURL();
if ($datatype=="FILE" || $datatype=="IMAGE" || $dbname) {
if ($type=='VideoAnalysisData') {
// Este codigo esta un poco obsoleto, ya que solo se utiliza para el proyecto de la cinta de correr con
// camaras. Solo funciona en modo fichero (no funcioan con los atributos en un storage
$numFiles =0;
$dir = $modelAttribute->GetFolder($realId);
$dir .="/".$realId;
if ($gestor = @opendir($dir)) {
while (false !== ($archivo = @readdir($gestor))) {
if ($archivo != "." && $archivo != "..") {
if ($foot=='L' && $archivo != 'pressure0.xml') continue;
if ($foot=='R' && $archivo != 'pressure1.xml') continue;
$dataFile ="";
$model->GetFile($dir . "/". $archivo,$dataFile,COMM_CRYPT|COMM_ZIP);
$this->SetData("File{$numFiles}Data_B",$dataFile);
$this->SetData("File{$numFiles}Name",$archivo);
$numFiles ++;
}
}
closedir($gestor);
}
$this->SetData('FileCount',$numFiles);
}
$fileLeft ='';
$fileRight ='';
$fileExtra ='';
if ($mvcMiddlewareURL)
$modelAttribute->GetRelativeFilenames($realId,$fileLeft,$fileRight,$fileExtra);
else
$modelAttribute->GetFilenames($realId,$fileLeft,$fileRight,$fileExtra);
// $this->VLog('Getattribute fileLeft: '.$fileLeft);
$loadRight = true;
$franchiseName = SiteOptionsHelper::getFranchiseName();
if (($franchiseName=='lafoot' ||
$franchiseName=='ppr' ||
$franchiseName=='voxelcare' ||
$franchiseName=='velasco' ||
$franchiseName=='jjcorne' ||
$franchiseName=='jjpodo' ||
$franchiseName=='rotterdam') && $type=='InsoleCADProject' && !$dbname)
{
$loadRight = false;
}
// Los atributos que se lean de archivos van siempre comprimidos y encriptado
if ($mvcMiddlewareURL) {
if (!$foot || $foot == 'L')
$model->GetMVCFile($fileLeft,$dataLeft,COMM_CRYPT|COMM_ZIP);
if ($loadRight && (!$foot || $foot == 'R'))
$model->GetMVCFile($fileRight,$dataRight,COMM_CRYPT|COMM_ZIP);
$model->GetMVCFile($fileExtra,$dataExtra,COMM_CRYPT|COMM_ZIP);
} else {
if (!$foot || $foot == 'L')
$model->GetFile($fileLeft,$dataLeft,COMM_CRYPT|COMM_ZIP);
if ($loadRight && (!$foot || $foot == 'R'))
$model->GetFile($fileRight,$dataRight,COMM_CRYPT|COMM_ZIP);
$model->GetFile($fileExtra,$dataExtra,COMM_CRYPT|COMM_ZIP);
}
}
$this->SetData('Type',$type);
$this->SetData('DataType',$datatype);
$this->SetData('Id',$atId);
$this->SetData('Name',$name);
$this->SetData('Foot',$foot);
$this->SetData('ValueLeft',$valueleft);
$this->SetData('ValueRight',$valueright);
if ($dataLeft!==null)
$this->SetData('DataLeft_B',$dataLeft);
if ($dataRight!==null)
$this->SetData('DataRight_B',$dataRight);
if ($dataExtra!==null)
$this->SetData('DataExtra_B',$dataExtra);
}
function StartVideoChunk(&$params)
{
$orderId = (int)$params['Request.Params.OrderId'];
$filename = $params['Request.Params.Filename_B'];
$size = $params['Request.Params.Size'];
$model =& $this->getModel('voxelservice');
$model->DecodeBase64($filename);
$ext = strtoupper(pathinfo($filename, PATHINFO_EXTENSION));
$maxSize = 20*1024*1024;
if ($size > $maxSize)
{
$this->SetData('Status','ERROR');
$this->SetData('Message','ieSizeNotAllowed');
return;
}
if ($ext!= "AVI" && $ext !="MPG" && $ext != "WMV")
{
$this->SetData('Status','ERROR');
$this->SetData('Message','ieExtensionNotAllowed');
return;
}
$db =& VoxelCareDB::getDatabase();
$sql = "SELECT id FROM #__vxc_attributetype WHERE name = 'Video'";
$db->setQuery($sql);
$typeId = $db->loadResult();
$modelAttribute =& $this->getModel('orderattribute');
$modelAttribute->SetId('');
$data = array();
$data['id'] ='';
$data['type'] = $typeId;
$data['orderid'] = $orderId;
$data['value_left'] = $filename;
$modelAttribute->store($data);
$atId = $modelAttribute->_id;
$this->SetData('Status','OK');
$this->SetData('Id',$atId);
}
function getMVCParams($params) {
$jsonStr = $params['Request.Params.mvcparams'];
if (!$jsonStr) return new stdClass();
$model =& $this->getModel('voxelservice');
$model->DecodeBase64($jsonStr);
$json = new Services_JSON();
return $json->decode($jsonStr);
}
function UploadVideoChunk(&$params) {
$modelAttribute =& $this->getModel('orderattribute');
$model =& $this->getModel('voxelservice');
$count = (int)$params['Request.Params.Count'];
$orderId = (int)$params['Request.Params.OrderId'];
$atId = (int)$params['Request.Params.AtId'];
if (!$atId) return;
$fileleft ='';
$fileright ='';
$fileextra ='';
$modelAttribute->GetFilenames($atId,$fileleft,$fileright,$fileextra);
$model->DecodeBase64($params['Request.Params.Data_B']);
$fic = fopen($fileleft,"ab");
$written = fwrite($fic,$params['Request.Params.Data_B'],$count);
fclose($fic);
$this->SetData('Written',$written);
}
function SetAttribute(&$params) {
//$this->VLog("SetAttribute");
//$this->VLog(print_r($params,true));
$modelAttribute =& $this->getModel('orderattribute');
$model =& $this->getModel('voxelservice');
$atId= trim($params['Request.Params.Id']);
$type= trim($params['Request.Params.Type']);
$orderId = (int)$params['Request.Params.OrderId'];
$atname='';
if (!$type)
$type ='NULL';
$db =& VoxelCareDB::getDatabase();
$franchiseName = SiteOptionsHelper::getFranchiseName();
$jsonObj = $this->getMVCParams($params);
//$this->VLog(print_r($jsonObj,true));
// $this->VLog("1");
$orderUUID = '';
if ($jsonObj->order && $jsonObj->attributes && count($jsonObj->attributes)>0) {
$orderUUID = $jsonObj->order->uuid;
$atname = $jsonObj->attributes[0]->name;
$userId = $jsonObj->user->id;
}
else if (strpos($atId,'_')!==FALSE || strpos($atId,'~')!==FALSE || strpos($atId,';')!==FALSE) {
if (strpos($atId,'~')!==FALSE)
$atInfo = explode('~',$atId);
else if (strpos($atId,';')!==FALSE)
$atInfo = explode(';',$atId);
else
$atInfo = explode('_',$atId);
if (count($atInfo)==2) {
$orderUUID = $atInfo[1];
$atname = $atInfo[0];
}
}
if ($orderUUID && $atname) {
// Buscamos el pedido con el guid para ver si podemos extraer el orderId
$modelOrder =& $this->getModel('order');
$orderId = $modelOrder->getOrderIdFromUUID($orderUUID);
// $this->VLog("userId: $userId orderUUID: $orderUUID , atname: $atname, orderId: $orderId ");
if (!$orderId) // Si no tenemos orderId , creamos un pedido nuevo
{
$orderData= array();
if ($userId)
$orderData['user'] = $userId;
else
$orderData['user'] = LegacyHelper::getUserId();
$orderData['uuid'] = $orderUUID;
$orderId = $modelOrder->createNew($orderData);
}
// Miro si el atributo no existe,
$atId = $modelAttribute->getIdFromDBName($orderUUID, $atname);
if (!$atId)
$atId = null;
// $this->VLog("atid: $atId userId: $userId orderUUID: $orderUUID ,atname: $atname, atfullkey: $atname, orderId: $orderId ");
}
if ($franchiseName == 'tecnoinsole' ||$franchiseName == 'velasco')
{
if ($type=='FoamBox') {
$serial =$params['Request.Params.Serial_B'];
if ($serial)
$model->DecodeBase64($serial);
$scannerType = trim($params['Request.Params.ScannerType']);
$serial = trim($serial);
$userId = LegacyHelper::getUserId();
if (!$userId)
$userId = 'NULL';
$dateNow = new JDate();
$scanDate = $dateNow->toMySQL();
if ($scannerType)
$scannerType = $db->Quote($scannerType);
else
$scannerType = 'NULL';
if ($serial)
$serial = $db->Quote($serial);
else
$serial = 'NULL';
$sql = "INSERT INTO #__vxc_scanlog(userid,scan_date,scanner_type,scanner_serial) VALUES ($userId,'$scanDate',$scannerType,$serial)";
$db->Execute($sql);
}
else if ($type=='InsoleCADProject' || $atname == 'cad.insoleCADProject')
{
$orderData = array();
$orderData['id'] = $orderId;
$modelOrder =& $this->getModel('order');
$modelOrder->SetId($orderId);
$userId = LegacyHelper::getUserId();
$orderData['last_save_user'] = $userId;
$modelUser =& $this->getModel('user');
$modelUser->SetId($userId);
if ($modelUser->checkPrivilege('Can check orders')) {
$currentOrder =& $modelOrder->getData();
$currentUser =& $modelUser->getData();
$userName = $currentUser->name;
$reviewers = $currentOrder->reviewers;
if (strrpos($reviewers,$userName)!=strlen($reviewers)- strlen($userName)) {
if ($reviewers) $reviewers .= ",";
$reviewers .= $userName;
$orderData['reviewers'] = $reviewers;
}
}
$modelOrder->store($orderData);
}
}
// $this->VLog("AtId: $atId");
$modelAttribute->SetId($atId);
$sql = "SELECT id FROM #__vxc_attributetype WHERE name = ".$db->Quote($type);
$db->setQuery($sql);
$typeId = $db->loadResult();
//$this->VLog("TypeId: $typeId");
// Comprobamos que solo hay un proyecto del CAD, si ya existe uno, lo reutilizamos
if (($type=='InsoleCADProject'|| $atname == 'cad.insoleCADProject') && $orderId && $typeId)
{
$sql = "SELECT at.id id
FROM #__vxc_attribute at
WHERE at.orderid = $orderId AND at.type = $typeId
ORDER BY at.id ASC";
$db->setQuery($sql);
$atList = $db->loadObjectList();
if (count($atList)>0)
$atId = $atList[0]->id;
}
$data = array();
$valueleft =& $params['Request.Params.ValueLeft'];
$valueright =& $params['Request.Params.ValueRight'];
$atNewValue = null;
if ($type=='InsoleCADProject' || $atname == 'cad.insoleCADProject') {
if ($valueleft=='1' && $valueright =='1')
$atNewValue = 'both';
else if ($valueleft=='1')
$atNewValue = 'left';
else if ($valueright=='1')
$atNewValue = 'right';
else
$atNewValue = 'none';
}
$data['id'] =$atId;
$data['type'] = $typeId;
if ($orderId)
$data['orderid'] = $orderId;
$data['value_left'] = $valueleft;
$data['value_right'] = $valueright;
//$this->VLog("data to Store: ".print_r($data,true));
// creamos o actualizamos
$modelAttribute->store($data);
$atId = $modelAttribute->_id;
//$this->VLog("final atid: ".$atId);
$modelAttribute->SetId($atId);
$row =& $modelAttribute->getData();
if (!$row) return;
$datatype = stripslashes($row->datatype);
$dataleft =& $params['Request.Params.DataLeft_B'];
$dataright =& $params['Request.Params.DataRight_B'];
$dataextra =& $params['Request.Params.DataExtra_B'];
$thumbleft =& $params['Request.Params.ThumbLeft_B'];
$thumbright =& $params['Request.Params.ThumbRight_B'];
$dataextraleft =& $params['Request.Params.DataExtraLeft_B'];
$dataextraright =& $params['Request.Params.DataExtraRight_B'];
$hasFiles = false;
if ($datatype=="FILE" || $datatype=="IMAGE")
$hasFiles = true;
else {
switch($atname) {
case 'cad.insoleCADProject':
case 'intake.foambox':
case 'intake.blueprint':
case 'intake.brandsole':
case 'intake.apd':
case 'intake.video':
case 'intake.bb1data':
$hasFiles = true;
break;
}
}
if($hasFiles) {
switch($atname) {
case 'intake.foambox':
case 'intake.blueprint':
case 'intake.brandsole':
case 'intake.apd':
case 'intake.bb1data':
if (strlen($dataleft)>0 && strlen($dataright)>0)
$atNewValue = 'both';
else if (strlen($dataleft)>0)
$atNewValue = 'left';
else if (strlen($dataright)>0)
$atNewValue = 'right';
else
$atNewValue = 'none';
break;
}
$mvcMiddlewareURL = LegacyHelper::getMiddlewareServiceURL();
// $this->VLog("Middleware URL : $mvcMiddlewareURL");
$numFiles = (int) $params['Request.Params.FileCount'];
for($i=0;$i<$numFiles;$i++) {
$name = $params["Request.Params.File{$i}Name"];
$data =& $params["Request.Params.File{$i}Data_B"];
$folderfilename ='';
if (!$mvcMiddlewareURL) {
$modelAttribute->GetFolderFilename($atId,$name,$folderfilename,true);
if (strlen($data)>0)
$model->SetFile($folderfilename,$data,COMM_DECRYPT|COMM_UNZIP);
else
@unlink($folderfilename);
}
else {
$modelAttribute->GetRelativeFolderFilename($atId,$name,$folderfilename);
if (strlen($data)>0)
$model->SetMVCFile($folderfilename,$data,COMM_DECRYPT|COMM_UNZIP);
else
$model->DeleteMVCFile($folderfilename);
}
}
$fileleft ='';
$fileright ='';
$fileextra ='';
$filethumbleft ='';
$filethumbright ='';
$extraLeft='';
$extraRight = '';
if ($mvcMiddlewareURL) {
$modelAttribute->GetRelativeFilenames($atId,$fileleft,$fileright,$fileextra);
$modelAttribute->GetRelativeThumbs($atId,$filethumbleft,$filethumbright);
$modelAttribute->GetRelativeExtras($atId,$extraLeft,$extraRight);
}
else {
$modelAttribute->GetFilenames($atId,$fileleft,$fileright,$fileextra);
$modelAttribute->GetThumbs($atId,$filethumbleft,$filethumbright);
$modelAttribute->GetExtras($atId,$extraLeft,$extraRight);
}
// $this->VLog("atId: $atId fileLeft: $fileleft ");
$dataToStore = array(
array($fileleft,$dataleft),
array($fileright,$dataright),
array($fileextra,$dataextra),
array($filethumbleft,$thumbleft),
array($filethumbright,$thumbright),
array($extraLeft,$dataextraleft),
array($extraRight,$dataextraright),
);
//SAM: Los atributos que se lean de archivos van siempre comprimidos y encriptado
foreach( $dataToStore as $packet) {
if ($mvcMiddlewareURL) {
if(strlen($packet[1])>0) {
// $this->VLog("Setting MVC file ". $packet[0]);
$model->SetMVCFile($packet[0],$packet[1],COMM_DECRYPT|COMM_UNZIP);
}
else {
// $this->VLog("Deleting MVC file ". $packet[0]);
$model->DeleteMVCFile($packet[0]);
}
}
else {
if(strlen($packet[1])>0)
$model->SetFile($packet[0],$packet[1],COMM_DECRYPT|COMM_UNZIP);
else
@unlink($packet[0]);
}
}
}
if (LegacyHelper::getNewMode()) {
$modelOrder =& $this->getModel('order');
$modelOrder->SetId($orderId);
$atUpdateUUID = LegacyHelper::generateUUID();
$modelOrder->CheckUpdateUUID($atUpdateUUID);
$modelAttribute->saveNewAttInfo($atname,$atUpdateUUID,$atNewValue);
}
$this->SetData('Id',$atId);
}
function SendError($msg) {
$this->VLog("ERROR: $msg");
}
function DefaultProcessMessage($msg) {
switch($msg['Request.Action'])
{
case 'RequestPluginSize':
$this->RequestPluginSize($msg);
break;
case 'RequestPluginChunk':
$this->RequestPluginChunk($msg);
break;
default:
$this->_SESSION['NewData']['Response.Res']="Unknown command: ${msg[Request.Action]}";
}
}
function decodeMessage(&$content) {
$model =& $this->getModel('voxelservice');
$strings=explode(",",$content);
$cuenta=count($strings);
for ($i=0; $i<$cuenta-1; $i++)
{
$value=explode("!",$strings[$i]);
$k = $value[0];
$model->DecodeBase64($k);
$v = $value[1];
if (substr($k,strlen($k)-2,2)!='_B')
$model->DecodeBase64($v);
$params[$k]=$v;
}
return $params;
}
function RequestPluginSize(&$msg)
{
$pluginName = $msg["Request.Params.Plugin"];
$pluginVersion = $msg["Request.Params.Version"];
$useCommonInS3 = LegacyHelper::getPHPGlobalVar("useCommonInS3");
$filesize = FALSE;
if ($useCommonInS3) {
$filename = $pluginName."_".$pluginVersion.".vxp";
if (strpos($filename,'/vxcommon/')==0)
$filename = substr($filename,10);
$headers = @get_headers('http://vxcommon.voxelcare.com/'.$filename,1);
if ($headers) {
$responseCode = substr($headers[0], 9, 3);
if ($responseCode==200)
$filesize = $headers['Content-Length'];
}
}
else {
$filename = LegacyHelper::getCommonParentFolder() .$pluginName."_".$pluginVersion.".vxp";
$filesize = @filesize($filename);
}
//@file_put_contents("c:\\info.txt","$filename : $filesize\n", FILE_APPEND);
if ($filesize!==FALSE)
$this->SetData("Size",$filesize);
else
$this->SetData("Size","-1");
}
function RequestPluginChunk(&$msg) {
$pluginName = $msg["Request.Params.Plugin"];
$pluginVersion = $msg["Request.Params.Version"];
$chunkStart = (int)$msg["Request.Params.Start"];
$chunkSize = (int)$msg["Request.Params.Size"];
$response ='';
$useCommonInS3 = LegacyHelper::getPHPGlobalVar("useCommonInS3");
if ($useCommonInS3) {
$headers = array();
$statusCode = 0;
$requestHeaders = array();
$requestHeaders['Range'] = 'bytes='.$chunkStart.'-'.($chunkStart+$chunkSize);
$filename = $pluginName."_".$pluginVersion.".vxp";
if (strpos($filename,'/vxcommon/')==0)
$filename = substr($filename,10);
$url = 'http://vxcommon.voxelcare.com/'.$filename;
$response = LegacyHelper::httpRequest('GET', $url, null, $requestHeaders, $statusCode,$headers);
}
else {
$filename = LegacyHelper::getCommonParentFolder() .$pluginName."_".$pluginVersion.".vxp";
$fic = @fopen($filename,"rb");
if (@fseek($fic,$chunkStart,SEEK_SET)!=0)
{
@fclose($fic);
$this->SetData("Status","ERROR");
$this->SetData("Readed","0");
$this->SetData("Data_B","");
}
$response = @fread($fic,$chunkSize);
}
$model =& $this->getModel('voxelservice');
$model->EncodeBase64($response);
$this->SetData("Readed",strlen($response));
$this->SetData("Data_B",$response);
}
static public function VLog($error)
{
$filename=$_SERVER['DOCUMENT_ROOT']."/voxelservice.log";
// $filename="voxelservice.log";
$fic=@fopen($filename,"at");
if ($fic)
{
@chmod($filename,0666);
$date=date("Y-m-d H:i:s");
@fputs($fic,"(".$date.") ".$error."\n");
@fclose($fic);
}
}
function Run()
{
global $tiempo_inicio;
$this->StartProcessing();
$this->SetData('Response.Res','OK');
$this->SetData('Response.OKString','');
$this->SetData('Response.ErrorString','');
try {
$msgCount = (int)JRequest::getVar('msgCount');
for ($i=0;$i<$msgCount;$i++) {
$msg=$this->decodeMessage(JRequest::getVar("msg$i"));
$this->curTicket=$msg["ticket"];
if ($this->curTicket)
$this->TICKET[$this->curTicket]=array();
if (!$this->ProcessMessage($msg))
$this->DefaultProcessMessage($msg);
}
$tiempo_fin = microtime(true);
$difTiempo = ($tiempo_fin - $tiempo_inicio)*1000;
$this->SetData('Profiler.LastMessage.ServerTime',"'".(int)$difTiempo." msecs'");
$this->GetResponse($response);
}
catch(Exception $e) {
$this->GetResponse($response);
$this->ChangeValueResponse($response,'Response.Res',"ERROR");
$this->ChangeValueResponse($response,'Response.ErrorString',$e->getMessage());
}
$this->EndProcessing();
//file_put_contents("c:/response".time().".txt",print_r($response,true));
JRequest::setVar('view', 'voxelservice');
JRequest::setVar('task', 'display');
JRequest::setVar('layout', 'default');
JRequest::setVar('format', 'raw');
JRequest::setVar('response', $response);
$this->display();
}
function ProcessMessage(&$msg) {
//$this->VLog('processmessage');
$model =& $this->getModel('voxelservice');
$commondir = $model->GetCommonDir();
$commopts=COMM_NONE;
$userId = $msg['Request.Params.userId'];
if ($userId) {
$myUserId = LegacyHelper::getUserId();
if ($myUserId != $userId)
LegacyHelper::setUserId($userId);
}
switch($msg['Request.Action']) {
case 'VideoAnalysisInit':
$this->VideoAnalysisInit($msg);
break;
case 'GetFileEx':
$commopts=COMM_CRYPT | COMM_ZIP;
case 'GetFile':
$who = $msg['Request.Params.Who'];
$relpath = $msg['Request.Params.Path'];
$type = $msg['Request.Params.Type'];
$contents = "";
switch($type)
{
case 'structural':
$useCommonInS3 = LegacyHelper::getPHPGlobalVar("useCommonInS3");
if ($useCommonInS3) {
$path = $who.'/'.$relpath;
$model->GetVxCommonFile($path,$contents,$commopts);
}
else {
$path = LegacyHelper::getCommonParentFolder().$commondir.'/'.$who.'/'.$relpath;
$model->GetFile($path,$contents,$commopts);
}
break;
case 'attribute':
default:
$path = '/data/'.$relpath;
$model->GetFile($path,$contents,$commopts);
break;
}
$model->EncodeBase64($relpath);
$this->SetData("relpath_B",$relpath);
$this->SetData("data_B",$contents);
break;
case 'GetDirectoryList':
$this->GetDirectoryList($msg);
break;
case 'SetFileEx':
$commopts=COMM_DECRYPT | COMM_UNZIP;
case 'SetFile':
$who = $msg['Request.Params.Who'];
$relpath = $msg['Request.Params.Path'];
$type = $msg['Request.Params.Type'];
$contents =& $msg['Request.Params.Data_B'];
$createBackup = ($msg['Request.Params.CreateBackup']=='true');
switch($type)
{
case 'structural':
$useCommonInS3 = LegacyHelper::getPHPGlobalVar("useCommonInS3");
if ($useCommonInS3) {
$path = $who.'/'.$relpath;
$model->SetVxCommonFile($path,$contents,$commopts);
}
else {
$path = LegacyHelper::getCommonParentFolder().$commondir."/".$who.'/'.$relpath;
$model->SetFile($path,$contents,$commopts);
if ($createBackup) {
$dotPos = strrpos($path,'.');
$date = new JDate();
$date->setOffset(date('Z')/3600.0);
$timestamp = $date->toFormat("%Y%m%d%H%M%S");
if ($dotPos===FALSE)
$newpath = $path .'_'. $timestamp;
else
$newpath = substr($path,0,$dotPos).'_'.$timestamp.substr($path,$dotPos,strlen($path)-$dotPos);
@copy($path,$newpath);
}
}
break;
case 'attribute':
default:
$path = '/data/'.$relpath;
$model->SetFile($path,$contents,$commopts);
if ($createBackup) {
$dotPos = strrpos($path,'.');
$date = new JDate();
$date->setOffset(date('Z')/3600.0);
$timestamp = $date->toFormat("%Y%m%d%H%M%S");
if ($dotPos===FALSE)
$newpath = $path .'_'. $timestamp;
else
$newpath = substr($path,0,$dotPos).'_'.$timestamp.substr($path,$dotPos,strlen($path)-$dotPos);
@copy($path,$newpath);
}
break;
}
break;
case 'GetPrivileges':
$contents = "'VIEW_PRICES,EXPORT_NCP,EXTENDED_MODE";
$modelUser =& $this->getModel('user');
if ($modelUser->checkPrivilege('Can manufacture'))
$contents.=",MANUFACTURING_MODE";
if ($modelUser->checkPrivilege('Can save templates'))
$contents.=",TEMPLATE_MANAGER";
if ($modelUser->checkPrivilege('Franchise Manager') || $modelUser->checkPrivilege('Can export foambox data'))
$contents.=",EXPORT_FOAMBOX";
$contents.="'";
$this->SetData("data",$contents);
break;
case 'GetAttribute':
$atId = $msg['Request.Params.Id'];
$foot = $msg['Request.Params.Foot'];
$this->GetAttribute($atId,$foot);
break;
case 'SetAttribute':
$this->SetAttribute($msg);
break;
case 'GetLanguage':
$this->GetLanguage($msg);
break;
case 'GetResourceTree':
$xml ='';
$this->GetResourceTree($msg,$xml);
$this->SetData('xml_B',$xml);
break;
case 'GetResource':
//$this->VLog(print_r($msg,true));
$id = $msg['Request.Params.Id'];
$foot= $msg['Request.Params.Foot'];
$this->GetResource($id,$foot);
//$this->VLog(print_r($msg,true));
break;
case 'SetResource':
$this->SetResource($msg);
break;
case 'DeleteResource':
$this->DeleteResource($msg);
break;
case 'GetResourceTranslations':
$this->GetResourceTranslations($msg);
break;
case 'GetConfirmationMessage':
$this->GetConfirmationMessage($msg);
break;
case 'SetConfirmationAnswer':
$this->SetConfirmationAnswer($msg);
break;
case 'SetMilledOrders':
$orderIds = $msg['Request.Params.OrderIds'];
$this->SetMilledOrders($orderIds);
break;
case 'GetAttributeByName':
$this->GetAttributeByName($msg);
break;
case 'UploadVideoChunk':
$this->UploadVideoChunk($msg);
break;
case 'StartVideoChunk':
$this->StartVideoChunk($msg);
break;
case 'GetOrderSummary':
// $this->VLog('GetOrderSummary: '.print_r($msg,true));
$orderId = $msg['Request.Params.OrderId'];
if (strchr($orderId,'.')!==FALSE) // Si el id tiene un punto es un pedido nuevo
$this->NewGetOrderSummary($msg);
else
$this->GetOrderSummary($msg);
break;
case 'GetLanguages':
$this->GetLanguages();
break;
case 'SergioTest':
$timeToWait = (int)$msg['Request.Params.Time'];
if (!$timeToWait)
$timeToWait = 60;
sleep($timeToWait);
break;
case 'InitDataUploader':
$this->InitDataUploader($msg);
break;
case 'GetUserRBTree':
$this->GetUserRBTree($msg);
break;
case 'GetUserRBResource':
$this->GetUserRBResource($msg);
break;
case 'DeleteUserRBResource':
$this->DeleteUserRBResource($msg);
break;
case 'SetResourceTranslation':
$this->SetResourceTranslation($msg);
break;
case 'GetOrderCAMProperties':
$orderIds = $msg['Request.Params.OrderIds_B'];
$model =&$this->getModel('voxelservice');
$model->DecodeBase64($orderIds);
$this->GetOrderCAMProperties($orderIds);
break;
default:
return false;
}
return true;
}
}
?>