Exemplo n.º 1
0
 public function __construct($door = "")
 {
     //iniciando a config básico, a menos que exita outro config, este vai ser o que vai ficar valendo
     $domain = Navigation::getURIDomain();
     if ($door) {
         //use em $door ":8080" por exemplo
         $domain = str_replace($door, "", $domain);
     }
     include "configs/" . $domain . "/config.php";
     //se não foi passado algum locale na url apos o nome do site faz um redirect passando o locale padrão
     $folders_array = Navigation::getURI(Config::getAliasFolder(), Navigation::URI_RETURN_TYPE_ARRAY);
     $locale = Config::getLocale();
     Translation::setLocale($locale);
     //inicia e pega resultado da controller
     $this->HttpResult = $this->getControllerResult();
     //agora verifica que tipo de retorno esperado e chama a view, se for o caso
     $ignore_name = Config::getAliasFolder();
     if (Config::getLocale()) {
         $ignore_name .= "/" . Config::getLocale();
     }
     //url com trata com regras de rota
     $url = explode("/", Config::rewriteUrl(Navigation::getURI($ignore_name, Navigation::URI_RETURN_TYPE_STRING)));
     $retornoDaView = self::searchFile($url, Config::getFolderView());
     if ($retornoDaView->success) {
         //echo Debug::li("retornoDaView:".$retornoDaView->urlToInclude);
         $this->view = $retornoDaView->urlToInclude;
     } else {
         $this->view = Config::getFolderView() . "/index.php";
     }
 }
Exemplo n.º 2
0
 public function __construct()
 {
     //iniciando a config básico, a menos que exita outro config, este vai ser o que vai ficar valendo
     include "configs/" . str_replace(":8888", "", Navigation::getURIDomain()) . "/config.php";
     //se não foi passado algum locale na url apos o nome do site faz um redirect passando o locale padrão
     //echo Debug::li(Config::getAliasFolder());
     $folders_array = Navigation::getURI(Config::getAliasFolder(), Navigation::URI_RETURN_TYPE_ARRAY);
     //echo Debug::li(Config::getRootApplication());
     //$folders_array = Navigation::getURI(Config::getAliasFolder(), Navigation::URI_RETURN_TYPE_ARRAY);
     $locale = Config::getLocale();
     Translation::setLocale($locale);
     //inicia e pega resultado da controller
     $this->HttpResult = $this->getControllerResult();
     //agora verifica que tipo de retorno esperado e chama a view, se for o caso
     $ignore_name = Config::getAliasFolder();
     if (Config::getLocale()) {
         $ignore_name .= "/" . Config::getLocale();
     }
     //url com trata com regras de rota
     $url = explode("/", Config::rewriteUrl(Navigation::getURI($ignore_name, Navigation::URI_RETURN_TYPE_STRING)));
     $retornoDaView = self::searchFile($url, Config::getFolderView());
     //Navigation::searchFileOrFolder(Config::getRootApplication()."/".Config::getLocale(), Config::getFolderView(), Navigation::SEARCH_FILE_MODE_FILE);
     //echo Debug::li("retornoDaView");
     //Debug::print_r($retornoDaView);
     if ($retornoDaView->success) {
         //echo Debug::li("retornoDaView:".$retornoDaView->urlToInclude);
         $this->view = $retornoDaView->urlToInclude;
     } else {
         $this->view = Config::getFolderView() . "/index.php";
     }
     //exit();
     //Debug::print_r("[SEARCH_FILE_MODE_CLASS_AND_METHOD]:".Navigation::searchFileOrFolder(Config::FOLDER_ROOT_APPLICATION, "view/democrart/", Navigation::SEARCH_FILE_MODE_CLASS_AND_METHOD, "", TRUE));
 }
Exemplo n.º 3
0
 /**
  * @param $captcha_code
  * @return exibição de imagem
  * @desc é necessário passar o codigo gerado pela classe NakedEncrypt
  */
 static function generate($captcha_code)
 {
     // Seleciona uma imagem que está na pasta bg/ com o nome 0.jpg à 9.jpg,
     // está imagem que vai ser o fundo da nossa imagem de segurança.
     $backgoundImage = Config::getFolderView("captcha/naked/");
     $backgoundImage .= rand(0, 9);
     $backgoundImage .= ".jpg";
     //posicionamento de horizontal
     $x = 10;
     //posicionamento de vertical
     $y = 0;
     // Separo o codigo de dois em dois numeros e transformo em caracter para formar a string do captcha
     for ($i = 1; $i < strlen($captcha_code) / 3; $i++) {
         $char = chr($captcha_code[$i] . $captcha_code[$i + 1]);
         // Gera um fontSize para a fonte de 3 à 5.
         $fontSize = rand(3, 5);
         // Seleciona as color RGB, menos muito clara, pois o fundo é branco, por isso de 0 à 200.
         $sel_colorR = rand(0, 200);
         $sel_colorG = rand(0, 200);
         $sel_colorB = rand(0, 200);
         // Joga os caracteres em um determinado lugar da imagem, x e y, sendo x sempre ele mais ele, pra não perder a ordem.
         // Nome que começa em 10 e termina em 30, pois temos 6 caracteres, e nossa imagem tem 180px,
         // por isso que vai ser de 30 em 30. e 10 para não ficar um caractere em cima do outro.
         $x += rand(10, 30);
         // o Y vai de 0 a 30, não a 50, pois pode colortar pois nossa imagem é de 50 px de altura.
         $y = rand(0, 30);
         // Aqui crio a color de cada caractere, RGB.
         $color = imagecolorallocate($image, $sel_colorR, $sel_colorG, $sel_colorB);
         // desenho o lugar dos caracteres de acolordo com as posições x e y.
         imagestring($image, $fontSize, $x, $y, $char, $color);
     }
     // Cria a imagem.
     return $image = imagecreatefromjpeg($backgoundImage);
 }
Exemplo n.º 4
0
 public function __construct($arrayRestFolder = NULL)
 {
     if ($arrayRestFolder != NULL) {
         $this->arrayVariable = Navigation::getVariableArraySlug($arrayRestFolder);
         $this->arrayRestFolder = $arrayRestFolder;
         //por padrão ele popula as infos que ele possui com o que veio na restFolder, pode ser resetado utilizando resetInfoPost
         $this->infoPost = new FileInfoPostVO($this->arrayVariable);
     }
     $this->defaultFolderForNewFiles = Config::getFolderView() . "/upload/file/";
     $this->moduleName = "facil_file";
 }
Exemplo n.º 5
0
 public function init()
 {
     $returnResult = parent::init();
     //$ContentVO->toStdClass(Config::getLocale());
     $SelectData = new ContentSelectView($this->arrayContentsVO);
     $SelectData->setGoToLocation(array("value" => "admin/menu_top"));
     $SelectData->gerate();
     $SelectData->setMassiveAttr('visible', FALSE, array('Name', 'Hat', 'Description', 'Content', 'Author', 'TemplateUrl', 'Slug', 'KeyWords', 'Date', 'DateIn', 'DateOut', 'Order'));
     $SelectData = $SelectData->getFormData();
     $HttpContentResult = $returnResult->getHttpContentResult();
     $HttpContentResult->selectData = $SelectData;
     $returnResult->setHttpContentResult($HttpContentResult);
     $HttpResult = $returnResult;
     //para o botao de inserir
     $HttpContentResult->url_insert = Config::getRootPath("admin/menu_top/insert/");
     include Config::getFolderView('admin/content/select.php');
     exit;
     //print_r($returnResult);exit();
     return $returnResult;
 }
Exemplo n.º 6
0
 public function init()
 {
     if ($this->sub == "blog") {
         $returnResult = parent::init("id", " DESC ");
     } else {
         $returnResult = parent::init();
     }
     //blog é id 36
     //$ContentVO->toStdClass(Config::getLocale());
     //Debug::print_r($this->arrayRestFolder[1]);exit();
     $SelectData = new ContentSelectView($this->arrayContentsVO);
     $SelectData->setGoToLocation(array("value" => "admin/page"));
     $SelectData->gerate();
     $SelectData->setMassiveAttr('visible', FALSE, array('Name', 'Hat', 'Description', 'Content', 'Author', 'TemplateUrl', 'KeyWords', 'Date', 'DateIn', 'DateOut', 'Order'));
     $SelectData->title["label"] = "Titulo:";
     $SelectData->slug["label"] = "Url:";
     $SelectData->slug["type"] = "url_local";
     //faz com que mostre a config::getRootPatc + url
     $SelectData = $SelectData->getFormData();
     $HttpContentResult = $returnResult->getHttpContentResult();
     $HttpContentResult->selectData = $SelectData;
     $returnResult->setHttpContentResult($HttpContentResult);
     $HttpResult = $returnResult;
     $HttpContentResult->sub = $this->sub;
     //para o botao de inserir
     $HttpContentResult->url_insert = Config::getRootPath("admin/page/insert/{$this->sub}");
     $content_sub = Config::getFolderView("admin/content/{$this->sub}/select.php");
     if (file_exists($content_sub)) {
         include $content_sub;
         exit;
     }
     include Config::getFolderView('admin/content/select.php');
     exit;
     //print_r($returnResult);exit();
     return $returnResult;
 }
Exemplo n.º 7
0
<?php

$HttpContentResult = $HttpResult->getHttpContentResult();
$id = isset($HttpContentResult->vo->id) ? $HttpContentResult->vo->id : "";
//print_r($HttpContentResult->vo);
include Config::getFolderView('/backend/head.php');
?>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/info/nav-detail.php');
?>
<div class="maincontent">
<a href="<?php 
echo Config::getRootPath('backend/info/gallery/upload/type.' . $HttpContentResult->gallery_type . '/id.' . $HttpContentResult->vo->id);
?>
" class="iconlink" id="upload" style="margin-top:15px; margin-left: 15px;"><img src="<?php 
echo Config::getAsset('backend/assets/images/icons/small/black/video.png');
?>
" class="mgright5" alt=""> <span>Upload</span></a>
    <div class="left">
        <div id="gallery" class="gallery">        
            <ul class="submenu">
                <li class="current"><a href="#gridview">Grid View</a></li>
                <li><a href="#listview">List View</a></li>
            </ul>
            
            <br />
            
            <div id="gridview" class="thumbview">
            	<?php 
Exemplo n.º 8
0
<?php

$HttpContentResult = $HttpResult->getHttpContentResult();
$id = isset($HttpContentResult->vo->id) ? $HttpContentResult->vo->id : "";
//print_r($HttpContentResult->vo);
include Config::getFolderView('/backend/head.php');
?>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/equipe/nav-detail.php');
?>
<div class="maincontent">
<a href="<?php 
echo Config::getRootPath('backend/equipe/gallery/upload/type.' . $HttpContentResult->gallery_type . '/id.' . $HttpContentResult->vo->id);
?>
" class="iconlink" id="upload" style="margin-top:15px; margin-left: 15px;"><img src="<?php 
echo Config::getAsset('backend/assets/images/icons/small/black/video.png');
?>
" class="mgright5" alt=""> <span>Upload</span></a>
    <div class="left">
        <div id="gallery" class="gallery">        
            <ul class="submenu">
                <li class="current"><a href="#gridview">Grid View</a></li>
                <li><a href="#listview">List View</a></li>
            </ul>
            
            <br />
            
            <div id="gridview" class="thumbview">
            	<?php 
Exemplo n.º 9
0
<?php

include_once "library/facil3/core/modules/category/dao/CategoryDAO.class.php";
include_once Config::FOLDER_APPLICATION . "modules/content/dao/ContentSiteDAO.class.php";
include_once "library/facil3/core/controller/interface/HTTPControllerInterface.class.php";
include_once Config::getFolderView("/content_module/HttpContentModule.class.php");
include_once "library/facil3/core/modules/file/dao/FileDAO.class.php";
include_once "library/facil3/navigation/http/HttpResult.class.php";
include_once DataHandler::removeDobleBars(Config::getFolderView() . "/HttpRoot.class.php");
/**
 * @author 	Renato Miawaki
 * @desc	Controller central, se nenhuma outra controller for encontrada, esta controller é iniciada
 * 			init é chamada caso nenhum metodo que combine com a requisição seja encontrada
 */
class Produtos
{
    private $arrayRestFolder = array();
    private $arrayVariable = array();
    private $DAO;
    public function __construct($arrayRestFolder)
    {
        Config::getConection();
        $this->DAO = CategoryDAO::getInstance();
        if ($arrayRestFolder != NULL) {
            $this->arrayRestFolder = $arrayRestFolder;
            $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
            //$this->MenuController = new MenuController($this->arrayVariable);
        }
    }
    /**
     * para listagem de produtos
Exemplo n.º 10
0
		active = 0;
	}
	$.ajax({
		  url: ROOT_URL+'backend/info_segmento/update_active/id.'+id+"/active."+active+"/",
		  dataType: 'json',
		  data: { },
		  success: function(data){
				//alert("salvo");
			}
		});
}
</script>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/info_estrutura/nav-in.php');
?>
<div class="maincontent">	

	<div class="left">
		<table cellpadding="0" cellspacing="0" border="0" class="dyntable" id="example">
            <thead>
                <tr>
                	<th class="head0" width="5%">ID</th>
                    <th class="head1" width="35%">Página</th>
                    <th class="head0" width="35%">Slug</th>
                    <th class="head1" width="15%"></th>
                    <th class="head0" width="10%">Ações</th>
                </tr>
            </thead>
            <colgroup>
Exemplo n.º 11
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");
     }
 }
Exemplo n.º 12
0
<?php

include_once "library/facil3/navigation/http/HttpResult.class.php";
include_once "library/facil3/core/controller/interface/HTTPControllerInterface.class.php";
include_once DataHandler::removeDobleBars(Config::getFolderView() . "/client/account/PurchaseInfo.class.php");
include_once "library/facil3/core/acl/UserClient.php";
include_once "library/e_commerce/modules/coupon/dao/CouponDAO.class.php";
include_once "library/e_commerce/modules/coupon/vo/CouponVO.class.php";
include_once "library/e_commerce/modules/purchase/dao/PurchaseOrderDAO.class.php";
include_once "library/e_commerce/modules/money_history/MoneyHistory.class.php";
include_once 'view/democrart/client/account/MoneyHistoryInfo.class.php';
include_once 'library/democrart/modules/partner/dao/PartnerDAO.class.php';
include_once Config::FOLDER_APPLICATION . "controller/admin/default/Content.php";
include_once "library/facil3/core/modules/category/dao/CategoryDAO.class.php";
include_once Config::FOLDER_APPLICATION . "modules/content/vo/ContentSiteVO.class.php";
include_once "library/facil3/core/dao/LinkDAO.class.php";
class Account implements HTTPControllerInterface
{
    private $arrayRestFolder = array();
    private $arrayVariable = array();
    private $DAO;
    public function __construct($arrayRestFolder = NULL)
    {
        if (!UserClient::isAlive()) {
            Navigation::redirect("client/login");
            exit;
        }
        $id_user = UserClient::getId();
        $PartnerDAO = PartnerDAO::getInstance();
        $ReturnPartnerDAO = $PartnerDAO->selectById($id_user);
        if ($ReturnPartnerDAO->success && count($ReturnPartnerDAO->result) > 0) {
Exemplo n.º 13
0
<?php

$HttpContentResult = $HttpResult->getHttpContentResult();
//de onde veio o usuário $to
$to = isset($HttpContentResult->to) ? $HttpContentResult->to : "";
include Config::getFolderView('/backend/head.php');
?>
<body style="background:#fff;">
<div class="loginlogo">
	<img src="images/logo.png" alt="Logo" />
</div><!--loginlogo-->

<div class="notification notifyError loginNotify">Invalid username or password. (Type anything)</div>

<?php 
//Retorna o erro do login
if ($HttpContentResult->returnResult != NULL) {
    if (!$HttpContentResult->returnResult->success) {
        ?>
			<div class="notification notifyError loginNotify" style="display:block;">
			<?php 
        echo $HttpContentResult->returnResult->message;
        ?>
			</div>
			<?php 
    }
}
?>

<form id="loginform" action="<?php 
echo Config::getRootPath('backend/login/check/to/' . $to);
Exemplo n.º 14
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>
Exemplo n.º 15
0
<?php

$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 
Exemplo n.º 16
0
 public function lembrarSenha()
 {
     $ReturnResultVO = new ReturnResultVO();
     $email = DataHandler::getValueByArrayIndex($_GET, "email");
     $DAO = UserDAO::getInstance();
     $ResultData = $DAO->select(UserDAO::RETURN_STD_OBJECT, $id = NULL, $active = NULL, $user_type_id = NULL, $login = NULL, $password = NULL, $email = $email);
     $ReturnResultVO->success = $ResultData->success;
     if ($ResultData->success) {
         if (count($ResultData->result) > 0) {
             $userStd = $ResultData->result[0];
             //Debug::print_r($userStd);
             //======
             $smtp = new Smtp(Config::SYSTEM_MAIL_SMTP, 587);
             $smtp->user = Config::SYSTEM_MAIL_LOGIN;
             $smtp->pass = Config::SYSTEM_MAIL_PASSWORD;
             ob_start();
             $smtp->debug = true;
             $from = Config::SYSTEM_MAIL_FROM;
             $to = $VO->getEmail();
             $subject = "Teto lembrar senha";
             $mensagem = file_get_contents(Config::getFolderView("/templates/email_para_lembrar_senha.html"));
             $mensagem = str_replace("###login", $userStd->login, $mensagem);
             $mensagem = str_replace("###senha", $userStd->password, $mensagem);
             $smtp->Send($to, $from, $subject, $mensagem, "text/html");
             ob_end_clean();
         }
     }
     echo $ReturnResultVO->toJson();
     exit;
 }
Exemplo n.º 17
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;
 }
Exemplo n.º 18
0
<?php

include_once "library/facil3/core/controller/admin/DefautAdmin.php";
include_once "library/facil3/navigation/http/HttpResult.class.php";
include_once "library/facil3/core/controller/interface/HTTPControllerInterface.class.php";
include_once DataHandler::removeDobleBars(Config::getFolderView() . "/HttpRoot.class.php");
include_once DataHandler::removeDobleBars(Config::getFolderView() . "/client/HttpClientAjax.class.php");
include_once Config::FOLDER_APPLICATION . "modules/user_detail/dao/UserDetailDAO.class.php";
include_once Config::FOLDER_APPLICATION . "modules/user_detail/vo/UserDetailVO.class.php";
/**
 * @author 	Renato Miawaki
 * @desc	Controller central, se nenhuma outra controller for encontrada, esta controller é iniciada
 * 			init é chamada caso nenhum metodo que combine com a requisição seja encontrada
 */
class Admin extends DefautAdmin implements HTTPControllerInterface
{
    protected $arrayRestFolder = array();
    protected $arrayVariable = array();
    public function __construct($arrayRestFolder = NULL)
    {
        if ($arrayRestFolder != NULL) {
            $this->arrayRestFolder = $arrayRestFolder;
            $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
        }
        parent::__construct();
    }
    public function init()
    {
        $returnResult = new HttpResult();
        $returnResult->setSuccess(1);
        //iniciando o resultado para o html
Exemplo n.º 19
0
<?php

$HttpContentResult = $HttpResult->getHttpContentResult();
$id = isset($HttpContentResult->vo->id) ? $HttpContentResult->vo->id : "";
include Config::getFolderView('/backend/head.php');
?>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/client/nav-in.php');
?>
<script type="text/javascript">
jQuery(document).ready(function() {
	jQuery('#example').dataTable( {
		"sPaginationType": "full_numbers"
	});
});
function toogleSelect(element){
	var id = parseInt($(element).attr("id").split("_")[1]);
	var client_id = parseInt($(element).attr("id").split("_")[2]);
	var method = "add_client/";
	if(!$(element).is(':checked')){
		method = "remove_client/";
	}
	$.ajax({
		  url: ROOT_PATH+'backend/client/family/'+method,
		  dataType: 'json',
		  data: { id:id , client_id:client_id},
		  success: function(data){
				//alert("salvo");
			}
Exemplo n.º 20
0
<?php

include Config::getFolderView('/backend/head.php');
?>
<script type="text/javascript" src="<?php 
echo Config::getAsset('backend/assets/js/custom/dashboard.js');
?>
"></script>

<body class="bodygrey">

<?php 
include Config::getFolderView('/backend/nav.php');
?>

<div class="sidebar">
	<div id="accordion">
        <h3 class="open"><!--Seja bem-vindo--></h3>
        <div class="content" style="display: block;">
        	<ul class="leftmenu"><!--
            	<li class="current"><a href="dashboard.html" class="home">General</a></li>
                <li><a href="forms.html" class="form">Form Styling</a></li>
                <li><a href="tables.html" class="table">Table Styling</a></li>
                <li><a href="gallery.html" class="gallery">Image Gallery</a></li>
                <li><a href="grid.html" class="grid">Grid Styling</a></li>
                <li><a href="calendar.html" class="calendar">Calendar</a></li>
                <li><a href="buttons.html" class="buttons">Buttons &amp; Icons</a></li>
                <li><a href="editor.html" class="editor">WYSIWYG Editor</a></li>
                <li><a href="filemanager.html" class="file">File Manager</a></li>
                <li><a href="invoice.html" class="form">Invoice</a></li>
                <li><a href="404.html" class="error">404 Page</a></li>-->
Exemplo n.º 21
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;
 }
Exemplo n.º 22
0
            $i++;
    }
}
$model .= "</div>";
//echo "<div id='files_model' class='multi_input_model' style='display:none'>{$model}</div>";
echo "<div id='files_container'>";
$printed_fields = 0;
//Debug::print_r($HttpContentResult->arrayVariable->array_file);
$array_file = $formView->getArrayFiles();
if ($array_file) {
    foreach ($array_file as $file) {
        $extensao = DataHandler::returnExtensionOfFile($file->url);
        //procurando o arquivo que simbolize esse icone
        $filePath = Config::getRootPath("/image/get_image/url.view[,]forum[,]assets[,]img[,]file[,]file_icon[:]jpg/max_width.30/max_heigth.30");
        //ve se o arquivo do icone existe
        $url_ico = Config::getFolderView("assets/img/file/{$extensao}_icon.gif");
        if (file_exists($url_ico)) {
            $url_ico = str_replace("/", "[,]", $url_ico);
            $url_ico = str_replace(".gif", "[:]gif", $url_ico);
            $filePath = Config::getRootPath("/image/get_image/url.{$url_ico}/max_width.30/max_heigth.30");
        }
        // 		view/forum/assets/img/file/file_icon.jpg
        // $delete_URL = Config::getRootPath("file/get_file/id.{$file->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], $file->{$attr}, $data);
        }
        $data = str_replace("###FILE_TAG###", "<img src='{$filePath}' alt='' title='' style='float:left;margin: 0 0 5px 0;display:block' />", $data);
        //file_{$file->id}
Exemplo n.º 23
0
<?php

include_once "library/facil3/core/modules/category/dao/CategoryDAO.class.php";
include_once "library/facil3/core/modules/content/dao/ContentDAO.class.php";
include_once "library/facil3/core/controller/interface/HTTPControllerInterface.class.php";
include_once DataHandler::removeDobleBars(Config::getFolderView() . "/content_module/HttpContentModule.class.php");
class ContentModule implements HTTPControllerInterface
{
    private $arrayRestFolder;
    private $arrayVariable;
    private $DAO;
    public function __construct($arrayRestFolder = NULL)
    {
        $this->DAO = new CategoryDAO();
        if ($arrayRestFolder != NULL) {
            $this->arrayRestFolder = $arrayRestFolder;
            $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
        }
    }
    /* (non-PHPdoc)
     * @see library/facil3/core/controller/interface/HTTPControllerInterface#init()
     */
    public function init()
    {
        //busca todas as paginas cadastradas na tabela content
        $returnResult = new HttpResult();
        //iniciando o resultado para o html
        $retornoDaPaginaHTML = new HttpContentModule();
        $slug_category = "404";
        if (count($this->arrayRestFolder) > 0) {
            $slug_category = $this->arrayRestFolder[0];
Exemplo n.º 24
0
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		<title>Teto</title>
		<meta name="viewport" content="user-scalable=yes, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    	<meta name="apple-mobile-web-app-capable" content="yes" />
		<link rel="stylesheet" media="screen" href="<?php 
echo Config::getAsset('/assets/css/reset.css');
?>
" />
		<link rel="stylesheet" media="screen" href="<?php 
echo Config::getAsset('/assets/css/home.css');
?>
" />
		<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>
Exemplo n.º 25
0
		active = 0;
	}
	$.ajax({
		  url: ROOT_URL+'backend/info_segmento/update_active/id.'+id+"/active."+active+"/",
		  dataType: 'json',
		  data: { },
		  success: function(data){
				//alert("salvo");
			}
		});
}
</script>
<body class="bodygrey">
<?php 
include Config::getFolderView('/backend/nav.php');
include Config::getFolderView('/backend/info_segmento/nav-in.php');
?>
<div class="maincontent">	

	<div class="left">
		<table cellpadding="0" cellspacing="0" border="0" class="dyntable" id="example">
            <thead>
                <tr>
                	<th class="head0" width="5%">ID</th>
                    <th class="head1" width="35%">Página</th>
                    <th class="head0" width="35%">Slug</th>
                    <th class="head1" width="15%"></th>
                    <th class="head0" width="10%">Ações</th>
                </tr>
            </thead>
            <colgroup>
Exemplo n.º 26
0
 /**
  * @param $_ContentFormView		ContentFormView
  * @param $direct_show_view		Boolean default TRUE
  * @param $form_action			String do action no form
  * @param $redirect_to			String do redirect to depois do commit
  * @param $arrayFields			array de fields
  * @param $p_ReturnResultVO		opicional parametro para retorno de mensagem de erro ou sucesso
  * @return void or HttpResult
  */
 public function edit($_ContentFormView = NULL, $direct_show_view = TRUE, $form_action = NULL, $redirect_to = NULL, $arrayFields = NULL, $p_ReturnResultVO = NULL)
 {
     if ($_ContentFormView) {
         $formData = $_ContentFormView;
     } else {
         if (FALSE) {
             $this->ContentSiteVO = new $ContentSiteVO();
         }
         //se for enviado o content_id por parametro, usa ele como id
         if ($this->content_id > 0) {
             $this->ContentSiteVO->setId($this->content_id, TRUE);
         }
         $action_path = Config::getRootPath('admin/content/commit');
         //se for enviado o $form_action, então utiliza o que foi enviado
         if ($form_action) {
             $action_path = Config::getRootPath($form_action);
         }
         $formData = new ContentFormView($this->ContentSiteVO, $action_path);
     }
     //$formData->setModules();
     $HttpResult = new HttpResult();
     $HttpResult->setSuccess(1);
     //iniciando o resultado para o html
     $retornoDaPaginaHTML = new HttpRoot();
     $retornoDaPaginaHTML->arrayVariable->form_data = $formData->getFormData();
     if ($redirect_to != NULL) {
         $retornoDaPaginaHTML->arrayVariable->form_data->fields->redirect_to = (object) array("name" => "redirect_to", "value" => $redirect_to, "visible" => false);
     }
     if ($arrayFields != NULL) {
         //passou array de fields para adicionar
         //adiciona
         foreach ($arrayFields as $field_item) {
             $retornoDaPaginaHTML->arrayVariable->form_data->fields[] = $field_item;
         }
     }
     //$redirect_to = NULL
     //buscando imagens vinculadas
     $array_image_vo = $this->ContentSiteVO->getImages();
     $array_image_std = array();
     foreach ($array_image_vo as $VO) {
         $StdVO = $VO->toStdClass();
         $array_image_std[] = $StdVO;
     }
     $retornoDaPaginaHTML->arrayVariable->array_image = $array_image_std;
     //se for enviado o ReturnResultVO no parametro, adiciona como atributo
     if ($p_ReturnResultVO) {
         //			print_r($p_ReturnResultVO);exit();
         $retornoDaPaginaHTML->return_result_vo = $p_ReturnResultVO;
     }
     //buscando arquivos vinculadas
     $array_file_vo = $this->ContentSiteVO->getFiles();
     $array_file_std = array();
     foreach ($array_file_vo as $VO) {
         $StdVO = $VO->toStdClass();
         $array_file_std[] = $StdVO;
     }
     $retornoDaPaginaHTML->arrayVariable->array_file = $array_file_std;
     //salvando o objeto de resultado de html no retorno
     $HttpResult->setHttpContentResult($retornoDaPaginaHTML);
     //se for passado como true vai usar o layout abaixo.
     if ($direct_show_view) {
         include Config::getFolderView($this->my_edit_page);
         exit;
     }
     return $HttpResult;
 }