本文整理汇总了PHP中load_model函数的典型用法代码示例。如果您正苦于以下问题:PHP load_model函数的具体用法?PHP load_model怎么用?PHP load_model使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_model函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: daftar
function daftar()
{
$this->load->helper(array('captcha', 'url'));
if ($this->input->post() && $this->input->post('secutity_code') == $this->session->userdata('mycaptcha')) {
$database = array('user_id' => load_model("akun", "akun_model", "generate_iduser"), 'username' => $this->input->post('username'), 'email' => $this->input->post('email'), 'password' => $this->input->post('password'), 'status_id' => 0, 'no_hp' => $this->input->post('no_hp'), 'alamat' => $this->input->post('alamat'));
$this->db->insert('users', $database);
echo "<script>alert('Registrasi Berhasil, Silahkan Login!!')</script>";
redirect('akun/masuk', 'refresh');
} else {
$this->session->unset_userdata('mycaptcha');
$this->load->helper('captcha');
$vals = array('img_path' => './captcha/', 'img_url' => base_url() . 'captcha/', 'img_width' => '200', 'img_height' => 30, 'border' => 1, 'word_length' => 4, 'pool' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'expiration' => 7200);
$cap = create_captcha($vals);
if ($this->input->post()) {
$this->session->set_userdata('mycaptcha', $cap['word']);
$this->session->set_flashdata('message', 'Captcha yang anda masukan salah!!');
}
$data_param['image'] = $cap['image'];
echo load_controller("web", "web", "web_header", $data_param);
echo load_controller("web", "web", "web_open_content", $data_param);
echo load_model("akun", "akun_model", "generate_iduser");
$this->load->view("akun/daftar", $data_param);
echo load_controller("web", "web", "web_close_content", $data_param);
echo load_controller("web", "web", "web_footer", $data_param);
}
}
示例2: web_premium_lelang
function web_premium_lelang($data_param)
{
$data['data_premium_lelang'] = load_model("web", "web_model", "get_list_premium_lelang");
//$data_param['data_premium_lelang'] = $data->result_array();
//$data_param['status_id'] = 1;
$this->load->view("web/premium_lelang", $data);
}
示例3: make
/**
* Make a new model object, optionally with some initialization data
*
* @param String $model the name of the model class to make
* @param Array $data an optional array of initialization data
* @param Boolean $has_changed whether the newly made object has changed
* @return SQL_model/Remote the newly made model object or its remote object
*/
public static function make($model, $data = array(), $has_changed = TRUE)
{
load_model($model);
$object = new $model($data, $has_changed);
if (array_key(self::$is_remote, Symbol::ALL) || array_key(self::$is_remote, $model)) {
$object = new Remote($object);
}
return $object;
}
示例4: delete
public function delete()
{
$id = get_routing_value();
if ($id !== null) {
$user = load_model('Example', (int) $id, null, true);
$user->set_to_delete();
}
return F\Core::redirect('home', 'main');
}
示例5: modcall
function modcall($model, $func, $args)
{
load_model($model);
$class = ucfirst($model) . "Model";
if (!class_exists($class)) {
Umsg("模型无效");
}
$rs = BaseCall("ctl", $class, $func, $args);
return $rs;
}
示例6: __construct
function __construct()
{
global $limit;
global $page;
$this->limit = $limit;
$this->page = $page;
$model = Utils::singularize(get_class($this));
load_model($model);
$this->model = ucfirst($model);
header('Content-Type: application/json');
}
示例7: Controller
function Controller()
{
$this->validate = Inspekt::makeSuperCage();
$this->db = Database::getInstance(array('conn_id' => Config::item('LINK_ID')));
$this->view = new View();
// auto load helper
load_helper(array('php', 'time', 'html', 'form', 'table', 'forum'));
// load forum model
load_model('forum', FALSE);
load_model('check', FALSE);
$this->forum = forum_model::getInstance();
}
示例8: send
function send()
{
if ($this->tpl_name) {
include_once '../tf_app/template_/Template_.class.php';
$tpl = new Template_();
$tpl->define('mail', 'views/mail/' . $this->tpl_name . '.tpl');
$tpl->assign($this->assigns);
$this->content = $tpl->fetch('mail');
}
/*
$subject=iconv("UTF-8", "EUC-KR", $subject);
$content=iconv("UTF-8", "EUC-KR", $content);
*/
if (!$this->sender_name) {
$this->sender_name = $this->settings->sender_name;
}
if (!$this->sender_password) {
$this->sender_password = $this->settings->sender_password;
}
// if (!$this->mailto)
// {
// $this->mailto = $this->settings->mailto;
// }
if (!$this->server) {
$this->server = $this->settings->server;
}
if (!$this->sender_user) {
$this->sender_user = $this->settings->sender_user;
}
if (!$this->sender_address) {
$this->sender_address = $this->settings->sender_address;
}
if ($this->mailto) {
require_once '../tf_app/ext/phpmailer/class.phpmailer.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = $this->server;
$mail->Port = 465;
$mail->Username = $this->sender_user;
$mail->Password = $this->sender_password;
$mail->From = $this->sender_address;
$mail->FromName = $this->sender_name;
$mail->Subject = $this->subject;
$mail->Body = $this->content;
$mail->AddAddress($this->mailto);
$mail->Send();
$mail_log = load_model("Members");
$mail_log->log_mail($this->mailto, $this->tpl_name, $this->content);
}
}
示例9: kategori
function kategori()
{
$data_param = "";
$url = $this->uri->segment(3);
$url_1 = explode("-", $url);
$id = $url_1[0];
$data_param['data_kategori_lelang'] = load_model("produk", "produk_model", "get_detail_kategori", array('id' => $id));
echo load_controller("web", "web", "web_header", $data_param);
echo load_controller("web", "web", "web_open_content", $data_param);
$this->load->view("produk/detail_kategori", $data_param);
echo load_controller("web", "web", "web_close_content", $data_param);
echo load_controller("web", "web", "web_footer", $data_param);
}
示例10: lelang
function lelang()
{
$data_param = "";
$url = $this->uri->segment(3);
$url_1 = explode("-", $url);
$id = $url_1[0];
$data_detail = load_model("produk", "produk_model", "get_detail_lelang", array('id' => $id));
foreach ($data_detail->result() as $detail) {
$produk_id = $detail->produk_id;
}
$data_gambar = load_model("produk", "produk_model", "get_gambar_produk", array('id' => $produk_id));
$data['data_detail'] = $data_detail;
$data['data_gambar'] = $data_gambar;
echo load_controller("web", "web", "web_header", $data_param);
echo load_controller("web", "web", "web_open_content", $data_param);
$this->load->view("produk/detail_lelang", $data);
echo load_controller("web", "web", "web_close_content", $data_param);
echo load_controller("web", "web", "web_footer", $data_param);
}
示例11: category_loadpreview
function category_loadpreview($c)
{
$data = false;
switch ($c['template']) {
case 'news-list':
load_model('news.func');
$query = 'WHERE category=' . $c['index'] . ' AND isdelete=0' . ' AND ishide=0' . ' ORDER BY istop DESC LIMIT 8';
$data = news_getBySQL($query);
break;
case 'item-list':
load_model('item.func');
$data = item_ofcategory($c['index']);
break;
case 'download-list':
load_model('download.func');
$data = download_ofcategory($c['index']);
break;
default:
# code...
break;
}
return $data;
}
示例12: auth_check
function auth_check($domain, $did, $auth, $level = 1)
{
if (!user_isLogin()) {
return false;
}
$auth = base_protect($auth);
$domain = base_protect($domain);
$did = (int) $did;
$level = (int) $level;
if (auth_checkSession($domain, $did, $auth, $level)) {
return true;
}
load_model('user.func');
$user = user_getById($_SESSION['twt_uid']);
if (!$user) {
return false;
}
$query = 'SELECT * FROM ' . table('authmap') . ' WHERE ' . '((`ownertype`="group" AND `ownerid`="' . $user['gid'] . '")' . ' OR ' . '(`ownertype`="user" AND `ownerid`="' . $user['uid'] . '"))' . ' AND `domain`="' . $domain . '"' . ' AND `did`="' . $did . '"' . ' AND `auth`="' . $auth . '"' . ' ORDER BY `iscancel` DESC LIMIT 1';
// echo $query;
global $db;
$result = $db->sql($query);
$row = $db->getRow($result);
if (!$row) {
return -1;
}
if ($row['iscancel'] != '0') {
return -2;
}
if ($row['level'] < $level) {
return -3;
}
if ($row['bindtype'] == 'group') {
return 2;
}
auth_setSession($row['domain'], $row['did'], $row['auth'], $row['level']);
return 1;
}
示例13: foreach
if (!is_null($default)) {
if (array_key_exists("libraries", $default)) {
foreach ($default["libraries"] as $library) {
if (!load_library($library)) {
show_error("The library " . $library . " not loaded.");
}
}
}
if (array_key_exists("config", $default)) {
foreach ($default["config"] as $conf) {
$config->load($conf);
}
}
if (array_key_exists("models", $default)) {
foreach ($default["models"] as $model) {
if (!load_model($model)) {
show_error("The model " . $model . " not loaded.");
}
}
}
}
/*
* ---------------------------------------------------------------
* Start router
* ---------------------------------------------------------------
*/
require_once BASEPATH . "router.php";
/*
* ---------------------------------------------------------------
* Get data
* ---------------------------------------------------------------
示例14: model
/**
* Load a model.
* @param string $name - Name of the model.
* @return {Model}
* @throws {RuntimeException} if anything goes wrong.
*/
protected function model($name)
{
return load_model($name);
}
示例15: load_model
<?
load_model('Message');
load_helper('Spam');
class Contact_controller extends App_controller
{
public function form()
{
$this->render->title = 'Contact form';
$message = $this->render->message = new Message($this->params->message);
if (Spam::is_spam($this->params)) return;
$message->status = 'P'; // Pending
if ($message->save())
{
$this->flash->sent = $this->send($message);
$this->redirect('default/index', array('notice' => 'Thank you for your interest. Please expect a friendly email from us in the next few days.'));
}
}
private function send($message)
{
return $this->send_mail('message', array(
'to' => CONTACT_EMAIL,
'from' => $message->email,
'subject' => 'Plumline website message',
'message' => $message,
));
}
}