Esempio n. 1
0
require_once B_ROOT . './source/adminfunc/album.func.php';
if (!empty($_POST['valuesubmit'])) {
    $albumid = createalbum($shopid, $_POST['catid'], $_G['uid'], $_G['username'], $_POST['album']['subject'], $_POST['album']['description']);
    if ($albumid > 0) {
        itemnumreset('album', $shopid);
        $_BCACHE->deltype('sitelist', 'album');
        $_BCACHE->deltype('storelist', 'album', $shopid);
        $_BCACHE->deltype('storelist', 'photo', $shopid, $albumid);
        cpmsg('message_success', $BASESCRIPT . '?action=add&m=photo&albumid=' . $albumid);
    }
}
//添加或更改的頁面
shownav('infomanage', 'nav_album_add', $_SGLOBAL['panelinfo']['subject']);
showformheader('add&m=album');
showtableheader('');
showsetting('album_subject', 'album[subject]', '', 'text');
showsetting('album_description', 'album[description]', '', 'textarea');
$mycats = mymodelcategory('album');
$please_select = '<select name="album[catid]" id="album_catid" style="width:140px;"><option value="0" selected="selected">' . lang('please_select') . '</option>';
foreach ($mycats as $value) {
    $please_select .= '<option value="' . $value['catid'] . '" >' . $value['name'] . '</option>';
}
$please_select .= '</select>';
//showsetting('album_catid', 'album[catid]', '',$please_select);
echo '<tr><td class="td27" colspan="2">' . lang('shop_album_catid') . '</td></tr><tr><td class="vtop rowform" id="' . $showarr['name'] . 'div" colspan="2">';
echo InteractionCategoryMenu(mymodelcategory('album'), 'catid', null, null);
echo '</td></tr>';
showalbumattr();
showsubmit('valuesubmit');
showtablefooter();
showformfooter();
Esempio n. 2
0
function pkregion($showarr)
{
    global $_G, $_SC;
    /*
    	 if($showarr['value']) {
    		$upid = $showarr['options'][$showarr['value']]['upid']? $showarr['options'][$showarr['value']]['upid']:0;
    		if($showarr['options'][$upid]['upid'] !=0) {
    		$upupid = $showarr['options'][$upid]['upid'];
    		} else {
    		$upupid = 0;
    		}
    		}*/
    //echo '<tr><td class="td27" colspan="2">'.lang('shop_'.$showarr['name']).$showarr['required'].'</td></tr><tr><td class="vtop rowform" id="'.$showarr['name'].'div" colspan="2"><select id="selector_0" name="'.$showarr['name'].'"><option value="-1">'.lang('shop_'.$showarr['name']).'</option>';
    echo '<tr><td class="td27" colspan="2">' . lang('shop_' . $showarr['name']) . $showarr['required'] . '</td></tr><tr><td class="vtop rowform" id="' . $showarr['name'] . 'div" colspan="2">';
    echo InteractionCategoryMenu($showarr['options'], $showarr['name'], $showarr['value'], null);
    echo '</td></tr>';
    /*
    	 foreach($showarr['options'] as $k=>$v) {
    
    if($v['upid'] == 0) {
    echo '<option value="'.$v['catid'].'"'.(($v['catid']==$upupid)||($v['catid']==$upid)||($upid==0&&$showarr['value']&&$v['catid']==$showarr['value'])?' selected="selected"':'').'>'.$v['name'].'</option>';
    }
    }
    echo '</select><span id="span_catid"></span><script type="text/javascript" charset="utf-8">';
    
    echo '
    $(function(){
    
    var '.$showarr['name'].'s = '.json_encode_region($showarr['options']).';
    var selector = 1;
    $("#selector_0").bind("change", function(){creat(this.id);});
    function creat(id) {
    var originalrid = $("#"+id+"").val();
    var csid = id.split("_")[1];
    var newregion = "";
    for(var i in '.$showarr['name'].'s) {
    if('.$showarr['name'].'s[i].upid == originalrid) {
    newregion += "<option value=\""+'.$showarr['name'].'s[i].catid+"\""+((typeof(upid)!="undefined"&&'.$showarr['name'].'s[i].catid==upid)||(typeof(value)!="undefined"&&'.$showarr['name'].'s[i].catid==value)?" selected=\"selected\"":"")+">"+'.$showarr['name'].'s[i].name+"</option>";
    }
    }
    var selectlength = $("#'.$showarr['name'].'div select").length;
    if(selectlength > 1) {
    for(var i = selectlength; i > 0; i--) {
    var cid = $("#'.$showarr['name'].'div select:nth-child("+i+")").attr("id");
    if( cid.split("_")[1] > csid) {
    $("#'.$showarr['name'].'div select:nth-child("+i+")").remove();
    }
    }
    selector = $("#'.$showarr['name'].'div select").length;
    
    }
    if(newregion!="") {
    $("#"+id+"").after("<select><option value=\"-1\">'.lang("please_select_".$showarr['name']).'</option>"+newregion+"</select>");
    $("#"+id+"").removeAttr("name");
    $("#"+id+" + select").attr("name", "'.$showarr['name'].'");
    $("#"+id+" + select").attr("id", "selector_"+selector);
    $("#"+id+" + select").bind("change", function(){'.($showarr['name']=='region'?'':'').'creat(this.id);});
    } else {
    $("#"+id).attr("name","'.$showarr['name'].'");
    }
    
    selector = $("#'.$showarr['name'].'div select").length;
    if(selector == 1) {
    $("#selector_0").attr("name","'.$showarr['name'].'");
    }
    '.($showarr['name']=='region'?'':'getattributes();').'
    }
    
    
    ';
    
    echo '<script>';
    if(!empty($showarr['value'])) {
    $upids = explode("|", getupid($showarr['value'],$showarr['options']));
    $org = 0;
    for($i=count($upids);$i > 1; $i--) {
    if($upids[$i-1]!=0) {
    echo '$("#selector_'.$org.'").val('.$upids[$i-1].');$("#selector_'.$org.'").change();';
    $org++;
    }
    }
    
    echo '$("#selector_'.$org.'").val('.$showarr['value'].');$("#selector_'.$org.'").change();';
    }
    echo '});</script></td></tr>';
    */
}
Esempio n. 3
0
function showlistmod($mname)
{
    global $_G, $catstr, $opcheckstr, $gradestr, $_SGLOBAL, $_SC;
    //下拉框拼湊
    $opcheckstr = "";
    foreach ($_SGLOBAL['shopgrade'] as $key => $value) {
        if ($_G['myshopstatus'] == 'verified' && ($key == 0 || $key == 5 || !pkperm('isadmin') && $key == 1)) {
        } else {
            $opcheckstr .= '&nbsp; <input class="radio" type="radio" name="opcheck" value="' . $key . '"' . (pkperm('isadmin') ? ' onClick="showchecktxt(' . $key . ');"' : '') . '> ' . $value . ' &nbsp;';
            $gradestr .= '<option value="' . $key . '" ' . ($_GET['grade'] == $key ? 'selected="selected"' : '') . '>' . $value . '</option>';
        }
    }
    //批量操作方法
    $opt_master_pass = $_GET['optpass'] == 1 ? true : false;
    //快速操作,管理員點擊待審核列表時,只出現更改審核狀態的設置
    $update_master_pass = $_GET['updatepass'] == 1 ? true : false;
    //審核通過店舖,修改信息後站長審核頁面。
    showtableheader(lang('operation_form'), 'nobottom');
    if (!$opt_master_pass && !$update_master_pass) {
        showsubtitle(array('', 'operation', 'option'));
    }
    $checktextjavascript = '
		<script type="text/javascript" charset="' . $_G['charset'] . '">
		function showchecktxt(cktxtid) {
			if($("#newgroupid").length>0) {
				$("#newgroupfield").css("display","none");
			}
			if(cktxtid==1) {
				$("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_fail') . '");
			} else if(cktxtid==2) {
				$("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_close') . '");
			} else if(cktxtid==3) {
				if($("#newgroupid").length>0) {
					$("#newgroupfield").css("display","");
				} else {
					var newgroupid = $("#groupid").clone();
					newgroupid[0].id= "newgroupid";
					newgroupid[0].name= "newgroupid";
					$("#newgroupselect").before(newgroupid);
					$("#newgroupfield").css("display","");
				}
				$("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_pass') . '");
			} else if(cktxtid==4) {
				$("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_recommend') . '");
			} else {
				$("#check_trid").css("display","none"); $("#check_txtid").text("");
			}
			}
			$(function() {
				$("#submit_listsubmit").click(function() {
					var operations = $(":radio[name=\'operation\']");
					if(operations.length>0) {
						for(var i = 0; i < operations.length; i++) {
							if(operations[i].checked) {
								return true;
							}
						}
					}
					alert("' . lang("operation_mustselected") . '");
					return false;
				});
			});
		</script>';
    // 如果進入的是待審核快速操作選項
    if ($opt_master_pass) {
        if ($mname == 'shop') {
            showtablerow('', array('style="display:none;"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" checked name="operation" value="check">', '&nbsp; <input type="radio" onclick="showchecktxt(3);" value="3" name="opcheck" class="radio">' . lang('pass_update') . '&nbsp;&nbsp; <input type="radio" onclick="showchecktxt(1);" value="1" name="opcheck" class="radio">' . lang('del_update')));
            showtablerow('id="check_trid" style="display:none;"', array('class="rowform" style="width:auto;"'), array('&nbsp;<textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea"></textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment') . '</span>'));
            $catstr = '<select name="newgroupid" id="newgroupid">';
            $query = DB::query("SELECT * FROM " . tname("shopgroup") . " ORDER BY id ASC;");
            while ($result = DB::fetch($query)) {
                $catstr .= '<option value="' . $result['id'] . '">' . $result['title'] . '</option>';
            }
            showtablerow('id="newgroupfield" style="display:none;"', array('class="rowform" style="width:auto;"'), array($catstr . '</select> <span id="newgroupselect" class="vtop tips2">' . lang('mod_check_newgroupid_comment') . '</span>'));
            echo $checktextjavascript;
        } else {
            showtablerow('', array('style="display:none;"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" checked="checked" name="operation" value="passcheck">', '&nbsp; <input type="radio" onclick="showchecktxt(3);" checked="checked" value="3" name="opcheck" class="radio">' . lang('pass_update') . ' &nbsp; <input type="radio" onclick="showchecktxt(1);" value="1" name="opcheck" class="radio">' . lang('del_update')));
            showtablerow('id="check_trid" style="display:;"', array('class="rowform" style="width:auto;"'), array('&nbsp;<textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea">' . lang('mod_update_pass_' . $mname) . '</textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment_' . $mname) . '</span>'));
            echo $checktextjavascript_ = '<script type="text/javascript" charset="' . $_G['charset'] . '">function showchecktxt(cktxtid) {
				if(cktxtid==1) {
					$("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_refuse_' . $mname) . '");
				} else if(cktxtid==3) {
					$("#check_trid").css("display",""); $("#check_txtid").text("' . lang('mod_checktxt_pass_' . $mname) . '");
				}
			}
				</script>
			';
        }
    } elseif ($update_master_pass) {
        if ($mname == 'shop') {
            showtablerow('', array('style="display:none;"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" checked name="operation" value="passupdate">', '&nbsp; <input class="radio" type="radio" checked="checked" name="update" value="1" />' . lang('pass_update') . ' &nbsp; <input class="radio" type="radio" name="update" value="0" />' . lang('del_update')));
            showtablerow('id="check_trid" style="display:;"', array('class="rowform" style="width:auto;"'), array('&nbsp;<textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea">' . lang('mod_update_pass_' . $mname) . '</textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment') . '</span>'));
        } else {
            showtablerow('', array('style="display:none;"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" checked name="operation" value="passupdate">', '&nbsp; <input class="radio" type="radio" checked="checked" name="update" value="1" />' . lang('pass_update') . ' &nbsp; <input class="radio" type="radio" name="update" value="0" />' . lang('del_update')));
            showtablerow('id="check_trid" style="display:;"', array('class="rowform" style="width:auto;"'), array('&nbsp;<textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea">' . lang('mod_update_pass_' . $mname) . '</textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment_' . $mname) . '</span>'));
        }
        echo '<script type="text/javascript" charset="' . $_G['charset'] . '">
				$(function(e){
					$(":radio[name=\'update\']").click(function(e){
						var update = e.target.value;
						if(update == 0) {
							$("#check_txtid").text("' . lang('mod_update_refuse_' . $mname) . '");
						} else {
							$("#check_txtid").text("' . lang('mod_update_pass_' . $mname) . '");
						}
					});
				});
		</script>';
    } else {
        // 調整顯示順序,除了圖片外都有顯示順序
        if ($mname != 'photo') {
            showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="display">', lang('mod_displayorder'), ''));
        }
        //一般情況的批量操作選項
        if ($mname == 'album') {
            $mycats = array();
            if (pkperm('isadmin')) {
                $mycats = getmodelcategory('album');
            } else {
                $mycats = mymodelcategory('album');
            }
            $please_select = '<select name="catid" id="album_catid" style="width:140px;"><option value="0" selected="selected">' . lang('please_select') . '</option>';
            foreach ($mycats as $value) {
                $please_select .= '<option value="' . $value['catid'] . '" >' . $value['name'] . '</option>';
            }
            $please_select .= '</select>';
            showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="album_movecat" >', lang('mod_album_movecat'), InteractionCategoryMenu(getmodelcategory('album'), 'catid', null, 1)));
        }
        //站長修改店舖組和分類
        if (pkperm('isadmin') && $mname == 'shop') {
            echo '<tr class="hover">
					<td class="td25"><input type="radio" value="changecat" name="operation" class="radio"></td>
					<td class="td24">' . lang("modallshopcat") . '</td>
					<td style="width: auto;" class="rowform">
					<div id="catdiv" style="width: 700px;">
				';
            $catelist = getmodelcategory('shop');
            echo '<div id="' . shopcat . 'div" colspan="2">';
            echo InteractionCategoryMenu(getmodelcategory('shop'), 'shopcat', null, null);
            echo '</div></div></td></tr>';
            $catstr = '<select name="groupid" id="groupid">';
            $query = DB::query("SELECT * FROM " . tname("shopgroup") . " ORDER BY id ASC;");
            while ($result = DB::fetch($query)) {
                $catstr .= '<option value="' . $result['id'] . '">' . $result['title'] . '</option>';
            }
            showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="movecat">', lang('mod_shop_changegroup'), $catstr . '</select>'));
        }
        //站長修改信息所屬店舖
        if (pkperm('isadmin') && $mname != 'shop' && $mname != 'photo') {
            showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="moveshop">', lang('mod_' . $mname . '_moveshop'), '<input class="number" type="number" name="opshopid">' . lang('mod_moveshop_id')));
        }
        //更改店舖狀態
        showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="check">', lang('mod_check'), $opcheckstr));
        if ($mname == 'shop') {
            //店舖狀態短信通知
            showtablerow('id="check_trid" style="display:none;"', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('', lang('mod_check_textarea'), '&nbsp;<textarea rows="6" name="check_txt" id="check_txtid" cols="50" class="tarea"></textarea> <span class="vtop tips2">' . lang('mod_check_textarea_comment') . '</span>'));
            showtablerow('id="newgroupfield" style="display:none;"', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('', '<font color="red">' . lang('shop_newgroupid') . '</font>', ' <span id="newgroupselect" class="vtop tips2">' . lang('mod_check_newgroupid_comment') . '</span>'));
            //店舖狀態短信通知js
            echo $checktextjavascript;
            //是否首頁推薦
            showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="recommend">', lang('mod_recommend'), '&nbsp; <input class="radio" type="radio" name="opallowreply" value="1"> ' . lang('yes') . ' &nbsp; &nbsp; <input class="radio" type="radio" name="opallowreply" value="0"> ' . lang('no')));
            //會員卡
            showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="discount">', lang('mod_discount'), '&nbsp; <input class="radio" type="radio" name="opdiscount" value="1"> ' . lang('mod_discount_yes') . ' &nbsp; &nbsp; <input class="radio" type="radio" name="opdiscount" value="0"> ' . lang('mod_discount_no')));
            //店舖所有者
            showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="owner">', lang('mod_owner'), '<input class="number" type="number" name="opowner" value="" /> <span style="color:#999;">&nbsp;' . lang('mod_owner_inputuid') . '</span>'));
        }
        //是否允許評論
        if ($mname != 'photo' && $mname != 'album') {
            showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="allowreply">', lang('mod_allowreply'), '&nbsp; <input class="radio" type="radio" name="opallowreply" value="1"> ' . lang('mod_allowreply_yes') . ' &nbsp; &nbsp; <input class="radio" type="radio" name="opallowreply" value="0"> ' . lang('mod_allowreply_no')));
        }
        //刪除信息
        showtablerow('', array('class="td25"', 'class="td24"', 'class="rowform" style="width:auto;"'), array('<input class="radio" type="radio" name="operation" value="delete">', lang('mod_delete'), $mname == 'shop' ? '<input class="checkbox" type="checkbox" name="opdelete" id="opdelete" value="1" checked="checked" /><label for="opdelete"> ' . lang('mod_delete_all') . '</label>' : ''));
    }
    showsubmit('listsubmit', 'submit', '');
    showtablefooter();
    showformfooter();
}