示例#1
0
 public function actionGet_sup()
 {
     //echo '123';
     if (isset($_GET['page_id'])) {
         echo Supplies::getSupplies($_GET['id'], $_GET['page_id']);
     } else {
         echo Supplies::getSupplies($_GET['id']);
     }
 }
示例#2
0
 public function actionPubl_materials()
 {
     $arr = explode(",", $_GET['val']);
     $html = '';
     foreach ($arr as $a) {
         if (!empty($a)) {
             $sup = \backend\modules\supplies\models\Supplies::find()->where(['code' => $a])->one();
             if (isset($sup->id)) {
                 $html .= \common\classes\Supplies::getOneAddSupplies($sup->id, $_GET['id_page']);
             }
         }
     }
     return $html;
 }
示例#3
0
文件: _form.php 项目: apuc/admin
        $html .= '</table>
                        <a page-id="' . $title . '"data-toggle="modal" data-target="#myModal4" href="#" class="attachMaterialList">Прикрепить материалы списком</a> |
                            <a page-id="' . $title . '"data-toggle="modal" data-target="#myModal3" href="#" class="attachMaterial">Прикрепить материал</a> | <a class="attachZag" data-toggle="modal" data-target="#myModal2" href = "#" page-id="' . $title . '">Добавить заголовок</a>
                           <input id="input_' . $title . '" type="hidden" name="infoPage[]" value="' . $inp . '">
                        </div>';
    } else {
        $title = \common\models\PageBlinds::getNameTitleAdmin($p->id_pages);
        $inp = $title;
        $title = str_replace(' ', '_', $title);
        $ul .= '<li><a href="#panel' . $title . '"><input id-page="' . $title . '" type="text" class="insetName" value="' . $inp . '"/></a><span page-id="' . $title . '" class="delPages">x</span></li>';
        $page = \common\models\PageItem::find()->where(['id_page' => $p->id_pages])->all();
        $html .= '<div id="panel' . $title . '" class="tabPanel"><h3>' . $inp . '</h3>';
        $html .= '<table id="t_' . $title . '" class="table table-bordered">';
        foreach ($page as $pg) {
            if ($pg->item_type == 'materials') {
                $html .= \common\classes\Supplies::getOneAddSupplies($pg->id_item, $title);
                $inp .= '*' . $pg->id_item . '_materials';
            } else {
                $zag = \common\models\PageForTitle::getName($pg->id_item);
                $html .= '<tr class="itemPage" page-id="' . $title . '" materials-id="' . $zag . '" item-type="zagolovok"><td colspan="7">' . $zag . '</td><td><a class="delSuplies" href="#">Удалить</a></td></tr>';
                $inp .= '*' . $zag . '_zagolovok';
            }
        }
        $html .= '</table>
                            <a page-id="' . $title . '"data-toggle="modal" data-target="#myModal4" href="#" class="attachMaterialList">Прикрепить материалы списком</a> | <a page-id="' . $title . '"data-toggle="modal" data-target="#myModal3" href="#" class="attachMaterial">Прикрепить материал</a> | <a class="attachZag" data-toggle="modal" data-target="#myModal2" href = "#" page-id="' . $title . '">Добавить заголовок</a>
                             <input id="input_' . $title . '" type="hidden" name="infoPage[]" value="' . $inp . '">
                        </div>';
    }
    $k++;
}
?>