本文整理汇总了PHP中fRequest::encode方法的典型用法代码示例。如果您正苦于以下问题:PHP fRequest::encode方法的具体用法?PHP fRequest::encode怎么用?PHP fRequest::encode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fRequest
的用法示例。
在下文中一共展示了fRequest::encode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: IN
$section = 'banner';
$sub = 'list';
?>
<?php
$typeOfUser = fAuthorization::checkAuthLevel('super');
//$canEdit = fAuthorization::checkACL('poll', 'edit');
//$canDelete = fAuthorization::checkACL('poll', 'delete');
$where = " WHERE ";
if (!$typeOfUser) {
$where = " WHERE " . fSession::get('where_at') . " AND ";
}
$limit = fRequest::encode('limit', 'integer');
$page = fRequest::encode('p', 'integer');
$query = fRequest::encode('query', 'string');
if ($page < 1) {
exit;
}
$start = ($page - 1) * $limit;
$sections = fRecordSet::buildFromSQL('BannerSection', "SELECT * FROM bannersection {$where} (name LIKE '%{$query}%' OR id_region IN (SELECT id_region FROM region WHERE name LIKE '%{$query}%')) LIMIT {$start},{$limit}", "SELECT count(*) FROM bannersection {$where} (name LIKE '%{$query}%' OR id_region IN (SELECT id_region FROM region WHERE name LIKE '%{$query}%'))", $limit, $page);
if ($sections->count() == 0) {
echo '<div class="notification information" >
Por el momento no hay registros en <b> Secciones de banners </b>.
</div>';
} else {
$p = new Pagination($sections->getPages(), $sections->getPage(), 3);
$pagination = $p->getPaginationLinks();
?>
<center>
<table class="contenttoc" style="width:auto; float:left">
示例2: count
<?php
$section = 'categories';
$section_id = 25;
$sub = 'listGcategory';
$typeOfUser = fAuthorization::checkAuthLevel('super');
$where = "";
if (!$typeOfUser) {
$where = " WHERE " . fSession::get('where_at');
}
?>
<?php
$limit = fRequest::encode('limit', 'integer');
$page = fRequest::encode('p', 'integer');
if ($page < 1) {
exit;
}
$start = ($page - 1) * $limit;
$categories = fRecordSet::buildFromSQL('EconomicUnitCategory', "SELECT * FROM economic_unit_categories {$where} LIMIT {$start},{$limit}", "SELECT count(*) FROM economic_unit_categories {$where}", $limit, $page);
if ($categories->count() == 0) {
echo '<div class="notification information" >
Por el momento no hay registros en <b> Categorías de Geolocalización</b>.
</div>';
} else {
$p = new Pagination($categories->getPages(), $categories->getPage(), 3);
$pagination = $p->getPaginationLinks();
?>
<center>
<table class="contenttoc" style="width:auto; float:left">
<tr>
示例3: catch
$u->setEmail(fRequest::encode('email', 'string'));
$u->setPassword($p);
$u->setFirstName(fRequest::encode('firstName', 'string'));
$u->setLastName(fRequest::encode('lastName', 'string'));
$u->setBirthday(fRequest::encode('birthday', 'date'));
$u->setPhone(fRequest::encode('phone', 'string'));
$u->setCellphone(fRequest::encode('cellphone', 'string'));
$u->setNextel(fRequest::encode('nextel', 'string'));
$u->setNextel(fRequest::encode('fax', 'string'));
$u->setNextel(fRequest::encode('address', 'string'));
$u->store();
} catch (Exception $e) {
die('El correo electrónico ya está asociado con una cuenta' . $e->getMessage());
}
$regions = array_unique(fRequest::encode('region', 'array'));
$permissions = array_unique(fRequest::encode('permission', 'array'));
try {
foreach ($regions as $item) {
if (!empty($item) && $item != 'null') {
$ur = new UserRegion();
$ur->setIdUser($u->getIdUser());
$ur->setIdRegion($item);
$ur->store();
}
}
foreach ($permissions as $item) {
if (!empty($item) && $item != 'null') {
$up = new UserPermission();
$up->setIdUser($u->getIdUser());
$up->setIdPermission($item);
$up->store();
示例4: fUpload
}
$lastId = $banner->prepareIdBanner();
/*
* Add Region
* Limited By User Permissions
*/
/*
* Add Files to Server
*/
if (!empty($_FILES)) {
$uploader = new fUpload();
$uploader->setOptional();
$uploader->setMIMETypes($acceptedFiles, 'El tipo de archivo es incorrecto');
$dir = 'uploads/banner/';
$dir2 = 'uploads/banner/thumbs/';
$imageDescrip = fRequest::encode('imageDescrip');
$uploaded = fUpload::count('files');
for ($i = 0; $i < $uploaded; $i++) {
$ext = strtolower(pathinfo($_FILES['files']['name'][$i], PATHINFO_EXTENSION));
$_FILES['files']['name'][$i] = fURL::makeFriendly(str_replace(' ', '-', $_FILES['files']['name'][$i])) . ".{$ext}";
$uploader->move($dir, 'files', $i);
$fileName[] = $_FILES['files']['name'][$i];
$fileType[] = $_FILES['files']['type'][$i];
copy($dir . $fileName[$i], $dir2 . $fileName[$i]);
$image3 = new fImage($dir2 . $fileName[$i]);
$image3->cropToRatio(1, 1, 'left', 'bottom');
$image3->resize(200, 0);
$image3->saveChanges();
/*
$ftp = new ftp($user,$pass);
$ftp->upload($dir . "/" . $fileName[$i], 'DIR EN REMOTE');
示例5: EconomicUnitCategory
<?php
$id = fRequest::encode('id', 'integer');
$s = fRequest::encode('id_section', 'integer');
try {
if ($s != 2) {
$category = new EconomicUnitCategory($id);
$category->setName(fRequest::encode('name', 'string'));
} else {
$category = new EconomicUnitCategory($id);
$category->setEconomicUnitCategoryName(fRequest::encode('name', 'string'));
}
} catch (Exception $e) {
}
try {
$category->store();
} catch (Exception $e) {
exit("Ha ocurrido un error.");
}
exit("1");
示例6: header
<?php
fSession::open();
$idUser = fSession::get(SESSION_ID_USER);
if (empty($idUser)) {
header('Location: ' . SITE);
exit("No se ha podido acceder a esta secci&oacite;n");
}
//if (fRequest::isPost()):
$section_id = fRequest::encode('id_section', 'integer');
$parent_id = fRequest::encode('id_parent', 'integer');
//var_dump($_POST); var_dump($_GET);
//$categories = Category::findAllUp($section_id,0,$region_id);
$categories = fRecordSet::buildFromSQL("Category", "SELECT * FROM category WHERE id_section = {$section_id} AND id_parent = {$parent_id}");
?>
<?php
if ($categories->count() > 0) {
echo '<tr>
<td><label for="id_category"> Categoría </label> </td>
<td >
<select class="subcategories" style="width:680px; " name="id_category">';
foreach ($categories as $category) {
echo '<option value="' . $category->prepareId_category() . '"> ' . $category->prepareName() . ' </option>';
}
//endif;
?>
</select>
</td>
</tr>
<tr class="category_select">
示例7: fUpload
}
/*
* Add Files to Server
*/
if (!empty($_FILES['files2']['name'][0])) {
$uploader = new fUpload();
$uploader->setOptional();
$uploader->setMIMETypes($acceptedFiles, 'El tipo de archivo es incorrecto');
$dir = 'uploads/geolocation/';
$dir2 = 'uploads/geolocation/thumbs/';
$imageDescrip = fRequest::encode('imageDescrip');
try {
$uploaded2 = fUpload::count('files2');
$productname = fRequest::encode('productname');
$productdescrip = fRequest::encode('descripp');
$productprice = fRequest::encode('price');
for ($i = 0; $i < $uploaded2; $i++) {
$ext = strtolower(pathinfo($_FILES['files2']['name'][$i], PATHINFO_EXTENSION));
$_FILES['files2']['name'][$i] = fURL::makeFriendly(str_replace(' ', '-', $_FILES['files2']['name'][$i])) . ".{$ext}";
$uploader->move($dir, 'files2', $i);
$fileName[] = $_FILES['files2']['name'][$i];
$fileType[] = $_FILES['files2']['type'][$i];
$ap = new EconomicUnitProduct();
$ap->setEconomicUnitId($lastId);
$ap->setName($productname[$i]);
$ap->setPrice($productprice[$i]);
$ap->setDescription($productdescrip[$i]);
$ap->setImage($fileName[$i]);
$ap->store();
copy($dir . $fileName[$i], $dir2 . $fileName[$i]);
$image3 = new fImage($dir2 . $fileName[$i]);
示例8: header
<?php
fSession::open();
$idUser = fSession::get(SESSION_ID_USER);
if (empty($idUser)) {
header('Location: ' . SITE);
exit("No se ha podido acceder a esta sección");
}
$id_parent = fRequest::encode('id_parent', 'integer') > 0 ? fRequest::encode('id_parent', 'integer') : -1;
$zones = fRecordSet::buildFromSQL('BannerSection', "SELECT * FROM bannersection WHERE id_parent = {$id_parent} ORDER BY name");
if ($zones->count() > 0) {
foreach ($zones as $zone) {
echo '<option value="' . $zone->prepareIdBannersection() . '">' . $zone->prepareName() . '</option>';
}
} else {
echo '<option value="0"> Selecciona una zona </option>';
}
die('1');
示例9: _getSubmittedValue
/**
* Encode & store the submitted value (if any) in the meta info
**/
public function _getSubmittedValue()
{
$input = fRequest::encode($this->name);
// TODO: Cast to approprate type?
if (is_string($input)) {
$input = trim($input);
}
$this->_value = $input;
return $this;
}
示例10: header
<?php
require_once 'init.php';
fSession::open();
$idUser = fSession::get(SESSION_ID_USER);
if (!empty($idUser)) {
header('Location: ' . SITE);
}
if (fRequest::isPost()) {
$u = new User(array('email' => fRequest::encode('email', 'string')));
$p = fRequest::encode('password', 'string') . SALT;
$p = md5($p);
$p = base64_encode($p);
$p = hash('sha256', $p);
if ($u && $u->preparePassword() == $p) {
switch ($u->prepareIdRole()) {
case 1:
fAuthorization::setUserAuthLevel('super');
break;
case 2:
fAuthorization::setUserAuthLevel('admin');
break;
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
fAuthorization::setUserAuthLevel('employee');
break;
case 9:
示例11: header
<?php
require_once '../init.php';
$section = 'banner';
$sub = 'editSection';
fSession::open();
$idUser = fSession::get(SESSION_ID_USER);
if (empty($idUser)) {
header('Location: ' . SITE);
exit("No se ha podido acceder a esta secci&oacite;n");
}
$id_bannersection = fRequest::encode('id', 'integer');
if (!fAuthorization::checkAuthLevel('super')) {
$isOwner = fRecordSet::build('BannerSection', array('id_bannersection=' => $id_bannersection));
$count = $isOwner->count() > 0;
if (!$count) {
header("Location: " . SITE);
}
}
try {
$bannersection = new BannerSection($id_bannersection);
} catch (Exception $e) {
header("Location: " . SITE);
}
require_once INCLUDES . 'header.php';
?>
<!-- MAIN CONTAINER -->
<link rel="stylesheet" href="<?php
echo JS;
?>
jwysiwyg/jquery.wysiwyg.css" type="text/css" />
示例12: json_encode
<?php
fSession::open();
$id_role = fRequest::get('id_role', 'integer');
$email = fRequest::encode('email', 'string');
if (empty($email)) {
exit;
}
$arr = array();
if (fAuthorization::checkAuthLevel('super')) {
if (empty($id_role)) {
$users = User::getByEmailSup($email);
} else {
$users = User::getByRoleAndEmailSup($id_role, $email);
}
} else {
if (empty($id_role)) {
$users = User::getByEmail($email, fSession::get('regs'));
} else {
$users = User::getByRoleAndEmail($id_role, $email, fSession::get('regs'));
}
}
if (!empty($users)) {
foreach ($users as $user) {
$arr[] = array('id_user' => $user->getIdUser(), 'email' => $user->getEmail());
}
}
echo json_encode($arr);
示例13: EconomicUnitCategory
<?php
require_once '../init.php';
$section = 'categories';
$sub = 'edit';
/*
if(!fAuthorization::checkAuthLevel('employee')):
exit("No se ha podido acceder");
endif;
*/
$id = fRequest::encode('id', 'integer');
$s = fRequest::encode('s', 'integer');
try {
$category = new EconomicUnitCategory($id);
} catch (Exception $e) {
header("Location: " . SITE);
}
require_once INCLUDES . 'header.php';
?>
<link rel="stylesheet" href="<?php
echo CSS;
?>
ui-lightness/jquery-ui-1.8.16.custom.css" type="text/css" />
<script type="text/javascript" src="<?php
echo JS;
?>
jquery.form.js"></script>
<script type="text/javascript" src="<?php
echo JS;
?>
upload/jquery.MultiFile.js"></script>
示例14: header
<?php
fSession::open();
$idUser = fSession::get(SESSION_ID_USER);
if (empty($idUser) || !fAuthorization::checkACL('news', 'delete')) {
header('Location: ' . SITE);
exit("No se ha podido acceder a esta secci&oacite;n");
}
$id = fRequest::encode('id', 'string');
if (strstr($id, ",")) {
fORMDatabase::retrieve()->query("DELETE FROM economic_units WHERE economic_unit_id IN ({$id})");
} else {
$author = new EconomicUnit($id);
$author->delete();
}
fORMDatabase::retrieve()->query("DELETE FROM economic_units_has_economic_unit_categories WHERE economic_units_economic_unit_id IN ({$id})");
示例15: Region
<?php
$r = new Region();
$tmp = $r->findAll(fRequest::encode('region'));
$regions = array();
if (!empty($tmp)) {
foreach ($tmp as $item) {
$regions[] = array('id_region' => $item->prepareIdRegion(), 'name' => $item->prepareName());
}
}
die(json_encode($regions));