当前位置: 首页>>代码示例>>PHP>>正文


PHP base::get_data方法代码示例

本文整理汇总了PHP中base::get_data方法的典型用法代码示例。如果您正苦于以下问题:PHP base::get_data方法的具体用法?PHP base::get_data怎么用?PHP base::get_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在base的用法示例。


在下文中一共展示了base::get_data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: base

<?php

$flush = 1;
require 'class.base.php';
require 'class.html.php';
require 'class.user.php';
$base_instance = new base();
$html_instance = new html();
$user_instance = new user();
$user_instance->check_for_admin();
if (isset($_REQUEST['save'])) {
    $months = $_REQUEST['months'];
    $today = date('Y-m-d H:i:s');
    $period_x = date('Y-m-d H:i:s', mktime(0, 0, 0, date('m') - $months, date('d'), date('Y')));
    $data = $base_instance->get_data("SELECT SQL_CALC_FOUND_ROWS * FROM {$base_instance->entity['USER']['MAIN']} WHERE lastlogin < '{$period_x}' AND last_reminded < '{$period_x}' LIMIT 10");
    $data2 = $base_instance->get_data("SELECT FOUND_ROWS() as fnd_rows");
    $fnd_rows = $data2[1]->fnd_rows;
    $sizeof = sizeof($data);
    for ($index = 1; $index <= $sizeof; $index++) {
        $ID = $data[$index]->ID;
        $username = $data[$index]->username;
        $password = $data[$index]->user_password;
        $email = $data[$index]->email;
        $lastlogin = $data[$index]->lastlogin;
        $last_reminded = $data[$index]->last_reminded;
        $url = $username . '/' . $password;
        $encoded_url = base64_encode($url);
        if (_SHORT_URLS == 1) {
            $url = _HOMEPAGE . '/login-' . $encoded_url;
        } else {
            $url = _HOMEPAGE . '/autologin.php?code=' . $encoded_url;
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:send-warning.php

示例2: base

require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
$html_instance->add_parameter(array('ACTION' => 'show_content', 'ENTITY' => 'TO_DO', 'SUBENTITY' => 'CATEGORY', 'MAXHITS' => 40, 'WHERE' => "WHERE user='{$userid}'", 'ORDER_COL' => 'title', 'ORDER_TYPE' => 'ASC', 'HEADER' => 'To-Do Categories &nbsp;&nbsp; <a href="add-to-do-category.php">[Add Category]</a>', 'INNER_TABLE_WIDTH' => '80%'));
$data = $html_instance->get_items();
if (!$data) {
    $base_instance->show_message('No to-do categories added yet', '<a href="add-to-do-category.php">[Add new Category]</a>');
} else {
    $all_text = '<table width="100%" border cellspacing=0 cellpadding=5 class="pastel">';
    for ($index = 1; $index <= sizeof($data); $index++) {
        $ID = $data[$index]->ID;
        $title = $data[$index]->title;
        #
        $data2 = $base_instance->get_data("SELECT COUNT(*) AS total FROM {$base_instance->entity['TO_DO']['MAIN']} WHERE user='{$userid}' AND category={$ID}");
        $number_to_do = $data2[1]->total;
        #
        $all_text .= '<tr onMouseOver=\'this.style.background="#e9e9e9"\' onMouseOut=\'this.style.background="#ffffff"\'>
<td width=140><a href="show-to-do.php?category_id=' . $ID . '"><strong>' . $title . '</strong></a></td>
<td align="left"><strong>Total:</strong> ' . $number_to_do . '</td>
<td align="center"><a href="add-to-do.php?category_id=' . $ID . '">[Add]</a></td>
<td align="center"><a href="show-to-do.php?category_id=' . $ID . '">[Show]</a></td>
<td align="center"><a href="show-to-do-print.php?category_id=' . $ID . '" target="_blank">[Print]</a></td>
<td align="center"><a href="search-to-do.php?category_id=' . $ID . '">[Search]</a></td>
<td align="center"><a href="edit-to-do-category.php?category_id=' . $ID . '">[Edit]</a></td>
<td align="center"><a href="merge-to-do-category.php?category_id=' . $ID . '">[Merge]</a></td>
<td align="center"><a href="javascript:void(window.open(\'delete-to-do-category.php?category_id=' . $ID . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete]</a></td>
</tr>';
    }
    $all_text .= '</table>';
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:show-to-do-categories.php

示例3: VALUES

        $error .= '<li> Category cannot be left blank';
    }
    if (!$firstname && !$lastname && !$company) {
        $error .= '<li> First name / Last name / Company  cannot be left blank';
    }
    if (!$error) {
        if ($new_category) {
            $base_instance->query('INSERT INTO ' . $base_instance->entity['CONTACT']['CATEGORY'] . ' (title,user) VALUES ("' . sql_safe($new_category) . '",' . $userid . ')');
            $category_id = mysqli_insert_id($base_instance->db_link);
        }
        $firstname = str_replace('"', '&quot;', $firstname);
        $lastname = str_replace('"', '&quot;', $lastname);
        $address = str_replace('"', '&quot;', $address);
        $company = str_replace('"', '&quot;', $company);
        $base_instance->query('UPDATE ' . $base_instance->entity['CONTACT']['MAIN'] . ' SET firstname="' . sql_safe($firstname) . '",lastname="' . sql_safe($lastname) . '",email="' . sql_safe($email) . '",telephone="' . sql_safe($telephone) . '",fax="' . sql_safe($fax) . '",mobile="' . sql_safe($mobile) . '",address="' . sql_safe($address) . '",notes="' . sql_safe($notes) . '",company="' . sql_safe($company) . '",url="' . sql_safe($url) . '",category=' . $category_id . ',public=' . $public . ' WHERE user=' . $userid . ' AND ID=' . $contact_id);
        $data = $base_instance->get_data("SELECT title FROM {$base_instance->entity['CONTACT']['CATEGORY']} WHERE user='{$userid}' AND ID='{$category_id}'");
        $cat_title = $data[1]->title;
        $base_instance->show_message('Contact updated', '<script language="JavaScript" type="text/javascript">function createRequestObject(){try{var requester=new XMLHttpRequest();}catch(error){try{var requester=new ActiveXObject("Microsoft.XMLHTTP");}catch(error){return false;}} return requester;}var http=createRequestObject();function DelContact(item){if(confirm("Delete Contact?")){http.open(\'get\',\'delete-contact.php?item=\'+item); http.send(null);}}</script>

<a href="add-contact.php?category_id=' . $category_id . '">[Add more]</a> &nbsp;&nbsp; <a href="edit-contact.php?contact_id=' . $contact_id . '">[Edit]</a> &nbsp;&nbsp; <a href="javascript:DelContact(\'' . $contact_id . '\')">[Delete]</a> &nbsp;&nbsp; <a href="send-content.php?contact_id=' . $contact_id . '">[Send]</a><p><a href="show-contact-categories.php">[Show all Categories]</a> &nbsp; <a href="show-contact.php">[Show all Contacts]</a><p><b>Internal Link:</b> [c' . $contact_id . '] &nbsp;&nbsp; <b>Category:</b> ' . $cat_title . ' <a href="show-contact.php?category_id=' . $category_id . '">[Show]</a>');
    } else {
        $html_instance->error_message = $error;
        $company = stripslashes($company);
        $address = stripslashes($address);
        $notes = stripslashes($notes);
    }
} else {
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['CONTACT']['MAIN']} WHERE user='{$userid}' AND ID={$contact_id}");
    if (!$data) {
        $base_instance->show_message('Contact not found', '', 1);
    }
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:edit-contact.php

示例4: base

<?php

require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
$data = $base_instance->get_data("SELECT username,user_password FROM organizer_user WHERE ID={$userid}");
$username = $data[1]->username;
$password = $data[1]->user_password;
$url = $username . '/' . $password;
$encoded_url = base64_encode($url);
$url = _HOMEPAGE . '/show-to-do-rss.php?code=' . $encoded_url;
$base_instance->show_message('RSS To-Do Feed', 'Copy and paste this encrypted RSS Feed:<p><form><input type="text" name="" size="80" value="' . $url . '" onFocus="this.select()"></form>', 1);
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:14,代码来源:generate-rss-feed-to-do.php

示例5: base

<?php

$flush = 1;
require 'class.base.php';
$base_instance = new base();
$userid = $base_instance->get_userid();
$text = 'firstname' . "\t" . 'lastname' . "\t" . 'company' . "\t" . 'email' . "\t" . 'telephone' . "\t" . 'fax' . "\t" . 'mobile' . "\t" . 'address' . "\t" . 'notes' . "\t" . 'url' . "\n";
$data = $base_instance->get_data("SELECT * FROM organizer_contact WHERE user='{$userid}'");
for ($index = 1; $index <= sizeof($data); $index++) {
    $ID = $data[$index]->ID;
    $firstname = $data[$index]->firstname;
    $lastname = $data[$index]->lastname;
    $company = $data[$index]->company;
    $email = $data[$index]->email;
    $telephone = $data[$index]->telephone;
    $fax = $data[$index]->fax;
    $mobile = $data[$index]->mobile;
    $address = $data[$index]->address;
    $notes = $data[$index]->notes;
    $url = $data[$index]->url;
    $text .= $firstname . "\t" . $lastname . "\t" . $company . "\t" . $email . "\t" . $telephone . "\t" . $fax . "\t" . $mobile . "\t" . $address . "\t" . $notes . "\t" . $url . "\n";
}
foreach (glob('./export/contacts*.*') as $filename) {
    unlink($filename);
}
$token = md5(uniqid(rand(), true));
$filepath = './export/contacts' . $token . '.txt';
$filename = 'contacts' . $token . '.txt';
exec("rm {$filepath}; touch {$filepath}; chmod 0600 {$filepath}");
if (is_writable($filepath)) {
    if (!($fp = fopen($filepath, 'w'))) {
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:export-contacts.php

示例6: isset

if ($userid != _ADMIN_USERID && $base_instance->allow_file_upload == 2) {
    $base_instance->show_message(_NO_FILE_UPLOAD_MSG, '');
}
$new_category = isset($_POST['new_category']) ? $_POST['new_category'] : '';
$category_id = isset($_REQUEST['category_id']) ? (int) $_REQUEST['category_id'] : '';
$public = isset($_POST['public']) ? (int) $_POST['public'] : 1;
if (isset($_POST['save'])) {
    $error = '';
    $title = $_POST['title'];
    $text = $_POST['text'];
    $source = $_POST['source'];
    if (!$category_id && !$new_category) {
        $error .= '<li> Category cannot be left blank';
    }
    if ($new_category) {
        $duplicate = $base_instance->get_data('SELECT * FROM ' . $base_instance->entity['FILE']['CATEGORY'] . ' WHERE title="' . sql_safe($new_category) . '" AND user=' . $userid);
        if ($duplicate) {
            $error .= '<li> Category with this name already exists';
        }
        $new_category = str_replace('"', '&quot;', $new_category);
        if (strlen($new_category) > 50) {
            $error .= '<li> Category title is too long (Max. 50 Characters)';
        }
    }
    if ($title) {
        $title = trim($title);
        $title = str_replace('"', '&quot;', $title);
        if (strlen($title) > 100) {
            $error .= '<li> Title too long (Max. 100 Characters)';
        }
    }
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:add-file-by-url.php

示例7: base

<?php

require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
$category_id = isset($_GET['category_id']) ? $_GET['category_id'] : '';
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Link Search', 'FORM_ACTION' => 'show-links.php', 'BODY' => 'onLoad="javascript:document.form1.text_search.focus()"', 'TD_WIDTH' => '35%', 'BUTTON_TEXT' => 'Search Links'));
# build category select box
$select_box = '&nbsp;<select name="category_id"><option>&lt;All&gt;';
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['LINK']['CATEGORY']} WHERE user='{$userid}' ORDER BY title");
for ($index = 1; $index <= sizeof($data); $index++) {
    $category_title = $data[$index]->title;
    $ID = $data[$index]->ID;
    if ($ID == $category_id) {
        $select_box .= "<option selected value={$ID}>{$category_title}";
    } else {
        $select_box .= "<option value={$ID}>{$category_title}";
    }
}
$select_box .= '</select>';
#
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'text_search', 'VALUE' => '', 'SIZE' => 30, 'TEXT' => 'Text'));
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT1' => 'Category:', 'TEXT2' => "{$select_box}", 'SECTIONS' => 2));
$html_instance->process();
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:26,代码来源:search-links.php

示例8: trim

if (isset($_POST['save'])) {
    $error = '';
    $about_me = $_POST['about_me'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $country = (int) $_POST['country'];
    if (!empty($about_me)) {
        $about_me = trim($about_me);
        if (strlen($about_me) > 65535) {
            $error .= '<li> Text is too long (Max. 65535 Characters)';
        }
    }
    if (!$error) {
        $base_instance->query('UPDATE ' . $base_instance->entity['USER']['MAIN'] . ' SET about_me="' . sql_safe($about_me) . '",firstname="' . sql_safe($firstname) . '",lastname="' . sql_safe($lastname) . '",country=' . $country . ' WHERE ID=' . $userid);
        $base_instance->show_message('About Me page updated', '<a href="show-user.php?userid=' . $userid . '">[View Profile Page]</a>');
    } else {
        $html_instance->error_message = $error;
    }
} else {
    $data = $base_instance->get_data("SELECT about_me,firstname,lastname,country FROM {$base_instance->entity['USER']['MAIN']} WHERE ID='{$userid}'");
    $about_me = $data[1]->about_me;
    $firstname = $data[1]->firstname;
    $lastname = $data[1]->lastname;
    $country = $data[1]->country;
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'About Me', 'TEXT_CENTER' => 'The About Me text is a public text which appears in your profile.<br>Firstname and lastname is not public, it will only be used for sending emails within the Organizer.<p>', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BODY' => 'onLoad="javascript:document.form1.about_me.focus()"', 'BUTTON_TEXT' => 'Update'));
$html_instance->add_form_field(array('TYPE' => 'textarea', 'NAME' => 'about_me', 'VALUE' => "{$about_me}", 'TEXT' => 'About me', 'COLS' => 80, 'ROWS' => 4));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'firstname', 'VALUE' => "{$firstname}", 'SIZE' => 35, 'TEXT' => 'Firstname'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'lastname', 'VALUE' => "{$lastname}", 'SIZE' => 35, 'TEXT' => 'Lastname'));
$html_instance->add_form_field(array('TYPE' => 'select', 'NAME' => 'country', 'VALUE' => "{$country}", 'OPTION' => 'country_array', 'TEXT' => 'Country'));
$html_instance->process();
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:edit-about-me.php

示例9: format

     $title = $_POST['title' . $index];
     $feed = $_POST['feed' . $index];
     $max_items = $_POST['max_items' . $index];
     if (!empty($feed) && substr($feed, 0, 4) != 'http') {
         $error .= '<li> Feed URL ' . $index . ' has wrong format (use http:// at the beginning)';
     }
     if (strlen($title) > 50) {
         $error .= '<li> Feed Title ' . $index . ' is too long (Max. 50 Characters)';
     }
     if (!empty($title) && !$feed) {
         $error .= '<li> Feed URL ' . $index . ' cannot be left empty';
     }
     if (!empty($feed) && !$title) {
         $error .= '<li> Feed Title ' . $index . ' cannot be left empty';
     }
     $data = $base_instance->get_data('SELECT ID FROM ' . $base_instance->entity['RSS']['MAIN'] . ' WHERE feed="' . sql_safe($feed) . '" AND user=' . $userid);
     if ($data) {
         $error .= '<li> RSS Feed ' . $index . ' already saved';
     }
 }
 if (!$error) {
     for ($index = 1; $index <= $number_of_fields; $index++) {
         if (!empty($_POST['title' . $index])) {
             $title = $_POST['title' . $index];
             $feed = $_POST['feed' . $index];
             $max_items = $_POST['max_items' . $index];
             $base_instance->query('INSERT INTO ' . $base_instance->entity['RSS']['MAIN'] . ' (user,feed,title,max_items) VALUES (' . $userid . ',"' . sql_safe($feed) . '","' . sql_safe($title) . '","' . sql_safe($max_items) . '")');
         }
     }
     $base_instance->show_message('RSS Feeds saved', '<a href="add-rss-feeds.php">[Add RSS Feeds]</a> &nbsp;&nbsp; <a href="show-rss-feeds.php">[Show RSS Feeds]</a><p><a href="show-home.php">[Edit Homepages]</a>');
 } else {
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:add-rss-feeds.php

示例10: base

<?php

$flush = 1;
require 'class.base.php';
require 'class.html.php';
require 'class.user.php';
$base_instance = new base();
$html_instance = new html();
$user_instance = new user();
$user_instance->check_for_admin();
$newsletter_id = isset($_GET['newsletter_id']) ? (int) $_GET['newsletter_id'] : exit;
$test = isset($_GET['test']) ? 1 : 0;
$subscribed = isset($_GET['subscribed']) ? (int) $_GET['subscribed'] : 0;
$all = isset($_GET['all']) ? 1 : 0;
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['NEWSLETTER']['MAIN']} WHERE ID={$newsletter_id}");
$newsletter_id = $data[1]->ID;
$newsletter_subject = trim($data[1]->subject);
$newsletter_text = trim($data[1]->text);
if ($test == 1) {
    $query = 'WHERE ID=' . _ADMIN_USERID . ' AND newsletter_opt_in=1';
} else {
    if ($subscribed == 1) {
        $query = "WHERE newsletter<>{$newsletter_id} AND newsletter_opt_in=1";
    } else {
        if ($all == 1) {
            $query = "WHERE newsletter<>{$newsletter_id}";
        } else {
            echo 'Error';
            exit;
        }
    }
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:send-newsletter.php

示例11: long

        if (strlen($title) > 100) {
            $error .= '<li> Title is too long (Max. 100 Characters)';
        }
        $title = str_replace('"', '&quot;', $title);
    }
    if (!$diary_text) {
        $error .= '<li> Text cannot be left blank';
    } else {
        $diary_text = trim($diary_text);
        if (strlen($diary_text) > 65535) {
            $error .= '<li> Text is too long (Max. 65535 Characters)';
        }
    }
    if (!$error) {
        $date = $year . '-' . $month . '-' . $day;
        $data = $base_instance->get_data("SELECT ID FROM {$base_instance->entity['DIARY']['MAIN']} WHERE date='{$date}' AND user='{$userid}'");
        if (isset($data)) {
            $diary_id = $data[1]->ID;
            $base_instance->query('UPDATE ' . $base_instance->entity['DIARY']['MAIN'] . ' SET text="' . sql_safe($diary_text) . '",title="' . sql_safe($title) . '" WHERE user=' . $userid . ' AND ID=' . $diary_id);
        } else {
            $today = date('Y-m-d');
            $base_instance->query('INSERT INTO ' . $base_instance->entity['DIARY']['MAIN'] . ' (date,text,title,user,last_shown) VALUES ("' . sql_safe($date) . '","' . sql_safe($diary_text) . '","' . sql_safe($title) . '",' . $userid . ',"' . $today . '")');
            $diary_id = mysqli_insert_id($base_instance->db_link);
        }
        $base_instance->show_message('Diary saved', '<script language="JavaScript" type="text/javascript">function createRequestObject(){try{var requester=new XMLHttpRequest();}catch(error){try{var requester=new ActiveXObject("Microsoft.XMLHTTP");}catch(error){return false;}} return requester;}var http=createRequestObject();function DelDiary(item){if(confirm("Delete Diary?")){http.open(\'get\',\'delete-diary.php?item=\'+item); http.send(null);}}</script>

<a href="add-diary.php?day=' . $day . '&month=' . $month . '&year=' . $year . '">[Edit]</a> &nbsp;&nbsp; <a href="javascript:DelDiary(\'' . $diary_id . '\')">[Delete]</a> &nbsp;&nbsp; <a href="send-content.php?diary_id=' . $diary_id . '">[Send]</a> &nbsp;&nbsp; <a href="show-diary.php">[Show all]</a><p>');
    } else {
        $all_text = '<blockquote><font color="#ff0000"><ul>' . $error . '</ul></font></blockquote>';
        $diary_text = stripslashes($diary_text);
        $title = stripslashes($title);
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:add-diary.php

示例12: base

<?php

require 'class.base.php';
require 'class.html.php';
require 'class.user.php';
$base_instance = new base();
$html_instance = new html();
$user_instance = new user();
$user_instance->check_for_admin();
$news_id = isset($_REQUEST['news_id']) ? (int) $_REQUEST['news_id'] : exit;
if (isset($_POST['save'])) {
    $base_instance->query("DELETE FROM {$base_instance->entity['NEWS']['MAIN']} WHERE ID='{$news_id}'");
    header('Location: close-me.php');
    exit;
}
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['NEWS']['MAIN']} WHERE ID='{$news_id}'");
if (!$data) {
    $base_instance->show_message('News not found');
    exit;
}
$datetime = $data[1]->datetime;
$text = $data[1]->text;
$title = $data[1]->title;
$text2 = substr($text, 0, 50);
$datetime_converted = $base_instance->convert_date($datetime . ' 00:00:00');
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => '<font color="#ff0000">Delete this News?</font>', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Delete News'));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'news_id', 'VALUE' => "{$news_id}"));
if ($title) {
    $text2 = "<b>{$title}</b>: {$text2}";
}
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT' => "<strong>Added:</strong> {$datetime_converted}<p>{$text2}"));
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:delete-news.php

示例13: AND

    $query = " AND (text REGEXP '([[:space:]]|[[:<:]]){$text_search}([[:>:]]|[[:space:]])' OR title REGEXP '([[:space:]]|[[:<:]]){$text_search}([[:>:]]|[[:space:]])') ";
    $param = 'text_search=' . $text_search . '&amp;';
} else {
    if ($text_search) {
        $query = " AND (text LIKE '%{$text_search}%' OR title LIKE '%{$text_search}%') ";
        $param = 'text_search=' . $text_search . '&amp;';
    } else {
        $query = '';
        $param = '';
    }
}
#
if ($category_id) {
    $query .= " AND (category={$category_id}) ";
    $param .= 'category_id=' . $category_id . '&amp;';
    $data = $base_instance->get_data("SELECT title FROM {$base_instance->entity['TO_DO']['CATEGORY']} WHERE ID={$category_id}");
    $title = $data[1]->title;
    $category_name = '(Category ' . $title . ')';
} else {
    $category_name = '';
}
#
if (isset($_GET['order_col'])) {
    $order_col = $_GET['order_col'];
    setcookie('oc_todo', $_GET['order_col'], time() + 2592000);
} else {
    $order_col = isset($_COOKIE['oc_todo']) ? $_COOKIE['oc_todo'] : 'datetime';
}
#
if (isset($_GET['order_type'])) {
    $order_type = $_GET['order_type'];
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:show-to-do.php

示例14: base

<?php

setcookie('sid', '', '631213200', '/');
# delete cookie
date_default_timezone_set('Europe/London');
require 'class.base.php';
$base_instance = new base();
if (isset($_GET['guest'])) {
    $data = $base_instance->get_data('SELECT * FROM ' . $base_instance->entity['USER']['MAIN'] . ' WHERE ID=' . _GUEST_USERID);
    $username = $data[1]->username;
    $pw = $data[1]->user_password;
} else {
    if (isset($_REQUEST['username'])) {
        $username = sql_safe($_REQUEST['username']);
    } else {
        $username = '';
    }
    if (isset($_REQUEST['pw'])) {
        $pw = sql_safe($_REQUEST['pw']);
    } else {
        $pw = '';
    }
    if (isset($_GET['secure_pw'])) {
        $secure_pw = sql_safe($_GET['secure_pw']);
    } else {
        $secure_pw = '';
    }
}
if (empty($username) && empty($pw)) {
    header('Location: sign-up.php');
    exit;
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:auth.php

示例15: COUNT

} else {
    $query = 'AND parent_id=0';
    $cat_name = '';
    $category_id = '';
}
$html_instance->add_parameter(array('ACTION' => 'show_content', 'ENTITY' => 'LINK', 'SUBENTITY' => 'CATEGORY', 'MAXHITS' => 40, 'WHERE' => "WHERE user='{$userid}' {$query}", 'ORDER_COL' => 'title', 'ORDER_TYPE' => 'ASC', 'HEADER' => 'Link Categories ' . $cat_name, 'TEXT_CENTER' => '<a href="add-link-category.php?category_id=' . $category_id . '">[Add new Category]</a><p>', 'INNER_TABLE_WIDTH' => '90%'));
$data = $html_instance->get_items();
if (!$data) {
    $base_instance->show_message('No link categories added yet', '<a href="add-link-category.php">[Add new Category]</a>');
} else {
    $all_text = '<table width="100%" border cellspacing=0 cellpadding=5 class="pastel">';
    for ($index = 1; $index <= sizeof($data); $index++) {
        $ID = $data[$index]->ID;
        $title = $data[$index]->title;
        #
        $data2 = $base_instance->get_data("SELECT COUNT(*) AS total FROM {$base_instance->entity['LINK']['MAIN']} WHERE user='{$userid}' AND category={$ID}");
        $number_links = $data2[1]->total;
        #
        $data3 = $base_instance->get_data("SELECT COUNT(*) AS total_subcats FROM {$base_instance->entity['LINK']['CATEGORY']} WHERE user='{$userid}' AND parent_id={$ID}");
        $number_subcats = $data3[1]->total_subcats;
        if ($number_subcats > 0) {
            $subcats = '<a href="show-link-categories.php?category_id=' . $ID . '">[Show Subcats: ' . $number_subcats . ']</a>';
        } else {
            $subcats = 'No Subcat';
        }
        #
        $all_text .= '<tr onMouseOver=\'this.style.background="#e9e9e9"\' onMouseOut=\'this.style.background="#ffffff"\'>
<td width=140><a href="show-links.php?category_id=' . $ID . '"><strong>' . $title . '</strong></a></td>
<td align="left"><strong>Total:</strong> ' . $number_links . '</td>
<td align="center">' . $subcats . '</td>
<td align="center"><a href="add-link.php?category_id=' . $ID . '">[Add]</a></td>
开发者ID:vijo,项目名称:Blue-Smiley-Organizer,代码行数:31,代码来源:show-link-categories.php


注:本文中的base::get_data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。