<?php $fieldOptions = new Cores\Models\FieldsOptionsModel(); $field = new Cores\Models\FieldsModel(); $fieldList = $fieldOptions->selectAll(); if (!empty($_GET['action'])) { switch ($_GET['action']) { case 'add_new_item': $itemObj = new Cores\Models\ItemsModel(); $uid = '3CEC7A3B-58BD-82B7-E4BA-8849286079BE'; $caid = $_POST['item_cata_add']; $title = $_POST['item_theme_add']; $count = null; if (!empty($_GET['count'])) { $count = $_GET['count']; } else { alert('count未定义'); redirectTo('admin.php?v=' . $_GET['v']); } if ($title == null || $caid == null) { alert('项目类别或项目主题不能为空'); redirectTo('admin.php?v=' . $_GET['v']); } $itemAdded = $itemObj->add($uid, $caid, $title); $itemId = $itemAdded[0]->getIid(); if ($itemId == null) { alert('添加投稿失败,请重试!'); } else { if (is_array($fieldList)) { foreach ($fieldList as $key => $value) { $foid = $value->getFoid();
$commentObj = new Cores\Models\CommentsModel(); $allCommentObj = $commentObj->selectAll(); print_r($allCommentObj); echo '<br>====================<br>'; //njx_users test $usersObj = new Cores\Models\UsersModel(); $allUserObj = $usersObj->selectAll(); print_r($allUserObj); echo '<br>====================<br>'; //njx_items test $itemsObj = new Cores\Models\ItemsModel(); $allItemObj = $itemsObj->selectAll(); print_r($allItemObj); echo '<br>====================<br>'; //njx_remarks test $remarksObj = new Cores\Models\RemarksModel(); $remarksObj = $remarksObj->selectAll(); print_r($remarksObj); echo '<br>====================<br>'; //njx_fields test $fieldsObj = new Cores\Models\FieldsModel(); $allFieldsObj = $fieldsObj->selectAll(); print_r($allFieldsObj); echo '<br>====================<br>'; //njx_fields_options test $fieldsOptionsObj = new Cores\Models\FieldsOptionsModel(); $AllFieldsOptionsObj = $fieldsOptionsObj->selectAll(); print_r($AllFieldsOptionsObj); echo '<br>====================<br>'; $testModel = new Cores\Models\Model('users'); print_r($testModel->selectAll());
<?php $filedOption = new Cores\Models\FieldsOptionsModel(); $allFieldOptions = $filedOption->selectAll(); $prompt = ''; function judgeFieldType($curr, $to) { if ($curr == $to) { return 'selected'; } } function generatorFieldEdintFOrm($name, $tips, $type, $count, $from, $to, $unit, $foid) { return '<div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> 编辑用户发布字段 </div> <div class="panel-body"><div class="col-lg-6"> <form role="form" method="post" action="admin.php?v=' . $_GET['v'] . '&action=edit_field_option&foid=' . $foid . '"> <div class="form-group"> <label>字段名称*</label> <input placeholder="字段名称" value="' . $name . '" name="field_name_edit" class="form-control"> </div> <div class="form-group"> <label>字段说明</label> <input placeholder="字段说明" value="' . $tips . '" name="filed_tips_edit" class="form-control"> </div> <div class="form-group"> <label>字段类型*</label> <select name="filed_type_edit" class="form-control">