Example #1
0
 private function createFormData($ReturnResultVO = NULL)
 {
     //adiciona o content na url de envio do formulario
     if ($this->content_id > 0) {
         $this->my_action .= "/id.{$this->content_id}/";
     }
     $formData = new ContentFormView($this->ContentSiteVO, Config::getRootPath($this->my_action));
     $ImageFormView = new ImageFormView();
     $ImageFormView->setFormLabel("Selecionar Imagem");
     $ImageFormView->setQuantity(0);
     //		$ImageFormView->setDescription(array('label'=>Translation::text('Link'), 'visible'=>false, 'type'=>'simpleText'));
     $FileFormView = new FileFormView();
     $FileFormView->setFormLabel("Selecionar Arquivo");
     $FileFormView->setQuantity(0);
     //		$formData->setPersonalInput(array("name"=>"destaque[]","label"=>"Mostrar na Home?", "options"=>array((object) array("name"=>"Palestrantes", "id"=>"33"), (object) array("name"=>"Outros Palestrantes", "id"=>"34"))));
     //trocando o rótulo para Content
     //		$formData->setContent(array("label"=>"Descrição:"));
     //trocando o rótulo para Title
     $formData->setTitle(array("label" => "Titulo:"));
     $formData->setHat(array("label" => "Url:"));
     $formData->setCategory(array("visible" => FALSE, "name" => "category[]", "selected" => array($this->category_id)));
     $formData->setImage($ImageFormView);
     $formData->setFile($FileFormView);
     $formData->setMassiveAttr('visible', FALSE, array('Name', 'Description', 'Content', 'Author', 'TemplateUrl', 'Slug', 'KeyWords', 'Date', 'DateIn', 'DateOut'));
     $formData->setActive(array("value" => "1", "visible" => FALSE));
     $this->my_redirect = "admin/menu_top/select/";
     parent::edit($formData, TRUE, NULL, $this->my_redirect, NULL, $ReturnResultVO);
 }
Example #2
0
 /**
  * envie por post uma array de ids de files, só os ids
  * file/get_ziped_files
  */
 public function getZipedFiles()
 {
     if (!UserClient::getId() > 0) {
         //nao tem permissao
         Navigation::redirect("405");
         exit;
     }
     $array_file_ids = DataHandler::getValueByArrayIndex($_POST, "file_id");
     //Debug::print_r($_REQUEST);
     $array_file_vo = array();
     if (is_array($array_file_ids)) {
         foreach ($array_file_ids as $id) {
             $FileVO = new FileVO();
             $Result = $FileVO->setId($id, TRUE);
             if ($Result->success == TRUE) {
                 $array_file_vo[] = $FileVO;
             }
         }
     } else {
         //erro, não é uma array, verifica se pelo menos é 1 único id
         $id = DataHandler::forceInt($array_file_ids);
         if ($id > 0) {
             //é um id único
             $FileVO = new FileVO();
             $Result = $FileVO->setId($id, TRUE);
             if ($Result->success == TRUE) {
                 $array_file_vo[] = $FileVO;
             }
         } else {
             //erro mesmo, esse dado é zoado, estoura excessão
             throw new Exception("No ids sended", 404);
             exit;
         }
     }
     //a pasta zip precisa existir
     DataHandler::createFolderIfNotExist("upload/zip/");
     //verifica o nome do arquivo baseado nos ids enviados conforme regra inventada agora
     $zip_name = "upload/zip/" . md5(implode("|", $array_file_ids));
     DataHandler::createFolderIfNotExist($zip_name);
     $zip_name = $zip_name . "/teto.zip";
     if (!file_exists($zip_name)) {
         //echo Debug::li($zip_name);exit();
         $Zip = new ZipArchive();
         $Zip->open($zip_name, ZipArchive::CREATE);
         foreach ($array_file_vo as $FileVO) {
             $url = $FileVO->getUrl();
             $array = explode("/", $url);
             $file = $array[count($array) - 1];
             $Zip->addFile($url, $file);
         }
         $Zip->close();
     }
     header("Location: " . Config::getRootPath($zip_name));
     exit;
 }
Example #3
0
function showCategory($categoryStd, $level)
{
    $level0 = $level == 0 ? $categoryStd->name : "";
    $level1 = $level == 1 ? $categoryStd->name : "";
    $level2 = $level == 2 ? $categoryStd->name : "";
    $return = "<tr class=\"gradeX\">";
    $return .= "<td class=\"con0\">" . $level0 . "</td>";
    $return .= "<td class=\"con1\">" . $level1 . "</td>";
    $return .= "<td class=\"con0\">" . $level2 . "</td>";
    $return .= "<td class=\"center con1\">\n                    \t<a href=\"" . Config::getRootPath("backend/category/edit/level.{$level}/id." . $categoryStd->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/edit.png') . "\" alt=\"\"></a>\n                    \t<a href=\"" . Config::getRootPath("backend/category/delete/id." . $categoryStd->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/close.png') . "\" alt=\"\"></a>                    \t\n                   \t</td>\n                   \t";
    return $return;
}
Example #4
0
 public function edit()
 {
     //busca o primeiro content vinculada com essa categoria
     if ($this->category_id > 0) {
         $CategoryVO = new CategoryVO();
         $CategoryVO->setId($this->category_id, TRUE);
         $array_content = $CategoryVO->getLinks("content", 1);
         //se tiver mais de um link
         if (count($array_content) > 0) {
             //pega o primeiro pois aqui só importa 1.
             $LinkVO = $array_content[0];
             if (FALSE) {
                 //ajuda aptana
                 $LinkVO = new LinkVO();
             }
             //echo Debug::li("tem content vinculada com id:".$LinkVO->getLinkedTableId());
             //inicia a ContentEncVO
             $this->ContentEncVO->setId($LinkVO->getLinkedTableId(), TRUE);
         }
     }
     //criar o formView
     $formData = new ContentFormView($this->ContentEncVO, Config::getRootPath($this->my_action));
     //trocando o rótulo para Content
     $formData->setContent(array("label" => "Edite o texto:"));
     $ImageFormView = new ImageFormView();
     $ImageFormView->setFormLabel("Inserir Imagem");
     //quando ta em outro idioma que não o padrao, não pode ter imagem
     $ImageFormView->setQuantity(0);
     $FileFormView = new FileFormView();
     $FileFormView->setFormLabel("Inserir Arquivo");
     $FileFormView->setQuantity(0);
     if ($this->ContentEncVO->getId() > 0) {
         //se tiver id significa que o content já foi adicionado alguma vez, então deixa queto
     } else {
         //seta o id dessa categoria caso não tenha nenhum content vinculado, pois essa categoria só admite 1 content
         $formData->setCategory(array("selected" => array($this->category_id)));
     }
     $formData->setImage($ImageFormView);
     $formData->setFile($FileFormView);
     $formData->setMassiveAttr('visible', FALSE, array('Name', 'Title', 'Hat', 'Description', 'Author', 'TemplateUrl', 'Slug', 'KeyWords', 'Date', 'DateIn', 'DateOut', 'Order'));
     $formData->setSlug(array("value" => "entre_em_contato", "visible" => FALSE));
     $formData->setActive(array("value" => "1", "visible" => FALSE));
     parent::edit($formData, TRUE, NULL, $this->my_redirect);
 }
Example #5
0
 private function createFormData($ReturnResultVO = NULL)
 {
     //busca o primeiro content vinculada com essa categoria
     if ($this->category_id > 0) {
         $CategoryVO = new CategoryVO();
         $CategoryVO->setId($this->category_id, TRUE);
         $array_content = $CategoryVO->getLinks("content", 1);
         //se tiver mais de um link
         if (count($array_content) > 0) {
             //pega o primeiro pois aqui só importa 1.
             $LinkVO = $array_content[0];
             if (FALSE) {
                 //ajuda aptana
                 $LinkVO = new LinkVO();
             }
             //echo Debug::li("tem content vinculada com id:".$LinkVO->getLinkedTableId());
             //inicia a ContentForumVO
             $this->ContentSiteVO->setId($LinkVO->getLinkedTableId(), TRUE);
         }
     } else {
         if ($this->content_id > 0) {
             $this->my_action .= "/id.{$this->content_id}/";
         }
     }
     $formData = new ContentFormView($this->ContentSiteVO, Config::getRootPath($this->my_action));
     $ImageFormView = new ImageFormView();
     $ImageFormView->setFormLabel("Selecionar Foto");
     $ImageFormView->setQuantity(0);
     //		$ImageFormView->setDescription(array('label'=>Translation::text('Link'), 'visible'=>false, 'type'=>'simpleText'));
     $FileFormView = new FileFormView();
     $FileFormView->setFormLabel("Selecionar Arquivo");
     $FileFormView->setQuantity(0);
     //		$formData->setPersonalInput(array("name"=>"destaque[]","label"=>"Mostrar em qual Menu?", "options"=>array((object) array("name"=>"Menu Topo", "id"=>"2"), (object) array("name"=>"Menu Rodapé", "id"=>"3"))));
     //trocando o rótulo para Content
     $formData->setDescription(array("label" => "Edite a coluna da Esquerda:", 'type' => 'htmlText'));
     $formData->setContent(array("label" => "Edite a coluna da Direita:"));
     $formData->setCategory(array("visible" => FALSE, "name" => "category[]", "selected" => array($this->category_id)));
     $formData->setImage($ImageFormView);
     $formData->setFile($FileFormView);
     $formData->setMassiveAttr('visible', FALSE, array('Name', 'Title', 'Hat', 'Author', 'TemplateUrl', 'Slug', 'KeyWords', 'Date', 'DateIn', 'DateOut', 'Order'));
     $formData->setActive(array("value" => "1", "visible" => FALSE));
     $this->my_redirect = "admin/contact/edit/";
     parent::edit($formData, TRUE, NULL, $this->my_redirect, NULL, $ReturnResultVO);
 }
Example #6
0
 protected function getContent($id, $width = "400", $height = "400")
 {
     //pega a CategoryVO
     $ContentVO = new ContentSiteVO();
     $ContentVO->setId($id, TRUE);
     $images = $ContentVO->getImages();
     $stdResult = new stdClass();
     $stdResult->title = $ContentVO->getTitle();
     $stdResult->content = $ContentVO->getContent();
     $stdResult->image_url = array();
     if (count($images) > 0) {
         foreach ($images as $image) {
             $url = Config::getRootPath("/image/get_image/image_id." . $image->id . "/max_width.{$width}/max_height.{$height}/crop.1/");
             //é o link
             $stdResult->image_url[] = $url;
         }
     }
     return $stdResult;
 }
Example #7
0
    However, the FileUpload user interface waits for CSS transition events in several callbacks,
    if a "fade" class is present. These CSS transitions are defined by the Bootstrap CSS.
    If it is not included, either remove the "fade" class from the upload/download templates,
    or define your own "fade" class with CSS transitions.
-->
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.css">
<link rel="stylesheet" href="<?php 
echo Config::getAsset('backend/assets/upload/jquery.fileupload-ui.css');
?>
">
</head>
<body style="overflow:hidden;">
		<br>
		<form id="fileupload" action="<?php 
echo Config::getRootPath('backend/equipe/commit_gallery/type.' . $HttpContentResult->gallery_type . '/id.' . $HttpContentResult->vo->id);
?>
" method="POST" enctype="multipart/form-data">
		<?php 
//Debug::print_r($HttpContentResult->vo->categories_dad);
foreach ($HttpContentResult->vo->categories_dad as $cat) {
    ?>
        			<input type="hidden" value="<?php 
    echo $cat;
    ?>
" name="category[]" />
        			<?php 
}
?>
        <div class="row">
            <div class="span16 fileupload-buttonbar">
Example #8
0
 function getHtml($templateItemSelecionado = "<li class=\"atual\">php[item]</li>", $templateItem = "<li><a href=\"php[link]\">php[item]</a></li>", $templateAnteriorAtivo = "<li class=\"ativo\"><a href=\"php[link]\">&lt;</a></li>", $templateAnteriorInativo = "<li class=\"inativo\">anterior</li>", $templateProximoAtivo = "<li class=\"ativo\"><a href=\"php[link]\">&gt;</a></li>", $templateProximoInativo = "<li class=\"inativo\">pr&oacute;ximo</li>", $templateSeparador = "  ", $templatePaginacao = "<ul class=\"paginacao\"> \r\n\t\t\t\t\t\t\t\t\tphp[primeiro]\r\n\t\t\t\t\t\t\t\t\tphp[anterior]\r\n\t\t\t\t\t\t\t\t\tphp[paginacao]\r\n\t\t\t\t\t\t\t\t\tphp[proximo]\r\n\t\t\t\t\t\t\t\t\tphp[ultimo]\r\n\t\t\t\t\t\t\t\t\t</ul>", $linkAtual = "", $returnCleanIfDontNeedPages = TRUE, $templatePrimeiro = "<li class=\"ativo\"><a href=\"php[link]\">&lt;&lt;</a></li>", $templateUltimo = "<li class=\"ativo\"><a href=\"php[link]\">&gt;&gt;</a></li>")
 {
     //devolve string
     /*
     public $paginaAtual_int;
     public $limitePaginacao_int;
     public $quantidadePorPagina_int;\
     public $quantTotalResultados_int;
     */
     // para uso do fácil
     $paginaAtual = $this->paginaAtual_int;
     $templateItemSelecionado = $templateItemSelecionado;
     $templateItem = $templateItem;
     $templateAnteriorAtivo = $templateAnteriorAtivo;
     $templateAnteriorInativo = $templateAnteriorInativo;
     $templateProximoAtivo = $templateProximoAtivo;
     $templateProximoInativo = $templateProximoInativo;
     $templateSeparador = $templateSeparador;
     $templatePaginacao = $templatePaginacao;
     $templateUltimo = $templateUltimo;
     $templatePrimeiro = $templatePrimeiro;
     $result = $templatePaginacao;
     $quantTotalPagina = ceil($this->quantTotalResultados_int / $this->quantidadePorPagina_int);
     $pagFinal = $quantTotalPagina;
     $metadePaginacao = floor($this->limitePaginacao_int / 2);
     $paginaInicial = 1;
     if ($this->limitePaginacao_int > 0) {
         // faz o calculo se tiver limite
         if ($quantTotalPagina > $this->limitePaginacao_int) {
             $paginaInicial = $this->paginaAtual_int - $metadePaginacao;
             if ($paginaInicial < 1) {
                 $paginaInicial = 1;
             }
         }
     }
     if ($this->limitePaginacao_int > 0) {
         //só faz o calculo se tiver limite
         $paginaFinal = $paginaInicial + $this->limitePaginacao_int;
     } else {
         $paginaFinal = $quantTotalPagina;
     }
     //verificando se a página final não está acima da quantidade de resultados
     if ($paginaFinal > $quantTotalPagina) {
         $paginaFinal = $quantTotalPagina;
     }
     // montando o link do a href=''
     if (empty($linkAtual)) {
         $linkAtual = Config::getRootPath(DataHandler::removeDobleBars(str_replace(Config::getRootApplication(), "", $_SERVER["REQUEST_URI"])));
     }
     if ($returnCleanIfDontNeedPages && $this->quantTotalResultados_int <= $this->quantidadePorPagina_int) {
         //se não precisar de paginação, e for enviado que quando isso acontecer retornar vazio, lá vai o vazio
         return "";
     }
     $primeira = str_replace("/pag.{$paginaAtual}", "/pag.1", $linkAtual);
     if ($paginaAtual > 1) {
         $ultima = str_replace("/pag.{$paginaAtual}", "/pag." . $paginaFinal, $linkAtual);
     } else {
         $ultima = $linkAtual . "/pag." . $pagFinal;
     }
     //exit();
     if (strpos($linkAtual, "/pag.{$paginaAtual}")) {
         //entra aqui se existe a tag de página no padrao com a página atual setada
         $anterior = str_replace("/pag.{$paginaAtual}", "/pag." . ($this->paginaAtual_int - 1), $linkAtual);
         $proximo = str_replace("/pag.{$paginaAtual}", "/pag." . ($this->paginaAtual_int + 1), $linkAtual);
     } else {
         if (strpos($linkAtual, "/pag.")) {
             //entra aqui se tiver em alguma página setada
             $anterior = @ereg_replace("pag\\.[0-9]+", "pag." . ($this->paginaAtual_int - 1), $linkAtual);
             $proximo = @ereg_replace("pag\\.[0-9]+", "pag." . ($this->paginaAtual_int + 1), $linkAtual);
         } else {
             //entra aqui se nunca foi setada nenhuma página
             $anterior = $linkAtual . "/pag." . ($this->paginaAtual_int - 1);
             $proximo = $linkAtual . "/pag." . ($this->paginaAtual_int + 1);
         }
     }
     $anterior = str_replace("http://", "", $anterior);
     $proximo = str_replace("http://", "", $proximo);
     $primeira = str_replace("http://", "", $primeira);
     $ultima = str_replace("http://", "", $ultima);
     $anterior = str_replace("//", "/", $anterior);
     $proximo = str_replace("//", "/", $proximo);
     $primeira = str_replace("//", "/", $primeira);
     $ultima = str_replace("//", "/", $ultima);
     $anterior = "http://" . $anterior;
     $proximo = "http://" . $proximo;
     $primeira = "http://" . $primeira;
     $ultima = "http://" . $ultima;
     $temp_primeira = str_replace("php[link]", $primeira, $templatePrimeiro);
     $temp_ultima = str_replace("php[link]", $ultima, $templateUltimo);
     //definindo qual template usar para o botao anterior
     $temp_anterior = "";
     if ($this->paginaAtual_int > 1) {
         //existe uma página proxima a esta
         $temp_anterior = $templateAnteriorAtivo;
         //echo Debug::li($temp_anterior);
         $temp_anterior = str_replace("php[link]", $anterior, $temp_anterior);
         //echo Debug::li($temp_anterior);
         //exit();
     } else {
         $temp_anterior = $templateAnteriorInativo;
     }
     //defidindo qual template usar para o botao próximo
     $temp_proximo = "";
     if ($this->paginaAtual_int < $quantTotalPagina) {
         //existe uma página anterior a esta
         $temp_proximo = $templateProximoAtivo;
         $temp_proximo = str_replace("php[link]", $proximo, $temp_proximo);
     } else {
         $temp_proximo = $templateProximoInativo;
     }
     //$templateProximo	= ;
     $paginacao_str = "";
     for ($i = $paginaInicial; $i <= $paginaFinal; $i++) {
         //definindo qual template usar
         $temp_pag = "";
         // página atual
         // quando está na página atual, $temp_pag é o item selecionado;
         // SENÂO, é apenas um item.
         // mais pra frente, aqui tá indo com php[item], mais pra frente tem o str_replace disso.
         if ($i == $this->paginaAtual_int) {
             $temp_pag = $templateItemSelecionado;
         } else {
             $temp_pag = $templateItem;
         }
         $item = "";
         if (strpos($linkAtual, "/pag.")) {
             //
             $item = @ereg_replace("/pag.[0-9]+", "/pag." . $i, $linkAtual);
         } else {
             if (!strpos($linkAtual, "/pag.")) {
                 //tem variavel masn ão de pagina
                 $item = $linkAtual . "/pag." . $i;
             }
         }
         // tira barra dupla
         $item = str_replace("http://", "", $item);
         $item = str_replace("//", "/", $item);
         $item = "http://" . $item;
         $temp_pag = str_replace("php[link]", $item, $temp_pag);
         if ($this->nomenclaturaDaPaginacao_array[$i]) {
             $temp_pag = str_replace("php[item]", $this->nomenclaturaDaPaginacao_array[$i], $temp_pag);
         } else {
             $temp_pag = str_replace("php[item]", $i, $temp_pag);
         }
         //adiciona na variavel de buffer
         $paginacao_str .= $temp_pag;
         //poe o separador se não for o ultimo
         if ($i + 1 <= $paginaFinal) {
             $paginacao_str .= $templateSeparador;
         }
     }
     //php[pag_id]
     //php[anterior] - php[paginacao] - php[proximo]
     //		$linkFinal = $linkAtual.$phpVar.$phpId;
     $result = $paginaAtual == 1 ? str_replace("php[primeiro]", "", $result) : str_replace("php[primeiro]", $temp_primeira, $result);
     $result = str_replace("php[proximo]", $temp_proximo, $result);
     $result = str_replace("php[anterior]", $temp_anterior, $result);
     $result = str_replace("php[paginacao]", $paginacao_str, $result);
     $result = $paginaAtual == $pagFinal ? str_replace("php[ultimo]", "", $result) : str_replace("php[ultimo]", $temp_ultima, $result);
     //		$result 			= str_replace("php[link]", 		$linkFinal, 	$result);
     return $result;
 }
Example #9
0
 public function sendToFriend()
 {
     $returnResult = new HttpResult();
     $retornoDaPaginaHTML = new HttpRoot();
     $returnResult->setHttpContentResult($retornoDaPaginaHTML);
     if (!isset($_POST["action"])) {
         $protuct_id = DataHandler::forceInt(DataHandler::getValueByArrayIndex($this->arrayVariable, "id"));
         $retornoDaPaginaHTML->form_action = Config::getRootPath("produto/send_to_friend");
         $retornoDaPaginaHTML->view = "form";
         $retornoDaPaginaHTML->product_id = $protuct_id;
     } else {
         $postData = (object) $_POST;
         $ContentSiteVO = new ContentSiteVO();
         $ReturnResult_vo = $ContentSiteVO->setId($postData->id, TRUE);
         if ($ReturnResult_vo->success) {
             $stdProduct = $ContentSiteVO->toStdClass();
             $stdProduct->array_gallery = $ContentSiteVO->getImages(NULL, "gallery", true);
             // Debug::print_r($stdProduct);  die;
             $template = file_get_contents(Config::getFolderView("/templates/email_produto.php"));
             $tpl_img_path = Config::getRootPath(Config::getFolderView());
             $recover_logo = $stdProduct->hat == 1 ? '<img style="" src="' . $tpl_img_path . '/assets/images/recover-min.png" />' : "";
             $first_image = sprintf("<img width='400px' src='%s' />", Config::getRootPath($stdProduct->array_gallery[0]->url));
             $replace_from = array("###PRODUCT_URI###", "###IMG_PATH###", "###TITLE###", "###HAT###", "###CONTENT###", "###IMG###", "###SENDER_NAME###", "###SENDER_EMAIL###", "###RECEIVER_NAME###", "###RECEIVER_MAIL###", "###RECEIVER_MESSAGE###");
             $replace_to = array(Config::getRootPath('produto/id.' . $stdProduct->id . '/' . $stdProduct->slug), $tpl_img_path, utf8_decode($stdProduct->title), $recover_logo, $stdProduct->content, $first_image, $postData->sender_name, $postData->sender_email, $postData->receiver_name, $postData->receiver_email, $postData->receiver_message);
             $template = str_replace($replace_from, $replace_to, $template);
             // var_dump( $stdProduct , $postData ) ;
             // echo $template ; die;
             $host = Config::SYSTEM_MAIL_SMTP;
             $mail = Config::SYSTEM_MAIL_LOGIN;
             $senha = Config::SYSTEM_MAIL_PASSWORD;
             // var_dump( $host , $mail , $senha ) ; die ;
             ob_start();
             $smtp = new Smtp($host, 587);
             $smtp->user = $mail;
             $smtp->pass = $senha;
             $smtp->debug = true;
             // $from = "'" . $postData->sender_name . "' <" . Config::SYSTEM_MAIL_FROM . ">" ;
             // $to = "'" . $postData->sender_name . "' <" . $postData->receiver_mail . ">" ;
             $from = Config::SYSTEM_MAIL_FROM;
             $to = $postData->receiver_email;
             $subject = "Indicação de produto";
             $msg = $template;
             $retornoDaPaginaHTML->sucess = $smtp->Send($to, $from, $subject, $msg, "text/html") ? true : false;
             ob_end_clean();
             //var_dump( $send ) ;
         }
         $retornoDaPaginaHTML->view = "result";
     }
     return $returnResult;
 }
Example #10
0
$printed_fields = 0;
foreach ($HttpContentResult->arrayVariable->array_image as $image) {
    //							print_r($image);
    $imagePath = Config::getRootPath("image/get_image/image_id.{$image->id}/max_width.150/max_heigth.150");
    // $delete_URL = Config::getRootPath("image/get_image/id.{$image->id}/max_width.150/max_heigth.150");
    $data = $model;
    preg_match_all("/###VALUE_([a-zA-Z_]+)###/", $model, $out);
    for ($i = 0; $i < sizeof($out[0]); $i++) {
        $attr = strtolower($out[1][$i]);
        $data = str_replace($out[0][$i], $image->{$attr}, $data);
    }
    $data = str_replace("###IMAGE_TAG###", "<img src='{$imagePath}' />", $data);
    $data = str_replace("###DELETE_TAG###", "<a class='delete btn' href='image_{$image->id}'>" . Translation::text('delete') . "</a>", $data);
    //				print_r($formView->getShowImageUrl());
    if ($formView->getShowImageUrl()) {
        $data = str_replace("###IMAGE_URL###", "<spam class='url'><b>Url da imagem:</b>" . Config::getRootPath("image/get_image/natural_size.true/direct_show.1/image_id." . $image->id), $data) . "</spam>";
    } else {
        $data = str_replace("###IMAGE_URL###", "", $data);
    }
    echo $data;
    $printed_fields++;
    /// die;
}
$model = preg_replace('/###([a-zA-Z_]+)###/', '', $model);
for ($i = $printed_fields; $i < $quantity; $i++) {
    echo $model;
}
echo "</div>";
if ($multi_fields) {
    echo "<input class='add_more_input btn' id='add_more_images' type='button' name='" . Translation::text('Add more') . "'  value='" . Translation::text("add more") . " '/>";
}
Example #11
0
<?php

include Config::getFolderView('/backend/head.php');
?>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/client/nav-in.php');
?>
<div class="maincontent">	
	<form action="<?php 
echo Config::getRootPath('backend/client/family/commit/');
?>
" method="post">        
        	<div class="form_default">   
                      <p>
                    	<label for="name">Familia</label>
                        <input type="text" name="title" class="sf" value="" />
                    </p>                    
                    <p>
                    	<button>Adicionar</button>
                    </p>
            </div><!--form-->       
        </form>
</div>
</body>
</html>
Example #12
0
            <colgroup>
                <col class="con0" />
                <col class="con1" />
                <col class="con0" />
                <col class="con1" />
            </colgroup>            
            <tbody>    
            	<?php 
if (isset($HttpContentResult->arrayContentsVO)) {
    foreach ($HttpContentResult->arrayContentsVO as $row) {
        $img_array = $row->getImages(NULL, "tagged");
        $img_tag = "";
        if (count($img_array) > 0) {
            $img = $img_array[0];
            //Debug::print_r($img);
            $url = Config::getRootPath("image/get_image/image_id." . $img->id . "/max_width.30/max_height.30/crop.1/");
            $img_tag = "<img src=\"{$url}\" />";
        }
        //verifica se está checado
        $checked = in_array($row->id, $HttpContentResult->vo->products_links) ? " checked=checked " : "  ";
        ?>
        
            	<tr class="gradeA">
                    <td><input <?php 
        echo $checked;
        ?>
 onclick="toogleSelect(this)" id="check_<?php 
        echo $HttpContentResult->vo->id;
        ?>
_<?php 
        echo $row->id;
Example #13
0
 public function show($_return = FALSE)
 {
     $url_config = Config::getRootPath("config");
     $head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
     $head .= '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
     $head .= '<head>' . "\n";
     $head .= '<meta http-equiv="X-UA-Compatible" content="IE=edge" >' . "\n";
     $head .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
     $head .= '<meta name="description" content="' . $this->description . '" />' . "\n";
     $head .= '<meta name="keywords" content="' . $this->keywords . '" />' . "\n";
     $head .= '<title>' . $this->title . '</title>' . "\n";
     $head .= '<link rel="shortcut icon" type="image/x-icon" href="' . Config::getImagePath("favicon.ico") . '" />';
     $head .= "\n<script type=\"text/javascript\" >";
     //pega as variaveis do config php e deixa visivel para js em contexto global
     $head .= "var ROOT_PATH = '" . Config::getRootPath() . "';";
     $head .= "var NEXT_URL = '" . Config::getNextUrl() . "';";
     $head .= "var LAST_URL = '" . Config::getLastUrl() . "';";
     $head .= "var LOCALE = '" . Config::getLocale() . "';";
     $head .= "</script>\n";
     $head .= '<link rel="apple-touch-icon" href="' . Config::getImagePath("icon-ipad.jpg") . '" />';
     foreach ($this->css as $slug => $data) {
         $file_path = $slug . '.css';
         $uri_path = Config::getAsset('assets/css/' . $file_path);
         $sys_path = Config::getFolderView('assets/css/' . $file_path);
         if (!file_exists($sys_path)) {
             $file_path = strpos('.css', $data->path) === FALSE ? $data->path . '.css' : $data->path;
             $uri_path = Config::getAsset('assets/' . $file_path);
             $sys_path = Config::getFolderView('assets/' . $file_path);
             if (!file_exists($sys_path)) {
                 var_dump($slug, '---', $data, $file_path);
                 echo "<!-- arquivo CSS {$uri_path} não encontrado (tentando no file_system : {$sys_path}  )-->\n";
                 exit;
                 continue;
             }
         }
         if ($data->ieOnly) {
             $head .= "\n<!--[if IE]>";
         }
         $head .= "\n<link type=\"text/css\" media=\"" . $data->media . "\" rel=\"stylesheet\" href=\"" . $uri_path . "\" />";
         if ($data->ieOnly) {
             $head .= "\n<![endif]-->";
         }
     }
     foreach ($this->js as $slug => $path) {
         $file_path = $slug . '.js';
         $uri_path = Config::getAsset('assets/js/' . $file_path);
         $sys_path = Config::getFolderView('assets/js/' . $file_path);
         if (!file_exists($sys_path)) {
             $file_path = strpos('.js', $path) === FALSE ? $path . '.js' : $path;
             $uri_path = Config::getAsset('assets/' . $file_path);
             $sys_path = Config::getFolderView('assets/' . $file_path);
             if (!file_exists($sys_path)) {
                 echo "<!-- arquivo JS {$uri_path} não encontrado (tentando no file_system : {$sys_path}  )-->\n";
                 continue;
             }
         }
         $head .= "\n<script type=\"text/javascript\" src=\"" . $uri_path . "\"></script>";
     }
     $head .= "\n</head>";
     if ($_return) {
         return $head;
     }
     echo $head;
 }
Example #14
0
		controls: {
			cut: { visible: true },
			copy: { visible: true },
			paste: { visible: true }
		}
	});
});
</script>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/info_estrutura/nav-detail.php');
?>
<div class="maincontent">	
	<form action="<?php 
echo Config::getRootPath('backend/info_estrutura/commit/id.' . $id);
?>
" method="post">
        
        	<div class="form_default">
        			<?php 
//Debug::print_r($HttpContentResult->vo->categories_dad);
foreach ($HttpContentResult->vo->categories_dad as $cat) {
    ?>
        			<input type="hidden" value="<?php 
    echo $cat;
    ?>
" name="category[]" />
        			<?php 
}
?>
Example #15
0
<?php

include Config::getFolderView('/backend/head.php');
?>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/product/nav-in.php');
?>
<div class="maincontent">	
	<form action="<?php 
echo Config::getRootPath('backend/product/family/commit/');
?>
" method="post">        
        	<div class="form_default">   
                      <p>
                    	<label for="name">Familia</label>
                        <input type="text" name="title" class="sf" value="" />
                    </p>                    
                    <p>
                    	<button>Adicionar</button>
                    </p>
            </div><!--form-->       
        </form>
</div>
</body>
</html>
Example #16
0
" />
		<script type="text/javascript"><?php 
include Config::getFolderView('/assets/js/home.php');
?>
</script>
	</head>
	<body>
		<div id="content">
			<div id="header">
				<ul>
					<li style="margin-left:60px;"><a href="<?php 
echo Config::getRootPath('produtos');
?>
">Produtos</a></li>
					<li><a href="<?php 
echo Config::getRootPath('clientes');
?>
">clientes</a></li>
				</ul>
				<div id="line"></div>
			</div>
			<div id="products">
				<?php 
foreach ($HttpContentResult->produtos as $produto) {
    ?>
				<div class="products" id="products-<?php 
    echo $i;
    ?>
">
					<?php 
    Debug::print_r($produto);
Example #17
0
 private function consultValues()
 {
     $ProductModelQuadroDAO = ProductModelQuadroDAO::getInstance();
     $this->MaterialDAO = MaterialDAO::getInstance();
     $this->ColorDAO = ColorDAO::getInstance();
     $this->StyleDAO = StyleDAO::getInstance();
     $this->FormatDAO = FormatDAO::getInstance();
     $this->ThemeDAO = ThemeDAO::getInstance();
     $this->CompositionDAO = CompositionDAO::getInstance();
     $this->TechniqueDAO = TechniqueDAO::getInstance();
     $this->TypeDAO = TypeDAO::getInstance();
     //fazendo o que precisa fazer para ter os dados do menu
     $this->arrayMaterial = $this->MaterialDAO->select(MaterialDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayMaterial);
     $this->arrayColor = $this->ColorDAO->select(ColorDAO::RETURN_VO, NULL, 1);
     // $this->addTotal($this->arrayColor);
     //Debug::print_r($this->arrayColor);
     //busca as imagens
     if ($this->arrayColor->success) {
         $tempVO = array();
         foreach ($this->arrayColor->result as $ColorVO) {
             $tempStdColor = $ColorVO->toStdClass();
             //primeira letra maiuscula
             $tempStdColor->name = ucfirst($tempStdColor->name);
             $tempVO[] = $tempStdColor;
             //Debug::print_r($tempVO);
         }
         $this->arrayColor->result = $tempVO;
     }
     $this->arrayStyle = $this->StyleDAO->select(StyleDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayStyle);
     $this->arrayFormat = $this->FormatDAO->select(FormatDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayFormat);
     $this->arrayTheme = $this->ThemeDAO->select(ThemeDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayTheme);
     $this->arrayComposition = $this->CompositionDAO->select(CompositionDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayComposition);
     $this->arrayTechnique = $this->TechniqueDAO->select(TechniqueDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayTechnique);
     $this->arrayType = $this->TypeDAO->select(TypeDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayType);
     //define a base da url
     $this->url_final = Config::getRootPath("quadros/filter");
     $this->arrayBreadCrumb = array();
     if ($this->arrayVariable != NULL) {
         $temp_array = array_splice($this->arrayRestFolder, 2, count($this->arrayRestFolder) - 1);
         //Debug::print_r($temp_array);
         //exit();
         if ($this->arrayRestFolder[1] == "filter") {
             $this->url_final .= "/" . implode("/", $temp_array);
             //tirando a página da url final
             $this->url_final = preg_replace("/\\/pag\\.[0-9]+?/", "", $this->url_final);
         }
         $array_relacao_variavel_resultado = array();
         $array_relacao_variavel_resultado["search"] = "requestSearch";
         $array_relacao_variavel_resultado["material"] = "requestMaterial";
         $array_relacao_variavel_resultado["color"] = "requestColor";
         $array_relacao_variavel_resultado["style"] = "requestStyle";
         $array_relacao_variavel_resultado["format"] = "requestFormat";
         $array_relacao_variavel_resultado["theme"] = "requestTheme";
         $array_relacao_variavel_resultado["composition"] = "requestComposition";
         $array_relacao_variavel_resultado["technique"] = "requestTechnique";
         $array_relacao_variavel_resultado["type"] = "requestType";
         $array_relacao_variavel_resultado["promocoes"] = "requestPromocao";
         foreach ($this->arrayVariable as $variable => $value) {
             if ($variable == "search" && DataHandler::forceString($value) != NULL) {
                 $this->requestResumeSearch = DataHandler::forceString(urldecode($value));
                 if (strlen($this->requestResumeSearch) > 10) {
                     $this->requestResumeSearch = substr($this->requestResumeSearch, 0, 10) . "...";
                 }
             }
             if (DataHandler::forceInt($value) > 0) {
                 if (isset($array_relacao_variavel_resultado[$variable]) && $array_relacao_variavel_resultado[$variable] != null) {
                     $this->{$array_relacao_variavel_resultado}[$variable] = DataHandler::forceInt(trim($value));
                 }
             } else {
                 //se não nenhum desses itens segnifica q é sujeira por isso não grava na url
                 continue;
             }
             //popula o bread crumb de maneira incompleta pois seria esforço a toa procurar o título aqui
             $this->arrayBreadCrumb[] = new BreadCrumbInfoVO("", $variable, $value);
             //concatena as veriaveis ja enviadas para fazer a base do link
             //$this->url_final .= "/".$variable.".".$value;
         }
     }
 }
Example #18
0
" class="users"><span>Equipe</span></a></li>
            <li <?php 
if (count($array_folders) > 1 && ($array_folders[1] == 'info' || $array_folders[1] == 'info_segmento')) {
    echo ' class="current"';
}
?>
><a href="<?php 
echo Config::getRootPath('backend/info_segmento/show');
?>
" class="elements"><span>Infos</span></a></li>
            
        </ul>
    </div><!-- tabmenu -->
    
    <div class="accountinfo" style="width:200px;">
    	<img src="<?php 
echo Config::getAsset('backend/assets/images/avatar.png');
?>
" alt="Avatar" />
        <div class="info" style="float:right;">
        	<h3>Sérgio Fix</h3>
            <p>
            	<a href=""></a> <a href="<?php 
echo Config::getRootPath("backend/login/logout/");
?>
">Logout</a>
            </p>
        </div><!-- info -->
    </div><!-- accountinfo -->
</div><!-- header -->
Example #19
0
    However, the FileUpload user interface waits for CSS transition events in several callbacks,
    if a "fade" class is present. These CSS transitions are defined by the Bootstrap CSS.
    If it is not included, either remove the "fade" class from the upload/download templates,
    or define your own "fade" class with CSS transitions.
-->
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.css">
<link rel="stylesheet" href="<?php 
echo Config::getAsset('backend/assets/upload/jquery.fileupload-ui.css');
?>
">
</head>
<body style="overflow:hidden;">
		<br>
		<form id="fileupload" action="<?php 
echo Config::getRootPath('backend/info_estrutura/commit_gallery/type.' . $HttpContentResult->gallery_type . '/id.' . $HttpContentResult->vo->id);
?>
" method="POST" enctype="multipart/form-data">
		<?php 
//Debug::print_r($HttpContentResult->vo->categories_dad);
foreach ($HttpContentResult->vo->categories_dad as $cat) {
    ?>
        			<input type="hidden" value="<?php 
    echo $cat;
    ?>
" name="category[]" />
        			<?php 
}
?>
        <div class="row">
            <div class="span16 fileupload-buttonbar">
Example #20
0
		controls: {
			cut: { visible: true },
			copy: { visible: true },
			paste: { visible: true }
		}
	});
});
</script>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/product/nav-detail.php');
?>
<div class="maincontent">	
	<form action="<?php 
echo Config::getRootPath('backend/product/commit/id.' . $id);
?>
" method="post">
        
        	<div class="form_default">
        			<?php 
//Debug::print_r($HttpContentResult->vo->categories_dad);
foreach ($HttpContentResult->vo->categories_dad as $cat) {
    ?>
        			<input type="hidden" value="<?php 
    echo $cat;
    ?>
" name="category[]" />
        			<?php 
}
?>
Example #21
0
?>
><a href="<?php 
echo Config::getRootPath('backend/client/change/id.' . $HttpContentResult->vo->id);
?>
" class="table">Infos</a></li>
            	<li <?php 
if (count($array_folders) > 2 && $array_folders[3] == 'tagged') {
    echo ' class="current"';
}
?>
><a href="<?php 
echo Config::getRootPath('backend/client/gallery/type.tagged/id.' . $HttpContentResult->vo->id);
?>
" class="form">Destaque</a></li>
                <li <?php 
if (count($array_folders) > 2 && $array_folders[3] == 'gallery') {
    echo ' class="current"';
}
?>
><a href="<?php 
echo Config::getRootPath('backend/client/gallery/type.gallery/id.' . $HttpContentResult->vo->id);
?>
" class="form">Galeria</a></li>
            </ul>
        </div>
        <h3 class="open"><!--Custom Text--></h3>
        <div class="content" style="display: block;"><!--Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.--></div>
	</div>
	
</div><!-- leftmenu -->
Example #22
0
?>
><a href="<?php 
echo Config::getRootPath('backend/product/gallery/type.video/id.' . $HttpContentResult->vo->id);
?>
" class="form">Video</a></li>
                <li <?php 
if (count($array_folders) > 2 && $array_folders[3] == '360') {
    echo ' class="current"';
}
?>
><a href="<?php 
echo Config::getRootPath('backend/product/gallery/type.360/id.' . $HttpContentResult->vo->id);
?>
" class="form">360&deg;</a></li>
                <li <?php 
if (count($array_folders) > 2 && $array_folders[2] == 'file') {
    echo ' class="current"';
}
?>
><a href="<?php 
echo Config::getRootPath('backend/product/file/id.' . $HttpContentResult->vo->id);
?>
" class="form">Arquivos</a></li>
            </ul>
        </div>
        <h3 class="open"><!--Custom Text--></h3>
        <div class="content" style="display: block;"><!--Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.--></div>
	</div>
	
</div><!-- leftmenu -->
Example #23
0
        echo $row->id;
        ?>
"><?php 
        echo $row->id;
        ?>
</td>
                            <td align="center"><img src="<?php 
        echo Config::getRootPath("image/get_image/image_id." . $row->id . "/max_width.80/max_height.255");
        ?>
" alt="" /></td>
                            <td><?php 
        echo $row->url;
        ?>
</td>
                            <td align="center"><?php 
        echo "<a href=\"" . Config::getRootPath("backend/info/delete_image/product_id." . $HttpContentResult->vo->id . "/id." . $row->id . "/type." . $HttpContentResult->gallery_type) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/close.png') . "\" alt=\"\"></a>";
        ?>
</td>
                        </tr>
                         <?php 
    }
}
?>
  
		                </tbody>
                    </table>
                 </div><!--sTableWrapper-->
                    
            </div><!-- listview -->

		</div><!--gallery-->
Example #24
0
 /**
  * baixar o zip do mal
  * ?products={product_id:N,gallery:true,dimensions:true,files:[]}|{product_id:N,gallery:true,dimensions:true,files:[]}
  */
 public function getZip()
 {
     if (!UserClient::getId() > 0) {
         //nao tem permissao
         Navigation::redirect("405");
         exit;
     }
     set_time_limit(0);
     //tratando variaveis enviadas
     $files_id = DataHandler::getValueByArrayIndex($_POST, "file_id");
     $imagens = DataHandler::getValueByArrayIndex($_POST, "imagens");
     $pdf = DataHandler::getValueByArrayIndex($_POST, "pdf");
     //precisa saber quais sao os produtos envolvidos
     $array_products_id = array();
     $array_files = array();
     if ($files_id) {
         foreach ($files_id as $file_id) {
             $temp_array = explode("_", $file_id);
             $product_id = $temp_array[0];
             if (!in_array($product_id, $array_products_id)) {
                 $array_products_id[] = $product_id;
                 $array_files[] = $product_id;
             }
         }
     }
     if ($imagens) {
         foreach ($imagens as $product_id) {
             if (!in_array($product_id, $array_products_id)) {
                 $array_products_id[] = $product_id;
             }
         }
     }
     if ($pdf) {
         foreach ($pdf as $product_id) {
             if (!in_array($product_id, $array_products_id)) {
                 $array_products_id[] = $product_id;
             }
         }
     }
     $ReturnResultVO = new ReturnResultVO();
     $ProductVO = new ContentSiteVO();
     $FileVO = new FileVO();
     //se tiver produtos para tratar
     if (count($array_products_id) > 0) {
         //a pasta zip precisa existir
         $zip_path = "upload/zip/";
         DataHandler::createFolderIfNotExist($zip_path);
         $array_products_to_zip = array();
         $unique_str = "";
         //nome final do zip que vai baixar, adiciona alguns parametros indicadores
         $zip_name = "teto";
         if (count($array_products_id) > 0) {
             //sao varios produtos
             $zip_name = $zip_name . "_produtos";
         }
         //cada indice dessa array, tem que ser array, terá um json com as info:
         foreach ($array_products_id as $product_id) {
             $resultProduto = $ProductVO->setId($product_id, TRUE);
             if ($resultProduto->success) {
                 $stdProduct = $ProductVO->toStdClass();
                 $array_products_to_zip[] = $stdProduct;
                 $array_images = array();
                 if ($imagens) {
                     if (in_array($product_id, $imagens)) {
                         $array_gallery = $ProductVO->getImages(NULL, "gallery", true);
                         foreach ($array_gallery as $imageVO) {
                             $array_images[] = $imageVO->getURL();
                             $unique_str .= "|" . $imageVO->getId();
                             //add a imagem na pasta
                         }
                         //
                         $array_dimensions = $ProductVO->getImages(NULL, "dimensions", true);
                         foreach ($array_dimensions as $imageVO) {
                             $array_images[] = $imageVO->getURL();
                             //add a imagem na pasta
                             $unique_str .= "|" . $imageVO->getId();
                         }
                     }
                 }
                 $stdProduct->images = $array_images;
                 $array_file_vo = array();
                 //cria a pasta do produto no zip
                 $product_folder_name = DataHandler::strToURL($stdProduct->title);
                 if (count($array_files) > 0) {
                     if (in_array($product_id, $array_files)) {
                         //esse produto pediu algum file
                         $temp_array_files = $ProductVO->getFiles();
                         foreach ($temp_array_files as $FileVO) {
                             if (in_array($FileVO->id, $files_id)) {
                                 $array_file_vo[] = $FileVO;
                                 $unique_str .= "|f." . $file_id;
                                 //add a url do arquivo no zip na pasta
                             }
                         }
                     }
                 }
                 $stdProduct->files = $array_file_vo;
                 $stdProduct->pdf = null;
                 //verificar se quer o pdf
                 if (count($pdf) > 0) {
                     $unique_str .= "|pdf!|";
                     //quero pdf
                     //ver com onde foi salvo
                     if (in_array($product_id, $pdf)) {
                         //ele quer esse pdf, provavelmente se chegou aqui é porque ele realmente exite
                         //mas vou conferir de novo
                         $pdf_url = "upload/pdf/{$product_id}/" . $ProductVO->slug . ".pdf";
                         if (file_exists($pdf_url)) {
                             $stdProduct->pdf = $pdf_url;
                         }
                     }
                 }
             }
             //end if produto sucess
         }
         $folder_name = md5($unique_str);
         DataHandler::createFolderIfNotExist($zip_path . $folder_name . "/");
         $zip_name = $zip_path . $folder_name . "/" . $zip_name . ".zip";
         //echo $zip_name;exit();
         if (!file_exists($zip_name)) {
             //echo Debug::li($zip_name);exit();
             $Zip = new ZipArchive();
             $Zip->open($zip_name, ZipArchive::CREATE);
             //adicionando os arquivos escolhidos
             foreach ($array_products_to_zip as $ProductStd) {
                 $product_slug_folder = $ProductStd->id . "_" . DataHandler::strToURL($ProductStd->title);
                 foreach ($ProductStd->files as $FileVO) {
                     $url = $FileVO->getUrl();
                     $array = explode("/", $url);
                     $file = $array[count($array) - 1];
                     $Zip->addFile($url, $product_slug_folder . "/arquivos/" . $file);
                 }
                 foreach ($ProductStd->images as $url) {
                     //$url 	= $ImageVO->getUrl();
                     $array = explode("/", $url);
                     $file = $array[count($array) - 1];
                     $file = str_replace("original_", "", $file);
                     $Zip->addFile($url, $product_slug_folder . "/imagens/" . $file);
                 }
                 if ($ProductStd->pdf) {
                     $url = $ProductStd->pdf;
                     $array = explode("/", $url);
                     $file = $array[count($array) - 1];
                     $Zip->addFile($url, $product_slug_folder . "/ficha_tecnica.pdf");
                 }
             }
             $Zip->close();
         }
         header("Location: " . Config::getRootPath($zip_name));
         exit;
     }
     exit;
 }
Example #25
0
$HttpContentResult = $HttpResult->getHttpContentResult();
$id = isset($HttpContentResult->vo->id) ? $HttpContentResult->vo->id : "";
$name = isset($HttpContentResult->vo->id) ? $HttpContentResult->vo->name : "";
?>

<?php 
include Config::getFolderView('/backend/head.php');
?>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/category/nav-in.php');
?>
<div class="maincontent">	
	<form action="<?php 
echo Config::getRootPath('backend/category/commit/id.' . $id);
?>
" method="post">
        
        	<div class="form_default">        			
        		<?php 
if (isset($HttpContentResult->array_category)) {
    if ($HttpContentResult->array_category != NULL) {
        ?>
       	 
                    <p>
                    	<label for="category_id">Superior</label>
                        <select name="category_id">
                          <?php 
        foreach ($HttpContentResult->array_category as $row) {
            ?>
Example #26
0
?>
><a href="<?php 
echo Config::getRootPath('backend/client/add/');
?>
" class="form">Inserir Cliente</a></li>
                <li <?php 
if (count($array_folders) > 3 && $array_folders[2] == 'family' && ($array_folders[3] == 'show' || $array_folders[3] == 'change')) {
    echo ' class="current"';
}
?>
><a href="<?php 
echo Config::getRootPath('backend/client/family/show');
?>
" class="form">Familia</a></li>
                <li <?php 
if (count($array_folders) > 3 && $array_folders[2] == 'family' && $array_folders[3] == 'add') {
    echo ' class="current"';
}
?>
><a href="<?php 
echo Config::getRootPath('backend/client/family/add/');
?>
" class="form">Inserir Familia</a></li>
            </ul>
        </div>
        <h3 class="open"><!--Custom Text--></h3>
        <div class="content" style="display: block;"><!--Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.--></div>
	</div>
	
</div><!-- leftmenu -->
Example #27
0
<div class="sidebar">
	<div id="accordion">
        <h3 class="open"><!--Seja bem-vindo--></h3>
        <div class="content" style="display: block;">
        	<ul class="leftmenu">
            	<li <?php 
if (count($array_folders) > 2 && $array_folders[2] == 'show') {
    echo ' class="current"';
}
?>
><a href="<?php 
echo Config::getRootPath('backend/equipe/show/');
?>
" class="table">Listagem</a></li>
                <li <?php 
if (count($array_folders) > 2 && $array_folders[2] == 'add') {
    echo ' class="current"';
}
?>
><a href="<?php 
echo Config::getRootPath('backend/equipe/add/');
?>
" class="form">Inserir Membro</a></li>
            </ul>
        </div>
        <h3 class="open"><!--Custom Text--></h3>
        <div class="content" style="display: block;"><!--Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.--></div>
	</div>
	
</div><!-- leftmenu -->
Example #28
0
		controls: {
			cut: { visible: true },
			copy: { visible: true },
			paste: { visible: true }
		}
	});
});
</script>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/info_estrutura/nav-detail.php');
?>
<div class="maincontent">	
	<form action="<?php 
echo Config::getRootPath('backend/info/commit/id.' . $id);
?>
" method="post">
        
        	<div class="form_default">
        			<?php 
//Debug::print_r($HttpContentResult->vo->categories_dad);
foreach ($HttpContentResult->vo->categories_dad as $cat) {
    ?>
        			<input type="hidden" value="<?php 
    echo $cat;
    ?>
" name="category[]" />
        			<?php 
}
?>
Example #29
0
            		<td><?php 
        echo $row->id;
        ?>
</td>
                    <td><?php 
        echo $row->title;
        ?>
</td>
                    <td><?php 
        echo $row->slug;
        ?>
</td>
                    <td></td>
                    <td>
                    	<?php 
        echo "<a href=\"" . Config::getRootPath("backend/info_segmento/change/id." . $row->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/edit.png') . "\" alt=\"\"></a>\n                    \t<a href=\"" . Config::getRootPath("backend/info_segmento/delete/id." . $row->id) . "\" class=\"iconlink2\"><img src=\"" . Config::getAsset('backend/assets/images/icons/small/black/close.png') . "\" alt=\"\"></a>";
        ?>
                    </td>
                </tr>                      
                <?php 
    }
}
?>
            </tbody>
            <tfoot>
                <tr>
                	<th class="head1">ID</th>
                    <th class="head1">Página</th>
                    <th class="head0">Slug</th>
                    <th class="head1"></th>
                    <th class="head0">Ações</th>
Example #30
0
 /**
  * 
  * Para acessar isso aqui seria a url: pdf_download/produto/id.N/
  */
 public function cliente($id = false)
 {
     if ($id == FALSE) {
         $id = DataHandler::forceInt(DataHandler::getValueByArrayIndex($this->arrayVariable, "id"));
     }
     if ($id > 0) {
         $ContentSiteVO = new ContentSiteVO();
         $ReturnResult_vo = $ContentSiteVO->setId($id, TRUE);
         if ($ReturnResult_vo->success) {
             $stdProduct = $ContentSiteVO->toStdClass();
             $stdProduct->array_gallery = $ContentSiteVO->getImages(NULL, "gallery", true);
             $stdProduct->array_tagged = $ContentSiteVO->getImages(NULL, "tagged", true);
             $html_start = "<html><body>";
             $html_end = "</body></html>";
             $detail_page = file_get_contents(Config::getFolderView("/PdfDownload/detail.tpl"));
             $image_page = file_get_contents(Config::getFolderView("/PdfDownload/image.tpl"));
             $dimension_page = file_get_contents(Config::getFolderView("/PdfDownload/dimension.tpl"));
             $tpl_img_path = "view/site/";
             //Config::getAsset() ;
             $recover_logo = $stdProduct->hat == 1 ? '<img style=" margin-top: 4px; margin-left: 5px; " src="' . $tpl_img_path . '/PdfDownload/recover_logo.png" />' : "";
             $stdProduct->description = utf8_decode($stdProduct->description);
             $stdProduct->title = utf8_decode($stdProduct->title);
             $stdProduct->content = utf8_decode($stdProduct->content);
             $common_tpl_data = array("###IMG_TPL_PATH###", "###content###", "###title###", "###PRODUCT_URI###", "###recover_logo###");
             $common_data = array($tpl_img_path, $stdProduct->content, $stdProduct->title, Config::getRootPath('produto/id.' . $stdProduct->id . '/' . $stdProduct->slug), $recover_logo);
             $detail_page = str_replace($common_tpl_data, $common_data, $detail_page);
             $image_page = str_replace($common_tpl_data, $common_data, $image_page);
             $dimension_page = str_replace($common_tpl_data, $common_data, $dimension_page);
             $detail_page = str_replace("###description###", $stdProduct->description, $detail_page);
             $html = $html_start . $detail_page;
             foreach ($stdProduct->array_gallery as $image) {
                 $w = 600;
                 $h = 550;
                 $img_url = "image/get_image/image_id." . $image->id . "/max_width.{$w}/max_height.{$h}/";
                 // Debug::print_r( $img_url ) ;
                 // $tmp = file_get_contents( $img_url ) ;
                 // unset( $tmp ) ;
                 // $new_page = str_replace( "###IMAGE_SRC###" , Config::getRootPath( "image/get_image/image_id." .  $image->id . "/max_width.600/max_height.525/" )  , $image_page ) ;
                 // $new_page = str_replace( "###IMAGE_SRC###" , $image->url  , $image_page ) ;
                 $img_name = preg_replace("/\\.jpg\$/", "", $image->url);
                 // $sys_img = $img_name . "_w{$w}_h{$h}_m_no_crop.jpg"  ;
                 $sys_img = $img_name . "_w{$w}_h{$h}_m_cache_crop.jpg";
                 // Debug::print_r($sys_img ) ;
                 // var_dump( file_exists($sys_img) ) ;
                 // die;
                 $new_page = str_replace("###IMAGE_SRC###", $sys_img, $image_page);
                 // Debug::print_r( $image ) ; die;
                 $html .= $new_page;
                 // break;
             }
             $html .= $html_end;
             // echo $html ; die;
             $dompdf = new DOMPDF();
             $dompdf->load_html($html);
             $dompdf->render();
             //$dompdf->stream( "upload/pdf/" . $stdProduct->id . "/" . $stdProduct->slug . ".pdf") ;
             $file = $stdProduct->slug . ".pdf";
             $path = "upload/pdf/" . $stdProduct->id . "/";
             if (!dir($path)) {
                 mkdir($path, 0777, true);
             }
             $html_file = "print.html";
             $html = str_replace("src=\"", "src=\"" . Config::getRootPath(), $html);
             $fp = fopen($path . $html_file, "w");
             fwrite($fp, $html);
             fclose($fp);
             $pdfoutput = $dompdf->output();
             // $filename = $output;
             $fp = fopen($path . $file, "w");
             fwrite($fp, $pdfoutput);
             fclose($fp);
             return true;
         } else {
             //não achou um produto com esse id
             return false;
             Navigation::redirect("");
         }
     } else {
         return false;
         //não mandou o id, vai pra listagem ((!?) TODO: ver se é isso mesmo)
         Navigation::redirect("clientes");
     }
 }