本文整理汇总了PHP中Check类的典型用法代码示例。如果您正苦于以下问题:PHP Check类的具体用法?PHP Check怎么用?PHP Check使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Check类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: login
function login()
{
if (!empty($_POST)) {
$check = new Check();
$user = new User();
$pdo = new Db();
$db = $pdo->get();
$mapper = new Mapper($db);
//Проверяем входные данные
$user->login = $check->checkInput($_POST['login']);
$password = $check->checkInput($_POST['pass']);
$user->password = md5($password);
//Если пользователь не найден
$this->user = $mapper->select($user);
if (empty($this->user)) {
$this->error = "Пароль или логин не совпадают";
$this->out('login.php');
} else {
$this->out('profile.php');
//Если найден, выводим профиль
}
} else {
$this->out('login.php');
}
}
开发者ID:toppestkek,项目名称:Test,代码行数:25,代码来源:ctrlIndex.php
示例2: edit
/**
* 编辑菜单
*/
public function edit()
{
$id = I('id');
if (IS_POST) {
$data = I('data');
//数据验证
$msg = Check::rule(array(array(Check::must($data['name']), L('namecannotnull')), array(Check::must($data['url']), L('linkcannotnull'))));
//提示信息
if ($msg !== true) {
$this->message($msg, NULL, 'error');
}
/* 更新图标 */
if ($_FILES['pic']['name']) {
$result = $this->ectouchUpload('pic', 'nav');
if ($result['error'] > 0) {
$this->message($result['message'], NULL, 'error');
}
$data['pic'] = substr($result['message']['pic']['savepath'], 2) . $result['message']['pic']['savename'];
}
$this->model->table('touch_nav')->data($data)->where('id=' . $id)->update();
$this->message(L('edit_ok'), url('index'));
}
//查询附表信息
$result = $this->model->table('touch_nav')->where('id=' . $id)->find();
/* 模板赋值 */
$this->assign('info', $result);
$this->assign('ur_here', L('navigator'));
$this->assign('action_link', array('text' => L('go_list'), 'href' => url('index')));
$this->display();
}
开发者ID:noikiy,项目名称:shop-3,代码行数:33,代码来源:NavigatorController.class.php
示例3: get_main
public function get_main()
{
$type = Check::isUserType();
if ($type == 'admin') {
$sql = 'SELECT * FROM `films-info` WHERE status = \'OK\' ORDER BY date_add DESC';
} elseif ($type == 'user') {
$sql = 'SELECT * FROM `films-info` WHERE permission = \'user\' OR permission = \'all\' AND status = \'OK\' ORDER BY date_add DESC';
} else {
$sql = 'SELECT * FROM `films-info` WHERE permission = \'all\' AND status = \'OK\' ORDER BY date_add DESC';
}
$result = mysql_query($sql);
if ($result) {
$content = '<h1 class="video-title">Новинки мирового кинопроката и блокбастеры</h1>';
while ($film = mysql_fetch_object($result)) {
$genre = explode(',', $film->genre);
$content .= '<div class="video">
<img src="' . $film->image . '">
<div class="video_content">
<p><a class="" href="/film/index/' . $film->href . '">' . $film->name . '</a></p>
<p class="video_info">' . $film->year . ', ' . $film->country . ', ' . $genre[0] . '</p>
</div>
</div>';
}
$json['header'] = 'main';
$json['content'] = $content;
return json_encode($json);
} else {
echo mysql_error();
}
}
开发者ID:SerG-Y,项目名称:ex-film,代码行数:30,代码来源:model_ajax.php
示例4: setTags
private function setTags()
{
$this->Tags['Title'] = $this->Data[0];
$this->Tags['Content'] = Check::Words(html_entity_decode($this->Data[1]), 25);
$this->Tags['Link'] = $this->Data[2];
$this->Tags['Image'] = $this->Data[3];
$this->Tags = array_map('strip_tags', $this->Tags);
$this->Tags = array_map('trim', $this->Tags);
$this->Data = null;
//NORMAL PAGE
$this->seoTags = "<title>{$this->Tags['Title']}</title>" . "\n";
$this->seoTags .= "<meta name='description' content='{$this->Tags['Content']}'/>" . "\n";
$this->seoTags .= "<meta name='robots' content='index, fallow'/>" . "\n";
$this->seoTags .= "<link rel='canonical' href='{$this->Tags['Link']}'>" . "\n";
$this->seoTags .= "\n";
//FACEBOOK
$this->seoTags .= "<meta property='og:site_name' content='" . SITENAME . "' />" . "\n";
$this->seoTags .= "<meta property='og:locale' content='pt-BR' />" . "\n";
$this->seoTags .= "<meta property='og:title' content='{$this->Tags['Title']}' />" . "\n";
$this->seoTags .= "<meta property='og:description' content='{$this->Tags['Content']}' />" . "\n";
$this->seoTags .= "<meta property='og:image' content='{$this->Tags['Image']}' />" . "\n";
$this->seoTags .= "<meta property='og:url' content='{$this->Tags['Link']}' />" . "\n";
$this->seoTags .= "<meta property='og:type' content='article' />" . "\n";
$this->seoTags .= "" . "\n";
//Item GROUP (TWITTER)
$this->seoTags .= "<meta itemprop='name' content='{$this->Tags['Title']}' />" . "\n";
$this->seoTags .= "<meta itemprop='description' content='{$this->Tags['Content']}' />" . "\n";
$this->seoTags .= "<meta itemprop='url' content='{$this->Tags['Link']}' />" . "\n";
$this->Tags = null;
}
开发者ID:adrianosilvareis,项目名称:FrameWork_Front,代码行数:30,代码来源:Seo.class.php
示例5: Set
function Set($f3)
{
if (!\Check::confirm('POST.password')) {
$this->flash('Konfirmasi Password Tidak Cocok');
$f3->reroute($f3->get('URI'));
}
$post = $f3->get('POST');
$db_host = $post['DB_HOST'];
$db_name = $post['DB_NAME'];
$db_user = $post['DB_USER'];
$db_pass = $post['DB_PASS'];
$dsn = "mysql:host={$db_host};port=3306;dbname={$db_name}";
$db = new \DB\SQL($dsn, $db_user, $db_pass);
try {
$db->begin();
$db->exec(explode(';', $f3->read('installation/install.sql')));
$user = new \DB\SQL\Mapper($db, 'user');
$user->username = $post['username'];
$user->password = \Bcrypt::instance()->hash($post['password']);
$user->type = 1;
$user->save();
$key = bin2hex(openssl_random_pseudo_bytes(32));
$data = "[globals]\nDEBUG=0\nAUTOLOAD=\"controller/;model/\"\nUI=\"view/\"\nAPP_KEY=\"{$key}\"\nDB_SET=\"{$dsn}\"\nDB_USER=\"{$db_user}\"\nDB_PASS=\"{$db_pass}\"";
$f3->write('config/config.ini', $data);
$f3->write('config/route.ini', $f3->read('installation/route.ini'));
$db->commit();
$this->flash('Success... Silahkan Hapus Folder Installation', 'success');
} catch (Exception $e) {
$db->rollback();
$this->flash($e->getMessage());
$f3->reroute('/');
}
$f3->reroute('/');
}
开发者ID:karepwes,项目名称:OcsPanels,代码行数:34,代码来源:install.php
示例6: Buy
function Buy($f3)
{
$server = $this->loadServer();
$account = new \Webmin($server);
if (($saldo = $this->me->saldo) < $server->price) {
$this->flash('Saldo Anda Kurang, Hub Admin utk Deposit');
$f3->reroute($f3->get('URI'));
}
if (!$account->check($f3->get('POST.user'))) {
$this->flash('User Sudah Terdaftar, Coba yang Lain');
$f3->reroute($f3->get('URI'));
}
$account->copyFrom('POST');
$account->real = $this->me->username;
if ($f3->exists('POST.pass', $pass)) {
if (!\Check::Confirm('POST.pass')) {
$this->flash('Konfirmasi Password Tidak Cocok');
$f3->reroute($f3->get('URI'));
}
$account->pass = $account->crypt($pass);
}
$active = date("Y/m/d", strtotime("+30 days"));
$account->expire = \Webmin::exp_encode($active);
if (!$account->save()) {
$this->flash('Gagal, Coba Beberapa Saat Lagi');
$f3->reroute($f3->get('URI'));
}
$this->me->saldo = $this->me->saldo - $server->price;
$this->me->save();
$this->flash('Pembelian Account Berhasil', 'success');
$f3->set('SESSION.uid', $account->uid);
$f3->set('SESSION.pass', $pass);
$f3->reroute($f3->get('URI') . '/success');
}
开发者ID:karepwes,项目名称:OcsPanels,代码行数:34,代码来源:server.php
示例7: setData
private function setData()
{
$this->Data = array_map('strip_tags', $this->Data);
$this->Data = array_map('trim', $this->Data);
$this->Data['category_name'] = Check::Name($this->Data['category_title']);
$this->Data['category_date'] = Check::Data($this->Data['category_date']);
$this->Data['category_parent'] = $this->Data['category_parent'] == 'null' ? null : $this->Data['category_parent'];
}
开发者ID:jairophp,项目名称:projetoSoftware,代码行数:8,代码来源:AdminCategory.class.php
示例8: correct_password
public function correct_password($string)
{
$correct_hash = $this->get('password');
if (!Check::is_hash($string)) {
$string = $this->encode_password($string);
}
return empty($correct_hash) || $string == $correct_hash;
}
开发者ID:4otaku,项目名称:4otaku,代码行数:8,代码来源:art_pool.php
示例9: correct_main_data
protected function correct_main_data($data)
{
if (empty($data['title'])) {
$data['title'] = '';
}
$data['link'] = Check::link(undo_safety($data['link']));
return $data;
}
开发者ID:4otaku,项目名称:4otaku,代码行数:8,代码来源:video.php
示例10: smarty_function_task
/**
* get task information for the specified task
*/
function smarty_function_task($params, &$smarty)
{
$t = new Task();
if (!Check::digits($params['task_id'], $empty = false)) {
return;
}
$smarty->assign('task', $t->getone($params['task_id']));
}
开发者ID:Maharaja1,项目名称:drdata,代码行数:11,代码来源:function.task.php
示例11: smarty_function_part
/**
* get data for a participant and create a smarty $part variable
*/
function smarty_function_part($params, &$smarty)
{
if (!Check::digits($params['part_id'], $empty = false)) {
return;
}
$p = new Participant();
$smarty->assign('part', $p->getone($params['part_id']));
}
开发者ID:Maharaja1,项目名称:drdata,代码行数:11,代码来源:function.part.php
示例12: smarty_function_tasklist2xml
/**
* return the tasklist as an xml document that
* would be used by the drdat app on a phone
*/
function smarty_function_tasklist2xml($params, &$smarty)
{
if (!Check::digits($params['study_id'], $empty = false)) {
return;
}
$s = new Schedule();
return htmlentities($s->tasklist2xml($params['study_id']));
}
开发者ID:Maharaja1,项目名称:drdata,代码行数:12,代码来源:function.tasklist2xml.php
示例13: smarty_function_forms
/**
* take our raw form data and make a data structure out of it
* that can be used in templates
*/
function smarty_function_forms($params, &$smarty)
{
if (!Check::digits($params['task_id'], $empty = false)) {
return;
}
$t = new Task();
$smarty->assign('forms', $t->parseforms($params['task_id']));
}
开发者ID:Maharaja1,项目名称:drdata,代码行数:12,代码来源:function.forms.php
示例14: smarty_function_tasks
/**
* find the tasks for this particular study
*/
function smarty_function_tasks($params, &$smarty)
{
$t = new Task();
if (!Check::digits($params['study_id'])) {
return;
}
$smarty->assign('tasks', $t->tasks($params['study_id'], $_SESSION['user']['researcher_id'], $params['all'] ? true : false));
}
开发者ID:Maharaja1,项目名称:drdata,代码行数:11,代码来源:function.tasks.php
示例15: smarty_function_formhtml
/**
* take our raw form data and make an xml representation of it
* that should be exactly what gets sent to the phones
*/
function smarty_function_formhtml($params, &$smarty)
{
if (!Check::digits($params['task_id'], $empty = false)) {
return;
}
# study_id is needed for the scheduling information for the task
if (!Check::digits($params['study_id'], $empty = false)) {
return;
}
$t = new Task();
if ($params['style'] == 'mobile') {
if ($params['width'] > 0) {
$width = (int) $params['width'];
} else {
$width = 400;
}
$rawhtml = $t->forms2html($params['task_id'], $params['study_id']);
$forms = explode('<!-- split -->', $rawhtml);
$numforms = count($forms) - 1;
foreach ($forms as $block) {
$f++;
if ($f > $numforms) {
break;
}
$spacer = "";
if ($f == 1) {
$prev = "< prev";
$next = "<input type=submit value=\"next >\">";
} else {
if ($f < $numforms) {
$prev = "<input type=submit value=\"< prev\">";
$next = "<input type=submit value=\"next >\">";
} else {
$prev = "<input type=submit value=\"< prev\">";
}
}
if ($f == $numforms) {
$next = "<input type=submit value=\"Save data\">";
$spacer = "<br><br><br>";
}
$html .= <<<HTML
<h4>Form {$f}</h4>
<table cellpadding=2 cellspacing=0 border=1 style="width: {$width}" width={$width} class="nobgcolor">
<tr><td>
{$block}
<br>
{$prev} {$next}
<br><br>
</td></tr>
</table>
{$spacer}
HTML;
}
return $html;
}
return htmlentities($t->forms2html($params['task_id'], $params['study_id']));
}
开发者ID:Maharaja1,项目名称:drdata,代码行数:62,代码来源:function.formhtml.php
示例16: createObject
/**
* get a new instance of the given className
*
* @param $className
* @return BaseObject
* @throws BaseException
*/
public static function createObject($className, BaseObject $obj)
{
Check::className($className);
$dPObj = new $className($obj);
if (!$dPObj instanceof DataPermission) {
throw new base_exception_DataPermission(TMS(base_exception_DataPermission::FACTORY_NO_INSTANCE_OF_DP));
}
return $dPObj;
}
开发者ID:kafruhs,项目名称:fws,代码行数:16,代码来源:Factory.php
示例17: checkLatency
public function checkLatency($id)
{
$check = Check::findOrFail($id);
$data = DB::table('checks_results')->select(array(DB::raw('UNIX_TIMESTAMP(`created_at`) * 1000 AS `x`'), DB::raw('`latency` AS `y`')))->where('check_id', '=', $check->id)->where('created_at', '>', DB::raw('NOW() - INTERVAL 1 WEEK'))->orderBy('created_at', 'asc')->get();
$data = array_map(function ($result) use($check) {
return array('x' => (int) $result->x, 'y' => (int) $result->y, 'color' => $result->y / 1000 < $check->latency_tolerating ? $result->y / 1000 < $check->latency_satisfied ? '#A1CF64' : '#F05940' : '#D95C5C');
}, $data);
return array(array('name' => trans('check.latency'), 'data' => $data));
}
开发者ID:dbirchak,项目名称:ping,代码行数:9,代码来源:ApiController.php
示例18: setFileName
private function setFileName()
{
//$fileName = Check::Name($this->name) . strrchr($this->file['name'], '.');
$fileName = time() . strrchr($this->file['name'], '.');
if (file_exists(self::$baseDir . $this->send . $fileName)) {
$fileName = Check::Name($this->name) . '-' . time() . strrchr($this->file['name'], '.');
}
$this->name = $fileName;
}
开发者ID:brenolessa,项目名称:projeto-RI-Br,代码行数:9,代码来源:Upload.class.php
示例19: action_add_message
function action_add_message()
{
if (Check::isLogin() != FALSE) {
$authorize = Check::isLogin();
}
if ($this->model->add_comment($_POST)) {
$data['success'] = 'you message added';
}
$this->view->generate('about_view.php', 'template_view.php', $data, $authorize);
}
开发者ID:SerG-Y,项目名称:ex-film,代码行数:10,代码来源:controller_main.php
示例20: get_function
protected function get_function($url)
{
if (empty($url[2]) || !Check::id($url[2])) {
throw new Error_Read_Edit();
}
$this->data['id'] = (int) $url[2];
$this->data['type'] = $this->get_type();
$this->template = 'edit/' . $this->data['type'] . '/' . $url[1];
return $url[1];
}
开发者ID:4otaku,项目名称:4otaku,代码行数:10,代码来源:abstract.php
注:本文中的Check类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论