本文整理汇总了PHP中_p函数的典型用法代码示例。如果您正苦于以下问题:PHP _p函数的具体用法?PHP _p怎么用?PHP _p使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_p函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
global $basedomain;
$dataUser['table'] = "bsn_users";
$dataUser['condition'] = array('type' => 2, 'n_status' => 1, 'idUser' => $this->user['idUser']);
$getUser = $this->userHelper->fetchData($dataUser);
$dataPengaduan = $this->mpengaduan->getPengaduan($this->user['idUser']);
if ($getUser) {
$this->view->assign('user', $getUser[0]);
}
if ($_POST['token']) {
if ($_POST['pass']) {
$pass = _p('pass');
$oldPass = sha1($getUser[0]['salt'] . $pass . $getUser[0]['salt']);
if ($getUser[0]['password'] == $oldPass) {
$pass1 = _p('pass1');
if ($pass1) {
$_POST['password'] = sha1($getUser[0]['salt'] . $pass1 . $getUser[0]['salt']);
}
}
}
$signup = $this->contentHelper->saveData($_POST, "_users");
// redirect($basedomain . 'profil');
}
$this->view->assign('dataPengaduan', $dataPengaduan);
return $this->loadView('akun/profile');
}
示例2: addProduct
function addProduct()
{
$category = _p('category');
$name = _p('name');
$description = _p('description');
$meta_desc = _p('meta_descriptoion');
$meta_key = _p('meta_keywords');
$model = _p('model');
$sku = _p('sku');
$upc = _p('upc');
$ean = _p('ean');
$jan = _p('jan');
$isbn = _p('isbn');
$mpn = _p('mpn');
$weight = _p('weight');
$weight_class = _p('weight_class');
$length = _p('length');
$width = _p('width');
$height = _p('height');
$length_class = _p('length_class');
$location = _p('location');
$price = _p('price');
$quantity = _p('quantity');
$minimum = _p('minimum');
$substract = _p('substract');
$shipping = _p('shipping');
$status = _p('status');
$date_added = date('Y-m-d H:i:s');
$pathUpload = "";
$image = uploadFile('gambar', $pathUpload, 'image');
$query_product = "INSERT INTO ck_product (`model`, `sku`, `upc`, `ean`, `jan`, `isbn`, `mpn`, `location`, `quantity`, `image`, `shipping`, `price`, `weight`, `weight_class_id`, `length`, `width`, `height`, `length_class_id`, `subtract`, `minimum`, `sort_order`, `status`, `date_added`) VALUES ('{$model}', '{$sku}', '{$upc}', '{$ean}', '{$jan}', '{$isbn}', '{$mpn}', '{$location}', {$quantity}, '{$image}', '{$shipping}', {$price}, {$weight}, '{$weight_class}', {$length}, {$width}, {$height}, '{$length_class}', '{$substract}', {$minimum}, '', {$status}, '{$date_added}' )";
echo "<br />" . $query_product;
echo "<br />";
pr($image);
}
示例3: RenderTable
public function RenderTable()
{
foreach ($this->objConstantArray as $objConstant) {
$strName = $objConstant->Variable->Name;
if (QApplication::$Login) {
$strName .= ' <a href="/edit_constant.php/' . $objConstant->Id . '" class="class_property_link" title="Edit">Edit</a>';
}
$strType = $objConstant->Variable->VariableType;
$strValue = $objConstant->Variable->DefaultValue;
$strDescription = $objConstant->Variable->ShortDescriptionAsHtml;
?>
<tr>
<td class="class_property_name"><?php
_p($strName, false);
?>
</td>
<td class="class_property_type"><?php
_p($strType, false);
?>
</td>
<td class="class_property_value"><?php
_p($strValue, false);
?>
</td>
<td class="class_property_description"><?php
_p($strDescription, false);
?>
</td>
</tr>
<?php
}
}
示例4: goLogin
function goLogin()
{
// pr($_POST);exit;
$username = _p('username');
$password = _p('password');
// pr($data);
$sql = "SELECT * FROM admin_member WHERE username = '{$username}' LIMIT 1";
// pr($sql);exit;
$res = $this->fetch($sql, 0, 0);
// pr($res);exit;
if ($res) {
$salt = sha1($password . $res['salt']);
// pr($salt);exit;
// $getRule = "SELECT * FROM cdc_group_rule WHERE groupID = {$res['usertype']} LIMIT 1 ";
// $res['rule'] = $this->fetch($getRule);
// pr($res);
// exit;
if ($res['password'] == $salt) {
// $_SESSION['admin'] = $res;
$this->session->set_session($res);
return true;
}
}
return false;
}
示例5: updateCategory
function updateCategory()
{
global $CONFIG;
$id = _p('category_id');
$parent = _p('parent');
$name = _p('name');
$description = _p('description');
$meta_description = _p('meta_description');
$meta_keywords = _p('meta_keywords');
$top = _p('top');
$column = _p('column');
$sort_order = _p('sort_order');
$status = _p('status');
$pathUpload = "";
$date_modified = date('Y-m-d H:i:s');
if ($_FILES['gambar']['name'] == "") {
$query = "UPDATE ck_category SET parent_id={$parent}, top={$top}, `column`={$column}, sort_order={$sort_order}, status={$status}, date_modified = '{$date_modified}' WHERE category_id = {$id}";
} else {
$image = uploadFile('gambar', $pathUpload, 'image');
$query = "UPDATE ck_category SET image='{$image}', parent_id={$parent}, top={$top}, `column`={$column}, sort_order={$sort_order}, status={$status}, date_modified='{$date_modified}' WHERE category_id = {$id}";
}
$query_desc = "UPDATE ck_category_description SET name = '{$name}', description = '{$description}', meta_description = '{$meta_description}', meta_keyword = '{$meta_keywords}' WHERE category_id = {$id}";
$result_query = $this->query($query);
$result_desc = $this->query($query_desc);
// pr ($_FILES['gambar']);
// echo ("<br/>");
// pr ($image);
// echo ("<br/>");
// echo "<br />".$query;
// exit();
return $result_desc && $result_query;
}
示例6: setting
public function setting()
{
global $CONFIG, $basedomain;
$id = $this->admin['admin']['id'];
$x = form_validation($_POST);
unset($x['token']);
if (isset($_POST['old_password'])) {
$old_password = sha1($x['old_password'] . $this->admin['admin']['salt']);
if ($old_password == $this->admin['admin']['password']) {
unset($x['old_password']);
unset($x['repassword']);
$x['password'] = sha1($x['password'] . $this->admin['admin']['salt']);
} else {
echo "<script>alert('Denied. Wrong password');window.location.href='" . $CONFIG['admin']['base_url'] . "profile'</script>";
}
} else {
$x['password'] = $this->admin['admin']['password'];
}
$data = $this->models->updSettings($x, $id);
if (_p('token')) {
$getUser = $this->models->updSess($x);
if ($getUser) {
echo "<script>alert('Settings has been saved.');window.location.href='" . $CONFIG['admin']['base_url'] . "profile'</script>";
} else {
redirect($basedomain . $CONFIG['admin']['login']);
}
exit;
}
}
示例7: goLogin
function goLogin()
{
// pr($_POST);
$email = _p('email');
$password = _p('password');
// pr($data);
$data['status'] = false;
$newCred = array();
$sql = "SELECT * FROM social_member WHERE email = '{$email}' AND usertype IN (1) AND n_status = 1 LIMIT 1";
// pr($sql);
$res = $this->fetch($sql);
// pr($res);
// exit;
if ($res) {
$salt = sha1($res['salt'] . $password);
// pr($salt);exit;
if ($res['password'] == $salt) {
$loginCount = intval($res['login_count'] + 1);
$lastLogin = date('Y-m-d H:i:s');
$sqlu = "UPDATE social_member SET last_login = '{$lastLogin}' ,login_count = {$loginCount} WHERE id = {$res['id']} LIMIT 1";
$result = $this->query($sqlu);
// $_SESSION['user'] = $res;
$ignoreFIeld = array('salt', 'password', 'email_token', 'email', 'username');
foreach ($res as $key => $val) {
if (!in_array($key, $ignoreFIeld)) {
$newCred[$key] = $val;
}
}
$this->set_session->set_session($newCred);
return $newCred;
}
}
return false;
}
示例8: Render
public function Render($blnPrint = true)
{
if (!$this->blnModified) {
return;
}
if (count($this->arrData)) {
$strDataArray = 'new Array(';
foreach ($this->arrData as $strData) {
$strDataArray .= sprintf("'%s', ", $strData);
}
$strDataArray = substr($strDataArray, 0, strlen($strDataArray) - 2);
$strDataArray .= ')';
} else {
$strDataArray = '';
}
$strRendered = '';
$strRendered .= sprintf("\$('%s').flushCache();", $this->strSelector);
$strRendered .= sprintf("\$('%s').autocomplete(%s);", $this->strSelector, $strDataArray);
$this->blnModified = false;
error_log("_______END RENDERING JS: " . ($this->blnModified ? 'true' : 'false'));
if ($blnPrint) {
_p($strRendered, false);
} else {
return $strRendered;
}
}
示例9: displayGenericExceptionPage
private function displayGenericExceptionPage($e, $context = null)
{
if ($this->report || $this->report === null) {
echo '<html>' . "\n";
echo ' <head>' . "\n";
echo ' <title>Oops, Uncaught Exception</title>' . "\n";
echo ' <style>' . "\n";
echo ' body{font-family: "Open Sans",arial,sans-serif; background: #FFF; color:#333; margin:2em}' . "\n";
echo ' code{background:#E0941B;border-radius:4px;padding:2px 6px}' . "\n";
echo ' </style>' . "\n";
echo ' </head>' . "\n";
echo ' <body>' . "\n";
echo ' <h1>Oops, uncaught exception !</h1>' . "\n";
echo ' <h2>This is embarrassing, but server made a booboo</h2>' . "\n";
echo ' <p><code>' . $e->getMessage() . '</code></p>' . "\n";
echo ' <h3>From:</h3>' . "\n";
echo ' <p><code>' . $e->getFile() . ' on line ' . $e->getLine() . '</code></p>' . "\n";
echo ' <h3>Call stack</h3>' . "\n";
echo ' <pre>' . $e->getTraceAsString() . '</pre>' . "\n";
if ($this->dumpContext) {
echo '<h3>Context:</h3>';
_p($context);
}
echo ' </body>' . "\n";
echo '</html>';
}
exit(1);
}
示例10: RenderTableForVariables
public function RenderTableForVariables($objVariableArray)
{
$strBackgroundColor = 'style="background-color: #eee0fa;"';
foreach ($objVariableArray as $objVariable) {
$strName = $objVariable->Variable->Name;
if (QApplication::$Login) {
$strName .= ' <a href="/edit_variable.php/' . $objVariable->Id . '" class="class_property_link" title="Edit">Edit</a>';
}
switch ($objVariable->InheritenceState) {
case InheritenceState::Interited:
$strClass = ' class_property_inherited';
$strDetails = '<br/><span style="color: #999999;">Inherits From: </span><b>' . $objVariable->QcodoClass->Name . '</b>';
break;
case InheritenceState::Overrides:
$strClass = ' class_property_overrides';
$strDetails = '<br/><span style="color: #999999;">Overrides: </span><b>' . $objVariable->OverridesVariable->QcodoClass->Name . '</b>';
break;
default:
$strClass = null;
$strDetails = null;
}
if ($objVariable->StaticFlag) {
$strDetails = 'Static: </span><b>Yes</b><br/><span style="color: #999999;">Protection Level: </span><b>' . ProtectionType::ToString($objVariable->ProtectionTypeId) . '</b>' . $strDetails;
} else {
$strDetails = 'Protection Level: </span><b>' . ProtectionType::ToString($objVariable->ProtectionTypeId) . '</b>' . $strDetails;
}
$strName .= '<div class="class_methods_detail"><span style="color: #999999;">' . $strDetails . '</div>';
$strType = $objVariable->Variable->VariableType;
if ($objVariable->ReadOnlyFlag) {
$strType .= '<br/><span class="class_property_subspan">(Read-Only)</span>';
}
$strValue = $objVariable->Variable->DefaultValue;
$strDescription = $objVariable->Variable->ShortDescriptionAsHtml;
?>
<tr>
<td class="class_property_name<?php
_p($strClass);
?>
"><?php
_p($strName, false);
?>
</td>
<td class="class_property_type"><?php
_p($strType, false);
?>
</td>
<td class="class_property_value"><?php
_p($strValue, false);
?>
</td>
<td class="class_property_description"><?php
_p($strDescription, false);
?>
</td>
</tr>
<?php
}
}
示例11: DisplayMonospacedText
function DisplayMonospacedText($strText)
{
$strText = QApplication::HtmlEntities($strText);
$strText = str_replace(' ', ' ', $strText);
$strText = str_replace(' ', ' ', $strText);
$strText = str_replace("\r", '', $strText);
$strText = str_replace("\n", '<br/>', $strText);
_p($strText, false);
}
示例12: Render
public function Render($blnPrint = true)
{
$strRendered = sprintf("\$('%s').selectmenu();", $this->strSelector);
if ($blnPrint) {
_p($strRendered, false);
} else {
return $strRendered;
}
}
示例13: RenderAsJSCall
public function RenderAsJSCall($blnPrint)
{
$strRendered = sprintf('$("head").append(\'%s\');', $this->__toString());
if ($blnPrint) {
_p($strRendered, false);
} else {
return $strRendered;
}
}
示例14: RenderAsJSCall
public function RenderAsJSCall($blnPrint)
{
$strRendered = sprintf('$("head").append($(\'<scr\' + \'ipt type="text/javascript" src="%s"></scr\' + \'ipt>\'));', $this->strSrc);
if ($blnPrint) {
_p($strRendered, false);
} else {
return $strRendered;
}
}
示例15: DisplayMonospacedText
function DisplayMonospacedText($strText)
{
//$strText = htmlentities($strText);
//$strText = str_replace(' ', ' ', $strText);
//$strText = str_replace(' ', ' ', $strText);
//$strText = str_replace("\r", '', $strText);
//$strText = str_replace("\n", '<br/>', $strText);
_p($strText, false);
}