<?php

require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
if (isset($_GET['token'])) {
    $token = $_GET['token'];
} else {
    exit;
}
$base_instance->query('UPDATE ' . $base_instance->entity['FILE']['MAIN'] . ' SET token="",public=1 WHERE token="' . sql_safe($token) . '"');
$base_instance->show_message('File private again', '', 1);
<?php

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>';
<?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['save_it'])) {
    $title_text_field = sql_safe($_POST['title_text_field']);
    $base_instance->query("INSERT INTO {$base_instance->entity['DATABASE']['TEXT_FIELDS']} (user,title,category_id) VALUES ({$userid},'{$title_text_field}',{$category_id})");
    $field_id = mysqli_insert_id($base_instance->db_link);
    $base_instance->show_message('Field saved', '<a href="add-database-number-field.php?category_id=' . $category_id . '">[Add Number Field]</a>&nbsp;&nbsp; <a href="add-database-text-field.php?category_id=' . $category_id . '">[Add Text Field]</a><p>
<a href="add-database-select-field.php?category_id=' . $category_id . '">[Add Select Field]</a> &nbsp;&nbsp; <a href="add-database-checkbox-field.php?category_id=' . $category_id . '">[Add Checkbox Field]</a><p><a href="add-database-data.php?category_id=' . $category_id . '">[Add Data]</a> &nbsp;&nbsp; <a href="edit-database-text-field.php?text_field_id=' . $field_id . '">[Edit Field]</a> &nbsp;&nbsp; <a href="show-database-data.php?category_id=' . $category_id . '">[Show all Data]</a>');
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Add Text Field', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'INNER_TABLE_WIDTH' => '400', 'TD_WIDTH' => '30%', 'BUTTON_TEXT' => 'Save Field'));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'save_it', 'VALUE' => 1));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'category_id', 'VALUE' => "{$category_id}"));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'title_text_field', 'VALUE' => '', 'SIZE' => 35, 'TEXT' => 'Name of Field'));
$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 ($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)';
        }
    }
$filename = 'contacts' . $token . '.txt';
exec("rm {$filepath}; touch {$filepath}; chmod 0600 {$filepath}");
if (is_writable($filepath)) {
    if (!($fp = fopen($filepath, 'w'))) {
        echo "Cannot open file ({$filename})";
        exit;
    }
    if (!fwrite($fp, $text)) {
        echo "Cannot write to file ({$filename})";
        exit;
    }
    fclose($fp);
} else {
    echo "The file {$filename} is not writable";
    exit;
}
#
if (file_exists($filepath)) {
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
    header('Cache-Control: no-cache, must-revalidate');
    header('Pragma: no-cache');
    header('Content-Description: File Transfer');
    header('Content-Type: application/force-download');
    header('Content-Disposition: attachment; filename="' . $filename . '";');
    #header('Content-Length: '.filesize($filepath));
    set_time_limit(0);
    @readfile($filepath) or die;
} else {
    $base_instance->show_message('File not found');
}
예제 #6
0
<?php

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' => 'HOME', 'MAXHITS' => 40, 'WHERE' => "WHERE user='******'", 'ORDER_COL' => 'ID', 'ORDER_TYPE' => 'ASC', 'HEADER' => 'Homepage Overview', 'TEXT_CENTER' => '<a href="add-home.php">[Add new Homepage]</a><p>', 'INNER_TABLE_WIDTH' => '80%'));
$data = $html_instance->get_items();
if (!$data) {
    $base_instance->show_message('No homepage added yet', '<a href="add-home.php">[Add new Homepage]</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;
        #
        $all_text .= '<tr onMouseOver=\'this.style.background="#e9e9e9"\' onMouseOut=\'this.style.background="#ffffff"\'>
<td width=140><a href="home.php?home_id=' . $ID . '"><strong>' . $title . '</strong></a></td><td align="center"><a href="edit-home.php?home_id=' . $ID . '">[Edit]</a></td><td align="center"><a href="home.php?home_id=' . $ID . '">[Show]</a></td><td align="center"><a href="delete-home.php?home_id=' . $ID . '">[Delete]</a></td>
</tr>';
    }
    $all_text .= '</table>';
}
$content_array[1] = array('MAIN' => $all_text);
$html_instance->content = $content_array;
$html_instance->process();
        # insert number values
        $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['NUMBER_FIELDS']} WHERE user='******' AND category_id='{$category_id}'");
        for ($index = 1; $index <= sizeof($data); $index++) {
            $ID = $data[$index]->ID;
            $value = sql_safe($_POST['number' . $ID]);
            $base_instance->query("INSERT INTO {$base_instance->entity['DATABASE']['NUMBER_VALUES']} (date,user,value,data_id,number_field_id,category_id) VALUES ('{$date}',{$userid},'{$value}',{$insert_id},{$ID},{$category_id})");
        }
        # insert text values
        $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['TEXT_FIELDS']} WHERE user='******' AND category_id='{$category_id}'");
        for ($index = 1; $index <= sizeof($data); $index++) {
            $ID = $data[$index]->ID;
            $value = sql_safe($_POST['text' . $ID]);
            $base_instance->query("INSERT INTO {$base_instance->entity['DATABASE']['TEXT_VALUES']} (date,user,value,data_id,text_field_id,category_id) VALUES ('{$date}',{$userid},'{$value}',{$insert_id},{$ID},{$category_id})");
        }
        $base_instance->show_message('Data 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 DelData(item){if(confirm("Delete Data?")){http.open(\'get\',\'delete-database-data.php?item=\'+item); http.send(null);}}</script>

<a href="add-database-data.php?category_id=' . $category_id . '">[Add more]</a> &nbsp;&nbsp; <a href="edit-database-data.php?data_id=' . $insert_id . '">[Edit]</a> &nbsp;&nbsp; <a href="javascript:DelData(\'' . $insert_id . '\')">[Delete]</a> &nbsp;&nbsp; <a href="show-database-data.php?category_id=' . $category_id . '">[Show all Data]</a><p>');
    } else {
        $html_instance->error_message = $error;
        $title = stripslashes($title);
    }
}
$day = date('j');
$month = date('n');
$year = date('Y');
$title = isset($_POST['title']) ? $_POST['title'] : '';
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Add Data', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Save Data'));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'save_data', 'VALUE' => "1"));
$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' => 50, 'TEXT' => 'Title'));
# get number fields
예제 #8
0
} else {
    $view_mode = isset($_COOKIE['vm_todo']) ? $_COOKIE['vm_todo'] : '';
}
#
if ($view_mode == 1) {
    $link = '<a href="' . $_SERVER['PHP_SELF'] . '?' . $param . 'view_mode=0">[Complete View]</a>';
} else {
    $link = '<a href="' . $_SERVER['PHP_SELF'] . '?' . $param . 'view_mode=1">[List View]</a>';
}
#
$html_instance->add_parameter(array('ACTION' => 'show_content', 'ENTITY' => 'TO_DO', 'ORDER_COL' => $order_col, 'ORDER_TYPE' => $order_type, 'MAXHITS' => 40, 'WHERE' => "WHERE user='******' {$query}", 'SORTBAR' => 2, 'SORTBAR_FIELD1' => 'datetime', 'SORTBAR_NAME1' => 'Date added', 'SORTBAR_FIELD2' => 'priority', 'SORTBAR_NAME2' => 'Priority', 'HEADER' => 'To-Do ' . $category_name . ' &nbsp;&nbsp; ' . $link . ' &nbsp;&nbsp; <a href="show-to-do-print.php?' . $param . '" target="_blank">[Print]</a>  &nbsp;&nbsp; <a href="generate-rss-feed-to-do.php">[RSS Feed]</a> ', 'INNER_TABLE_WIDTH' => '80%', 'URL_PARAMETER' => $param, 'HEAD' => '<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 DelToDo(item){if(confirm("Delete To-Do?")){http.open(\'get\',\'delete-to-do.php?item=\'+item);http.onreadystatechange=handleResponse;http.send(null);}}function handleResponse(){if(http.readyState==4){var response=http.responseText;var update=new Array();if(response.indexOf(\'|\'!=-1)){res=response.split(\'|\');document.getElementById(res[0]).innerHTML=res[1];}}}</script>'));
$data = $html_instance->get_items();
if (!$data) {
    if ($text_search) {
        if ($text_search) {
            $base_instance->show_message('Search Result', 'Nothing found for the entered search terms.<p><a href="javascript:history.go(-1)">[Go Back]</a>');
        }
    } else {
        $base_instance->show_message('No to-do added yet', '<a href="add-to-do.php">[Add To-do]</a>');
    }
} else {
    $all_text = '';
    for ($index = 1; $index <= sizeof($data); $index++) {
        $ID = $data[$index]->ID;
        $title = $data[$index]->title;
        $priority = $data[$index]->priority;
        $status = $data[$index]->status;
        $category_id = $data[$index]->category;
        $datetime = $data[$index]->datetime;
        if ($index % 2 == 1) {
            $bg = '#fbfbfb';
예제 #9
0
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}"));
$html_instance->process();
예제 #10
0
#
$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)
{
    $request = xmlrpc_encode_request('weblogUpdates.ping', array($title, $url));
    $header[] = 'Host: ' . $rpc;
    $header[] = 'Content-type: text/xml';
    $header[] = 'Content-length: ' . strlen($request) . "\r\n";
    $header[] = $request;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $ping_server);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    $result = curl_exec($ch);
    curl_close($ch);
예제 #11
0
<?php

require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
if ($userid != _ADMIN_USERID && $base_instance->allow_file_upload == 2) {
    $base_instance->show_message(_NO_FILE_UPLOAD_MSG, '');
}
$text_search = isset($_REQUEST['text_search']) ? sql_safe($_REQUEST['text_search']) : '';
$whole_words = isset($_POST['whole_words']) ? 1 : '';
$category_id = isset($_REQUEST['category_id']) ? (int) $_REQUEST['category_id'] : '';
if ($text_search && $whole_words) {
    $query = " AND (text REGEXP '([[:space:]]|[[:<:]]){$text_search}([[:>:]]|[[:space:]])' OR title REGEXP '([[:space:]]|[[:<:]]){$text_search}([[:>:]]|[[:space:]])' OR filename 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}%' OR filename 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}";
    $data = $base_instance->get_data("SELECT title FROM {$base_instance->entity['FILE']['CATEGORY']} WHERE ID={$category_id}");
    $title = $data[1]->title;
    $category_name = '(Category ' . $title . ')';
    $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'];
    setcookie('ot_todo', $_GET['order_type'], time() + 2592000);
} else {
    $order_type = isset($_COOKIE['ot_todo']) ? $_COOKIE['ot_todo'] : 'DESC';
}
$html_instance->add_parameter(array('ACTION' => 'show_content', 'ENTITY' => 'TO_DO', 'ORDER_COL' => $order_col, 'ORDER_TYPE' => $order_type, 'MAXHITS' => 40, 'WHERE' => "WHERE public='2'", 'SORTBAR' => 2, 'SORTBAR_FIELD1' => 'datetime', 'SORTBAR_NAME1' => 'Date added', 'SORTBAR_FIELD2' => 'priority', 'SORTBAR_NAME2' => 'Priority', 'HEADER' => 'Public To-Do', 'INNER_TABLE_WIDTH' => '80%'));
$data = $html_instance->get_items();
if (!$data) {
    $base_instance->show_message('No public to-do added yet');
} else {
    $all_text = '';
    for ($index = 1; $index <= sizeof($data); $index++) {
        $ID = $data[$index]->ID;
        $title = $data[$index]->title;
        $text = $data[$index]->text;
        $priority = $data[$index]->priority;
        $category_id = $data[$index]->category;
        $datetime = $data[$index]->datetime;
        $user_id = $data[$index]->user;
        $datetime_converted = $base_instance->convert_date($datetime);
        $text = convert_square_bracket($text);
        $text = $base_instance->insert_links($text);
        $text = nl2br($text);
        if (!empty($title)) {
    $userid = $data[1]->user;
    $url = './upload/' . $userid . '/' . $filename;
    if (file_exists($url)) {
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
        header('Cache-Control: no-cache, must-revalidate');
        header('Pragma: no-cache');
        header('Content-Description: File Transfer');
        header('Content-Type: application/force-download');
        header('Content-Disposition: attachment; filename="' . $filename . '";');
        #header('Content-Length: '.filesize($url));
        set_time_limit(0);
        @readfile($url) or die;
    } else {
        header('HTTP/1.1 404 Not Found');
        $base_instance->show_message('File not found');
    }
}
if ($token) {
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['FILE']['MAIN']} WHERE token='{$token}'");
    if (!$data) {
        header('HTTP/1.1 404 Not Found');
        $base_instance->show_message('File not found', '<font face="Verdana" size="1" color="#636363">Powered by <a href="http://www.bookmark-manager.com/" target="_blank"><font color="#191970">Blue Smiley Organizer</font></a></font>');
    }
    $file_id = $data[1]->ID;
    $filename = $data[1]->filename;
    $title = $data[1]->title;
    $text = $data[1]->text;
    $userid = $data[1]->user;
    $filesize = filesize('./upload/' . $userid . '/' . $filename);
    if ($filesize > 1048576) {
예제 #14
0
<?php

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' => 'RSS', 'ORDER_COL' => 'title', 'ORDER_TYPE' => 'ASC', 'MAXHITS' => 40, 'WHERE' => "WHERE user='******'", 'HEADER' => 'RSS Feeds', 'TEXT_CENTER' => '<a href="add-rss-feeds.php">[Add RSS Feeds]</a><p>', 'INNER_TABLE_WIDTH' => '80%'));
$data = $html_instance->get_items();
if (!$data) {
    $base_instance->show_message('No RSS Feeds added yet', '<a href="add-rss-feeds.php">[Add RSS Feeds]</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;
    $feed = $data[$index]->feed;
    $all_text .= '<tr onMouseOver=\'this.style.background="#e9e9e9"\' onMouseOut=\'this.style.background="#ffffff"\'><td><strong>' . $title . '</strong></td><td>' . $feed . '</td><td><a href="' . $feed . '" target="_blank">[Show]</a></td><td><a href="edit-rss-feed.php?feed_id=' . $ID . '">[Edit]</a></td><td><a href="javascript:void(window.open(\'delete-rss-feed.php?feed_id=' . $ID . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete]</a></td></tr>';
}
$all_text .= '</table>';
$content_array[1] = array('MAIN' => $all_text);
$html_instance->content = $content_array;
$html_instance->process();
예제 #15
0
# translate bluebox ORDER_COL
$data = $html_instance->get_items();
if ($order_col == 'ttv') {
    $html_instance->para['ORDER_COL'] = 'ttv';
}
# translate back (workaround to show red arrow down and up)
if ($order_col == 'bluebox') {
    $html_instance->para['ORDER_COL'] = 'bluebox';
}
# translate back (workaround to show red arrow down and up)
if (!$data) {
    if ($text_search) {
        $html_instance->add_parameter(array('HEADER' => 'Nothing found (Links)', 'TEXT' => '<form action="show-links.php" method="post"><center><table cellpadding=10 cellspacing=0 border=0 bgcolor="#ffffff" class="pastel2"><tr><td align="right"><b>Text:</b> &nbsp;<input type="text" name="text_search" size="30" value="' . $text_search . '"></td></tr><tr><td align="center"><input type="SUBMIT" value="Search Links" name="save"></td></tr></table></center></form>'));
        $html_instance->process();
    } else {
        $base_instance->show_message('No links added yet', '<a href="add-link.php">[Add Link]</a> or <a href="import-bookmarks-start.php">[Upload your Bookmarks]</a>');
    }
} else {
    if (isset($_GET['page'])) {
        $page = (int) $_GET['page'];
    } else {
        $page = 1;
    }
    $all_text = '<table width="100%" border=0 cellspacing=0 cellpadding=2 class="pastel"><tr><td align="center"><a href="' . $_SERVER['PHP_SELF'] . '?' . $param . '&amp;page=' . $page . '&amp;order_col=' . $order_col . '&amp;order_type=' . $order_type . '">[Refresh]</a></td><td align="center"><table class="no_border"><tr><td><strong>Search:</strong>&nbsp;</td><td><form method="post" action="url-search.php" target="_blank"><input type="Text" name="text_search" size=10><input type=submit value="Go!"></form></td></tr></table></td><td colspan="6" align="center"><b>Actions</b></td>';
    if ($order_col == 'frequency') {
        $all_text .= '<td align="center"><u><b>Visit every</b></u></td>';
    } else {
        $all_text .= '<td align="center"><b>Visit every</b></td>';
    }
    if ($order_col == 'speed') {
        $all_text .= '<td align="center"><u><b>Ascent Speed</b></u></td>';
<?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,7) as odate,COUNT(*) AS number FROM {$base_instance->entity['KNOWLEDGE']['MAIN']} WHERE user='******' GROUP BY odate ORDER BY odate DESC");
if (!$data) {
    $base_instance->show_message('No knowledge added yet', '');
}
$all_text = '<div align="center"><table border=1 cellspacing=0 cellpadding=5 bgcolor="#ffffff" class="pastel"><tr bgcolor="#dedede"><td><b>Month</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 Knowledge by Month', 'TEXT' => "{$all_text}", 'BACK' => 1));
$html_instance->process();
$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();
예제 #18
0
            $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);
    }
} elseif (isset($diary_id)) {
    $data = $base_instance->get_data("SELECT ID,date,text,title FROM {$base_instance->entity['DIARY']['MAIN']} WHERE ID='{$diary_id}' AND user='******'");
    if (!$data) {
        $base_instance->show_message('Diary entry not found', '', 1);
    }
    $ID = $data[1]->ID;
    $date = $data[1]->date;
    $diary_text = $data[1]->text;
    $title = $data[1]->title;
예제 #19
0
<?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);
예제 #20
0
$userid = $base_instance->get_userid();
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'));
     }
     if (!$error) {
         $base_instance->query('UPDATE ' . $base_instance->entity['DATABASE']['CHECKBOX_FIELDS'] . ' SET title="' . sql_safe($title_field) . '" WHERE user='******' AND ID=' . $checkbox_field_id);
         #
         for ($index = 1; $index <= $number_of_fields; $index++) {
             $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;
예제 #22
0
        }
        $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 {
        $html_instance->error_message = $error;
    }
}
if (isset($_POST['more_fields'])) {
    $number_of_fields += 3;
    $text = '<table>';
    for ($index = 1; $index <= $number_of_fields; $index++) {
        if (isset($_POST['title' . $index])) {
            $title = stripslashes($_POST['title' . $index]);
        } else {
            $title = '';
        }
        if (isset($_POST['feed' . $index])) {
            $feed = $_POST['feed' . $index];
<?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

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['save'])) {
    if (!$category_id) {
        exit;
    }
    $base_instance->query("DELETE FROM {$base_instance->entity['TO_DO']['MAIN']} WHERE user='******' AND category='{$category_id}'");
    $base_instance->query("DELETE FROM {$base_instance->entity['TO_DO']['CATEGORY']} WHERE user='******' AND ID='{$category_id}'");
    header('Location: close-me.php');
    exit;
} else {
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['TO_DO']['CATEGORY']} WHERE user='******' AND ID='{$category_id}'");
    if (!$data) {
        $base_instance->show_message('To-Do Category not found');
        exit;
    }
    $title = $data[1]->title;
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => '<font color="#ff0000">Delete this category?</font>', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Delete'));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'category_id', 'VALUE' => "{$category_id}"));
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT' => "Are you sure you want to delete the <b>'{$title}'</b> category AND the items of this category?"));
$html_instance->process();
require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
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) {
        $title = sql_safe($title);
        $html_instance->check_for_duplicates_by_title('NOTE', 'CATEGORY', $title, $userid);
        $base_instance->query('INSERT INTO ' . $base_instance->entity['NOTE']['CATEGORY'] . ' (title,user) VALUES ("' . $title . '",' . $userid . ')');
        $cat_id = mysqli_insert_id($base_instance->db_link);
        $base_instance->show_message('Notes Category saved', '<a href="add-note.php?category_id=' . $cat_id . '">[Add Note]</a> &nbsp;&nbsp; <a href="add-note-category.php">[Add Category]</a> &nbsp;&nbsp; <a href="edit-note-category.php?category_id=' . $cat_id . '">[Edit]</a> &nbsp;&nbsp; <a href="javascript:void(window.open(\'delete-note-category.php?category_id=' . $cat_id . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete]</a><p><a href="show-note-categories.php">[Show Notes Categories]</a>');
    } else {
        $html_instance->error_message = $error;
        $title = stripslashes($title);
    }
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Add Notes Category', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BODY' => 'onLoad="javascript:document.form1.title.focus()"', 'INNER_TABLE_WIDTH' => '400', 'TD_WIDTH' => '20%', 'BUTTON_TEXT' => 'Save Category'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'title', 'VALUE' => '', 'SIZE' => 35, 'TEXT' => 'Title'));
$html_instance->process();
require 'class.base.php';
require 'class.html.php';
$base_instance = new base();
$html_instance = new html();
$userid = $base_instance->get_userid();
if (isset($_GET['unread'])) {
    $query = 'AND popup=0';
    $link = '<a href="show-instant-messages.php">[Show all]</a>';
} else {
    $query = '';
    $link = '<a href="show-instant-messages.php?unread=1">[Show only Unread]</a>';
}
$html_instance->add_parameter(array('ACTION' => 'show_content', 'ENTITY' => 'INSTANT_MESSAGE', 'ORDER_COL' => 'ID', 'MAXHITS' => 50, 'WHERE' => "WHERE (user='******' OR receiver='{$userid}') {$query}", 'HEADER' => 'Instant Messages &nbsp;&nbsp; ' . $link, 'INNER_TABLE_WIDTH' => '95%'));
$data = $html_instance->get_items();
if (!$data) {
    $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}");
    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');
    exit;
} else {
    $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['CATEGORY']} WHERE user='******' AND ID='{$category_id}'");
    if (!$data) {
        $base_instance->show_message('Database Category not found');
        exit;
    }
    $title = $data[1]->title;
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => '<font color="#ff0000">Delete this category?</font>', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Delete Category'));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'category_id', 'VALUE' => "{$category_id}"));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'delete_it', 'VALUE' => 1));
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT' => "Are you sure you want to delete the <b>'{$title}'</b> category AND the items of this category?"));
$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();
$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();
예제 #29
0
        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);
        $firstname = str_replace('"', '&quot;', $firstname);
        $lastname = str_replace('"', '&quot;', $lastname);
        $address = str_replace('"', '&quot;', $address);
        $company = str_replace('"', '&quot;', $company);
        $base_instance->query('INSERT INTO ' . $base_instance->entity['CONTACT']['MAIN'] . ' (datetime,user,firstname,lastname,email,telephone,fax,mobile,address,notes,company,url,category,public) VALUES ("' . sql_safe($datetime) . '",' . $userid . ',"' . sql_safe($firstname) . '","' . sql_safe($lastname) . '","' . sql_safe($email) . '","' . sql_safe($telephone) . '","' . sql_safe($fax) . '","' . sql_safe($mobile) . '","' . sql_safe($address) . '","' . sql_safe($notes) . '","' . sql_safe($company) . '","' . sql_safe($url) . '",' . $category_id . ',' . $public . ')');
        $contact_id = mysqli_insert_id($base_instance->db_link);
        $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 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 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);
    }
}
# default category
if (!$category_id) {
    $data = $base_instance->get_data("SELECT default_contact_category FROM {$base_instance->entity['USER']['MAIN']} WHERE ID='{$userid}'");
    $category_id = $data[1]->default_contact_category;
}
# build category section
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['CONTACT']['CATEGORY']} WHERE user='******' ORDER BY title");
        }
    }
    if ($freq_hours < 1 && $freq_mins < 1) {
        $error .= '<li> <strong>Hours / Mins</strong> cannot be left blank';
    }
    if (!$error) {
        $freq_total = 0;
        if ($freq_hours > 0) {
            $freq_total += $freq_hours * 3600;
        }
        if ($freq_mins > 0) {
            $freq_total += $freq_mins * 60;
        }
        $now = time();
        $datetime = $_POST['datetime'];
        $html_instance->check_for_duplicates('REMINDER', 'HOURS', $datetime, $userid);
        $base_instance->query('INSERT INTO ' . $base_instance->entity['REMINDER']['HOURS'] . ' (datetime, title, user, frequency, last_reminded, text) VALUES ("' . sql_safe($datetime) . '", "' . sql_safe($title) . '",' . $userid . ',' . $freq_total . ',' . $now . ',"' . sql_safe($text) . '")');
        $reminder_id = mysqli_insert_id($base_instance->db_link);
        $base_instance->show_message('Reminder saved', '<a href="add-reminder-hours.php">[Add more]</a> &nbsp;&nbsp; <a href="javascript:void(window.open(\'edit-reminder-hours.php?reminder_id=' . $reminder_id . '\',\'\',\'width=600,height=300,top=100,left=100\'))">[Edit]</a> &nbsp;&nbsp; <a href="javascript:void(window.open(\'delete-reminder-hours.php?reminder_id=' . $reminder_id . '\',\'\',\'width=450,height=300,top=100,left=100\'))">[Delete]</a> &nbsp;&nbsp; <a href="show-reminder-hours.php">[Show all]</a><p>');
    } else {
        $html_instance->error_message = $error;
        $title = stripslashes($title);
        $text = stripslashes($text);
    }
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Add Reminder (By Hours) &nbsp;&nbsp; <a href="help-reminder.php">[Help]</a>', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Save Reminder'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'title', 'VALUE' => "{$title}", 'SIZE' => 50, 'TEXT' => 'Title'));
$html_instance->add_form_field(array('TYPE' => 'textarea', 'NAME' => 'text', 'VALUE' => "{$text}", 'COLS' => 50, 'ROWS' => 3, 'TEXT' => 'Notes', 'SECTIONS' => 2));
$freq_text = 'Hours: <input type="text" name="freq_hours" size="2" value="' . $freq_hours . '"> &nbsp; Minutes: <input type="text" name="freq_mins" size="2" value="' . $freq_mins . '">';
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT1' => 'Every:', 'TEXT2' => "{$freq_text}", 'SECTIONS' => 2));
$html_instance->process();