function options_form() { global $config, $phpc_script, $config_form; $tbody = tag('tbody'); foreach ($config_form as $element) { $name = $element[0]; $text = $element[1]; $type = $element[2]; switch ($type) { case CHECK: $input = create_checkbox($name, '1', $config[$name]); break; case TEXT: $input = create_text($name, $config[$name]); break; case DROPDOWN: $sequence = create_sequence(0, count($element[3]) - 1); $input = create_select($name, $element[3], $config[$name], $sequence); break; default: soft_error(_('Unsupported config type') . ": {$type}"); } $tbody->add(tag('tr', tag('th', $text . ':'), tag('td', $input))); } return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', attributes('class="phpc-main"'), tag('caption', _('Options')), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), create_hidden('action', 'options_submit'), create_submit(_('Submit'))))), $tbody)); }
function display_form($menuname) { echo '<form method = "get">'; create_select($menuname); echo '<input type="submit" name="submitted" value="Go!"> </form>'; }
function search_form() { global $day, $month, $year, $phpc_script, $month_names, $sort_options, $order_options; $day_sequence = create_sequence(1, 31); $month_sequence = create_sequence(1, 12); $year_sequence = create_sequence(1970, 2037); $html_table = tag('table', attributes('class="phpc-main"'), tag('caption', _('Search')), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), create_submit(_('Submit'))))), tag('tr', tag('td', _('Phrase') . ': '), tag('td', tag('input', attributes('type="text"', 'name="searchstring"', 'size="32"')), create_hidden('action', 'search'))), tag('tr', tag('td', _('From') . ': '), tag('td', create_select('sday', $day_sequence, $day), create_select('smonth', $month_names, $month), create_select('syear', $year_sequence, $year))), tag('tr', tag('td', _('To') . ': '), tag('td', create_select('eday', $day_sequence, $day), create_select('emonth', $month_names, $month), create_select('eyear', $year_sequence, $year))), tag('tr', tag('td', _('Sort By') . ': '), tag('td', create_select('sort', $sort_options, false))), tag('tr', tag('td', _('Order') . ': '), tag('td', create_select('order', $order_options, false)))); return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), $html_table); }
function config_form() { global $phpc_script, $phpc_user_tz, $phpc_user_lang, $phpc_token; $tz_input = create_multi_select('timezone', get_timezone_list(), $phpc_user_tz); $languages = array("" => __("Default")); foreach (get_languages() as $lang) { $languages[$lang] = $lang; } $lang_input = create_select('language', $languages, $phpc_user_lang); $form = tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', attributes("class=\"phpc-container\""), tag('caption', __('Settings')), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), create_hidden('phpc_token', $phpc_token), create_hidden('action', 'settings'), create_hidden('phpc_submit', 'settings'), create_submit(__('Submit'))))), tag('tbody', tag('tr', tag('th', __('Timezone')), tag('td', $tz_input)), tag('tr', tag('th', __('Language')), tag('td', $lang_input))))); return tag('div', attrs('id="phpc-config"'), $form); }
function display_form() { global $phpc_script, $phpc_token, $phpcdb; $groups = array(); foreach ($phpcdb->get_groups() as $group) { $groups[$group['gid']] = $group['name']; } $size = sizeof($groups); if ($size > 6) { $size = 6; } return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('table', attributes("class=\"phpc-container\""), tag('caption', __('Create User')), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), create_hidden('phpc_token', $phpc_token), create_hidden('action', 'user_create'), create_hidden('submit_form', 'submit_form'), create_submit(__('Submit'))))), tag('tbody', tag('tr', tag('th', __('User Name')), tag('td', create_text('user_name'))), tag('tr', tag('th', __('Password')), tag('td', create_password('password1'))), tag('tr', tag('th', __('Confirm Password')), tag('td', create_password('password2'))), tag('tr', tag('th', __('Make Admin')), tag('td', create_checkbox('make_admin', '1', false, __('Admin')))), tag('tr', tag('th', __('Groups')), tag('td', create_select('groups[]', $groups, false, attrs('multiple', "size=\"{$size}\""))))))); }
function formElemCreate($name_id, $html_class = null, $input_area = null) { require_once SERVER_ROOT . '/module/form_elem/dist/create_select.php'; require_once SERVER_ROOT . '/module/form_elem/dist/create_input.php'; require_once SERVER_ROOT . '/module/definition/module.php'; $server = getenv('server'); $userWR = getenv('userRO'); $passWR = getenv('passRO'); $db = getenv('db'); $html = ''; if ($name_id === 'category') { $html_class = 'category'; } else { if ($html_class === null) { $html_class = ""; } } // Create connection $conn = new mysqli($server, $userWR, $passWR, $db); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } //<<< Get input info. $sql = "select html_type, title, tooltip \n" . "from param_input \n" . "where name_id = '" . $name_id . "' \n"; $result = $conn->query($sql); $row = $result->fetch_assoc(); $html_type = $row["html_type"]; $title = $row["title"]; $tooltip = $row["tooltip"]; //>>> //<<< Handle different types of write inputs. if ($html_type === 'select') { //Generate dropdown html. $html = create_select($name_id, $title, $html_class, $tooltip, $input_area); } else { if ($html_type === 'input') { //Generate input html. $html = create_input($name_id, $title, $html_class, $tooltip, $input_area); } } //>>> $conn->close(); return $html; }
function display_form() { global $phpc_script, $phpc_token, $phpcdb, $vars, $phpc_cal; $groups = array(); foreach ($phpc_cal->get_groups() as $group) { $groups[$group['gid']] = $group['name']; } $size = sizeof($groups); if ($size > 6) { $size = 6; } $user = $phpcdb->get_user($vars["uid"]); $user_groups = array(); foreach ($user->get_groups() as $group) { $user_groups[] = $group['gid']; } return tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('div', attributes("class=\"phpc-container\""), tag('h2', __('Edit User Groups')), tag('div', create_select('groups[]', $groups, $user_groups, attrs('multiple', "size=\"{$size}\""))), tag('div', create_hidden('phpc_token', $phpc_token), create_hidden('uid', $vars['uid']), create_hidden('action', 'user_groups'), create_hidden('submit_form', 'submit_form'), create_submit(__('Submit'))))); }
function config_form() { global $phpc_script, $phpc_user_tz, $phpc_user_lang, $phpc_token, $phpcdb, $phpc_user; $tz_input = create_multi_select('timezone', get_timezone_list(), $phpc_user_tz); $languages = array("" => __("Default")); foreach (get_languages() as $lang) { $languages[$lang] = $lang; } $lang_input = create_select('language', $languages, $phpc_user_lang); $calendars = array("" => __("None")); foreach ($phpcdb->get_calendars() as $calendar) { $calendars[$calendar->get_cid()] = $calendar->get_title(); } $default_input = create_select('default_cid', $calendars, $phpc_user->get_default_cid()); $table = tag('table', attrs('class="phpc-form"')); if (is_user()) { $table->add(tag('tr', tag('th', __('Default Calendar')), tag('td', $default_input))); } $table->add(tag('tr', tag('th', __('Timezone')), tag('td', $tz_input))); $table->add(tag('tr', tag('th', __('Language')), tag('td', $lang_input))); $form = tag('form', attributes("action=\"{$phpc_script}\"", 'method="post"'), tag('div', attrs('class="phpc-sub-title"'), __('Settings')), $table, create_hidden('phpc_token', $phpc_token), create_hidden('action', 'user_settings_submit'), create_submit(__('Submit'))); return tag('div', attrs('id="phpc-config"'), $form); }
</td></tr><script>' . "Datepick('[name=\"active_on_date\"]',\"\",\"yyyy-mm-dd\");Datepick('[name=\"active_off_date\"]',\"\",\"yyyy-mm-dd\");</script>"; $data["order_html"] .= '<tr><td align="right">現折:</td><td> 滿<input type="text" name="detail[]" value="' . $data["one"]["detail"][0] . '">元<br> 折抵<input type="text" name="detail[]" value="' . $data["one"]["detail"][1] . '">元 </td></tr>'; $data["close"]["pic"] = '1'; $data["button"]["pick_product"] = '1'; $tree_data_type = display_tree('1', $conn, PREFIX . 'category'); //-分類資料 //---取出分類資料---- if ($tree_data_type) { foreach ($tree_data_type as $item) { $aa[$item['id']] = $item['show_text']; } } $data["one"]["prolist"] = create_select("prolist", $aa, NULL, '1', "根目錄"); //--加價購選單 //----商品資料 if ($data["one"]["add_pic"] != NULL && $data["one"]["add_pic"] != '') { $add_pic = explode('|__|', $data["one"]["add_pic"]); } if ($data["one"]["add_pro"] != NULL && $data["one"]["add_pro"] != '') { $add_pro = explode('|__|', $data["one"]["add_pro"]); } if (is_array($add_pro)) { foreach ($add_pro as $k => $v) { $data["one"]["add_all"][$k]["pic"] = $add_pic[$k]; $data["one"]["add_all"][$k]["id"] = $add_pro[$k]; $temp = $conn->GetRow("SELECT * FROM " . PREFIX . "products WHERE id='" . $add_pro[$k] . "'"); $data["one"]["add_all"][$k]["name"] = $temp['name']; }
function display($id, $action, $check, $upid = 0) { global $pro_class_table; global $product_table; global $pro_color_table; global $pro_size_table; global $pic_max_size; //圖片檔案大小限制 global $pic_jpg; //JPG圖片是否啟用 global $pic_gif; //GIF圖片是否啟用 global $pic_png; //PNG圖片是否啟用 global $pic_no_pic; //預設圖片 global $sys_product_pics; global $pro_pic_set; //額外圖片--啟用 global $pro_multpic_set; //額外圖片(大量上傳) - 啟用 global $pro_download_set; //檔案下載--啟用 global $pro_download_num; //檔案下載數量 global $pro_color_set; //顏色--啟用與否 global $pro_size_set; //Size--啟用與否 global $pro_stock_set; //庫存--啟用與否 global $pro_utube_set; //影片嵌入--啟用與否 global $pro_home_set; //首頁顯示 global $pro_home_num; //首頁顯示筆數 global $pro_home_name; //首頁顯示--名稱 global $pro_new_set; //最新 --屬性 global $pro_new_name; //表單顯示的屬性名稱 global $pro_run_set; //跑馬燈 --屬性 global $pro_run_name; //表單顯示的屬性名稱 global $pro_hot_set; //熱門 --屬性 global $pro_hot_name; //表單顯示的屬性名稱 global $pro_class_set; //分類選項 global $numbers_set; //產品編號 global $price_set; //價格 global $s_price_set; //特價 global $s_info_set; //簡易介紹 global $info_set; //詳細介紹 global $info2_set; //備用欄位1 --編輯器 global $info3_set; //備用欄位2 --編輯器 global $info4_set; //備用欄位3 --編輯器 global $info5_set; //備用欄位4 --編輯器 $row = array(); $row['upid'] = $upid; if ($id != 0 and !empty($id)) { $product = new product(); $product->id = $id; $product->table = $product_table; $product->get_db_var(); $row = $product->display(); } if (empty($row['pic'])) { $row['pic'] = $pic_no_pic; } $oFCKeditor = new FCKeditor('info'); // 變數名稱 $oFCKeditor->BasePath = '../../fckeditor/'; //主程式資料夾路徑 $oFCKeditor->Value = $row['info']; // 一開始顯示的字 $oFCKeditor->Width = '700'; //寬度 $oFCKeditor->Height = '550'; //高度 $oFCKeditor->Config['SkinPath'] = 'skins/silver/'; //樣板 $oFCKeditor->ToolbarSet = 'mybasic'; // 工具列配置 if ($info2_set == 1) { $oFCKeditor2 = new FCKeditor('info2'); // 變數名稱 $oFCKeditor2->BasePath = '../../fckeditor/'; //主程式資料夾路徑 $oFCKeditor2->Value = $row['info2']; // 一開始顯示的字 $oFCKeditor2->Width = '700'; //寬度 $oFCKeditor2->Height = '550'; //高度 $oFCKeditor2->Config['SkinPath'] = 'skins/silver/'; //樣板 $oFCKeditor2->ToolbarSet = 'mybasic'; // 工具列配置 } if ($info3_set == 1) { $oFCKeditor3 = new FCKeditor('info3'); // 變數名稱 $oFCKeditor3->BasePath = '../../fckeditor/'; //主程式資料夾路徑 $oFCKeditor3->Value = $row['info3']; // 一開始顯示的字 $oFCKeditor3->Width = '700'; //寬度 $oFCKeditor3->Height = '550'; //高度 $oFCKeditor3->Config['SkinPath'] = 'skins/silver/'; //樣板 $oFCKeditor3->ToolbarSet = 'mybasic'; // 工具列配置 } if ($info4_set == 1) { $oFCKeditor4 = new FCKeditor('info4'); // 變數名稱 $oFCKeditor4->BasePath = '../../fckeditor/'; //主程式資料夾路徑 $oFCKeditor4->Value = $row['info4']; // 一開始顯示的字 $oFCKeditor4->Width = '700'; //寬度 $oFCKeditor4->Height = '550'; //高度 $oFCKeditor4->Config['SkinPath'] = 'skins/silver/'; //樣板 $oFCKeditor4->ToolbarSet = 'mybasic'; // 工具列配置 } if ($info5_set == 1) { $oFCKeditor5 = new FCKeditor('info5'); // 變數名稱 $oFCKeditor5->BasePath = '../../fckeditor/'; //主程式資料夾路徑 $oFCKeditor5->Value = $row['info5']; // 一開始顯示的字 $oFCKeditor5->Width = '700'; //寬度 $oFCKeditor5->Height = '550'; //高度 $oFCKeditor5->Config['SkinPath'] = 'skins/silver/'; //樣板 $oFCKeditor5->ToolbarSet = 'Basic'; // 工具列配置 } ?> <!---引入檔區域,由於使用的是back資料夾內,故需要以back資料夾的路徑為準---> <script src="../../jquery.js"></script> <script> var $id = <?php print $id; ?> ; </script> <script src="pics/ajaxfileupload.js"></script> <?php if ($pro_color_set == 1) { ?> <!-- <script src="color/eye.js"></script> <script src="color/utils.js"></script> <script src="color/layout.js"></script> <script src="color/colorpicker.js"></script> --> <script src="color/color.js"></script> <?php } if ($pro_size_set == 1) { ?> <script src="size/size.js"></script> <?php } if ($pro_stock_set == 1) { ?> <script src="stock/stock.js"></script> <?php } if ($pro_pic_set == 1) { ?> <script src="pics/pics.js"></script> <?php } if ($pro_download_set == 1) { ?> <script src="download/download.js"></script> <?php } if ($pro_multpic_set == 1) { ?> <script type="text/javascript" src="muliti_pics/swfupload.js"></script> <script type="text/javascript" src="muliti_pics/swfupload.queue.js"></script> <script type="text/javascript" src="muliti_pics/fileprogress.js"></script> <script type="text/javascript" src="muliti_pics/handlers.js"></script> <script type="text/javascript" src="muliti_pics/pics.js"></script> <script type="text/javascript"> var swfu; window.onload = function() { var settings = { flash_url : "muliti_pics/swfupload.swf", upload_url: "muliti_pics/upload.php?id=<?php echo $id; ?> ", post_params: {"PHPSESSID" : "<?php echo session_id(); //需要用session_id傳遞 ?> "}, file_size_limit : "1 MB", file_types : "*.jpg;*.gif", file_types_description : "JPG", file_upload_limit : 100, file_queue_limit : 0, custom_settings : { progressTarget : "fsUploadProgress", cancelButtonId : "btnCancel" }, debug: false, // Button settings button_image_url: "muliti_pics/images/TestImageNoText_65x29.png", button_width: "65", button_height: "29", button_placeholder_id: "spanButtonPlaceHolder", button_text: '<span class="theFont">上傳</span>', button_text_style: ".theFont { font-size: 13; }", button_text_left_padding: 12, button_text_top_padding: 3, // The event handler functions are defined in handlers.js file_queued_handler : fileQueued, file_queue_error_handler : fileQueueError, file_dialog_complete_handler : fileDialogComplete, upload_start_handler : uploadStart, upload_progress_handler : uploadProgress, upload_error_handler : uploadError, upload_success_handler : uploadSuccess, upload_complete_handler : uploadComplete, queue_complete_handler : queueComplete // Queue plugin event }; swfu = new SWFUpload(settings); }; </script> <?php } ?> <!--引入檔結束---> <!--表單開始---> <form name="form1" method="post" action="<?php echo $action; ?> " enctype="multipart/form-data" > <input type="hidden" name="check" value="<?php echo $check; ?> "/> <input type="hidden" name="id" value="<?php echo $row['id']; ?> "/> <input type="hidden" name="pic" value="<?php echo $row['pic']; ?> " /> <div style="text-align:left;padding:5px;"> <a href="<?php print $_GET['backurl']; ?> ">【回頁面管理】</a> </div> <table width="700" border="0" align="center" cellpadding="0" cellspacing="0" id="pro"> <tr> <td class="title"><span class="message"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /></span>產品基本資料</td> </tr> <tr> <td height="35" align="left" valign="middle" id="main00"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品名稱: </span> <input name="name" type="text" id="name" value="<?php print $row['name']; ?> " size="50" maxlength="30" /> <label></label> <span class="ps">(*名稱請勿超過30個字元!)</span></td> </tr> <?php if ($numbers_set == 1) { ?> <tr> <td height="35" align="left" valign="middle" id="main00"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品編號: <input name="numbers" type="text" id="name2" value="<?php print $row['numbers']; ?> " size="50" maxlength="30" /> </span></td> </tr> <?php } ?> <?php if ($pro_class_set == 1) { ?> <tr> <td height="35" align="left" valign="middle" id="main00"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" />產品分類: <select name="upid"> <?php create_select($row['upid']); ?> </select> <span class="ps">(*分類一定要選擇!)</span></td> </tr> <?php } ?> <?php if ($price_set == 1) { ?> <tr> <td height="35" align="left"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品價格: <input name="price" type="text" size="15" value="<?php print $row['price']; ?> " /> </span></td> </tr> <?php } ?> <?php if ($s_price_set == 1) { ?> <tr> <td height="35" align="left"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品特價: <input name="s_price" type="text" size="15" value="<?php print $row['s_price']; ?> " /> </span><span class="ps">本欄位數字大於0時啟用</span></td> </tr> <?php } ?> <tr> <td height="35" align="left"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品排序: <input name="no" type="text" id="no" value="<?php print $row['no']; if (empty($row['no'])) { echo '100'; } ?> " size="5" maxlength="4" /> </span></td> </tr> <!--產品圖片-單張 Begin--> <tr> <td class="title"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" />主要圖片</td> </tr> <tr> <td height="35" align="left" valign="middle" id="main00"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">上傳圖片(圖片長寬比為: 1:1): </span> <?php if (!empty($row['pic'])) { ?> <div style="padding:3px;"> <img src="<?php echo $row['pic']; ?> " width="100" /> </div> <?php } ?> <label> <input type="file" name="upload" size="20" /> </label><br /> <span class="ps"> *圖片限 <?php if ($pic_jpg == 1) { echo "JPG "; } if ($pic_gif == 1) { echo "GIF "; } if ($pic_png == 1) { echo "PNG "; } ?> 檔,檔案大小不可超過 <?php $size = ceil($pic_max_size / 1024); if ($size >= 1024) { echo $size = mb_substr($size / 1024, 0, 6, "UTF-8"); echo "MB"; } else { echo $size; echo "KB"; } ?> ! 圖片的最佳顯示比例為長寬比 1 : 1</span></td> </tr> <!--產品圖片 End--> <!-----產品圖片-多張Begin---> <?php if ($pro_pic_set == 1) { ?> <tr> <td class="title"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" />其他圖片</td> </tr> <tr> <td height="35" align="left" style="padding:5px;"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">上傳圖檔 (圖片長寬比為: 1:1): <input name="picsUpload" id="picsUpload" type="file" size="20"/> <input type="button" name="Goupload" value="開始上傳" onclick="pics_add()"> <span id='Uploading'></span> </span> <div class='ps'> 檔案限 <?php if ($pic_jpg == 1) { echo "JPG "; } if ($pic_gif == 1) { echo "GIF "; } if ($pic_png == 1) { echo "PNG "; } ?> 檔,檔案大小不可超過 <?php $size = ceil($pic_max_size / 1024); if ($size >= 1024) { echo $size = mb_substr($size / 1024, 0, 6, "UTF-8"); echo "MB"; } else { echo $size; echo "KB"; } echo ',共可上傳 ' . $sys_product_pics . ' 張'; ?> </div> </td> </tr> <tr> <td height="35" align="left"> <div id="picsList"> </div> </td> </tr> <?php } ?> <!-----產品圖片-多張End-----> <!-----產品圖片-多張(大量上傳) Begin----> <?php if ($pro_multpic_set == 1) { ?> <tr> <td class="title"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" />案例圖片</td> </tr> <tr> <td height="35" align="left" style="padding:5px;"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">上傳圖檔: <div class="fieldset flash" id="fsUploadProgress" style="border:1px solid #cccccc; padding:5px;"> <span class="legend">上傳進度</span> </div> <div id="divStatus">0 個檔案已上傳</div> <div> <span id="spanButtonPlaceHolder"></span> <input id="btnCancel" type="button" value="取消上傳" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" /> </div> </span> <div class='ps'> 檔案限 <?php if ($pic_jpg == 1) { echo "JPG "; } if ($pic_gif == 1) { echo "GIF "; } if ($pic_png == 1) { echo "PNG "; } ?> 檔,檔案大小不可超過 <?php $size = ceil($pic_max_size / 1024); if ($size >= 1024) { echo $size = mb_substr($size / 1024, 0, 6, "UTF-8"); echo "MB"; } else { echo $size; echo "KB"; } ?> </div> </td> </tr> <tr> <td height="35" align="left"> <div id="picsList"></div> </td> </tr> <?php } ?> <!-----產品圖片-多張(大量上傳) End----> <!-----下載檔案Begin---> <?php if ($pro_download_set == 1) { ?> <tr> <td class="title"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" />檔案上傳</td> </tr> <tr> <td height="35" align="left" style="padding:5px;"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">上傳檔案: <br /> <iframe name="pics_upload" allowtransparency="true" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="download/add.php?id=<?php echo $row['id']; ?> " width="700" height="30"></iframe> <br /> <!-- <table width="400" cellpadding="5" cellspacing="1" border="0"> <tr> <td width="120">Product Name</td> <td><input type="text" name="d_name" value="" /></td> </tr> <tr> <td>Size</td><td><input type="text" name="d_size" value="" /></td> </tr> <tr> <td>Color</td><td><input type="text" name="d_color" value="" /></td> </tr> <tr> <td>CCT</td><td><input type="text" name="d_cct" value="" /></td> </tr> <tr> <td>Type</td><td><input type="text" name="d_type" value="" /></td> </tr> <tr> <td>CRI</td><td><input type="text" name="d_cri" value="" /></td> </tr> <tr> <td>Forward</td><td><input type="text" name="d_forward" value="" /></td> </tr> <tr> <td>File</td> <td><input name="downloadUpload" id="downloadUpload" type="file" size="20"/> <input type="button" name="Goupload" value="開始上傳" onclick="download_add()"> </td> </tr> </table> --> </span> <div class='ps'> 檔案限 pdf 檔,大小限制於 10mb 內 ,共可上傳 <?php echo $pro_download_num; ?> 個 。 </div></td> </tr> <tr> <td height="35" align="left"> <div id="downloadList"></div></td> </tr> <?php } ?> <!-----下載檔案End-----> <!--產品顏色 Begin ---> <?php if ($pro_color_set == 1) { ?> <script> /* $('#colorSelector').ColorPicker({ color: '#0000ff', onShow: function (colpkr) { $(colpkr).fadeIn(500); return false; }, onHide: function (colpkr) { $(colpkr).fadeOut(500); return false; }, onChange: function (hsb, hex, rgb) { $('#colorSelector div').css('backgroundColor', '#' + hex); $(this).val('#' + hex); } }); */ </script> <tr> <td class="title"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" />產品顏色</td> </tr> <tr> <td style="padding:5px;"> <div id="color_container"> <div id="pcList"></div> <div id="color_search"> <div style="margin:20px;padding-top:20px;"> 選擇產品顏色 : <select name="p_color"> <option value="0">---請選擇此商品擁有的顏色---</option> <?php $sql = "select * from `{$pro_color_table}` order by name ASC,id ASC"; $res = mysql_query($sql); while ($n = mysql_fetch_array($res)) { echo "<option value='" . $n['id'] . "'>" . $n['name'] . '</option>'; } ?> </select> <br> 上傳相應圖片 : <input name="colorUpload" id="colorUpload" type="file" size="20"/> <br> <br> <a href='#agas' id="p_color_add"><img src="../images/color.png" onmouseover="this.src='../images/color-over.png'" onmouseout="this.src='../images/color.png'" name="add" border='0' align="absmiddle"/></a><span id='Uploading_color'></span> <span class="ps"> ※請選擇顏色名稱後,並選擇上傳一張圖片,按新增顏色,即可新增顏色種類。 </span> <div style="text-align:right;padding-right:60px;" id="color_open"> <a href="#a">展開顏色管理 <img src="../images/arrow_right.png" align="absmiddle"></a> </div> </div> </div> <div id="color_manage"> <div style="padding:10px;background:#DDFFFF;"> 顏色:<input type="text" name="color" value=""> <input type="button" id="color_add" value="新增顏色種類"> </div> <div id="colorList" ></div> </div> </div> </td> </tr> <?php } ?> <!---產品顏色End--> <!---產品Size Begin--> <?php if ($pro_size_set == 1) { ?> <tr> <td class="title"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" />產品Size</td> </tr> <tr> <td style="padding:5px;"> <div id="size_container"> <div id="psList"></div> <div id="size_search"> <div style="margin:20px;padding-top:20px;"> 選擇產品 Size : <select name="p_size"> <option value="0">---請選擇此商品擁有的Size---</option> <?php $sql = "select * from `{$pro_size_table}` order by name ASC,id ASC"; $res = mysql_query($sql); while ($n = mysql_fetch_array($res)) { echo "<option value='" . $n['id'] . "'>" . $n['name'] . '</option>'; } ?> </select> <span class="ps">Size排序按照字首筆畫排列</span> <br> <br> <br> <a href='#agas' id="p_size_add"><img src="../images/size.png" onmouseover="this.src='../images/size-over.png'" onmouseout="this.src='../images/size.png'" name="add" border='0' align="absmiddle"/></a><span id='Uploading_color'></span> <span class="ps"> ※請選擇Size後,按Size,即可新增 </span> <div style="text-align:right" id="size_open"> <a href="#a">展開Size管理 <img src="../images/arrow_right.png" align="absmiddle"></a> </div> </div> </div> <div id="size_manage"> <div style="padding:10px;background:#DDFFDD;"> Size:<input type="text" name="size" value=""> <input type="button" id="size_add" value="新增Size"> </div> <div id="sizeList" ></div> </div> </div> </td> </tr> <?php } ?> <!--產品 Size End--> <!--產品庫存 Begin--> <?php if ($pro_stock_set == 1) { ?> <tr> <td class="title"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" />產品庫存</td> </tr> <tr> <td style="padding:5px;"><div id="stockList" ></div></td> </tr> <?php } ?> <!--產品庫存 End--> <?php if ($pro_utube_set == 1) { ?> <!--產品影片 Begin--> <tr> <td class="title"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" />Youtube影片</td> </tr> <tr> <td height="40" align="left" valign="middle" id="main00"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2"> 請輸入影片嵌入碼: <input type="text" name="utube" id="utube" value="<?php echo htmlspecialchars($row['utube']); ?> " size="60"/></span> <div class="ps">請勿使用舊版內嵌程式碼</div> </td> </tr> <tr> <td style="padding:5px;"><?php if (!empty($row['utube'])) { echo utube_replace_width($row['utube'], 300, 180); } ?> </td> </tr> <!--產品影片 End--> <?php } ?> <tr> <td class="title"><span class="message"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /></span>產品狀態</td> </tr> <tr> <td height="35" align="left"><span class="message"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">是否上架: <input name="act" type="checkbox" id="no" value="1" <?php if ($row['act'] == 1 or count($row) == 2) { print "checked"; } ?> /> </span></span> <?php if ($pro_new_set == 1) { ?> <img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2"><?php echo $pro_new_name; ?> : <input name="p_new" type="checkbox" id="no" value="1" <?php if ($row['p_new'] == 1) { print "checked"; } ?> /> </span> <?php } if ($pro_run_set == 1) { ?> <img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><?php echo $pro_run_name; ?> <span class="style2">: <input name="p_run" type="checkbox" id="no" value="1" <?php if ($row['p_run'] == 1) { print "checked"; } ?> /> </span> <?php } if ($pro_hot_set == 1) { ?> <img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2"><?php echo $pro_hot_name; ?> : <input name="p_hot" type="checkbox" id="no" value="1" <?php if ($row['p_hot'] == 1) { print "checked"; } ?> /> </span> <?php } ?> <?php if ($pro_home_set == 1) { ?> <img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2"><?php echo $pro_home_name; ?> : <input name="p_home" type="checkbox" id="no" value="1" <?php if ($row['p_home'] == 1) { print "checked"; } ?> /> </span> <?php } ?> </td> </tr> <?php if ($s_info_set == 1) { ?> <tr> <td height="35" align="left" class="title"><span class="message"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品簡介:</span></span></td> </tr> <tr> <td height="35" align="left" style='padding:5px;'><textarea name="s_info" cols='60' rows='8'><?php print $row['s_info']; ?> </textarea></td> </tr> <?php } ?> <?php if ($info_set == 1) { ?> <tr> <td height="35" align="left" class="title"><span class="message"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品介紹:</span> <label> </label> <span class="style3">(*貼上文件時,請先選擇跳出視窗中的"</span></span><span class="style6">不允許</span><span class="message"><span class="style3">"後,即可在</span></span><span class="style6">空白方框處</span><span class="message"><span class="style3">貼上文件)</span></span></td> </tr><TR><TD align="center"><?php $oFCKeditor->Create(); ?> </TD> </TR> <?php } if ($info2_set == 1) { ?> <tr> <td height="35" align="left" class="title"><span class="message"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">規格說明:</span> <label> </label> <span class="style3">(*貼上文件時,請先選擇跳出視窗中的"</span></span><span class="style6">不允許</span><span class="message"><span class="style3">"後,即可在</span></span><span class="style6">空白方框處</span><span class="message"><span class="style3">貼上文件)</span></span></td> </tr><TR><TD align="center"><?php $oFCKeditor2->Create(); ?> </TD> </TR> <?php } if ($info3_set == 1) { ?> <tr> <td height="35" align="left" class="title"><span class="message"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品詳細介紹:</span> <label> </label> <span class="style3">(*貼上文件時,請先選擇跳出視窗中的"</span></span><span class="style6">不允許</span><span class="message"><span class="style3">"後,即可在</span></span><span class="style6">空白方框處</span><span class="message"><span class="style3">貼上文件)</span></span></td> </tr><TR><TD align="center"><?php $oFCKeditor3->Create(); ?> </TD> </TR> <?php } if ($info4_set == 1) { ?> <tr> <td height="35" align="left" class="title"><span class="message"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品詳細介紹:</span> <label> </label> <span class="style3">(*貼上文件時,請先選擇跳出視窗中的"</span></span><span class="style6">不允許</span><span class="message"><span class="style3">"後,即可在</span></span><span class="style6">空白方框處</span><span class="message"><span class="style3">貼上文件)</span></span></td> </tr><TR><TD align="center"><?php $oFCKeditor4->Create(); ?> </TD> </TR> <?php } if ($info5_set == 1) { ?> <tr> <td height="35" align="left" class="title"><span class="message"><img src="../../images/add-folder-blue.gif" width="14" height="14" hspace="5" border="0" align="absmiddle" /><span class="style2">產品詳細介紹:</span> <label> </label> <span class="style3">(*貼上文件時,請先選擇跳出視窗中的"</span></span><span class="style6">不允許</span><span class="message"><span class="style3">"後,即可在</span></span><span class="style6">空白方框處</span><span class="message"><span class="style3">貼上文件)</span></span></td> </tr><TR><TD align="center"><?php $oFCKeditor5->Create(); ?> </TD> </TR> <?php } ?> <TR> <TD height="50" align="center"><div align="center"> <input type="submit" name="Submit" value="資料確認送出" /> <input name="Submit2" type="reset" value="重 新 填 寫" /> </div></TD> </TR> </table> </form> <?php }
$data["button"]["width"] = ' style="width:45%;" '; ///--資料 $data["one"]["b_name"] = str_replace("'", "\\'", $data["one"]["b_name"]); $data["one"]["b_value"] = str_replace("'", "\\'", $data["one"]["b_value"]); $data["one"]["size_name"] = $data["one"]["b_name"]; $data["one"]["size_value"] = $data["one"]["b_value"]; } break; case "product": $data["button"]["file"] = 1; $data["button"]["size"]["name"] = 'size_name'; $data["button"]["size"]["value"] = 'size_value'; $detail = explode('|__|', deQuotes(@$data["one"]["detail"], -1)); $data["uploadfilemax"] = 1 - $data_pic_count; //圖檔上傳上限 $data["order_html"] = '<tr><td align="right">產品分類:</td><td>' . create_select("class", $aa, $data["one"]["class"], '1', "根目錄") . '</td></tr>'; $data["order_html"] .= '<tr><td align="right">適用場合:</td><td>' . Fck("detail[0]", '90%', '450', '../fckeditor/', $detail[0]) . '</td></tr>'; $data["order_html"] .= '<tr><td align="right">產品說明:</td><td>' . Fck("detail[1]", '90%', '450', '../fckeditor/', $detail[1]) . '</td></tr>'; break; case "news": $data["close"]["pic"] = '1'; $data["button"]["detail"] = '1'; $data["button"]["fck"] = '1'; $data["order_html"] .= '<tr><td align="right">消息分類:</td><td><select name="new_type">' . Make_list($_SETUP["new_tage"], $data["one"]["new_type"]) . '</select></td>'; break; case "foor": $data["close"]["pic"] = '1'; $data["button"]["detail"] = '1'; $data["button"]["fck"] = '1'; break; case "history_case":
} else { echo "Not all required fields are filled.."; } } $galleries = getGalleries($_SESSION['user_id']); //ako nema ni jednu galeriju dosad - nek ju napravi if (empty($galleries)) { header('Location: new_gallery.php'); exit; } //napravi izbor korisnikovih galerija $options = array(); foreach ($galleries as $key => $value) { array_push($options, create_element("option", true, ["contents" => $value, "value" => $key])); } $input = create_select(["name" => "galleryOption", "contents" => $options]); function validatePicture($picture) { $MIN_WIDTH = 128; $MIN_HEIGHT = 128; $MAX_SIZE = 512000; //500 kB $dimensions = getimagesize($picture); if ($dimensions === false || $dimensions[0] == 0 || $_FILES['file']['size'] > $MAX_SIZE) { echo "Velicina prevelika: " . $_FILES['file']['size'] . "\n"; return false; } if ($dimensions[0] < $MIN_WIDTH || $dimensions[1] < $MIN_HEIGHT) { echo "Velicina premala\n"; return false; }
function cache_html($type, $data = NULL) { global $jpage; $tpl = new Smarty(); $tpl->left_delimiter = '({'; $tpl->right_delimiter = '})'; $tpl->template_dir = APP_PATH . "/templates/"; $tpl->compile_dir = APP_PATH . "/templates_c/"; $tpl->config_dir = APP_PATH . "/configs/"; $tpl->cache_dir = APP_PATH . "/cache/"; if ($type == "page") { $record["act"] = "page"; //開頭比數 $jpage["start_date"] = $start_num = $data["perpage"] * ($data["now_page"] - 1) + 1; //到了盡頭,只顯示共的筆數 if ($data["perpage"] * $data["now_page"] > $data["total"]) { $jpage["end_date"] = $end_num = $data["total"]; } else { $jpage["end_date"] = $end_num = $data["perpage"] * $data["now_page"]; } $total_page = ceil($data["total"] / $data["perpage"]); $jpage["page_date_count"] = $data["total"]; $jpage["now_page"] = $data["now_page"]; $jpage["all_page"] = $total_page; $record["total_page"] = $total_page; $record["start_page"] = max($data["now_page"] - 4, 1); $record["end_page"] = min($record["total_page"], $record["start_page"] + 9); //顯示資訊 $record["info"] = "顯示 " . $start_num . " - " . $end_num . " 筆,共 " . $data["total"] . " 筆"; $record["info2"] = $data["now_page"] . " / " . $total_page; if (@$data["ajax"] == 1) { //判斷上一頁下一頁 if ($data["now_page"] == 1) { $jpage["up_url"] = $record["pre_url"] = "ajax_page('" . $data["url"] . "','" . $data["ajax_type"] . "',1,'" . $data["keyword"] . "')"; } else { $jpage["down_url"] = $record["pre_url"] = "ajax_page('" . $data["url"] . "','" . $data["ajax_type"] . "'," . ($data["now_page"] - 1) . ",'" . $data["keyword"] . "')"; } if ($data["now_page"] == $total_page) { $jpage["up_url"] = $record["next_url"] = "ajax_page('" . $data["url"] . "','" . $data["ajax_type"] . "'," . $total_page . ",'" . $data["keyword"] . "')"; } else { $jpage["down_url"] = $record["next_url"] = "ajax_page('" . $data["url"] . "','" . $data["ajax_type"] . "'," . ($data["now_page"] + 1) . ",'" . $data["keyword"] . "')"; } $jpage["jump_page_url"] = $record["url"] = $data["url"]; for ($i = 1; $i <= $total_page; $i++) { $menu[$i] = $i; } $event = "onchange=\"ajax_page('" . $data["url"] . "','" . $data["ajax_type"] . "'" . ",this.value,'" . $data["keyword"] . "' )\""; //製作下拉選單 $record["jump_menu"] = create_select("jump_page", $menu, $data["now_page"], "", "分頁", "style='vertical-align:middle;width:50px;'", $event); } else { //判斷上一頁下一頁 if ($data["now_page"] == 1) { $jpage["up_url"] = $record["pre_url"] = "location='" . $data["url"] . "&page=1'"; } else { $jpage["down_url"] = $record["pre_url"] = "location='" . $data["url"] . "&page=" . ($data["now_page"] - 1) . "'"; } if ($data["now_page"] == $total_page) { $jpage["up_url"] = $record["next_url"] = "location='" . $data["url"] . "&page=" . $total_page . "'"; } else { $jpage["down_url"] = $record["next_url"] = "location='" . $data["url"] . "&page=" . ($data["now_page"] + 1) . "'"; } $jpage["jump_page_url"] = $record["url"] = $data["url"]; //for($i=$record["start_page"];$i<=$record["end_page"];$i++) for ($i = 1; $i <= $record["total_page"]; $i++) { $record["page_num"][] = array("url" => $data["now_page"] == $i ? "<span style='color:black'>" . $i . ".</span>" : "<a href=\"Javascript:location='" . $data["url"] . "&page=" . $i . "'\">" . $i . ".</a>", "class" => $data["now_page"] == $i ? " class='active' " : ""); if ($data["now_page"] == $i) { $selected = 'selected'; } else { $selected = ''; } $jpage["jump_page_html"] .= '<option value="' . $i . '" ' . $selected . '>' . $i . '</option>'; } for ($i = 1; $i <= $total_page; $i++) { $menu[$i] = $i; } $event = "onchange=\"jump(" . "'" . $record["url"] . "'" . ",this.value )\""; //製作下拉選單 $record["jump_menu"] = create_select("jump_page", $menu, $data["now_page"], "", "分頁", "style='vertical-align:middle;width:50px;'", $event); } } else { if ($type == "left_menu") { $big_menu = array(); foreach ($data as $key => $item) { if ($item["Levelseq"] == 0) { $big_menu[] = $item; //$big_menu[$key]["sub_menu"]=array(); } else { foreach ($big_menu as $key2 => $item2) { if ($item["Level"] == $item2["Level"]) { $big_menu[$key2]["sub_menu"][] = $item; break; } } } } $record["act"] = $type; $record["data"] = $big_menu; } else { $record["act"] = $type; $record["data"] = $data; } } ob_start(); //打開快取 $tpl->assign("record", $record); $tpl->display(ROOT_PATH . ADMIN_PATH . 'templates/Sample_template.html'); $data["html"] = ob_get_contents(); //接收快取頁面 ob_end_clean(); //關閉快取 $jpage["up_url"] = str_replace("'", '', $jpage["up_url"]); $jpage["down_url"] = str_replace("'", '', $jpage["down_url"]); $jpage["up_url"] = str_replace("location=", '', $jpage["up_url"]); $jpage["down_url"] = str_replace("location=", '', $jpage["down_url"]); return $data["html"]; }
end_head(); begin_body(null); start_form("rezultati.php", "POST"); create_table(["border" => "1px"]); $questionId = 0; $_SESSION['cat1counter'] = $categoryOneCounter; $_SESSION['cat2counter'] = $categoryTwoCounter; $_SESSION['cat3counter'] = $categoryThreeCounter; foreach ($categoryOne as $key => $value) { $cell1 = $key; $options = array(); for ($i = 0; $i < count($value) - 1; $i++) { array_push($options, create_element("option", true, ["contents" => $value[$i]])); } $_SESSION["1_.{$questionId}._answer"] = $value[count($value) - 1]; $cell2 = create_select(["name" => '1_' . $questionId, "contents" => $options]); echo create_table_row(["contents" => array(create_table_cell(["contents" => $cell1]), create_table_cell(["contents" => $cell2]))]); $questionId++; } $brTag = create_element("br", false, null); $questionId = 0; foreach ($categoryTwo as $key => $value) { $cell1 = $key; $options = array(); for ($i = 0; $i < count($value) - 1; $i++) { array_push($options, create_input(["type" => "checkbox", "value" => $value[$i], "name" => '2_' . $questionId . '_checklist[]']) . $value[$i]); } $_SESSION["2_.{$questionId}._answer"] = $value[count($value) - 1]; $content = implode($brTag, $options); echo create_table_row(["contents" => array(create_table_cell(["contents" => $cell1]), create_table_cell(["contents" => $content]))]); $questionId++;
function create_config_input($element, $default = false) { $name = $element[0]; $text = $element[1]; $type = $element[2]; $value = false; if (isset($element[3])) { $value = $element[3]; } switch ($type) { case PHPC_CHECK: if ($default == false) { $default = $value; } $input = create_checkbox($name, '1', $default, $text); break; case PHPC_TEXT: if ($default == false) { $default = $value; } $input = create_text($name, $default); break; case PHPC_DROPDOWN: $input = create_select($name, $value, $default); break; case PHPC_MULTI_DROPDOWN: $input = create_multi_select($name, $value, $default); break; default: soft_error(__('Unsupported config type') . ": {$type}"); } return $input; }
$data["one"]["stock_pic"] = $size_array = explode('|__|', $data["one"]["stock_pic"]); $data["one"]["stock_no"] = $size_array = explode('|__|', $data["one"]["stock_no"]); $data["one"]["stock_status"] = explode('|__|', $data["one"]["stock_status"]); $data["one"]["stock_price"] = explode('|__|', $data["one"]["stock_price"]); $data["one"]["memo"] = dequotes($data["one"]["memo"], -1); $data["one"]["memo_1"] = dequotes($data["one"]["memo_1"], -1); } else { foreach ($tree_data_type as $item) { $type_list[$item["id"]] = $aa[$item['id']] = $item["show_text"]; } //--組合分類陣列 if ($data["list"]) { foreach ($data["list"] as $k => $v) { $temp_class_list = explode('|__|', $v["class"]); if ($temp_class_list) { foreach ($temp_class_list as $a => $b) { $temp_class_list[$a] = $type_list[$b]; } } $data["list"][$k]["class_html"] = implode('<br>', $temp_class_list); //$data["list"][$k]["class_html"] = create_select("class_".$v["id"],$type_list,$v["class"],'1',"根目錄"); } } } $_SESSION["admin_info"]["search"]["status"] = '<option value="">選擇狀態</option>' . Make_list($_SETUP["status"], $_GET["s_status"]); $_SESSION["admin_info"]["tmp"]["search_other"] .= create_select("s_class", $aa, $_GET["s_class"], '1', "根目錄"); include_once "index.php"; //assign 所有資料、共用頁面 $tpl->assign("data_table", $cpos["table"]); $tpl->assign("content", ROOT_PATH . $admin_path . "templates/" . $page_name . ".html"); $tpl->display(ROOT_PATH . $admin_path . "templates/index.html");
function create_select($name_id, $title, $html_class = "", $tooltip = null, $input_area = null) { require SERVER_ROOT . '/php/dist/sql_openConn.php'; //Initialize $html = ''; $hasChildren = false; $html_class .= ' watch'; switch ($input_area) { case "y-axis": $show_filter = "and o.show_in_yaxis_flag = 1 "; break; case "x-axis": $show_filter = "and o.show_in_xaxis_flag = 1 "; break; case "filters": $show_filter = "and o.show_in_filters_flag = 1 "; break; default: $show_filter = ""; break; } $sql = "select d.name_id, d.title, d.tooltip, o.order_num, o.option_value, o.option_text, show_filter_flag \n" . "from param_input d \n" . "inner join param_dropdown_option o \n" . "\ton d.name_id = o.name_id \n" . "where \n" . " d.name_id = '" . $name_id . "' \n" . " " . $show_filter . " \n" . "order by o.order_num asc \n"; $resultOption = $conn->query($sql); $html .= '<div class="select-wrap">'; $count = 1; if ($resultOption->num_rows > 0) { $valueInList = false; //Initialize. $valueInList will be used later to determine whether $value isn't an option in the param_dropdown table. while ($row = $resultOption->fetch_assoc()) { $option_value = $row["option_value"]; $option_text = $row["option_text"]; if ($count === 1) { $sql = "select c.child_name_id, c.html_class \n" . "from param_input_child c \n" . "where option_value = '" . $option_value . "' \n"; $resultChild = $conn->query($sql); if ($resultChild->num_rows > 0) { $hasChildren = true; // $html_class .= ' watch'; } if ($tooltip !== null) { $html .= '<select class="' . $html_class . ' form-control" data-toggle="tooltip" title="' . $tooltip . '">'; } else { $html .= '<select class="' . $html_class . ' form-control">'; } } $html .= '<option value="' . $option_value . '">' . $option_text . '</option>'; $count++; } $html .= '</select>'; } else { $html .= '{error: child not found}'; } //Create elem expand (even if no children). $html .= '<div class="elem-expand">'; if ($hasChildren) { while ($row = $resultChild->fetch_assoc()) { $child_name_id = $row["child_name_id"]; $html_class = $row["html_class"]; $html .= create_select($child_name_id, "", $html_class); } } $html .= '</div>'; //Close 'elem-expand' div. $html .= '</div>'; //Close 'select-wrap' div. $conn->close(); return $html; }
$tpl->assign("content", ROOT_PATH . $admin_path . "templates/_sysmenu_nocon.html"); } else { $tpl->assign("content", ROOT_PATH . $admin_path . "templates/_sysmenu.html"); } //--複製結構樹 if ($_GET["copy"]) { include_once "_sysmenu_copy.php"; } //--語系資料 $langehtml = $conn->GetArray("select * from " . PREFIX . "language where detail!='" . $_SESSION["admin_info"]["lang"] . "'"); if ($langehtml) { foreach ($langehtml as $k => $v) { $aa[$v['detail']] = $v["name"]; } } $tpl->assign("langselect", create_select("class", $aa, '', '', "選擇一個語系")); $table = PREFIX . "sysmenu"; $id = quotes($_GET["id"]); $act = $_POST["act"]; $del_id = quotes($_GET["del_id"]); $lang_sql = ' and lang ="' . $_SESSION["admin_info"]["lang"] . '"'; if ($_POST) { foreach ($_POST as $k => $v) { $record[$k] = quotes($v); } } $sql = "select MAX(floor) from " . $table; //取得最大floor值 $max_floor = $conn->GetRow($sql); $max_floor = $max_floor["0"]; $sql = "select * from " . $table . ' where 1=1' . $lang_sql;
} else { $edit = $rpl_replace_str = $rpl_with_str = $rpl_from_post = $rpl_to_msg = $rpl_from_post_opt = $rpl_preg_opt = ''; $rpl_replace_opt = isset($_POST['rpl_replace_opt']) ? (int) $_POST['rpl_replace_opt'] : 1; } require $WWW_ROOT_DISK . 'adm/admpanel.php'; ?> <h2>Replacement Management System</h2> <form name="frm_rpl" method="post" action="admreplace.php"> <?php echo _hs; ?> <table class="datatable solidtable"> <tr class="field"> <td>Replacement Type:</td> <td><?php echo create_select('rpl_replace_opt', "Simple Replace\nPerl Regex (preg_replace)", "1\n0", $rpl_replace_opt & 1, 'onChange="document.frm_rpl.submit();"'); ?> </td> </tr> <tr class="field"> <td>Replace mask:</td> <?php if (!$rpl_replace_opt) { ?> <td>/<input type="text" name="rpl_replace_str" value="<?php echo htmlspecialchars($rpl_replace_str); ?> ">/<input type="text" name="rpl_preg_opt" size=3 value="<?php echo htmlspecialchars($rpl_preg_opt); ?>
<script type="text/javascript" src="js/forms/stocksEdit.js"></script> <div class="mainHolder"> <div class="hintHolder ui-state-default"> <strong>Editing stock values</strong> </div> <div class="left"> <fieldset class="mainFormHolder"> <legend>Stock</legend> <div class="formsLeft">Stock:</div> <div class="formsRight"> <?php echo create_select('stock', $stocks, array('empty' => 'Choose stock', 'class' => 'text-input')); ?> </div> </fieldset> <div id="details"> </div> </div> <div id="create" class="left" style="display: none;"> <fieldset class="mainFormHolder"> <legend>Add new</legend> <div class="formsLeft">Date:</div> <div class="formsRight"> <input type="text" name="date" id="create-date" class="text-input" /> </div>
$data = dbq('SELECT propid, street_address, suburb, external_link FROM prop_details WHERE external_link != \'\' AND (online = 1 OR status = "sold")'); $labels = array(); $values = array(); $count = count($data); for ($i = 0; $i < $count; $i++) { $labels[] = $data[$i]['street_address'] . ', ' . $data[$i]['suburb']; $values[] = $data[$i]['external_link']; } ?> <tr> <td colspan="2"> <label>Property</label> <?php echo create_select('video', $labels, $values, 'video'); ?> </td> <td colspan="2"> <label>Video Url (Propvid url)</label><br/> <input type="text" class="textfield width-300" maxlength="255" value="<?php if (isset($_POST['title'])) { echo htmlspecialchars($_POST['videourl']); } else { echo htmlspecialchars($record['videourl']); } ?> " id="videourl" name="videourl"/> <input type="button" class="button" value="Retrieve Details" name="update" id="update"/> </td> <?php
require $WWW_ROOT_DISK . 'adm/admclose.php'; exit; } $rdf_url = $WWW_ROOT . 'pdf.php'; ?> <h2>PDF Output Configuration</h2> <form method="post" action="admpdf.php"><?php echo _hs; ?> <table class="datatable solidtable"> <?php print_bit_field('PDF Output Enabled', 'PDF_ENABLED'); print_bit_field('Complete Forum Output', 'PDF_ALLOW_FULL'); $opts = "A0\nA1\nA2\nA3\nA4\nA5\nA6\nB5\nletter\nlegal\nledger"; $names = "A0: 2380 x 3368\nA1: 1684 x 2380\nA2: 1190 x 1684\nA3: 842 x 1190\nA4: 595 x 842\nA5: 421 x 595\nA6: 297 x 421\nB5: 501 x 709\nletter: 612 x 792\nlegal: 612 x 1008\nledger: 1224 x 792"; $sel = create_select('CF_PDF_PAGE', $names, $opts, $PDF_PAGE); echo '<tr class="field"><td>Page Dimensions: <br><font size="-1">The sizes are in points, each point is 1/72 of an inch.</font></td><td valign="top">' . $sel . '</td></tr>'; print_reg_field('Horizontal Margin', 'PDF_WMARGIN', 1); print_reg_field('Vertical Margin', 'PDF_HMARGIN', 1); print_reg_field('Maximum CPU Time', 'PDF_MAX_CPU', 1); ?> <tr class="fieldaction"><td colspan=2 align=right><input type="submit" name="btn_submit" value="Change Settings"></td></tr> </table> <input type="hidden" name="form_posted" value="1"> </form> <br> <table border=0 cellspacing=1 cellpadding=3> <tr><th><b>Quick PDF Tutorial</b></th></tr> <tr class="tutor"><td> If enabled, this feature will allow forum visitors to generate PDF files based on the forum data for easy printing and other uses.<br /> This facility supports 3 data retrieval modes, messages, topics & entire forums.<br />
function event_form() { global $vars, $day, $month, $year, $db, $config, $phpc_script, $month_names, $event_types; if (isset($vars['id'])) { // modifying $id = $vars['id']; $title = sprintf(_('Editing Event #%d'), $id); $row = get_event_by_id($id); $subject = htmlspecialchars(stripslashes($row['subject'])); $desc = htmlspecialchars(stripslashes($row['description'])); $year = $row['year']; $month = $row['month']; $day = $row['day']; $hour = date('H', strtotime($row['starttime'])); $minute = date('i', strtotime($row['starttime'])); $end_year = $row['end_year']; $end_month = $row['end_month']; $end_day = $row['end_day']; $durmin = $row['duration'] % 60; $durhr = floor($row['duration'] / 60); if (!$config['hours_24']) { if ($hour > 12) { $pm = true; $hour = $hour - 12; } elseif ($hour == 12) { $pm = true; } else { $pm = false; } } $typeofevent = $row['eventtype']; $multiday = $year != $end_year || $month != $end_month || $day != $end_day; } else { // case "add": $title = _('Adding event to calendar'); $subject = ''; $desc = ''; if ($day == date('j') && $month == date('n') && $year == date('Y')) { if ($config['hours_24']) { $hour = date('G'); } else { $hour = date('g'); if (date('a') == 'pm') { $pm = true; } else { $pm = false; } } } else { $hour = 6; $pm = true; } $minute = 0; $end_day = $day; $end_month = $month; $end_year = $year; $durhr = 1; $durmin = 0; $typeofevent = 1; $multiday = false; } if ($config['hours_24']) { $hour_sequence = create_sequence(0, 23); } else { $hour_sequence = create_sequence(1, 12); } $minute_sequence = create_sequence(0, 59, 5, 'minute_pad'); $year_sequence = create_sequence(1970, 2037); $html_time = tag('td', create_select('hour', $hour_sequence, $hour), tag('b', ':'), create_select('minute', $minute_sequence, $minute)); if (!$config['hours_24']) { if ($pm) { $value = 1; } else { $value = 0; } $html_time->add(create_select('pm', array(_('AM'), _('PM')), $value)); } if (isset($id)) { $input = create_hidden('id', $id); } else { $input = ''; } $attributes = attributes('class="phpc-main"'); $day_of_month_sequence = create_sequence(1, 31); return tag('form', attributes("action=\"{$phpc_script}\""), tag('table', $attributes, tag('caption', $title), tag('tfoot', tag('tr', tag('td', attributes('colspan="2"'), $input, create_submit(_("Submit Event")), create_hidden('action', 'event_submit')))), tag('tbody', tag('tr', tag('th', _('Date of event')), tag('td', create_select('day', $day_of_month_sequence, $day), create_select('month', $month_names, $month), create_select('year', $year_sequence, $year))), tag('tr', tag('th', _('Multiple day event')), tag('td', create_checkbox('multiday', '1', $multiday))), tag('tr', tag('th', _('End date (Multiple day events only)')), tag('td', create_select('endday', $day_of_month_sequence, $end_day), create_select('endmonth', $month_names, $end_month), create_select('endyear', $year_sequence, $end_year))), tag('tr', tag('th', _('Event type')), tag('td', create_select('typeofevent', $event_types, $typeofevent))), tag('tr', tag('th', _('Time')), $html_time), tag('tr', tag('th', _('Duration')), tag('td', create_select('durationhour', create_sequence(0, 23), $durhr), _('hour(s)') . "\n", create_select('durationmin', $minute_sequence, $durmin), _('minutes') . "\n")), tag('tr', tag('th', _('Subject') . ' (' . $config['subject_max'] . ' ' . _('chars max') . ')'), tag('td', tag('input', attributes('type="text"', "size=\"{$config['subject_max']}\"", "maxlength=\"{$config['subject_max']}\"", 'name="subject"', "value=\"{$subject}\"")))), tag('tr', tag('th', _('Description')), tag('td', tag('textarea', attributes('rows="5"', 'cols="50"', 'name="description"'), $desc)))))); }
function create_select_range($name, $lbound, $ubound, $increment = 1, $default = false, $name_function = false) { $arr = array(); for ($i = $lbound; $i <= $ubound; $i += $increment) { if ($name_function !== false) { $text = $name_function($i); } else { $text = $i; } $arr[$i] = $text; } return create_select($name, $arr, $default); }
$depth = '1'; } //明細 if ($_SESSION["admin_info"]["view"] == "detail") { $data["pic_size_title"] = "任意比例"; $data["uploadfilemax"] = 50; //圖檔上傳上限 $data["one"]["pic"] = is_array($data["one"]["pic"]) ? $data["one"]["pic"] : explode('|__|', $data["one"]["pic"]); //計算圖片總數並判斷第一個是否為空值 空值等於 目前有的數量為0 $temp_pic_count = 0; foreach ($data["one"]["pic"] as $k => $v) { if ($v != NULL && $v != '') { $temp_pic_count += 1; } } $data["one"]["parent_id_html"] = $data["one"]["prolist"] = create_select("parent_id", $tree_array, $data["one"]["parent_id"] != NULL ? $data["one"]["parent_id"] : $_GET["parent_id"], $mode, "根目錄"); //--加價購選單 //--分類樹判斷 switch ($mode) { case "1": //--層級判斷 switch ($depth) { case "1": $data["order_html"] .= '<tr><td align="right">分類折扣:</td><td><input type="text" name="desh" value="' . $data["one"]["desh"] . '" maxlength="7"></td></tr>'; break; } break; } } else { if ($data["list"]) { foreach ($data["list"] as $k => $v) {
$str = "checked"; } } if ($v["lv"] == $v_2["parents"]) { if (in_array($v_2["lv"], $session_auth) || $_SESSION["admin_info"]["control"] == '0') { //--非系統管理員進行權限判斷 $html .= ' <input name="auth_' . $v_2["lv"] . '" class="auth_' . $v["lv"] . '" type="checkbox" value="' . $v_2["lv"] . '" ' . $str . ' />' . $v_2["name"] . '(' . $temp_lang_list[$v_2["lang"]] . ')'; } } } } $data["auth_html"] = $html; //-語系版本授權 $data["lang_auth_html"] = create_select("lang_auth", $lang_data_array, $data["lang_auth"] ? $data["lang_auth"] : $_SESSION["admin_info"]["lang_auth"], "dd", "不限制", $_SESSION["admin_info"]["lang_auth"] && $_SESSION["admin_info"]["control"] != '0' ? ' onfocus="defaultValue=this.value" onchange="this.value=defaultValue"' : ""); $_SESSION["admin_info"]["view"] = "detail"; } else { include "search_data.php"; $sql .= " 1=1 " . ($_SESSION["admin_info"]["lang_auth"] ? " and lang_auth='" . $_SESSION["admin_info"]["lang_auth"] . "'" : "") . " order by create_date desc"; //改為擷取語系使用者 $data = $conn->PageExecute($sql, $per_page_qty, $page); foreach ($data as $k => $v) { foreach ($v as $k_2 => $v_2) { $data_temp[$k][$k_2] = $v_2; } //存入新陣列 給與 smarty section 使用 //$data_temp[$k]["status"] = $_SETUP["status"][$data_temp[$k]["status"]]; $data_temp[$k]["status_html"] = Make_radio($_SETUP["status"], $data_temp[$k]["status"], "status_" . $data_temp[$k]["id"]); } $tpl->assign("page_table", Page_table($data, $per_page_qty));
echo array_get($data, 'email'); ?> " /> </div> <br /> <div class="formsLeft">Status:</div> <div class="formsRight"> <?php echo create_select('status', array(0 => 'Not active', 1 => 'Active'), array('default' => array_get($data, 'status'), 'class' => 'text-input')); ?> </div> <br /> <div class="formsLeft">Type:</div> <div class="formsRight"> <?php echo create_select('type', array('owner' => 'Owner', 'editor' => 'Editor'), array('default' => array_get($data, 'type'), 'class' => 'text-input')); ?> </div> <br /> <div class="formsLeft">Contacts:</div> <div class="formsRight"> <textarea class="text-area" name="contacts" id="contacts"><?php echo array_get($data, 'contacts'); ?> </textarea> </div> <br /> <div class="formsLeft">Notes:</div> <div class="formsRight"> <textarea class="text-area" name="notes" id="notes"><?php echo array_get($data, 'notes');