unset($value); } if ($value['fieldname'] == "styletitle" || $value['fieldname'] == "groupid" || $value['fieldname'] == "region") { unset($value); } if (empty($value)) { continue; } if ($value['formtype'] != 'timestamp') { // 如果是自定字 if (strpos($value['fieldname'], 'ext_') === 0) { $title = $value['fieldtitle']; } else { $title = $mname . '_' . $value['fieldname']; } pklabel(array('type' => $value['formtype'], 'alang' => $title, 'name' => $value['fieldname'], 'options' => $temparr2, 'rows' => 10, 'width' => '30%', 'size' => '60', 'value' => $editvalue[$value['fieldname']], 'other' => $other, 'fileurl' => $fileurl, 'required' => $value['required'])); } } echo '<script charset="' . $_G['charset'] . '">function getattributes() {$("#attributes").load("batch.attribute.php?ajax=1&itemid=' . $editvalue['itemid'] . '&typeid="+$("select[name=catid]").val());}</script>'; if (($mname == 'good' || $mname == 'groupbuy') && $_GET['action'] != 'list') { showrelatedinfo($mname); if ($_GET['action'] == 'add') { showrelatedinfojs($mname, $_SGLOBAL['panelinfo']['groupid'], '', $_SGLOBAL['panelinfo']['itemid'], 'admin'); } else { $editvalue['groupid'] = getgroupid($mname, $editvalue['itemid']); showrelatedinfojs($mname, $editvalue['groupid'], $editvalue['itemid'], $editvalue['shopid'], 'admin'); } } if (!empty($_SGLOBAL['panelinfo'])) { showhiddenfields(array('shopid' => $_SGLOBAL['panelinfo']['itemid'])); } elseif ($editvalue['shopid']) {
/** * 添加消費卷系統生成和個人上傳表單 */ function showconsumemaker($radio = array(), $file = 'admin') { global $_G, $_SGLOBAL, $_SSCONFIG, $editvalue; if (isset($editvalue['imagetype'])) { if ($editvalue['imagetype'] == 1 && empty($radio[0])) { $editvalue['imagetype'] = 0; } elseif ($editvalue['imagetype'] == 0 && empty($radio[1])) { $editvalue['imagetype'] = 1; } } else { $editvalue['imagetype'] = !empty($radio[0]) ? 1 : 0; } $editvalue['imagetype'] = isset($editvalue['imagetype']) ? $editvalue['imagetype'] : !empty($radio[0]) ? 1 : 0; showsetting('consume_subjectimage', array('imagetype', $radio, true), $editvalue['imagetype'], 'mradio'); if (!empty($radio[0])) { showtagheader('tbody', 'uploadimg', $editvalue['imagetype'], 'sub'); pklabel(array('type' => 'file', 'alang' => '', 'name' => 'subjectimage', 'value' => $editvalue['subjectimage'], 'fileurl' => A_URL . '/' . $editvalue['subjectimage'])); showtagfooter('tbody'); } if (!empty($radio[1])) { if ($_GET['action'] == 'add') { $shopid = $_SGLOBAL['panelinfo']['itemid']; $hotline = $_SGLOBAL['panelinfo']['tel']; $address = $_SGLOBAL['panelinfo']['address']; } else { $shopid = $editvalue['shopid']; $shopinfo = DB::fetch(DB::query("SELECT tel, address FROM " . tname('shopitems') . " WHERE itemid='{$shopid}'")); $hotline = $shopinfo['tel']; $address = $shopinfo['address']; } showtagheader('tbody', 'createimg', !$editvalue['imagetype'], 'sub'); echo '<tr style="display:none;"> <td class="vtop rowform"> <textarea class="tarea" cols="50" id="address" name="address" rows="6">' . $address . '</textarea> </td> <td class="vtop tips2"> </td> </tr>'; $dir = opendir(B_ROOT . 'static/image/consume/thumb'); echo '<tr class="noborder"><td colspan="2"><ul id="shop_album_list">'; while ($consumeimgtpl = readdir($dir)) { if (strtolower(fileext($consumeimgtpl)) == 'jpg') { $imgtplvalue = substr($consumeimgtpl, 0, strpos($consumeimgtpl, '.')); echo '<li> <a target="_blank" href="static/image/consume/' . $imgtplvalue . '.jpg' . '"><img style="width: 192px; height: 119px;" alt="' . lang('theme_' . $entry . '_name') . '" src="static/image/consume/thumb/' . $imgtplvalue . '.jpg' . '"></a> <div class="album_desc"> <input class="radio" type="radio" name="imgtplid" value="' . intval($imgtplvalue) . '"'; if (!empty($editvalue['imgtplid'])) { if ($editvalue['imgtplid'] == $imgtplvalue) { echo 'checked'; } } else { $checked = $imgtplvalue == 1 ? 'checked' : ''; echo $checked; } echo '> </div> </li> '; } } echo '</ul></td></tr>'; echo '<tr> <td colspan="15"> <script type="text/javascript" charset="' . $_G['charset'] . '"> function previewimg() { $("#previewimg").load("' . $file . '.php?action=ajax&opt=previewconsume&shopid=' . $shopid . '&id="+$("*[name=\'imgtplid\']:checked").val()+"&coupon_title="+encodeURIComponent($("*[name=\'subject\']").val())+"&brief="+encodeURIComponent($("*[name=\'message\']").val())+"&exception="+encodeURIComponent($("*[name=\'exception\']").val())+"&begin_date="+$("*[name=\'validity_start\']").val()+"&end_date="+$("*[name=\'validity_end\']").val()); } </script> <div class="fixsel"> <input type="button" value="' . lang('preview') . '" title="' . lang('consume_preview_title') . '" name="previewsubmit" id="previewsubmit" class="btn" onclick="previewimg();"> </div> <div id="previewimg"> </div> </td> </tr>'; showtagfooter('tbody'); } }