водяной знак - фоновое изображение - php - PullRequest
0 голосов
/ 05 августа 2020

Прежде всего, я хочу поздороваться с любым из вас,

Некоторое время go я сменил свою бухгалтерскую компанию, но у меня возникли проблемы со счетом. Я хочу установить водяной знак (как фоновое изображение) в своей теме счета, но мои навыки php равны 0.

вот пример кода:

<style>
    page {
        padding: 20 15 20 15;
        font-size: 8;
        font-family: LiberationSans;
    }

    td, th {
        padding: 0.5 1 0 1;
    }

    translation {
    <? if ($invoice['Invoice']['translation_language_id']): ?> font-size: 6;
        font-style: italic;
        display: inline;
    <? else: //?> display: none;
    <? endif ?>
    }
</style>

<? foreach ((array)$parameters['pages'] as $page): ?>
    <page>
        <header height="85">
            <? if (isset($invoice['footerCreator'])): ?>
                <div position="absolute" x="12" y="267" font-size="6" text-align="center">
                    <?= $invoice['footerCreator']; ?>
                </div>
            <? endif; ?>

            <style>
                .invoice-header {
                    position: absolute;
                    y: -10;
                    text-align: center;
                }

                /* logo */
                .invoice-logo {
                    width: 45%;
                    height: 40;
                    float: left;
                }

                /* main info - start */
                .invoice-main-info {
                    width: 48%;
                    float: right;
                }

                .invoice-main-info tr th {
                    padding: 1.5 0 1.5 0;
                }

                .invoice-main-info tr td {
                    padding: 1 0 1 1;
                }

                .invoice-main-info tr:child(0) {
                    font-size: 9;
                    text-align: center;
                    background-gradient-type: linear;
                    background-gradient-color1: white;
                    background-gradient-color2: lightgrey;
                }

                .invoice-main-info tr td div:child(0) {
                    width: 49%;
                    float: left;
                }

                .invoice-main-info tr td div:child(1) {
                    width: 49%;
                    float: right;
                }

                .invoice-main-info tr td div div:child(0) {
                    width: 57%;
                    float: left;
                }

                .invoice-main-info tr td div div:child(1) {
                    width: 42%;
                    float: right;
                }

                /* main info - stop */

                /* transaction sides - start */
                <? if ($invoice['ContractorDetailReceiver']['id']): ?>
                .invoice-transaction-side:child(0) {
                    width: 38%;
                    float: left;
                }

                .invoice-transaction-side:child(1) {
                    width: 31%;
                    float: left;
                }

                .invoice-transaction-side:child(2) {
                    width: 30%;
                    float: right;
                }

                <? else: ?>
                .invoice-transaction-side:child(0) {
                    width: 48%;
                    float: left;
                }

                .invoice-transaction-side:child(1) {
                    width: 48%;
                    float: right;
                }

                <? endif ?>
                /* transaction sides - stop */

                .invoice-bar {
                    position: absolute;
                    y: 71;
                    font-size: 10;
                    text-align: right;
                    padding: 0 1 -0.5 0;
                    margin-top: 4;
                    border-bottom: 1px;
                    background-gradient-type: linear;
                    background-gradient-color1: white;
                    background-gradient-color2: lightgrey;
                    background-gradient-coordinates: 0 0 1 0;
                }
            </style>

            <? if ($invoice['Invoice']['header']): ?>
                <p class="invoice-header"><?= $xml->sanitize($invoice['Invoice']['header']); ?></p>
            <? endif ?>

            <div class="invoice-logo">
                <? if ($parameters['logo_path']): ?>
                    <img width="80" src="<?= $parameters['logo_path'] ?>"/>
                <? endif ?>
            </div>

            <div class="invoice-main-info">
                <table>
                    <tr>
                        <th>Faktura<?= $xml->sanitize($parameters['document_name_suffix']) ?>
                            nr <?= $xml->sanitize($invoice['Invoice']['fullnumber']) ?></th>
                    </tr>
                    <tr>
                        <td>
                            <div>
                                <div>Data wystawienia:<br/>
                                    <translation><?= $translation->get('Invoice:Data wystawienia') ?></translation>
                                </div>
                                <div><?= $xml->sanitize($invoice['Invoice']['date']) ?></div>
                                <div clear="both"/>
                            </div>

                            <div>
                                <? if (!$invoice['Invoice']['disposaldate_empty']): ?>
                                    <div>Data sprzedaży:<br/>
                                        <translation><?= $translation->get('Invoice:Data sprzedaży') ?></translation>
                                    </div>
                                    <div><?= $invoice['Invoice']['disposaldate'] ?></div>
                                <? endif ?>
                                <div clear="both"/>
                            </div>

                            <div clear="both"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div>
                                <div>Termin płatności:<br/>
                                    <translation><?= $translation->get('Invoice:Termin płatności') ?></translation>
                                </div>
                                <div><?= $xml->sanitize($invoice['Invoice']['paymentdate']) ?></div>
                                <div clear="both"/>
                            </div>

                            <div>
                                <div>Metoda płatności:<br/>
                                    <translation><?= $translation->get('Invoice:Metoda płatności') ?></translation>
                                </div>
                                <div>
                                    <?= $xml->sanitize($invoice['Invoice']['paymentmethod']) ?><br/>
                                    <translation><?= $xml->sanitize($translation->get('Invoice:' . $invoice['Invoice']['paymentmethod'])) ?></translation>
                                </div>
                                <div clear="both"/>
                            </div>

                            <div clear="both"/>
                        </td>
                    </tr>
                </table>
            </div>
    </page>
    <? endif ?>

I попытался добавить свойство background-image и opacity, я попытался изменить css, но все это, похоже, не работает.

Я знаю, что это действительно новый ie вопрос, но я сдался. Может ли кто-нибудь помочь мне с водяным знаком?

1 Ответ

0 голосов
/ 05 августа 2020

Я не вижу водяного знака в вашем коде, но для вашей информации вы можете создать «водяной знак» в css следующим образом:

.watermark{
    opacity: 0.5; /* Firefox, Chrome, Safari, Opera, IE >= 9 (preview) */
    filter:alpha(opacity=50); /* for <= IE 8 */
}
.rotate45{
    transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);    /* Safari */
    -moz-transform: rotate(-45deg);       /* Firefox */
    -ms-transform: rotate(-45deg);        /* IE */
    -o-transform: rotate(-90deg);         /* Opera */
}

<div class="rotate45 watermark"> Watermark text </div>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...