本文整理汇总了PHP中load_data函数的典型用法代码示例。如果您正苦于以下问题:PHP load_data函数的具体用法?PHP load_data怎么用?PHP load_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_data函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load_stories
function load_stories($topic)
{
if ($topic == "headlines") {
$url = "http://feeds.bbci.co.uk/news/rss.xml";
} else {
$url = "http://feeds.bbci.co.uk/news/{$topic}/rss.xml";
}
$data = load_data($url);
$xml = simplexml_load_string($data);
$items = array();
foreach ($xml->channel->item as $object) {
$item['title'] = (string) $object->title;
$item['description'] = (string) $object->description;
$item['link'] = (string) $object->link;
$item['published'] = strtotime((string) $object->pubDate);
$namespaces = $object->getNamespaces(true);
$media = $object->children($namespaces["media"]);
foreach ($media->thumbnail as $thumbnail) {
// Thumbnail in XML namespace
$thumbnailAttributes = $thumbnail->attributes();
// Return biggest thumbnail
if ($thumbnailAttributes->width > 140) {
$item['thumbnail'] = (string) $thumbnailAttributes->url;
}
}
array_push($items, $item);
}
return $items;
}
示例2: index
public function index()
{
if (!$this->session->userdata('islogged')) {
$this->load->model('login_model');
$data = array('page_title' => 'Login');
$projects = array('project_list' => $this->login_model->project_list());
$this->load->view('modules/login', load_data(array_merge($data, $projects)));
$this->load->view('parts/footer');
}
}
示例3: index
public function index()
{
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Reports', 'page_title' => 'Sales and Expense');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar', load_data($page_info));
$this->load->view('modules/sales_expense');
$this->load->view('parts/footer');
} else {
echo jcode(array('success' => 1));
}
}
示例4: index
public function index()
{
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Reports', 'page_title' => 'Summary');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar', load_data($page_info));
$this->load->view('modules/summary');
$this->load->view('parts/footer');
} else {
redirect('login');
}
}
示例5: index
public function index()
{
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => '', 'page_title' => '');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar', load_data($page_info));
$this->load->view('modules/account_settings');
$this->load->view('parts/footer');
} else {
echo jcode(array('success' => 1));
}
}
示例6: index
public function index()
{
$this->load->model('management_model');
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Reports', 'page_title' => 'Management');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar');
$this->load->view('modules/management');
$this->load->view('parts/footer');
} else {
echo jcode(array('success' => 1));
}
}
示例7: index
public function index()
{
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Administrator', 'page_title' => 'User Access');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar', load_data($page_info));
$data = array('user_access_type' => $this->user_access_model->show_user_type()->result(), 'u_id' => $this->user_access_model->get_last_record(), 'user_access' => $this->user_access_model->show_user_access()->result(), 'project_list' => $this->user_access_model->project_list());
$this->load->view('modules/user_access', $data);
$this->load->view('parts/footer');
} else {
echo jcode(array('success' => 1));
}
}
示例8: index
public function index()
{
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Ledger', 'page_title' => 'Trial Balance');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar', load_data($page_info));
$viewData = array('charts_account' => $this->trial_balance_model->get_charts_title());
$this->load->view('modules/trial_balance', $viewData, true);
$this->load->view('parts/footer');
} else {
redirect('login');
}
}
示例9: index
public function index()
{
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Set Up', 'page_title' => 'Master Account');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar', load_data($page_info));
$this->load->model('master_account_model');
$account_title = array('account_title' => $this->master_account_model->get_title());
$this->load->view('modules/master_account', $account_title);
$this->load->view('parts/footer');
} else {
redirect('login');
}
}
示例10: index
public function index()
{
$this->load->model('general_ledger_model');
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Ledger', 'page_title' => 'General Ledger');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar', load_data($page_info));
$viewData = array('account_title' => $this->general_ledger_model->get_accounts());
$this->load->view('modules/general_ledger', $viewData);
$this->load->view('parts/footer');
} else {
echo jcode(array('success' => 1));
}
}
示例11: index
public function index()
{
$this->load->model('audit_trail_model');
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Administrator', 'page_title' => 'Audit Trail');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar');
$data = array('audit_data' => $this->audit_trail_model->load_records(), 'user' => $this->audit_trail_model->load_users());
$this->load->view('modules/audit_trail', $data);
$this->load->view('parts/footer');
} else {
echo jcode(array('success' => 1));
}
}
示例12: fieldType
public static function fieldType($field)
{
$field_name = "`{$field['name']}`";
$field_types = load_data('field_types');
$db_type = $field['dtype'];
$ftype = $field_name . ' ';
switch ($db_type) {
case 'int':
if ($field['length'] <= 8) {
$db_type = 'tinyint';
}
$ftype .= "{$db_type}({$field['length']})";
break;
case 'varchar':
if (empty($field['length'])) {
$field['length'] = 128;
}
$ftype .= "{$db_type}({$field['length']})";
break;
case 'upload':
if (empty($field['length'])) {
$field['length'] = 64;
}
$ftype .= "{$db_type}({$field['length']})";
break;
case 'resource':
return '';
case 'url':
if (empty($field['length'])) {
$field['length'] = 64;
}
$ftype .= "{$db_type}({$field['length']})";
break;
case 'htmltext':
$ftype .= "mediumtext";
break;
default:
$ftype .= "{$db_type}";
break;
}
if ($field['ifnull']) {
$ftype .= " NULL";
} else {
$ftype .= " NOT NULL";
}
if (!empty($field['defaultvalue'])) {
$ftype .= " DEFAULT '{$field['defaultvalue']}'";
}
return $ftype;
}
示例13: index
public function index()
{
$this->load->model('subsidiary_account_model');
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Journal', 'page_title' => 'General Journal');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar');
$viewData = array('account_title' => $this->subsidiary_account_model->get_accounts());
$this->load->view('modules/general_journal', $viewData);
$this->load->view('parts/footer');
} else {
redirect('login');
}
}
示例14: index
public function index()
{
$this->load->model("main_account_model");
if ($this->session->userdata('islogged')) {
$page_info = array('page_tab' => 'Set Up', 'page_title' => 'Subsidiary Account');
$this->load->view('parts/header', load_data($page_info));
$this->load->view('parts/sidebar', load_data($page_info));
$master_name = array('master_name' => $this->main_account_model->show_master_name()->result());
$this->load->view('modules/subsidiary_account', $master_name);
$this->load->view('parts/footer');
} else {
redirect('login');
}
}
示例15: aggregate_old_data
function aggregate_old_data()
{
global $ss;
$after = $ss->options['aggregate_after'];
if ($after == 0) {
return;
}
// start from the earliest month to aggregate
$yr = intval(date('Y'));
$mo = intval(date('n')) - $after - 1;
while ($mo < 1) {
$yr--;
$mo += 12;
}
if ($ss->options['last_aggregated']['yr'] >= $yr && $ss->options['last_aggregated']['mo'] >= $mo) {
return;
}
// we're already up to date
$ss->update_option('last_aggregated', array('yr' => $yr, 'mo' => $mo));
$result = $ss->query("SELECT MIN(`date`) FROM {$ss->tables['visits']} LIMIT 1");
if (!$result) {
return;
}
$earliest = mysql_fetch_row($result);
preg_match('/^(\\d{4})-(\\d{2})/', $earliest[0], $matches);
$min_yr = intval($matches[1]);
$min_mo = intval($matches[2]);
// is the earliest data within cutoff range?
if (gmmktime(0, 0, 0, $mo, 1, $yr) < gmmktime(0, 0, 0, $min_mo, 1, $min_yr)) {
return;
}
while (true) {
$data = load_data(array('yr' => $yr, 'mo' => $mo));
$data = $ss->esc(gzdeflate(serialize($data)));
// put into archive
$ss->query("INSERT INTO `{$ss->tables['archive']}` (`yr`, `mo`, `data`) VALUES ( '{$yr}', '{$mo}', '{$data}' )");
$endofmonth = "{$yr}-{$mo}-" . days_in_month($mo, $yr);
// delete raw data
$ss->query("DELETE FROM `{$ss->tables['visits']}` WHERE `date` >= '{$yr}-{$mo}-01' AND `date` <= '{$endofmonth}'");
if ($yr == $min_yr && $mo == $min_mo) {
break;
}
$mo--;
if ($mo < 1) {
$yr--;
$mo += 12;
}
}
$ss->query("OPTIMIZE TABLE `{$ss->tables['visits']}`");
}