示例#1
0
 public function listAction()
 {
     $keyid = $this->get('keyid');
     if (empty($keyid)) {
         $this->adminMsg(lang('a-lin-1'));
     }
     if ($this->isPostForm()) {
         $listorders = $this->post('listorders');
         foreach ($listorders as $id => $value) {
             $value = intval($value);
             $this->link->update(array('listorder' => $value), 'id=' . $id);
         }
         $this->adminMsg($this->getCacheCode('linkage') . lang('success'), url('admin/linkage/list', array('keyid' => $keyid)));
     }
     $tree = $this->instance('linkage_tree');
     $tree->icon = array('   │ ', '   ├─ ', '   └─ ');
     $tree->nbsp = '   ';
     $parentid = (int) $this->get('parentid');
     $page = $this->get('page') ? $this->get('page') : 1;
     $pagelist = $this->instance('pagelist');
     $pagesize = 130;
     $pagelist->loadconfig();
     $toplink = $this->link->find($keyid);
     $where = $toplink['site'] ? 'site=' . $this->siteid . ' AND keyid=' . $keyid : 'keyid=' . $keyid;
     $total = $this->link->count('linkage', 'id', $where);
     if ($total > $pagesize) {
         //若本页无法全部显示,就只统计本级菜单。
         $where .= ' and parentid=' . $parentid;
         $total = $this->link->count('linkage', 'id', $where);
         $parent = 1;
     }
     $result = $this->link->page_limit($page, $pagesize)->where($where)->order(array('listorder ASC', 'id ASC'))->select();
     $pagelist = $pagelist->total($total)->url(url('admin/linkage/list', array('keyid' => $keyid, 'parentid' => $parentid, 'page' => '{page}')))->num($pagesize)->page($page)->output();
     $sdata = array();
     foreach ($result as $t) {
         $sdata[$t['id']] = $t;
         $sdata[$t['id']]['option'] = $parent && $this->isLastNode($t['keyid'], $t['id']) ? '<a href="' . url('admin/linkage/list', array('keyid' => $keyid, 'parentid' => $t['id'])) . '">' . lang('a-lin-0') . '</a> | ' : '';
         !admin_auth($this->userinfo['roleid'], 'linkage-addson') or $sdata[$t['id']]['option'] .= '<a href="' . url('admin/linkage/addson', array('id' => $t['id'])) . '">' . lang('a-add') . '</a> | ';
         !admin_auth($this->userinfo['roleid'], 'linkage-editson') or $sdata[$t['id']]['option'] .= '<a href="' . url('admin/linkage/editson', array('id' => $t['id'])) . '">' . lang('a-edit') . '</a> | ';
         !admin_auth($this->userinfo['roleid'], 'linkage-del') or $sdata[$t['id']]['option'] .= '<a href="javascript:del(' . $t['id'] . ');">' . lang('a-del') . '</a>  ';
     }
     $pdata = $this->link->find($parentid, 'parentid');
     if ($pdata) {
         $pstr = "<a href='" . url('admin/linkage/list', array('keyid' => $keyid, 'parentid' => $pdata['parentid'])) . "'>" . lang('a-lin-2') . "</a> | ";
     }
     $str = "<tr>\n\t\t\t\t\t<td align='center'><input name='listorders[\$id]' type='text' size='3' value='\$listorder' class='input-text-c'></td>\n\t\t\t\t\t<td align='left'>\$id</td>\n\t\t\t\t\t<td>\$spacer\$name</td>\n\t\t\t\t\t<td align='left'>" . $pstr . "\$option</td>\n\t\t\t\t</tr>";
     $tree->init($sdata);
     $list = $tree->get_tree($parentid, $str);
     $this->view->assign(array('list' => $list, 'parentid' => $parentid, 'pagelist' => $pagelist, 'data' => $data, 'keyid' => $keyid));
     $this->view->display('admin/linkage_list');
 }
        echo $t['posid'];
        ?>
);"><?php 
        echo lang('a-pos-5');
        ?>
</a>
			</td>
		</tr>
		<?php 
    }
}
?>
		<tr>
			<td colspan="7" align="left">&nbsp;
			<input <?php 
if (!admin_auth($userinfo['roleid'], 'position-del')) {
    ?>
disabled<?php 
}
?>
 type="submit" class="button" value="<?php 
echo lang('a-del');
?>
" name="submit" onclick="return confirm_del()" />&nbsp;</td>
		</tr>   
		</tbody>
		</table>
		</form>
	</div>
</div>
<script type="text/javascript">
示例#3
0
<?php

// - edit_details.php
//Admin page used to add, edit, and delete publishers.
session_start();
include 'include/header.html';
require 'model/data_functions.php';
$user_id = $_SESSION['user_id'];
$email = $_SESSION['email'];
$page = $_SERVER['REQUEST_URI'];
// Assign current URL to a variable to use in the form action. This will include the GET date for the week of Monday...
$nav_href = 'edit_details.php?monday=';
// For use in week_nav()
$admin_auth =& admin_auth($user_id, $email);
// *** First, check if user has permission to view the page ***
if ($admin_auth == 0) {
    require 'include/login_functions.inc.php';
    redirect_user('index.php');
} else {
    // *** END permission check ***
    require 'include/functions.inc.php';
    require 'include/functions_date.php';
    require MYSQL;
    $monday = $_GET['monday'];
    // Date value from URL. Always represents the date of a Monday of the week.
    $date = date('F j, Y', strtotime($monday));
    $sunday = date('F j, Y', strtotime('+6 days', strtotime($monday)));
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        // Handle the form.
        $problem = FALSE;
        $song_1 = mysqli_real_escape_string($dbc, trim(strip_tags($_POST['song_1'])));
示例#4
0
<?php

/***************************************************************************
 *
 *	 PROJECT: eLitius Open Source Affiliate Software
 *	 VERSION: 1.0
 *	 LISENSE: GNU GPL (http://www.opensource.org/licenses/gpl-license.html)
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation.
 *
 *   Link to eLitius.com can not be removed from the software pages without
 *	 permission of the eLitius respective owners. It is the only requirement
 *	 for using this software.
 *
 *   Copyright 2009 Intelliants LLC
 *   http://www.intelliants.com/
 *
 ***************************************************************************/
admin_auth();
示例#5
0
    $now = time();
    if (isset($_SESSION['_amember_sess_expires']) && isset($_SESSION['_admin_pass'])) {
        if ($_SESSION['_amember_sess_expires'] < $now) {
            if (isset($_COOKIE[session_name()])) {
                setcookie(session_name(), '', time() - 42000, '/');
            }
            session_destroy();
            admin_html_redirect($config['root_url'] . '/admin/', "Admin session expired", "Admin session expired, please login again", $target_top = true);
            exit;
        }
    }
    $_SESSION['_amember_sess_expires'] = $now + 3600;
}
///////////////////////////////////////////////////////////////////////////////
$t = new_smarty();
$vars = get_input_vars();
admin_check_session();
// check if session expired and User Agent
if ($err = admin_auth()) {
    // authentication failed
    admin_login_form($err);
    // display login form
    exit;
}
if ($_SESSION['amember_admin']['last_session'] != session_id()) {
    $db->admin_update_login_info($_SESSION['amember_admin']['admin_id']);
}
if ($t) {
    $t->assign('SID', session_name() . '=' . session_id());
}
unset($vars);
}
?>
		<tr >
			<td colspan="6" align="left">
			<input <?php 
if (!admin_auth($userinfo['roleid'], 'tag-del')) {
    ?>
disabled<?php 
}
?>
 type="submit" class="button" value="<?php 
echo lang('a-del');
?>
" name="submit_del" onClick="$('#list_form').val('del');return confirm_del()" />&nbsp;
			<input <?php 
if (!admin_auth($userinfo['roleid'], 'tag-edit')) {
    ?>
disabled<?php 
}
?>
 type="submit" class="button" value="<?php 
echo lang('a-gx');
?>
" name="submit_update" onClick="$('#list_form').val('update')" />&nbsp;
			<div class="onShow"><?php 
echo lang('a-tag-7');
?>
</div>
			</td>
		</tr>
		</tbody>
    ?>
"><em><?php 
    echo lang('a-add');
    ?>
</em></a><span>|</span><?php 
}
?>
		<a href="<?php 
echo url('admin/model/import', array('typeid' => $typeid));
?>
" class="on"><em><?php 
echo lang('a-import');
?>
</em></a><span>|</span>
		<?php 
if (admin_auth($userinfo['roleid'], 'model-cache')) {
    ?>
<a href="<?php 
    echo url('admin/model/cache', array('typeid' => $typeid));
    ?>
"><em><?php 
    echo lang('a-cache');
    ?>
</em></a><?php 
}
?>
    </div>
	<div class="bk10"></div>
	<div class="table-list">
		<form action="" method="post" enctype="multipart/form-data">
		<table width="100%" class="table_form">
" target="_blank"><?php 
        echo lang('a-cat-23');
        ?>
</a> |
    <?php 
        if (admin_auth($userinfo['roleid'], 'form-edit')) {
            ?>
<a href="<?php 
            echo url('admin/form/edit', array('id' => $t['id'], 'modelid' => $modelid, 'cid' => $cid));
            ?>
"><?php 
            echo lang('a-edit');
            ?>
</a> | <?php 
        }
        if (admin_auth($userinfo['roleid'], 'form-del')) {
            ?>
<a href="javascript:;" onClick="if(confirm('<?php 
            echo lang('a-confirm');
            ?>
')){ window.location.href='<?php 
            echo $del;
            ?>
'; }"><?php 
            echo lang('a-del');
            ?>
</a> <?php 
        }
        ?>
    </td>
</tr>
        ?>
">
			<img src="<?php 
        echo $t[ico];
        ?>
">
			<a href="<?php 
        echo url('admin/theme/edit', array('dir' => $t['dir']));
        ?>
"><?php 
        echo $t['name'];
        ?>
</a></td>
			<td width="70%">
			<?php 
        if (admin_auth($userinfo['roleid'], 'theme-del')) {
            ?>
			&nbsp;<a href="javascript:;" onClick="if(confirm('<?php 
            echo lang('a-confirm');
            ?>
')){ window.location.href='<?php 
            echo url('admin/theme/del', array('name' => $t['dir']));
            ?>
'; }" title="<?php 
            echo lang('a-del');
            ?>
">×</a>
			<?php 
        }
        ?>
			</td>
        echo date(TIME_FORMAT, $t['lastlogintime']);
        ?>
</td>
			<td align="left">
			<?php 
        if (admin_auth($userinfo['roleid'], 'user-edit')) {
            ?>
<a href="<?php 
            echo url('admin/user/edit', array('userid' => $t['userid']));
            ?>
"><?php 
            echo lang('a-edit');
            ?>
</a> | <?php 
        }
        if (admin_auth($userinfo['roleid'], 'user-del')) {
            ?>
<a href="javascript:del(<?php 
            echo $t['userid'];
            ?>
);"><?php 
            echo lang('a-del');
            ?>
</a> <?php 
        }
        ?>
			</td>
		</tr>
		<?php 
    }
}
);"><?php 
                echo lang('a-del');
                ?>
</a> <?php 
            }
        }
        ?>
</td>
		</tr>
		<?php 
    }
}
?>
		<tr>
			<td colspan="8" align="left"><input <?php 
if (!admin_auth($userinfo['roleid'], 'model-editfield')) {
    ?>
disabled<?php 
}
?>
 class="button" type="submit" name="submit" value="<?php 
echo lang('a-order');
?>
" /></td>
		</tr>
		</tbody>
		</table>
	    </form>
	</div>
</div>
</body>
    ?>
disabled<?php 
}
?>
 type="submit" class="button" value="<?php 
echo lang('a-con-39');
?>
" name="submit_status_3" onClick="$('#list_form').val('status_3')" />&nbsp;
			<?php 
if ($join) {
    echo lang('a-con-65');
    ?>
:
			<input type="text" class="input-text" size="10" name="toid" />
			<input <?php 
    if (!admin_auth($userinfo['roleid'], 'form-edit')) {
        ?>
disabled<?php 
    }
    ?>
 type="submit" class="button" value="<?php 
    echo lang('a-con-66');
    ?>
" name="submit_join" onClick="$('#list_form').val('join')" />&nbsp;
			<?php 
}
?>
			</td>
		</tr>
        <?php 
if ($diy_file) {
"><em><?php 
echo lang('a-con-23');
?>
(<?php 
echo $count[3];
?>
)</em></a><span>|</span>
	<a href="<?php 
echo url('admin/form/add', array('modelid' => $modelid, 'cid' => $cid));
?>
" class="on"><em><?php 
echo lang('a-con-24');
?>
</em></a><span>|</span>
	<?php 
if (admin_auth($userinfo['roleid'], 'form-config')) {
    ?>
<a href="<?php 
    echo url('admin/form/config', array('modelid' => $modelid, 'cid' => $cid));
    ?>
"><em><?php 
    echo lang('a-con-60');
    ?>
</em></a><span>|</span><?php 
}
?>
	<a href="<?php 
echo $site_url;
echo url('form/post', array('modelid' => $modelid, 'cid' => $cid));
?>
" target="_blank"><em><?php 
        if ($t['endtime']) {
            $time = round(($t['endtime'] - $t['addtime']) / 3600);
            echo $time > 0 ? $time . lang('a-aip-12') : lang('a-aip-7');
        } else {
            echo lang('a-aip-9');
        }
        ?>
</td>
		</tr>
		<?php 
    }
}
?>
		<tr >
		    <td colspan="9" align="left"> <input <?php 
if (!admin_auth($userinfo['roleid'], 'ip-del')) {
    ?>
disabled<?php 
}
?>
 type="submit" class="button" value="<?php 
echo lang('a-del');
?>
" name="submit_del" />&nbsp;</td>
		</tr>
		</table>
		<?php 
echo $pagelist;
?>
		</form>
	</div>
" clz="1" target="_blank"><?php 
            echo lang('a-cat-23');
            ?>
</a> |
        <?php 
            if (admin_auth($userinfo['roleid'], 'content-edit')) {
                ?>
<a href="<?php 
                echo url('admin/content/edit', array('id' => $t['id']));
                ?>
"><?php 
                echo lang('a-edit');
                ?>
</a> | <?php 
            }
            if (admin_auth($userinfo['roleid'], 'content-del')) {
                ?>
<a href="javascript:;" clz="1" onClick="if(confirm('<?php 
                echo lang('a-confirm');
                ?>
')){ window.location.href='<?php 
                echo $del;
                ?>
'; }"><?php 
                echo lang('a-del');
                ?>
</a> <?php 
            }
        }
        ?>
    </td>
                ?>
</a>&nbsp;<?php 
            }
        } else {
            if (admin_auth($userinfo['roleid'], 'plugin-add')) {
                ?>
<a href="<?php 
                echo url('admin/plugin/add', array('dir' => $t['dir']));
                ?>
"><font color="#FF0000"><?php 
                echo lang('a-plu-48');
                ?>
</font></a>&nbsp;<?php 
            }
        }
        if (admin_auth($userinfo['roleid'], 'plugin-unlink')) {
            ?>
<a href="<?php 
            echo url('admin/plugin/unlink', array('dir' => $t['dir']));
            ?>
"><?php 
            echo lang('a-del');
            ?>
</a><?php 
        }
        ?>
			</td>
			<td width="35%" align="left"></td>
		</tr>
		<?php 
    }
            ?>
'; }"><?php 
            echo lang('a-del');
            ?>
</a><?php 
        }
        ?>
		</td>
	</tr>
	<?php 
    }
}
?>
	<tr height="25">
	    <td colspan="4" align="left"> <input <?php 
if (!admin_auth($userinfo['roleid'], 'block-del')) {
    ?>
disabled<?php 
}
?>
 type="submit" class="button" value="<?php 
echo lang('a-del');
?>
" name="submit_del" onclick="return confirm_del()" />&nbsp;</td>
	</tr>
	</table>
	<?php 
echo $pagelist;
?>
	</form>
	</div>
}
?>
		<tr>
			<td colspan="9" align="left">
				<input <?php 
if (!admin_auth($userinfo['roleid'], 'category-del')) {
    ?>
disabled<?php 
}
?>
 type="submit" class="button" value="<?php 
echo lang('a-del');
?>
" name="delete" onclick="return confirm_del()" />&nbsp;
				<input <?php 
if (!admin_auth($userinfo['roleid'], 'category-edit')) {
    ?>
disabled<?php 
}
?>
 type="submit" class="button" value="<?php 
echo lang('a-order');
?>
" name="submit" onClick="$('#load').show()" />&nbsp;<div class="onShow"><?php 
echo lang('a-cat-24');
?>
</div>
				<span id="load" style="display:none"><img src="<?php 
echo ADMIN_THEME;
?>
images/loading.gif"></span>
                echo lang('a-jin');
            }
            ?>
</a> | <?php 
        }
        if (admin_auth($userinfo['roleid'], 'model-export')) {
            ?>
<a href="<?php 
            echo url('admin/model/export', array('typeid' => $typeid, 'modelid' => $t['modelid']));
            ?>
"><?php 
            echo lang('a-export');
            ?>
</a> | <?php 
        }
        if (admin_auth($userinfo['roleid'], 'model-del')) {
            ?>
<a href="javascript:del(<?php 
            echo $t['modelid'];
            ?>
);"><?php 
            echo lang('a-del');
            ?>
</a> <?php 
        }
        ?>
				</td>
			</tr>
			<?php 
    }
}
" class="on"><em><?php 
echo lang('a-cat-13');
?>
</em></a><span>|</span>
		<?php 
if (admin_auth($userinfo['roleid'], 'category-url')) {
    ?>
<a href="<?php 
    echo url('admin/category/url');
    ?>
"><em><?php 
    echo lang('a-cat-14');
    ?>
</em></a><span>|</span><?php 
}
if (admin_auth($userinfo['roleid'], 'category-cache')) {
    ?>
<a href="<?php 
    echo url('admin/category/cache');
    ?>
"><em><?php 
    echo lang('a-cache');
    ?>
</em></a><?php 
}
?>
	</div>
	<div class="table-list">
		<form method="post" action="" id="myform" name="myform">
		<input type="hidden" value="<?php 
echo $catid;
    ?>
 type="submit" class="button" value="<?php 
    echo lang('dr008');
    ?>
" name="submit_status_5" onClick="$('#list_form').val('status_5')" />&nbsp;
			<?php 
    echo lang('a-con-40');
    ?>
			<select name="movecatid">
			<option value="0"> ---- </option>
			<?php 
    echo $category;
    ?>
			</select>
			<input <?php 
    if (!admin_auth($userinfo['roleid'], 'content-edit')) {
        ?>
disabled<?php 
    }
    ?>
 type="submit" class="button" value="<?php 
    echo lang('a-con-41');
    ?>
" name="submit_move" onClick="$('#list_form').val('move')" />&nbsp;
			<?php 
}
?>
			</td>
		</tr>
		-->