<?php
namespace platyFramework;

/** @var ptyFormModel $form */
/** @var ptyItemModel $item */
/** @var string $postUrl */
/** @var string $title */
/** @var string $title_desc */
?>
<script src="<?= $this->request->moduleUrl ?>/ptyadmin/resources/AdminLTE-2.4.5/bower_components/ckeditor/ckeditor.js"></script>

<section class="content-header">
    <h1>
        <?= $title ?>
        <small><?= $title_desc ?></small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="<?= $this->request->appUrl ?>"><i class="fa fa-dashboard"></i> Home</a>
        </li>
    </ol>
</section>
<?php // ptyDebug($item);
?>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <!-- Horizontal Form -->
            <div class="box box-info">
                <form class="form-horizontal" method="post" action="<?= $postUrl ?>" enctype="multipart/form-data">
                    <input type="hidden" name="id" value="<?= $item->id ?>">
                    <div class="box-body">
                        <div class='col-md-12'>
                            <? if ($this->request->functionName == "edit") { ?>
                                <?= $form->getDateTime("등록일", "regDateTime", "required placeholder='2018-01-01 00:00:00'"); ?>
                            <? } ?>
                            <?= $form->getSelect("노출여부", "enabled", array("활성화" => "1", "비활성화" => 0)); ?>
                            <? if (strstr($_SERVER['HTTP_HOST'], "dev.") || strstr($_SERVER['HTTP_HOST'], ".goodsshare")) { ?>
                                <?= $form->getSelect("배너 종류", "type", ptybannerItemModel::$_goodsShareType)?>
                            <? } else { ?>
                                <?= $form->getInput("배너 종류", "type"); ?>
                            <? } ?>
                            <?= $form->getInput("제목", "title"); ?>
                            <?= $form->getFile("이미지", "imageUrl", 0, " onchange='checkUpload(this, 1);'", "모든 파일 첨부는 최대 " . ini_get("post_max_size") . " 까지 가능합니다"); ?>
                            <?= $form->getInput("동작설정", "action", "", "https:// 또는 shopItemId://1234 shopProductId://1234 "); ?>
                            <?= $form->getTextEdit("메모", "note"); ?>
                        </div>
                        <div class="box-footer">
                            <button type="submit" class="btn btn-primary">저장</button>
                            <button type="button" class="btn btn-default ptyGoBack pull-right">취소</button>
                        </div>
                </form>
            </div>
        </div>
    </div>
</section>
