<?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;
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='******'", '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='******' 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>';
        $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='******' AND ID=' . $contact_id);
        $data = $base_instance->get_data("SELECT title FROM {$base_instance->entity['CONTACT']['CATEGORY']} WHERE user='******' 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='******' AND ID={$contact_id}");
    if (!$data) {
        $base_instance->show_message('Contact not found', '', 1);
    }
<?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);
<?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='******'");
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'))) {
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='******'<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)';
        }
    }
<?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='******' 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();
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();
     $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='******'<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 {
<?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;
        }
    }
Esempio n. 11
0
        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='******'");
        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='******' 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);
Esempio n. 12
0
<?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}"));
Esempio n. 13
0
    $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'];
Esempio n. 14
0
<?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;
} 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='******' {$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='******' 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='******' 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>
    $base_instance->show_message('No Instant Messages yet', '');
} else {
    $all_text = '<table width="100%" cellspacing=0 cellpadding=5 class="pastel">';
    for ($index = 1; $index <= sizeof($data); $index++) {
        $ID = $data[$index]->ID;
        $datetime = $data[$index]->datetime;
        $text = $data[$index]->text;
        $user = $data[$index]->user;
        $receiver = $data[$index]->receiver;
        $popup = $data[$index]->popup;
        if ($popup == 1) {
            $status = 'Read';
        } else {
            $status = '<b>Unread</b>';
        }
        $data2 = $base_instance->get_data("SELECT username FROM {$base_instance->entity['USER']['MAIN']} WHERE ID={$user}");
        if (!empty($data2)) {
            $username = $data2[1]->username;
        } else {
            $username = '******';
        }
        $data3 = $base_instance->get_data("SELECT username FROM {$base_instance->entity['USER']['MAIN']} WHERE ID={$receiver}");
        if (!empty($data3)) {
            $receiver = $data3[1]->username;
        } else {
            $receiver = '[delete]';
        }
        $datetime_converted = $base_instance->convert_date($datetime);
        $all_text .= '<tr><td width="80" align="center">' . $datetime_converted . '</td><td>' . $status . '</td><td><a href="show-user.php?username='******'">' . $username . '</a> to <a href="show-user.php?username='******'">' . $receiver . '</a>: ' . $text . '</td></tr>';
    }
    $all_text .= '</table>';
                $title_var = $_POST['name_checkbox_field_item_' . $index];
                $id_var = (int) $_POST['id_checkbox_field_item_' . $index];
                if ($title_var) {
                    if ($id_var) {
                        $base_instance->query('UPDATE ' . $base_instance->entity['DATABASE']['CHECKBOX_ITEMS'] . ' SET title="' . sql_safe($title_var) . '" WHERE user='******' AND ID=' . $id_var);
                    } else {
                        $base_instance->query('INSERT INTO ' . $base_instance->entity['DATABASE']['CHECKBOX_ITEMS'] . ' (title,user,checkbox_field_id) VALUES ("' . sql_safe($title_var) . '",' . $userid . ',' . $checkbox_field_id . ')');
                    }
                }
            }
            $base_instance->show_message('Field upated', '<a href="edit-database-checkbox-field.php?checkbox_field_id=' . $checkbox_field_id . '">[Edit Field]</a> &nbsp;&nbsp; <a href="javascript:void(window.open(\'delete-database-checkbox-field.php?checkbox_field_id=' . $checkbox_field_id . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete Field]</a>');
        } else {
            $html_instance->error_message = $error;
        }
    } else {
        $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['CHECKBOX_FIELDS']} WHERE user='******' AND ID='{$checkbox_field_id}'");
        if (!$data) {
            $base_instance->show_message('Database field not found');
            exit;
        }
        $title_field = $data[1]->title;
        $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['CHECKBOX_ITEMS']} WHERE user='******' AND checkbox_field_id='{$checkbox_field_id}' ORDER BY ID ASC");
        $number_of_fields = sizeof($data) + 3;
        for ($index = 1; $index <= sizeof($data); $index++) {
            $item_id[$index] = $data[$index]->ID;
            $item_name[$index] = $data[$index]->title;
        }
    }
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Edit Checkbox Field', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'TEXT_CENTER' => 'You can rename field names here, do not change the position of field items.<p>', 'BUTTON_TEXT' => 'Update Field'));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'number_of_fields', 'VALUE' => "{$number_of_fields}"));
<?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 left(datetime,4) as odate,COUNT(*) AS number FROM {$base_instance->entity['LINK']['MAIN']} WHERE user='******' GROUP BY odate ORDER BY odate DESC");
if (!$data) {
    $base_instance->show_message('No links added yet', '');
}
$all_text = '<div align="center"><table border=1 cellspacing=0 cellpadding=5 bgcolor="#ffffff" class="pastel"><tr bgcolor="#dedede"><td><b>Year</b></td><td><strong>Entries</strong></td></tr>';
for ($index = 1; $index <= sizeof($data); $index++) {
    $number = $data[$index]->number;
    $odate = $data[$index]->odate;
    $all_text .= '<tr><td><b>' . $odate . '</b></td><td align="center">' . $number . '</td></tr>';
}
$all_text .= '</table></div>';
$html_instance->add_parameter(array('HEADER' => 'Added Links by Year', 'TEXT' => "{$all_text}", 'BACK' => 1));
$html_instance->process();
<?php

require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
if (!empty($_GET['category_id'])) {
    $category_id = (int) $_GET['category_id'];
} else {
    exit;
}
# get checkbox fields
$all_text = '<table border=1 cellspacing=0 cellpadding=10 bgcolor="#ffffff" class="pastel"><tr><td><strong>Checkbox Fields</strong> <a href="add-database-checkbox-field.php?category_id=' . $category_id . '">[Add New]</a><br><br>';
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['CHECKBOX_FIELDS']} WHERE category_id='{$category_id}' AND user='******'");
$all_text .= '<table border=1 cellspacing=0 cellpadding=2 bgcolor="#ffffff" class="pastel">';
for ($index = 1; $index <= sizeof($data); $index++) {
    $ID = $data[$index]->ID;
    $title = $data[$index]->title;
    $all_text .= '<tr><td bgcolor="#dedede"><b>' . $title . '</b></td>
<td><a href="edit-database-checkbox-field.php?checkbox_field_id=' . $ID . '">[Edit]</a></td>
<td><a href="javascript:void(window.open(\'delete-database-checkbox-field.php?checkbox_field_id=' . $ID . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete Field]</a></td><td><a href="delete-database-checkbox-field-items.php?checkbox_field_id=' . $ID . '">[Delete Field Items]</a></td></tr>';
}
$all_text .= '</table></td></tr></table><p>';
# get select fields
$all_text .= '<table border=1 cellspacing=0 cellpadding=10 bgcolor="#ffffff" class="pastel"><tr><td>';
$all_text .= '<strong>Select Fields</strong> <a href="add-database-select-field.php?category_id=' . $category_id . '">[Add New]</a><br><br>';
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['SELECT_FIELDS']} WHERE category_id='{$category_id}' AND user='******'");
$all_text .= '<table border=1 cellspacing=0 cellpadding=2 bgcolor="#ffffff" class="pastel">';
for ($index = 1; $index <= sizeof($data); $index++) {
    $ID = $data[$index]->ID;
} else {
    $month = (int) $_GET['month'];
}
if (empty($_GET['year'])) {
    $year = date('Y');
} else {
    $year = (int) $_GET['year'];
}
$days = $diary_instance->get_days_in_month($month, $year);
$all = '<br><div align="center" class="header">Monthly Reminder Overview &nbsp;&nbsp; <a href="show-reminder-monthly-overview.php">[Normal View]</a></div><p>';
for ($day = 1; $day <= $days; $day++) {
    $timestamp = mktime(0, 0, 0, $month, $day, $year);
    $day_of_the_week = date('w', $timestamp) + 1;
    $day_of_the_week_text = date('l', $timestamp);
    $all .= '<table width="80%" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF" class="pastel2"><tr><td colspan="5" style="background-image: url(\'pics/gradient.jpg\');border-bottom:1px solid ' . _BLOCK_LINE_COLOR . '">&nbsp;<b>' . $day_of_the_week_text . ', ' . $day . '.' . $month . '.' . $year . '</b></td></tr>';
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['REMINDER']['DATE']} WHERE user={$userid} AND day={$day} AND (month={$month} OR month=0) AND (year={$year} OR year=0)");
    for ($index = 1; $index <= sizeof($data); $index++) {
        $ID = $data[$index]->ID;
        $title = $data[$index]->title;
        $all .= '<tr bgcolor="#ffffff"><td width="40"><a href="javascript:void(window.open(\'edit-reminder-date.php?reminder_id=' . $ID . '\',\'\',\'width=600,height=620,top=100,left=100\'))">[Edit]</a></td><td width="50"><a href="javascript:void(window.open(\'delete-reminder-date.php?reminder_id=' . $ID . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete]</a></td><td>' . $title . '</td></tr>';
    }
    #
    $data2 = $base_instance->get_data("SELECT * FROM {$base_instance->entity['REMINDER']['WEEKDAY']} WHERE day_of_the_week LIKE '%{$day_of_the_week}%' AND user={$userid}");
    $dotw_total = sizeof($data2);
    for ($index = 1; $index <= $dotw_total; $index++) {
        $dotw_id = $data2[$index]->ID;
        $dotw_title = $data2[$index]->title;
        $dotw_time = $data2[$index]->what_time;
        $all .= '<tr bgcolor="#ffffff"><td width="40"><a href="javascript:void(window.open(\'edit-reminder-weekday.php?reminder_id=' . $dotw_id . '\',\'\',\'width=600,height=500,top=100,left=100\'))">[Edit]</a></td><td width="50"><a href="javascript:void(window.open(\'delete-reminder-weekday.php?reminder_id=' . $dotw_id . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete]</a></td><td>' . $dotw_title . ' - ' . $dotw_time . '</td></tr>';
    }
    $all .= '</table><p>';
Esempio n. 21
0
$base_instance = new base();
$html_instance = new html();
$home_instance = new home();
$userid = $base_instance->get_userid();
$home_id = isset($_REQUEST['home_id']) ? (int) $_REQUEST['home_id'] : '';
$base_instance->query("SET sql_mode = 'NO_UNSIGNED_SUBTRACTION'");
// necessary for the overflow problem, see http://dev.mysql.com/doc/refman/5.6/en/out-of-range-and-overflow.html
$all_text = '<div align="center">';
if ($userid == _GUEST_USERID) {
    $all_text .= '<h3>Demo Login, do not save any relevant data.</h3>Please read the <a href="help-intro.php"><u>help section</u></a> to get started with the Organizer';
} else {
    $all_text .= '<br>';
}
#
if (empty($home_id)) {
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['HOME']['MAIN']} WHERE user='******' ORDER BY ID LIMIT 1");
} else {
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['HOME']['MAIN']} WHERE ID='{$home_id}' AND user='******'");
}
if (isset($data)) {
    $title = $data[1]->title;
    $element1 = $data[1]->element1;
    $element2 = $data[1]->element2;
    $element3 = $data[1]->element3;
    $element4 = $data[1]->element4;
    $element5 = $data[1]->element5;
    $element6 = $data[1]->element6;
    $element7 = $data[1]->element7;
    $element8 = $data[1]->element8;
    $element9 = $data[1]->element9;
    $element10 = $data[1]->element10;
$category_id = isset($_REQUEST['category_id']) ? (int) $_REQUEST['category_id'] : exit;
if (isset($_POST['save'])) {
    $error = '';
    $title = $_POST['title'];
    if (!$title) {
        $error .= '<li> Title cannot be left blank';
    } else {
        $title = trim($title);
        if (strlen($title) > 50) {
            $error .= '<li> Title is too long (Max. 50 Characters)';
        }
        $title = str_replace('"', '&quot;', $title);
    }
    if (!$error) {
        $base_instance->query('UPDATE ' . $base_instance->entity['BLOG']['CATEGORY'] . ' SET title="' . sql_safe($title) . '" WHERE user='******' AND ID=' . $category_id);
        $base_instance->show_message('Blog Category updated', '<a href="add-blog.php?category_id=' . $category_id . '">[Add Blog Post]</a> &nbsp;&nbsp; <a href="add-blog-category.php">[Add Category]</a> &nbsp;&nbsp; <a href="edit-blog-category.php?category_id=' . $category_id . '">[Edit]</a> &nbsp;&nbsp; <a href="javascript:void(window.open(\'delete-blog-category.php?category_id=' . $category_id . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete]</a><p><a href="show-blog-categories.php">[Show Blog Categories]</a>');
    } else {
        $html_instance->error_message = $error;
    }
} else {
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['BLOG']['CATEGORY']} WHERE user='******' AND ID='{$category_id}'");
    if (!$data) {
        $base_instance->show_message('Blog Category not found');
        exit;
    }
    $title = $data[1]->title;
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Edit Blog Category', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BODY' => 'onLoad="javascript:document.form1.title.focus()"', 'INNER_TABLE_WIDTH' => '400', 'TD_WIDTH' => '20%', 'BUTTON_TEXT' => 'Update Category'));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'category_id', 'VALUE' => $category_id));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'title', 'VALUE' => $title, 'SIZE' => 35, 'TEXT' => 'Title'));
$html_instance->process();
<?php

require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
if (!empty($_GET['days_reminder_id'])) {
    $days_reminder_id = (int) $_GET['days_reminder_id'];
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['REMINDER']['DAYS']} WHERE ID={$days_reminder_id} AND user={$userid}");
    $title = $data[1]->title;
    $text = $data[1]->text;
    $text = convert_square_bracket($text);
    $text = nl2br($text);
    $all_text = "<strong>{$title}</strong><p>{$text}";
} else {
    if (!empty($_GET['weekday_reminder_id'])) {
        $weekday_reminder_id = (int) $_GET['weekday_reminder_id'];
        $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['REMINDER']['WEEKDAY']} WHERE ID={$weekday_reminder_id} AND user={$userid}");
        $title = $data[1]->title;
        $text = $data[1]->text;
        $text = convert_square_bracket($text);
        $text = nl2br($text);
        $all_text = "<strong>{$title}</strong><p>{$text}";
    } else {
        if (!empty($_GET['hours_reminder_id'])) {
            $hours_reminder_id = (int) $_GET['hours_reminder_id'];
            $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['REMINDER']['HOURS']} WHERE ID={$hours_reminder_id} AND user={$userid}");
            $title = $data[1]->title;
            $text = $data[1]->text;
            $text = convert_square_bracket($text);
    }
    if (!$text) {
        $error .= '<li> Text cannot be left blank';
    } else {
        $text = trim($text);
        if (strlen($text) > 65535) {
            $error .= '<li> Text is too long (Max. 65535 Characters)';
        }
    }
    if (!$error) {
        if ($new_category) {
            $base_instance->query('INSERT INTO ' . $base_instance->entity['KNOWLEDGE']['CATEGORY'] . ' (title,user) VALUES ("' . sql_safe($new_category) . '",' . $userid . ')');
            $category_id = mysqli_insert_id($base_instance->db_link);
        }
        $base_instance->query('UPDATE ' . $base_instance->entity['KNOWLEDGE']['MAIN'] . ' SET text="' . sql_safe($text) . '",title="' . sql_safe($title) . '",category=' . $category_id . ',value=' . $value . ',public=' . $public . ' WHERE user='******' AND ID=' . $knowledge_id);
        $data = $base_instance->get_data('SELECT title FROM ' . $base_instance->entity['KNOWLEDGE']['CATEGORY'] . ' WHERE user='******' AND ID=' . $category_id);
        $cat_title = $data[1]->title;
        $base_instance->show_message('Knowledge 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 DelKnow(item){if(confirm("Delete Knowledge?")){http.open(\'get\',\'delete-knowledge.php?item=\'+item); http.send(null);}}</script>

<a href="add-knowledge.php?category_id=' . $category_id . '">[Add more]</a> &nbsp;&nbsp; <a href="edit-knowledge.php?knowledge_id=' . $knowledge_id . '">[Edit]</a> &nbsp;&nbsp; <a href="javascript:DelKnow(\'' . $knowledge_id . '\')">[Delete]</a> &nbsp;&nbsp; <a href="send-content.php?knowledge_id=' . $knowledge_id . '">[Send]</a><p><a href="show-knowledge-categories.php">[Show all Categories]</a> &nbsp; <a href="show-knowledge.php">[Show all Knowledge]</a><p><b>Internal Link:</b> [k' . $knowledge_id . '] &nbsp;&nbsp; <b>Category:</b> ' . $cat_title . ' <a href="show-knowledge.php?category_id=' . $category_id . '">[Show]</a>');
    } else {
        $html_instance->error_message = $error;
        $text = stripslashes($text);
        $title = stripslashes($title);
    }
} else {
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['KNOWLEDGE']['MAIN']} WHERE user='******' AND ID='{$knowledge_id}'");
    if (!$data) {
        $base_instance->show_message('Knowledge not found', '', 1);
    }
    $datetime = $data[1]->datetime;
$userid = $base_instance->get_userid();
$where = '';
if (isset($_GET['text_search'])) {
    $text_search = sql_safe($_GET['text_search']);
    $where = " AND (text LIKE '%{$text_search}%' OR title LIKE '%{$text_search}%') ";
}
if (isset($_GET['category_id'])) {
    $category_id = (int) $_GET['category_id'];
    $where .= ' AND category=' . $category_id;
} else {
    if (isset($_GET['blog_id'])) {
        $blog_id = (int) $_GET['blog_id'];
        $where = ' AND ID=' . $blog_id;
    }
}
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['BLOG']['MAIN']} WHERE user='******'{$where} ORDER BY datetime DESC");
echo '<head><meta http-equiv="content-type" content="text/html;charset=utf-8">
<style type="text/css">
td {font-family:Arial; font-size:10pt}
table.pastel,table.pastel td {border:1px solid #c5c5c5; border-collapse:collapse}
</style>
</head>

<table width="100%" border cellspacing=0 cellpadding=5 class="pastel">';
for ($index = 1; $index <= sizeof($data); $index++) {
    $title = $data[$index]->title;
    $text = $data[$index]->text;
    $title = convert_square_bracket($title);
    $text = convert_square_bracket($text);
    $text = nl2br($text);
    echo '<tr><td><strong>', $title, '</strong><br>', $text, '</td></tr>';
<?php

require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
$file_id = isset($_GET['file_id']) ? (int) $_GET['file_id'] : exit;
$token = 't' . md5(uniqid(rand(), true));
#
$data = $base_instance->get_data("SELECT filename FROM {$base_instance->entity['FILE']['MAIN']} WHERE ID='{$file_id}'");
$filename = $data[1]->filename;
$path = pathinfo($filename);
if (isset($path['extension'])) {
    $ext = strtolower($path['extension']);
} else {
    $ext = '';
}
if ($ext == 'gif' or $ext == 'png' or $ext == 'jpg' or $ext == 'jpeg') {
    $image_link = '<p><form><strong>Display Image:</strong> &nbsp; <input type="text" name="" size="15" value="[image-' . $file_id . ']" onFocus="this.select()"></form>';
} else {
    $image_link = '';
}
#
$base_instance->query("UPDATE {$base_instance->entity['FILE']['MAIN']} SET token='{$token}',public=2 WHERE ID='{$file_id}'");
$base_instance->show_message('File is public now', '<b>Download Link:</b><p><form><input type="text" name="" size="80" value="' . _HOMEPAGE . '/file-' . $token . '" onFocus="this.select()"></form>' . $image_link, 1);
<?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($_REQUEST['category_id']) ? (int) $_REQUEST['category_id'] : exit;
if (isset($_POST['delete_it'])) {
    $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['CATEGORY']} WHERE user='******' AND ID='{$category_id}'");
    $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['MAIN']} WHERE user='******' AND category_id='{$category_id}'");
    # delete checkbox records
    $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['CHECKBOX_VALUES']} WHERE user='******' AND category_id='{$category_id}'");
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['CHECKBOX_FIELDS']} WHERE user='******' AND category_id='{$category_id}'");
    for ($index = 1; $index <= sizeof($data); $index++) {
        $checkbox_field_id = $data[$index]->ID;
        $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['CHECKBOX_ITEMS']} WHERE user='******' AND checkbox_field_id='{$checkbox_field_id}'");
    }
    $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['CHECKBOX_FIELDS']} WHERE user='******' AND category_id='{$category_id}'");
    # delete select records
    $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['SELECT_VALUES']} WHERE user='******' AND category_id='{$category_id}'");
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['SELECT_FIELDS']} WHERE user='******' AND category_id='{$category_id}'");
    for ($index = 1; $index <= sizeof($data); $index++) {
        $select_field_id = $data[$index]->ID;
        $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['SELECT_ITEMS']} WHERE user='******' AND select_field_id='{$select_field_id}'");
    }
    $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['SELECT_FIELDS']} WHERE user='******' AND category_id='{$category_id}'");
    # delete number records
    $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['NUMBER_FIELDS']} WHERE user='******' AND category_id='{$category_id}'");
    $base_instance->query("DELETE FROM {$base_instance->entity['DATABASE']['NUMBER_VALUES']} WHERE user='******' AND category_id='{$category_id}'");
    header('Location: close-me.php');
 $month = (int) $_POST['month'];
 $year = (int) $_POST['year'];
 if ($title) {
     $title = trim($title);
     if (strlen($title) > 100) {
         $error .= '<li> Title too long (Max. 100 Characters)';
     }
     $title = str_replace('"', '&quot;', $title);
 }
 if (!$error) {
     $date = "{$year}-{$month}-{$day}";
     $time = date('H:i:s');
     $base_instance->query('INSERT INTO ' . $base_instance->entity['DATABASE']['MAIN'] . ' (datetime,day,month,year,title,text,user,category_id) VALUES ("' . $date . ' ' . $time . '",' . $day . ',' . $month . ',' . $year . ',"' . sql_safe($title) . '","' . sql_safe($text) . '",' . $userid . ',' . $category_id . ')');
     $insert_id = mysqli_insert_id($base_instance->db_link);
     # insert checkbox values
     $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['CHECKBOX_FIELDS']} WHERE user='******' AND category_id='{$category_id}'");
     for ($index = 1; $index <= sizeof($data); $index++) {
         $ID = $data[$index]->ID;
         if (isset($_POST['checkbox' . $ID])) {
             $checkbox_array = $_POST['checkbox' . $ID];
             for ($hh = 0; $hh < count($checkbox_array); $hh++) {
                 $value = sql_safe($checkbox_array[$hh]);
                 if ($value) {
                     $base_instance->query("INSERT INTO {$base_instance->entity['DATABASE']['CHECKBOX_VALUES']} (date,user,value,data_id,checkbox_field_id,category_id) VALUES ('{$date}',{$userid},{$value},{$insert_id},{$ID},{$category_id})");
                 }
             }
         }
     }
     unset($data);
     # insert select values
     $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['SELECT_FIELDS']} WHERE user='******' AND category_id='{$category_id}'");
Esempio n. 29
0
$address = isset($_POST['address']) ? $_POST['address'] : '';
$notes = isset($_POST['notes']) ? $_POST['notes'] : '';
$url = isset($_POST['url']) ? $_POST['url'] : '';
$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 = '';
    if (!$firstname && !$lastname && !$company) {
        $error .= '<li> First name / Last name / Company cannot be left blank';
    }
    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['CONTACT']['CATEGORY'] . ' WHERE title="' . sql_safe($new_category) . '" AND user='******'<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 (!$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);
        }
        $datetime = $_POST['datetime'];
        $html_instance->check_for_duplicates('CONTACT', 'MAIN', $datetime, $userid);
Esempio n. 30
0
<?php

require 'class.base.php';
$base_instance = new base();
$blog_id = isset($_GET['blog_id']) ? $_GET['blog_id'] : exit;
$data = $base_instance->get_data("SELECT title FROM {$base_instance->entity['BLOG']['MAIN']} WHERE ID={$blog_id}");
$title = $data[1]->title;
if (_SHORT_URLS == 1) {
    $url = _HOMEPAGE . '/permalink-' . $blog_id;
} else {
    $url = _HOMEPAGE . '/show-blog-public-permalink.php?blog_id=' . $blog_id;
}
#
$result1 = ping_server('http://rpc.technorati.com/rpc/ping', 'rpc.technorati.com', $title, $url);
$result2 = ping_server('http://rpc.icerocket.com:10080', 'rpc.icerocket.com', $title, $url);
preg_match("/<string>([\\x{1}-\\x{99999}]+)<\\/string>/ui", $result1, $ll);
if (!empty($ll[1])) {
    $string1 = $ll[1];
} else {
    $string1 = '(Error)';
}
preg_match("/<string>([\\x{1}-\\x{99999}]+)<\\/string>/ui", $result2, $ll);
if (!empty($ll[1])) {
    $string2 = $ll[1];
} else {
    $string2 = '(Error)';
}
$base_instance->show_message('Server Pinged', '<u>Technorati Result:</u> ' . $string1 . '<p><u>Icerocket Result:</u> ' . $string2);
#
function ping_server($ping_server, $rpc, $title, $url)
{