本文整理汇总了PHP中perm函数的典型用法代码示例。如果您正苦于以下问题:PHP perm函数的具体用法?PHP perm怎么用?PHP perm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了perm函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ensure
/**
* Ensure that user has a specified permission
*
* @param $permission
* @return \Illuminate\Http\RedirectResponse|null
*/
public function ensure($permission)
{
$perm = perm();
if ($perm == 'admin' || perm() == $permission) {
return null;
}
return redirect()->back();
}
开发者ID:vjaykoogu,项目名称:smile-media-laravel,代码行数:14,代码来源:BaseAdminController.php
示例2: clearLog
public function clearLog()
{
perm('dash', 'Activity', $this->Session->read("user_perm"), true);
if ($this->request->is('ajax')) {
$server = $this->Session->read("current_server");
$logfile = TMP . "server/" . $server . ".log";
$file = new File($logfile);
if ($file->exists()) {
$log = $file->delete();
return $log;
}
}
}
开发者ID:Tim-NL,项目名称:SpaceBukkitPanel,代码行数:13,代码来源:ServersController.php
示例3: perm
function perm($arr, $n, $result = array())
{
if ($n <= 0) {
return false;
}
$i = 0;
$new_result = array();
foreach ($arr as $r) {
if (count($result) > 0) {
foreach ($result as $res) {
$new_element = array_merge($res, array($r));
$new_result[] = $new_element;
}
} else {
$new_result[] = array($r);
}
}
if ($n == 1) {
return $new_result;
}
return perm($arr, $n - 1, $new_result);
}
开发者ID:raahman,项目名称:ringzer0team-ctf,代码行数:22,代码来源:hash.php
示例4: dirname
<?php
require_once dirname(__FILE__) . "/permutation.php";
// Writes to: regression_tests/if/correct/if_with_comments.in
$ws = alt("", " \t", "\n");
$comment = alt("/*c*/", "//c\n");
$wsComment = alt(clone $ws, clone $comment, clone $ws);
$comments = alt(clone $ws, clone $comment);
$list = perm('{', clone $comments, 'if', clone $comments, '$a', clone $comments, '}', "\n {\$a}\n{/if}");
$a = app("if/correct/if_with_comments.in", $argv);
$a->output("{var \$a = \"foo\"}\n");
do {
$str = $list->generate();
$a->output($str . "\n");
} while ($list->increase());
开发者ID:bmdevel,项目名称:ezc,代码行数:15,代码来源:permutation_if_basic.php
示例5: auth
analysepca: Boolean analyse shape of images
sanalysisfile: String name of shape analysis file
usepci: Boolean load PCI model from pcifile
pci: Boolean do any color PCI functions
pcifile: String name of PCI model to load or save
analysepci: Boolean analyse colour of images
canalysisfile: String name of colour analysis file
images: String[] list of image paths
texture: Boolean use texture to create average
mask: String name of mask to use for PCI
***********************************************************/
require_once $_SERVER['DOCUMENT_ROOT'] . '/include/main_func.php';
auth();
ini_set('max_execution_time', 6000);
$return = array('error' => true, 'errorText' => '', 'newFileName' => '');
if (!perm('pca')) {
$return['errorText'] .= 'You do not have permission to create a PCA';
} else {
$url = 'http://' . $_SERVER["SERVER_NAME"] . '/tomcat/psychomorph/pca?';
// set up data
$theData = $_POST['theData'];
$theData['subfolder'] = intval($_SESSION['user_id']);
$paramsJoined = array();
foreach ($theData as $param => $value) {
if (is_array($value)) {
foreach ($value as $subvalue) {
$paramsJoined[] = "{$param}={$subvalue}";
}
} else {
$paramsJoined[] = "{$param}={$value}";
}
开发者ID:debruine,项目名称:webmorph,代码行数:31,代码来源:tcPCA.php
示例6: storeSettings
/**
* Store saved settings
*
* @param Request $request
* @param UserService $userService
* @return \Illuminate\Http\RedirectResponse
*/
public function storeSettings(Request $request, UserService $userService)
{
$this->validate($request, $this->validationRulesForSettings($request));
$fields = $request->only(['name', 'email', 'password', 'avatar', 'language']);
if (perm('demo')) {
unset($fields['password']);
unset($fields['language']);
}
$userService->updateProfile($this->currentUser, $fields);
return redirect()->back();
}
开发者ID:vjaykoogu,项目名称:smile-media-laravel,代码行数:18,代码来源:AccountController.php
示例7: dirname
<?php
require_once dirname(__FILE__) . "/permutation.php";
// Writes to: regression_tests/blocks/incorrect/block_invalid_closing_*.in
$singleBlockNames = alt("var", "cycle", "use", "increment", "decrement", "reset", "return", "break", "skip", "continue", "else", "elseif", "include", "ldelim", "rdelim");
$nestedBlockNames = alt("foreach", "while", "if", "switch", "case", "default", "delimiter", "literal");
$otherNames = alt("tru", "fals", "ray");
$alts = alt($singleBlockNames, $nestedBlockNames, $otherNames);
$data = alt("", " \$foo");
$lineStart = perm("{/", $alts);
$line = perm($lineStart, $data, "}");
$list = perm($line, "\n");
$a = app("", $argv);
$dir = $a->dir;
$i = 1;
do {
$num = sprintf("%04d", $i);
$str = $list->generate();
$fileIn = $dir . "/blocks/incorrect/block_invalid_closing_" . $num . ".in";
$fileOut = $dir . "/blocks/incorrect/block_invalid_closing_" . $num . ".out";
$name = $alts->generate();
$a->store("{* file: " . "block_invalid_closing_" . $num . ".in" . " *}\n{var \$foo = \"T42p\"}\n" . $str . "\n", $fileIn);
if ($alts->index == 0) {
$dataText = $data->generate();
$a->store("mock:3:2: This block cannot be closed.\n" . "\n" . "{/{$name}{$dataText}}\n" . " ^\n", $fileOut);
} elseif ($alts->index == 1) {
$lineText = $line->generate();
if ($data->index == 0) {
$offset = strlen($line->generate()) + 1;
$a->store("mock:3:{$offset}: Found closing block {/{$name}} without an opening block.\n" . "\n" . "{$lineText}\n" . str_repeat(" ", $offset - 1) . "^\n", $fileOut);
} else {
开发者ID:bmdevel,项目名称:ezc,代码行数:31,代码来源:permutation_block_invalid_closing.php
示例8: details
//.........这里部分代码省略.........
$i = 0;
$key = 0;
while ($stkd = pg_fetch_array($stkdRslt)) {
# Keep track of selected stock amounts
$amts[$i] = $stkd['amt'];
$i++;
# Get warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$stkd['whid']}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# Get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkd['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
# Serial number
if ($stk['serd'] == 'yes' && $inv['serd'] == 'n') {
$sers = ext_getavserials($stkd['stkid']);
$sernos = "<select class='width : 15' name='sernos[]'>";
foreach ($sers as $skey => $ser) {
$sernos .= "<option value='{$ser['serno']}'>{$ser['serno']}</option>";
}
$sernos .= "</select>";
} else {
$sernos = "<input type=hidden name=sernos[] value='{$stkd['serno']}'>{$stkd['serno']}";
}
# Input qty if not serialised
$qtyin = "<input type=text size=3 name=qtys[] value='{$stkd['qty']}'>";
if ($stk['serd'] == 'yes') {
$qtyin = "<input type=hidden size=3 name=qtys[] value='{$stkd['qty']}'>{$stkd['qty']}";
}
# check permissions
if (perm("invoice-unitcost-edit.php")) {
$viewcost = "<input type=text size=8 name=unitcost[] value='{$stkd['unitcost']}'>";
} else {
$viewcost = "<input type=hidden size=8 name=unitcost[] value='{$stkd['unitcost']}'>{$stkd['unitcost']}";
}
# Put in product
$products .= "<tr class='bg-odd'><td><input type=hidden name=whids[] value='{$stkd['whid']}'>{$wh['whname']}</td><td><input type=hidden name=stkids[] value='{$stkd['stkid']}'><a href='#bottom' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td><td>{$sernos}</td><td>" . extlib_rstr($stk['stkdes'], 30) . "</td><td>{$qtyin}</td><td>{$viewcost}</td><td><input type=text size=4 name=disc[] value='{$stkd['disc']}'> OR <input type=text size=4 name=discp[] value='{$stkd['discp']}' maxlength=5>%</td><td><input type=hidden name=amt[] value='{$stkd['amt']}'> " . CUR . " {$stkd['amt']}</td><td><input type=checkbox name=remprod[] value='{$key}'><input type=hidden name=SCROLL value=yes></td></tr>";
$key++;
}
# Look above(remprod keys)
$keyy = $key;
# Look above(if i = 0 then there are no products)
if ($i == 0) {
$done = "";
} else {
$SCROLL = "yes";
}
# check if stock warehouse was selected
if (isset($whidss)) {
foreach ($whidss as $key => $whid) {
if (isset($stkidss[$key]) && $stkidss[$key] != "-S" && isset($cust['pricelist'])) {
# skip if not selected
if ($whid == "-S") {
continue;
}
# Get selected warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$whid}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# Get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkidss[$key]}' AND div = '" . USER_DIV . "' ORDER BY stkcod ASC";
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:67,代码来源:inv-cust-credit-b.php
示例9: dirname
<?php
require_once dirname(__FILE__) . "/permutation.php";
// Writes to: regression_tests/array_fetch/correct/comments.in
$ws = alt("", " \t", "\n");
$comment = alt("/*c*/", "//c\n");
$wsComment = alt(clone $ws, clone $comment, clone $ws);
$comments = alt(clone $ws, clone $comment);
$list = perm("{\$a[", clone $comments, '0', clone $comments, "]}\n");
$a = app("array_fetch/correct/comments.in", $argv);
$a->output("{var \$a = array( 0 => 'foo' )}\n");
$i = 0;
do {
$str = $list->generate();
$a->output($str);
++$i;
} while ($list->increase());
$a->close();
$a->store(str_repeat("foo\n", $i), $a->dir . "/array_fetch/correct/comments.out");
开发者ID:bmdevel,项目名称:ezc,代码行数:19,代码来源:permutation_array_fetch_comments.php
示例10: while
print "<table border=0 width=100%><td width=5% id=s><b>Options</b></td><td id=s><b>Filename</b></td><td id=s><b>Size</b></td><td id=s><b>Permissions</b></td><tr>";
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if (is_dir($file)) {
$directories[] = $file;
} else {
$files[] = $file;
}
}
asort($directories);
asort($files);
foreach ($directories as $file) {
print "<td id=d><a href=\"?p=rename&file=" . realpath($file) . "&dir=" . realpath('.') . "\">[R]</a><a href=\"?p=delete&file=" . realpath($file) . "\">[D]</a></td><td id=d><a href=\"" . $me . "?dir=" . realpath($file) . "\">" . $file . "</a></td><td id=d ></td><td id=d><a href=\"?p=chmod&dir=" . realpath('.') . "&file=" . realpath($file) . "\">" . perm($file) . "</a></td><tr>";
}
foreach ($files as $file) {
print "<td id=f><a href=\"?p=rename&file=" . realpath($file) . "&dir=" . realpath('.') . "\">[R]</a><a href=\"?p=delete&file=" . realpath($file) . "\">[D]</a></td><td id=f><a href=\"" . $me . "?p=edit&dir=" . realpath('.') . "&file=" . realpath($file) . "\">" . $file . "</a></td><td id=f>" . filesize($file) . "</td><td id=f><a href=\"?p=chmod&dir=" . realpath('.') . "&file=" . realpath($file) . "\">" . perm($file) . "</a></td><tr>";
}
} else {
print "<u>Error!</u> Can't open <b>" . realpath('.') . "</b>!<br>";
}
print "</table><hr><table border=0 width=100%><td>Upload file<br><form enctype=\"multipart/form-data\" action=\"" . $me . "?dir=" . realpath('.') . "\" method=\"POST\">\n\n<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"100000000\" /><input name=\"uploadedfile\" type=\"file\" />\n\n<input type=\"submit\" value=\"Upload File\" />\n\n</form></td><td><form action=\"" . $me . "\" method=GET><b>Directory:</b><input type=text size=40 name=dir value=\"" . realpath('.') . "\"><input type=submit value=\"Change Directory\"></form></td></table>";
}
function login()
{
print "<table border=0 width=100% height=100%><td valign=\"middle\"><center>\n\n\t<form action=" . basename(__FILE__) . " method=\"POST\"><b>Password?</b>\n\n\t<input type=\"password\" maxlength=\"32\" name=\"pass\"><input type=\"submit\" value=\"Login\">\n\n\t</form>";
}
function reload()
{
header("Location: " . basename(__FILE__));
}
function get_execution_method()
开发者ID:ASDAFF,项目名称:Shells-Database,代码行数:31,代码来源:iron_shell.php
示例11: posix_getgrgid
$owner=$fileownera['name'];
}
$group = @filegroup($d."/".$files[$i]);
if($os=="unix"){
$groupinfo = posix_getgrgid($group);
$group=$groupinfo['name'];
}
$info=perm($perms);
if($i%2){$color="#D1D1D1";}else{$color="#D7FFA8";}
if ($size < 1024){$siz=$size.' b';
}else{
if ($size < 1024*1024){$siz=number_format(($size/1024), 2, '.', '').' kb';}else{
if ($size < 1000000000){$siz=number_format($size/(1024*1024), 2, '.', '').' mb';}else{
if ($size < 1000000000000){$siz=number_format($size/(1024*1024*1024), 2, '.', '').' gb';}
开发者ID:plirof,项目名称:php-exploit-scripts,代码行数:29,代码来源:nstview.php
示例12: details
//.........这里部分代码省略.........
$key++;
++$ai;
} else {
# Keep track of selected stock amounts
$amts[$i] = $stkd['amt'];
$i++;
# Get warehouse name
db_conn("exten");
$sql = "SELECT whname FROM warehouses WHERE whid = '{$stkd['whid']}' AND div = '" . USER_DIV . "'";
$whRslt = db_exec($sql);
$wh = pg_fetch_array($whRslt);
# Get selected stock in this warehouse
db_connect();
$sql = "SELECT * FROM stock WHERE stkid = '{$stkd['stkid']}' AND div = '" . USER_DIV . "'";
$stkRslt = db_exec($sql);
$stk = pg_fetch_array($stkRslt);
# Serial number
if ($stk['serd'] == 'yes' && ($inv['serd'] == 'n' || $stkd["serno"] == "")) {
$sers = ext_getavserials($stkd['stkid']);
$sernos = "<select name='sernos[{$ai}]'>";
foreach ($sers as $skey => $ser) {
$sernos .= "<option value='{$ser['serno']}'>{$ser['serno']}</option>";
}
$sernos .= "</select>\n\t\t\t\t\t<input type='hidden' name='sernos_ss[]' value='*_*_*CUBIT_SERIAL_SELECT_BOX*_*_*' />";
} else {
$sernos = "\n\t\t\t\t\t<input type='hidden' name='sernos_ss[]' value='{$stkd['ss']}' />\n\t\t\t\t\t<input type='hidden' name='sernos[{$ai}]' value='{$stkd['serno']}'>{$stkd['ss']}";
}
# Input qty if not serialised
$qtyin = "<input type='text' size='3' name='qtys[{$ai}]' value='{$stkd['qty']}'>";
if ($stk['serd'] == 'yes') {
$qtyin = "<input type='hidden' size='3' name='qtys[{$ai}]' value='{$stkd['qty']}'>{$stkd['qty']}";
}
# check permissions
if (perm("invoice-unitcost-edit.php")) {
$viewcost = "<input type='text' size='8' name='unitcost[{$ai}]' value='{$stkd['unitcost']}'>";
} else {
$viewcost = "<input type='hidden' size='8' name='unitcost[{$ai}]' value='{$stkd['unitcost']}'>{$stkd['unitcost']}";
}
db_conn('cubit');
$Sl = "SELECT * FROM vatcodes ORDER BY code";
$Ri = db_exec($Sl) or errDie("Unable to get vat codes");
$Vatcodes = "\n\t\t\t\t<select name='vatcodes[{$ai}]'>\n\t\t\t\t\t<option value='0'>Select</option>";
while ($vd = pg_fetch_array($Ri)) {
if ($stkd['vatcode'] == $vd['id']) {
$sel = "selected";
} else {
$sel = "";
}
$Vatcodes .= "<option value='{$vd['id']}' {$sel}>{$vd['code']}</option>";
}
$Vatcodes .= "</select>";
# Put in product
$products .= "\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type='hidden' name='accounts[{$ai}]' value='0'>\n\t\t\t\t\t\t<input type='hidden' name='descriptions[{$ai}]' value=''>\n\t\t\t\t\t\t<input type='hidden' name='whids[{$ai}]' value='{$stkd['whid']}'>{$wh['whname']}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td><input type='hidden' name='stkids[]' value='{$stkd['stkid']}'><a href='#bottom' onclick='openwindow(\"stock-amt-det.php?stkid={$stk['stkid']}\")'>{$stk['stkcod']}</a></td>\n\t\t\t\t\t<td>{$Vatcodes}</td>\n\t\t\t\t\t<td>{$sernos}</td>\n\t\t\t\t\t<td>" . extlib_rstr($stk['stkdes'], 30) . "</td>\n\t\t\t\t\t<td>{$qtyin}</td>\n\t\t\t\t\t<td>{$viewcost}</td>\n\t\t\t\t\t<td><input type='text' size='4' name='disc[{$ai}]' value='{$stkd['disc']}'> OR <input type='text' size='4' name='discp[{$ai}]' value='{$stkd['discp']}' maxlength='5'>%</td>\n\t\t\t\t\t<td nowrap><input type='hidden' name='amt[{$ai}]' value='{$stkd['amt']}'> " . CUR . " {$stkd['amt']}</td>\n\t\t\t\t\t<td><input type='checkbox' name='remprod[{$ai}]' value='{$key}'></td>\n\t\t\t\t</tr>";
$key++;
++$ai;
}
}
# Look above(remprod keys)
$keyy = $key;
# Look above(if i = 0 then there are no products)
if ($i == 0) {
$done = "";
} else {
$SCROLL = "yes";
}
# check if stock warehouse was selected
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:67,代码来源:cust-credit-stockinv.php
示例13: mapautotrim
function mapautotrim()
{
perm('worlds', 'runMapAutoTrim', $this->Session->read("user_perm"), true);
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}
require APP . 'spacebukkitcall.php';
//notify users
$args = array($this->Session->read("Sbvars.10"), '$bServer will shut down shortly due to map mainteniance with MapAutoTrim');
$api->call("broadcastWithName", $args, false);
sleep(10);
//run MapAutoTrim
$vars = $this->request->data;
$args2 = array($vars['world'], $vars['dilatation'], $vars['blocks']);
$api->call("runMapTrimmer", $args2, true);
sleep(5);
w_serverlog($this->Session->read("current_server"), __('[WORLDS] ') . $this->Auth->user('username') . ' ' . __('ran MapAutoTrim on') . ' ' . $vars['world']);
while (is_null($api->call('getWorlds', array(), false))) {
sleep(1);
}
$this->redirect($this->referer());
}
开发者ID:Tim-NL,项目名称:SpaceBukkitPanel,代码行数:22,代码来源:TworldsController.php
示例14: while
print "<table border=0 width=100%><td width=5% id=s><b>Options</b></td><td id=s><b>Filename</b></td><td id=s><b>Size</b></td><td id=s><b>Permissions</b></td><td id=s>Last modified</td><tr>";
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if (is_dir($file)) {
$directories[] = $file;
} else {
$files[] = $file;
}
}
asort($directories);
asort($files);
foreach ($directories as $file) {
print "<td id=d><a href=\"?p=rename&file=" . realpath($file) . "&dir=" . realpath('.') . "\">[R]</a><a href=\"?p=delete&file=" . realpath($file) . "\">[D]</a></td><td id=d><a href=\"" . $me . "?dir=" . realpath($file) . "\">" . $file . "</a></td><td id=d></td><td id=d><a href=\"?p=chmod&dir=" . realpath('.') . "&file=" . realpath($file) . "\"><font color=" . get_color($file) . ">" . perm($file) . "</font></a></td><td id=d>" . date("Y/m/d, H:i:s", filemtime($file)) . "</td><tr>";
}
foreach ($files as $file) {
print "<td id=f><a href=\"?p=rename&file=" . realpath($file) . "&dir=" . realpath('.') . "\">[R]</a><a href=\"?p=delete&file=" . realpath($file) . "\">[D]</a></td><td id=f><a href=\"" . $me . "?p=edit&dir=" . realpath('.') . "&file=" . realpath($file) . "\">" . $file . "</a></td><td id=f>" . filesize($file) . "</td><td id=f><a href=\"?p=chmod&dir=" . realpath('.') . "&file=" . realpath($file) . "\"><font color=" . get_color($file) . ">" . perm($file) . "</font></a></td><td id=f>" . date("Y/m/d, H:i:s", filemtime($file)) . "</td><tr>";
}
} else {
print "<u>Error!</u> Can't open <b>" . realpath('.') . "</b>!<br>";
}
print "</table><hr><table border=0 width=100%><td><b>Upload file</b><br><form enctype=\"multipart/form-data\" action=\"" . $me . "?dir=" . realpath('.') . "\" method=\"POST\"> \n<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"100000000\" /><input size=30 name=\"uploadedfile\" type=\"file\" /> \n<input type=\"submit\" value=\"Upload File\" /> \n</form></td><td><form action=\"" . $me . "\" method=GET><b>Change Directory<br></b><input type=text size=40 name=dir value=\"" . realpath('.') . "\"><input type=submit value=\"Change Directory\"></form></td> \n<tr><td><form action=\"" . $me . "\" method=GET><b>Create file<br></b><input type=hidden name=dir value=\"" . realpath('.') . "\"><input type=text size=40 name=file value=\"" . realpath('.') . "\"><input type=hidden name=p value=edit><input type=submit value=\"Create file\"></form> \n</td><td><form action=\"" . $me . "\" method=GET><b>Create directory<br></b><input type=text size=40 name=crdir value=\"" . realpath('.') . "\"><input type=hidden name=dir value=\"" . realpath('.') . "\"><input type=hidden name=p value=createdir><input type=submit value=\"Create directory\"></form></td> \n</table>";
}
function login()
{
print "<table border=0 width=100% height=100%><td valign=\"middle\"><center> \n <form action=" . basename(__FILE__) . " method=\"POST\"><b>Password?</b> \n <input type=\"password\" maxlength=\"32\" name=\"pass\"><input type=\"submit\" value=\"Login\"> \n </form>";
}
function reload()
{
header("Location: " . basename(__FILE__));
}
function get_execution_method()
开发者ID:pioytazsko,项目名称:drell,代码行数:31,代码来源:aa.php
示例15: while
if ($handle = @opendir($dir)) {
while (false != ($link = readdir($handle))) {
$on3 = @posix_getpwuid(@fileowner($dir . "/" . $link));
$gr = @posix_getgrgid(@filegroup($dir . "/" . $link));
if (@is_dir($dir . DIRECTORY_SEPARATOR . $link)) {
$file = array();
@($file['link'] = "<a href='{$me}?dir={$dir}" . DIRECTORY_SEPARATOR . "{$link}'>[ {$link} ]</font></a>");
$file['pir'] = "<a href='?sws=chmod&file={$link}&dir={$dir}'\">" . @wsoPermsColor($dir . "/" . $link) . "</a>";
$file['pir2'] = "<a href='?sws=chmod&file={$link}&dir={$dir}'\">" . @perm($dir . "/" . $link) . "</a>";
$folder = "<tr><td> " . $file['link'] . "</td><td>dir</td><td>" . date('Y-m-d H:i:s', @filemtime($dir . "/" . $link)) . "</td><td>" . $on3['name'] . "/" . $gr['name'] . "</td><td>" . $file['pir'] . " " . $file['pir2'] . "<td><a href='?sws=rname&file={$link}&dir={$dir}'\">R</a> - <a href='?sws=chmod&file={$link}&dir={$dir}'\">C</a> - <a href='?sws=rm&file={$link}&dir={$dir}'\">rm</a></td></td></tr></div>";
array_push($folders, $folder);
} else {
$file = array();
$ext = @strpos($link, ".") ? @strtolower(end(explode(".", $link))) : "";
$file['pir'] = "<a href='?sws=chmod&file={$link}&dir={$dir}'\">" . @wsoPermsColor($dir . "/" . $link) . "</a>";
$file['pir2'] = "<a href='?sws=chmod&file={$link}&dir={$dir}'\">" . @perm($dir . "/" . $link) . "</a>";
$file['size'] = @number_format(@filesize($dir . "/" . $link) / 1024, 2);
@($file['link'] = "<a href='?sws=edit&file={$link}&dir={$dir}'\">" . $link . "</a>");
$file = "<tr><td>" . $file['link'] . "</td><td>" . $file['size'] . "</td><td>" . date('Y-m-d H:i:s', @filemtime($dir . "/" . $link)) . "</td><td>" . $on3['name'] . "/" . $gr['name'] . "</td><td>" . $file['pir'] . " " . $file['pir2'] . "<td><a href='?sws=edit&file={$link}&dir={$dir}'\">E</a> - <a href='?sws=rname&file={$link}&dir={$dir}'\">R</a> - <a href='?sws=chmod&file={$link}&dir={$dir}'\">C</a> - <a href='?sws=dow&file={$link}&dir={$dir}'\">D</a> - <a href='?sws=rm&file={$link}&dir={$dir}'\">rm</a></td></td></tr></div>";
array_push($files, $file);
}
}
asort($folders);
asort($files);
foreach ($folders as $folder) {
echo $folder;
}
foreach ($files as $file) {
echo $file;
}
echo "</table></div>";
开发者ID:Theov,项目名称:webshells,代码行数:31,代码来源:sa.php
示例16: dirname
<?php
require_once dirname(__FILE__) . "/permutation.php";
// Writes to: regression_tests/array_fetch/correct/indexes.in
$ws = alt("", " ", "\n");
$comment = alt("/*c*/", "//c\n");
$wsComment = alt(clone $ws, clone $comment, clone $ws);
$comments = alt(clone $ws, clone $comment);
$indexPre = perm("[1]", clone $comments, "[]", clone $comments);
$indexPost = perm("[2]");
$entry1 = alt("", perm(clone $comments, "[1]"), perm("[1]", clone $comments, "[2]"), perm($indexPre, $indexPost));
$var = perm("{\$a[0]");
$fetch = perm($var, $entry1, "}");
$list = perm($fetch, "\n");
$a = app("array_fetch/correct/indexes.in", $argv);
$top = "{var \$a = array( 0 => array( 1 => array( 2 => 'foo' ) ) )}\n";
$a->output($top);
$i = 1;
$out = '';
$map = array(0 => "Array\n", 1 => "Array\n", 2 => "foo\n", 3 => '');
do {
$num = sprintf("%04d", $i);
$str = $list->generate();
if ($entry1->index == 3) {
$a->store("{* file: indexes_{$num}.in *}\n" . $top . $str, $a->dir . "/array_fetch/incorrect/indexes_{$num}.in");
/* $text = $fetch->generate();
$len = strlen( $text );
$a->store( "mock:3:{$len}: Unexpected array append '[]'. Did you forget an expresssion between the brackets?\n" .
"\n" .
"{$text}\n" .
str_repeat( " ", ezcTemplatePermutation::column( $var->generate() . $indexPre->generate() ) ) . "^\n",
开发者ID:bmdevel,项目名称:ezc,代码行数:31,代码来源:permutation_array_fetch.php
示例17: dirname
<?php
require_once dirname(__FILE__) . "/permutation.php";
// Writes to: regression_tests/literals/array_create_with_comments2.in
$ws = alt("", " \t", "\n");
$comment = alt("/*c*/", "//c\n");
$wsComment = alt(clone $ws, clone $comment, clone $ws);
$comments = alt(clone $ws, clone $comment);
$list = perm('debug_dump( array', '(', alt(perm(clone $comments, alt('0'), clone $comments), perm(clone $comments, alt('0'), clone $comments, alt(','), clone $comments)), ') )');
$a = app("literals/array_create_with_comments2.in", $argv);
do {
$str = $list->generate();
$a->output("{" . $str . "}\n");
} while ($list->increase());
开发者ID:bmdevel,项目名称:ezc,代码行数:14,代码来源:permutation_array_create2.php
示例18: alloc
//.........这里部分代码省略.........
$vatcode_drop = "<select name='setvatcode'>";
while ($varr = pg_fetch_array($run_vatc)) {
if (isset($setvatcode) and $setvatcode == $varr['id']) {
$vatcode_drop .= "<option value='{$varr['id']}' selected>{$varr['code']} {$varr['description']}</option>";
} else {
$vatcode_drop .= "<option value='{$varr['id']}'>{$varr['code']} {$varr['description']}</option>";
}
}
$vatcode_drop .= "</select>";
}
$setvatsel1 = "";
$setvatsel2 = "";
if ($setvat == "novat") {
$setvatsel2 = "checked='yes'";
} else {
$setvatsel1 = "checked='yes'";
}
// <input type='hidden' name='bankid' value='$bankid'>
// <input type='hidden' name='date' value='$date'>
// <input type='hidden' name='descript' value='$descript'>
// <input type='hidden' name='reference' value='$reference'>
// <input type='hidden' name='cheqnum' value='$cheqnum'>
// <input type='hidden' name='amt' value='$amt'>
// <input type='hidden' name='setvat' value='$setvat'>
// <input type='hidden' name='setvatcode' value='$setvatcode'>
// <input type='hidden' name='setamt' value='".sprint (array_sum($stock_setamt))."'>
$prsel1 = "";
$prsel2 = "";
if ($process_type == "batch") {
$prsel2 = "checked='yes'";
} else {
$prsel1 = "checked='yes'";
}
if (perm("allow-user-change-supp-process-type.php")) {
$show_process_type = "\n\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan='2'>Payment Process Type</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td><input type='radio' name='process_type' value='now' {$prsel1}>Pay creditor immediately and add to cashbook</td>\n\t\t\t\t\t<td><input type='radio' name='process_type' value='batch' {$prsel2}>Add to creditor payment batch</td>\n\t\t\t\t</tr>\n\t\t\t\t" . TBL_BR . "\n\t\t\t</table>";
} else {
$show_process_type = "<input type='hidden' name='process_type' value='{$process_type}'>";
}
$confirm = "\n\t\t<script>\n\t\t\tfunction showText() {\n\t\t\t\tXPopupShow('{$settext}', getObject('phonetic_show'));\n\t\t\t}\n\t\t\tfunction updateStockTotal (counter){\n\t\t\t\tvar total_val = getObj('total_id'+counter);\n\t\t\t\tvar htotal_val = getObj('total_hid'+counter);\n\t\t\t\tvar set_val = getObj('set_id'+counter);\n\t\t\t\tvar hset_val = getObj('set_hid'+counter);\n\t\n\t\t\t\tvar button_val = getObj('button'+counter);\n\t\n\t\t\t\tif (total_val.value == '0.00'){\n\t\t\t\t\ttotal_val.value = htotal_val.value - hset_val.value;\n\t\t\t\t}else {\n\t\t\t\t\ttotal_val.value = '0.00';\n\t\t\t\t}\n\t\t\t\tif (set_val.value == '0.00'){\n\t\t\t\t\tset_val.value = hset_val.value;\n\t\t\t\t}else {\n\t\t\t\t\tset_val.value = '0.00';\n\t\t\t\t}\n\t\t\t\tbutton_val.blur();\n\t\t\t}\n\t\t\tfunction pageXY(el){\n\t\t\t\tvar XY={x:0, y:0};\n\t\t\t\tfor( var node = el; node; node=node.offsetParent)\n\t\t\t\t{ XY.x += node.offsetLeft;\n\t\t\t\t\tXY.y += node.offsetTop;\n\t\t\t\t}\n\t\t\t\treturn XY;\n\t\t\t}\n\t\t\tfunction gotoName(name){\n\t\t\t\tvar anchors, anchor, XY;\n\t\t\t\tanchors=document.anchors;\n\t\t\t\tanchor=anchors[name];\n\t\t\t\tif(!anchor) // IE sucks\n\t\t\t\t{\n\t\t\t\t\tfor( var i = 0; i < anchors.length; ++i){\n\t\t\t\t\t\tif(anchors[i].name==name){\n\t\t\t\t\t\t\tanchor = anchors[i];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!anchor){\n\t\t\t\t\tif( document.getElementById)\n\t\t\t\t\t\tanchor=document.getElementById(name);\n\t\t\t\t\telse if( document.all) // untested\n\t\t\t\t\t\tanchor=document.all[name];\n\t\t\t\t}\n\t\t\t\tif(anchor){\n\t\t\t\t\tXY = pageXY(anchor);\n\t\t\t\t\twindow.scrollTo(XY.x, XY.y);\n\t\t\t\t}\n\t\t\t}\n\t\t</script>\n\t\t<h3>New Bank Payment</h3>\n\t\t<form action='" . SELF . "' method='POST' name='form1'>\n\t\t{$show_process_type}\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t{$err}\n\t\t\t<input type='hidden' name='key' value='confirm'>\n\t\t\t<input type='hidden' name='all' value='{$all}'>\n\t\t\t<input type='hidden' name='supid' value='{$supid}'>\n\t\t\t<input type='hidden' name='pur' value=''>\n\t\t\t<input type='hidden' name='inv' value=''>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>Field</th>\n\t\t\t\t\t\t\t<th>Value</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>Account</td>\n\t\t\t\t\t\t\t<td>{$bank_drop}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>Payment Date</td>\n\t\t\t\t\t\t\t<td valign='center'>" . mkDateSelect("date", $date_year, $date_month, $date_day) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>Paid To</td>\n\t\t\t\t\t\t\t<td valign='center'>({$sup['supno']}) {$sup['supname']}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>Description</td>\n\t\t\t\t\t\t\t<td valign='center'><textarea col='18' rows='3' name='descript'>{$descript}</textarea></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>Reference</td>\n\t\t\t\t\t\t\t<td valign='center'><input type='text' size='25' name='reference' value='{$reference}'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>Total Amount</td>\n\t\t\t\t\t\t\t<td>" . CUR . " {$amt}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>Settlement Discount</td>\n\t\t\t\t\t\t\t<td valign='center'>" . CUR . " " . sprint(array_sum($stock_setamt)) . " <input type='button' onClick='showText();' value='Tax Credit Note ?'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td nowrap>Settlement Discount VAT</td>\n\t\t\t\t\t\t\t<td nowrap>\n\t\t\t\t\t\t\t\t{$vatcode_drop} \n\t\t\t\t\t\t\t\t<input type='radio' name='setvat' value='inc' {$setvatsel1}> VAT Inclusive \n\t\t\t\t\t\t\t\t<input type='radio' name='setvat' value='novat' {$setvatsel2}> No VAT\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t\t<td width='5%'></td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<
|
请发表评论