' . $url . '

For the password reminder go here:

' . _HOMEPAGE . '/password-reminder.php';
        $msg .= "\n\n";
        $msg .= _SEPARATOR . "\n";
        $msg .= _EMAIL_ADVERT_TEXT . "\n";
        $msg .= _SEPARATOR . "\n";
        $msg .= _SLOGAN . "\n";
        $msg .= _HOMEPAGE . "\n";
        $msg .= 'Email: ' . _ADMIN_EMAIL . "\n";
        mail($email, $mailsubject, $msg, $mailheaders);
        $base_instance->query("UPDATE {$base_instance->entity['USER']['MAIN']} SET last_reminded='{$today}' WHERE ID={$ID}");
    }
    if ($sizeof > 0) {
        echo '<head><meta http-equiv="refresh" content="10;URL=send-warning.php?months=' . $months . '&save=1"></head><p><strong>Continue to send more reminder emails in a few seconds (' . $fnd_rows . ' left) ..</strong>';
    } else {
        echo 'finished';
    }
    exit;
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Send Reminder', 'TEXT_CENTER' => 'Send a reminder email to user who have not logged in for a long time.<p>', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Send', 'INNER_TABLE_WIDTH' => '220'));
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT' => '<strong>Send Email to users who have .. </strong>'));
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT' => '<select name="months">
<option value=3>Not logged in for 3 months
<option selected value=6>Not logged in for 6 months
<option value=12>Not logged in for 1 year
<option value=24>Not logged in for 2 years
</select>'));
$html_instance->process();
    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();
    $datetime = $data[1]->datetime;
    $firstname = $data[1]->firstname;
    $lastname = $data[1]->lastname;
    $telephone = $data[1]->telephone;
    $fax = $data[1]->fax;
    $mobile = $data[1]->mobile;
    $email = $data[1]->email;
    $address = $data[1]->address;
    $notes = $data[1]->notes;
    $company = $data[1]->company;
    $url = $data[1]->url;
    $category_id = $data[1]->category;
    $public = $data[1]->public;
    $datetime_converted = $base_instance->convert_date($datetime);
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Edit Contact', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Save Contact'));
# build category select box
$select_box = '&nbsp;<select name="category_id">';
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['CONTACT']['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> or <b>New Category:</b> <input type="text" name="new_category" value="">';
#
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'contact_id', 'VALUE' => $contact_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);
            $text = nl2br($text);
            $all_text = "<strong>{$title}</strong><p>{$text}";
        } else {
            if (!empty($_GET['date_reminder_id'])) {
                $date_reminder_id = (int) $_GET['date_reminder_id'];
                $data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['REMINDER']['DATE']} WHERE ID={$date_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}";
            }
        }
    }
}
$html_instance->add_parameter(array('TEXT' => $all_text));
$html_instance->process();
}
if (empty($_GET['order_col'])) {
    $order_col = 'ID';
} else {
    $order_col = sql_safe($_GET['order_col']);
}
if (empty($_GET['show_all'])) {
    $where = "WHERE DATE_ADD(last_reminded, INTERVAL frequency DAY)<'{$datetime}' AND user='******'";
    $header = 'Reminders To Do &nbsp;&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?show_all=1">[Show all Reminders]</a>';
    $show_all = 0;
} else {
    $where = "WHERE user='******'";
    $header = 'All Reminders &nbsp;&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?show_all=0">[Show Reminders To Do]</a>';
    $show_all = 1;
}
$html_instance->add_parameter(array('ACTION' => 'show_content', 'ENTITY' => 'REMINDER', 'SUBENTITY' => 'DAYS', 'MAXHITS' => 50, 'WHERE' => "{$where} AND homepage=1", 'ORDER_COL' => "{$order_col}", 'ORDER_TYPE' => "{$order_type}", 'HEADER' => "{$header}", 'SORTBAR' => 6, 'SORTBAR_FIELD1' => 'title', 'SORTBAR_NAME1' => 'Title', 'SORTBAR_FIELD2' => 'bluebox', 'SORTBAR_NAME2' => 'Days due', 'SORTBAR_FIELD3' => 'last_reminded', 'SORTBAR_NAME3' => 'Last Time Done', 'SORTBAR_FIELD4' => 'done', 'SORTBAR_NAME4' => 'Done', 'SORTBAR_FIELD5' => 'frequency', 'SORTBAR_NAME5' => 'Do every', 'SORTBAR_FIELD6' => 'datetime', 'SORTBAR_NAME6' => 'Date added', 'INNER_TABLE_WIDTH' => '95%', 'URL_PARAMETER' => "show_all={$show_all}"));
if ($order_col == 'bluebox') {
    $html_instance->para['ORDER_COL'] = '(UNIX_TIMESTAMP("' . $datetime . '")-UNIX_TIMESTAMP(last_reminded)-(frequency*86400))';
}
# translate bluebox ORDER_COL
$data = $html_instance->get_items();
if ($order_col == 'bluebox') {
    $html_instance->para['ORDER_COL'] = 'bluebox';
}
# translate back (workaround to show red arrow down and up)
$all_text = '<table width="100%" border=1 cellspacing=0 cellpadding=2 class="pastel"><tr><td align="center"><a href="' . $_SERVER['PHP_SELF'] . '?order_col=' . $order_col . '&order_type=' . $order_type . '&show_all=' . $show_all . '">[Refresh]</a></td>';
if ($order_col == 'bluebox') {
    $all_text .= '<td align="center"><u><b>Days due</b></u></td>';
} else {
    $all_text .= '<td align="center"><b>Days due</b></td>';
}
    } 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}"));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'checkbox_field_id', 'VALUE' => "{$checkbox_field_id}"));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'title_field', 'VALUE' => "{$title_field}", 'SIZE' => 30, 'TEXT' => 'Name of Field'));
for ($index = 1; $index <= $number_of_fields; $index++) {
    if (empty($item_id[$index])) {
        $item_id[$index] = '';
    }
    if (empty($item_name[$index])) {
        $item_name[$index] = '';
    }
    $html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'name_checkbox_field_item_' . $index, 'VALUE' => $item_name[$index], 'SIZE' => 30, 'TEXT' => 'Name Item ' . $index));
    $html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'id_checkbox_field_item_' . $index, 'VALUE' => $item_id[$index]));
}
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT' => '<input type="submit" name="add_fields" value="More Item Fields">'));
$html_instance->process();
<td><a href="javascript:void(window.open(\'delete-database-select-field.php?select_field_id=' . $ID . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete Field]</a></td><td><a href="delete-database-select-field-items.php?select_field_id=' . $ID . '">[Delete Field Items]</a></td></tr>';
}
$all_text .= '</table></td></tr></table><p>';
# get number fields
$all_text .= '<table border=1 cellspacing=0 cellpadding=10 bgcolor="#ffffff" class="pastel"><tr><td>';
$all_text .= '<strong>Number Fields</strong> <a href="add-database-number-field.php?category_id=' . $category_id . '">[Add New]</a><br><br>';
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['NUMBER_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-number-field.php?number_field_id=' . $ID . '">[Edit]</a></td>
<td><a href="javascript:void(window.open(\'delete-database-number-field.php?number_field_id=' . $ID . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete]</a></td></tr>';
}
$all_text .= '</table></td></tr></table><p>';
# get text fields
$all_text .= '<table border=1 cellspacing=0 cellpadding=10 bgcolor="#ffffff" class="pastel"><tr><td>';
$all_text .= '<strong>Text Fields</strong> <a href="add-database-text-field.php?category_id=' . $category_id . '">[Add New]</a><br><br>';
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['DATABASE']['TEXT_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-text-field.php?text_field_id=' . $ID . '">[Edit]</a></td>
<td><a href="javascript:void(window.open(\'delete-database-text-field.php?text_field_id=' . $ID . '\',\'\',\'width=450,height=200,top=100,left=100\'))">[Delete]</a></td></tr>';
}
$all_text .= '</table></td></tr></table><p>';
$html_instance->add_parameter(array('HEADER' => 'Edit Fields', 'TEXT_CENTER' => "{$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();
$id = isset($_GET['id']) ? (int) $_GET['id'] : exit;
$del_message = isset($_GET['del_message']) ? (int) $_GET['del_message'] : '';
if ($userid == _ADMIN_USERID && $del_message) {
    $base_instance->query("DELETE FROM {$base_instance->entity['FORUM']['MAIN']} WHERE ID={$del_message}");
}
$html_instance->add_parameter(array('ACTION' => 'show_content', 'ENTITY' => 'FORUM', 'WHERE' => "WHERE ID={$id} OR followup={$id}", 'ORDER_COL' => 'followup,datetime', 'ORDER_TYPE' => 'DESC', 'MAXHITS' => 40, 'TEXT_CENTER' => '<center><a href="javascript:history.go(-1)">[Go Back]</a></center>', 'INNER_TABLE_WIDTH' => '90%', 'HEADER' => 'Thread', 'URL_PARAMETER' => "id={$id}"));
$data = $html_instance->get_items();
$all_text = '';
for ($index = 1; $index <= sizeof($data); $index++) {
    $ID = $data[$index]->ID;
    $text = $data[$index]->text;
    $title = $data[$index]->title;
    $text = convert_square_bracket($text);
    $title = convert_square_bracket($title);
    if ($title) {
        $html_instance->para['HEADER'] = $title;
    }
    $userid_message = $data[$index]->user;
    $followup = $data[$index]->followup;
    $datetime = $data[$index]->datetime;
    $datetime_converted = $base_instance->convert_date($datetime);
    if ($followup == 0) {
        $color = '#dedfdf';
    } else {
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();
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;
        }
    }
}
$period_11 = date('Y-m-d H:i:s', mktime(0, 0, 0, date('m') - 11, date('d'), date('Y')));
$html_instance->add_parameter(array('ENTITY' => 'USER', 'WHERE' => $query, 'ORDER_COL' => 'ID', 'ORDER_TYPE' => 'DESC', 'MAXHITS' => '199'));
$data = $html_instance->get_items();
if (empty($data)) {
    echo 'All done!';
    exit;
} elseif ($test == 1) {
    echo '<a href="edit-newsletter.php?newsletter_id=' . $newsletter_id . '">Edit Newsletter</a><br><br>';
} else {
    echo '<head><meta http-equiv="refresh" content="3;URL=' . $_SERVER['PHP_SELF'] . '?all=' . $all . '&newsletter_id=' . $newsletter_id . '&subscribed=' . $subscribed . '"></head>';
}
for ($index = 1; $index <= sizeof($data); $index++) {
    unset($msg);
    $ID = $data[$index]->ID;
    $username = $data[$index]->username;
    $email = $data[$index]->email;
    $lastlogin = $data[$index]->lastlogin;
Esempio n. 11
0
        $ID = $data[1]->ID;
        $diary_text = $data[1]->text;
        $title = $data[1]->title;
    } else {
        $ID = '';
        $diary_text = '';
        $title = '';
    }
}
if (empty($ID)) {
    $ID_text = '';
} else {
    $ID_text = '<strong>ID:</strong> ' . $ID;
}
$current_month = $diary_instance->get_month_view($month, $year);
$weekday = date('l', mktime(0, 0, 0, $month, $day, $year));
$date_converted = $base_instance->convert_date($year . '-' . $month . '-' . $day . ' 00:00:00');
$all_text .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form1">
<input type="Hidden" name="day" value="' . $day . '">
<input type="Hidden" name="month" value="' . $month . '">
<input type="Hidden" name="year" value="' . $year . '">

<div align="center"><br>

<table><tr><td><table cellpadding=4 cellspacing=0 border=0 bgcolor="#ffffff" width=40% class="pastel2"><tr><td align="right"><b>Date:</b></td><td>' . $date_converted . ' - ' . $weekday . ' &nbsp;&nbsp; ' . $ID_text . '</td></tr><tr><td align="right"><b>Title:</b></td><td align="left">&nbsp;
<input type="text" name="title" size="65" value="' . $title . '"></td></tr><tr><td colspan=2 align=center><textarea rows=15 cols=100 name="diary_text" wrap>' . $diary_text . '</textarea></td></tr><tr><td colspan=2 align=center><input type="SUBMIT" value="Save Diary" name="save"></td></tr></form></td></tr></table>
</td><td valign="top">' . $current_month . '</td></tr></table>

</div>';
$html_instance->add_parameter(array('TEXT_CENTER' => "{$all_text}", 'BODY' => 'onLoad="javascript:document.form1.title.focus()"'));
$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,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();
Esempio n. 13
0
}
#
if (isset($_GET['view_mode'])) {
    $view_mode = $_GET['view_mode'];
    setcookie('vm_todo', $view_mode, time() + 2592000);
} 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;
Esempio n. 14
0
    $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 . ')';
} else {
    $category_name = '';
}
#
if (!empty($_GET['public'])) {
    $query .= " AND (public=2) ";
    $param = "public=1";
    $link = '<a href="show-files.php">[Show all]</a>';
} else {
    $link = '<a href="show-files.php?public=1">[Only Public]</a>';
}
$html_instance->add_parameter(array('ACTION' => 'show_content', 'ENTITY' => 'FILE', 'MAXHITS' => 40, 'WHERE' => "WHERE user='******' {$query}", 'SORTBAR' => 2, 'SORTBAR_FIELD1' => 'datetime', 'SORTBAR_NAME1' => 'Date added', 'SORTBAR_FIELD2' => 'title', 'SORTBAR_NAME2' => 'Title', 'HEADER' => 'Uploaded Files ' . $category_name . ' &nbsp;&nbsp; ' . $link, '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 DelFile(item){if(confirm("Delete File?")){http.open(\'get\',\'delete-file.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) {
        $html_instance->add_parameter(array('HEADER' => 'Nothing found (Files)', 'TEXT' => '<form action="show-files.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 Files" name="save"></td></tr></table></center></form>'));
        $html_instance->process();
    } else {
        $base_instance->show_message('No files uploaded yet', '<a href="add-file.php">[Upload File]</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;
        $datetime = $data[$index]->datetime;
        $text = $data[$index]->text;
        $title = $data[$index]->title;
<?php

require 'class.base.php';
require 'class.html.php';
require 'class.diary.php';
$base_instance = new base();
$html_instance = new html();
$diary_instance = new diary();
if (isset($_GET['year'])) {
    $year = (int) $_GET['year'];
} else {
    exit;
}
$year_overview = $diary_instance->get_year_view($year);
$html_instance->add_parameter(array('TEXT_CENTER' => '<p>' . $year_overview));
$html_instance->process();
Esempio n. 16
0
            } else {
                $feed = '';
            }
            if (isset($_POST['max_items' . $index])) {
                $max_items = $_POST['max_items' . $index];
            } else {
                $max_items = '';
            }
            $text .= '<tr><td align="right"><b>Feed Title ' . $index . ':</b></td><td align="left">&nbsp;<input type="text" name="title' . $index . '" size="65" value="' . $title . '"></td></tr><tr><td align="right"><b>Feed URL ' . $index . ':</b></td><td align="left">&nbsp;<input type="text" name="feed' . $index . '" size="65" value="' . $feed . '"></td></tr><tr><td align="right"><b>Max Items ' . $index . ':</b></td><td align="left">&nbsp;<input type="text" name="max_items' . $index . '" size="5" value="' . $max_items . '"></td></tr>';
        }
        $text .= '<tr><td></td><td><input type="SUBMIT" value="More Fields" name="more_fields"></td></tr></table>

<input type="Hidden" name="number_of_fields" value="' . $number_of_fields . '">';
    } else {
        $text = '<table>';
        $number_of_fields = 5;
        for ($index = 1; $index < $number_of_fields + 1; $index++) {
            $text .= '<tr><td align="right"><b>Feed Title ' . $index . ':</b></td><td align="left">&nbsp;<input type="text" name="title' . $index . '" size="65" value=""></td></tr>

<tr><td align="right"><b>Feed URL ' . $index . ':</b></td><td align="left">&nbsp;<input type="text" name="feed' . $index . '" size="65" value=""></td></tr>

<tr><td align="right"><b>Max Items ' . $index . ':</b></td><td align="left">&nbsp;<input type="text" name="max_items' . $index . '" size="5" value=""></td></tr>';
        }
        $text .= '<tr><td></td><td><input type="SUBMIT" value="More Feeds" name="more_fields"></td></tr></table>

<input type="Hidden" name="number_of_fields" value="' . $number_of_fields . '">';
    }
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Add RSS Feeds', 'INNER_TABLE_WIDTH' => '60%', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BODY' => 'onLoad="javascript:document.form1.title1.focus()"', 'BUTTON_TEXT' => 'Save RSS Feeds'));
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT' => $text));
$html_instance->process();
require 'class.html.php';
require 'class.misc.php';
$base_instance = new base();
$html_instance = new html();
$misc_instance = new misc();
$userid = $base_instance->get_userid();
if (isset($_GET['category_id'])) {
    $category_id = (int) $_GET['category_id'];
    $query = 'AND parent_id=' . $category_id;
    $cat_name = $misc_instance->get_link_category($category_id);
} 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) {
<?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['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>';
$category_id = isset($_GET['category_id']) ? $_GET['category_id'] : '';
# build category section
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['FILE']['CATEGORY']} WHERE user='******' ORDER BY title");
if (!$data) {
    $cat_title = 'New Category:';
    $select_category = '&nbsp;<input type="text" name="new_category" value="' . $new_category . '">';
} else {
    $cat_title = 'Category:';
    $select_category = '&nbsp;<select name="category_id">';
    for ($index = 1; $index <= sizeof($data); $index++) {
        $category_title = $data[$index]->title;
        $ID = $data[$index]->ID;
        if ($ID == $category_id) {
            $select_category .= "<option selected value={$ID}>{$category_title}";
        } else {
            $select_category .= "<option value={$ID}>{$category_title}";
        }
    }
    $select_category .= '</select> or <b>New Category:</b> <input type="text" name="new_category" value="' . $new_category . '" size="12">';
}
#
$title = isset($_POST['title']) ? $_POST['title'] : '';
$text = isset($_POST['text']) ? $_POST['text'] : '';
$source = isset($_POST['source']) ? $_POST['source'] : '';
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Upload Image by URL', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BODY' => 'onLoad="javascript:document.form1.source.focus()"', 'BUTTON_TEXT' => 'Upload File'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'source', 'VALUE' => "{$source}", 'SIZE' => 55, 'TEXT' => 'Image URL'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'title', 'VALUE' => "{$title}", 'SIZE' => 55, 'TEXT' => 'Title'));
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT1' => 'Category:', 'TEXT2' => "{$select_category}", 'SECTIONS' => 2));
$html_instance->add_form_field(array('TYPE' => 'textarea', 'NAME' => 'text', 'VALUE' => "{$text}", 'COLS' => 50, 'ROWS' => 3, 'TEXT' => 'Notes', 'SECTIONS' => 2));
$html_instance->add_form_field(array('TYPE' => 'radio', 'NAME' => 'public', 'FIELD_ARRAY' => 'public_array', 'VALUE' => "{$public}", 'TEXT' => 'File is'));
$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();
Esempio n. 21
0
<?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();
Esempio n. 22
0
}
#
if (isset($_GET['order_col'])) {
    $order_col = $_GET['order_col'];
    setcookie('oc_link', $_GET['order_col'], time() + 2592000);
} else {
    $order_col = isset($_COOKIE['oc_link']) ? $_COOKIE['oc_link'] : 'datetime';
}
#
if (isset($_GET['order_type'])) {
    $order_type = $_GET['order_type'];
    setcookie('ot_link', $_GET['order_type'], time() + 2592000);
} else {
    $order_type = isset($_COOKIE['ot_link']) ? $_COOKIE['ot_link'] : 'DESC';
}
$html_instance->add_parameter(array('ACTION' => 'show_content', 'ENTITY' => 'LINK', 'ORDER_COL' => $order_col, 'ORDER_TYPE' => $order_type, 'MAXHITS' => 100, 'WHERE' => "{$where}", 'HEADER' => "{$header} {$cat_header}", 'SORTBAR' => 10, 'SORTBAR_FIELD1' => 'title', 'SORTBAR_NAME1' => 'Title', 'SORTBAR_FIELD2' => 'bluebox', 'SORTBAR_NAME2' => 'Due for', 'SORTBAR_FIELD3' => 'last_visit', 'SORTBAR_NAME3' => 'Last Visit', 'SORTBAR_FIELD4' => 'ttv', 'SORTBAR_NAME4' => 'Speed Ranking', 'SORTBAR_FIELD5' => 'speed', 'SORTBAR_NAME5' => 'Speed', 'SORTBAR_FIELD6' => 'sequence', 'SORTBAR_NAME6' => 'Sequence', 'SORTBAR_FIELD7' => 'popularity', 'SORTBAR_NAME7' => 'Popularity', 'SORTBAR_FIELD8' => 'visits', 'SORTBAR_NAME8' => 'Visits', 'SORTBAR_FIELD9' => 'frequency', 'SORTBAR_NAME9' => 'Visit every', 'SORTBAR_FIELD10' => 'datetime', 'SORTBAR_NAME10' => 'Date added', 'INNER_TABLE_WIDTH' => '96%', 'URL_PARAMETER' => $param));
if ($order_col == 'ttv') {
    $html_instance->para['ORDER_COL'] = '(UNIX_TIMESTAMP("' . $datetime . '")-UNIX_TIMESTAMP(last_visit)-frequency)*(speed/100000)';
}
# translate ttv ORDER_COL
if ($order_col == 'bluebox') {
    $html_instance->para['ORDER_COL'] = '(UNIX_TIMESTAMP("' . $datetime . '")-UNIX_TIMESTAMP(last_visit)-frequency)';
}
# 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';
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();
    #
    $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>';
}
# next year / next month
$prev_year = $year - 1;
$next_year = $year + 1;
$prev_month = $month - 1;
if ($prev_month == 0) {
    $prev_month = 12;
    $prev_year_month = $prev_year;
} else {
    $prev_year_month = $year;
}
$next_month = $month + 1;
if ($next_month == 13) {
    $next_month = 1;
    $next_year_month = $next_year;
} else {
    $next_year_month = $year;
}
$all .= '<table border="0"><tr><td align="center" valign="top" align="left" class="pages"><a href="' . $_SERVER['PHP_SELF'] . '?month=' . $prev_month . '&year=' . $prev_year_month . '">&laquo; Previous</a> &nbsp;&nbsp;&nbsp; <a href="' . $_SERVER['PHP_SELF'] . '?month=' . $next_month . '&year=' . $next_year_month . '">Next &raquo;</a></td></tr></table>';
$html_instance->add_parameter(array('TEXT_CENTER' => "{$all}"));
$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();
$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>';
Esempio n. 26
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();
<?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();
function bigger(what,add) {
if (what.style.height==\'\') { what.style.height=\'300px\'; }
newHeight=parseInt(what.style.height)+add;
what.style.height=newHeight+"px";
}

function smaller(what,deduct) {
if ((parseInt(what.style.height)-deduct) > 50) {
newHeight=parseInt(what.style.height)-deduct;
what.style.height=newHeight+"px";
} else { newHeight=50; what.style.height="50px"; }
}

</script>';
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Edit Knowledge', 'HEAD' => $js, 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BUTTON_TEXT' => 'Update Knowledge'));
# build category select box
$select_box = '&nbsp;<select name="category_id">';
$data = $base_instance->get_data("SELECT * FROM {$base_instance->entity['KNOWLEDGE']['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> or <b>New Category:</b> <input type="text" name="new_category" value="">';
#
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'knowledge_id', 'VALUE' => "{$knowledge_id}"));
Esempio n. 29
0
    $cat_title = 'New Category:';
    $select_category = '&nbsp;<input type="text" name="new_category" value="' . $new_category . '">';
} else {
    $cat_title = 'Category:';
    $select_category = '&nbsp;<select name="category_id">';
    for ($index = 1; $index <= sizeof($data); $index++) {
        $category_title = $data[$index]->title;
        $ID = $data[$index]->ID;
        if ($ID == $category_id) {
            $select_category .= "<option selected value={$ID}>{$category_title}";
        } else {
            $select_category .= "<option value={$ID}>{$category_title}";
        }
    }
    $select_category .= '</select> or <b>New Category:</b> <input type="text" name="new_category" value="' . $new_category . '" size="12">';
}
#
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'Add Contact', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BODY' => 'onLoad="javascript:document.form1.firstname.focus()"', 'BUTTON_TEXT' => 'Save Contact'));
$html_instance->add_form_field(array('TYPE' => 'label', 'TEXT1' => "{$cat_title}", 'TEXT2' => $select_category, 'SECTIONS' => 2));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'firstname', 'VALUE' => $firstname, 'SIZE' => 45, 'TEXT' => 'First Name'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'lastname', 'VALUE' => $lastname, 'SIZE' => 45, 'TEXT' => 'Last Name'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'company', 'VALUE' => $company, 'SIZE' => 45, 'TEXT' => 'Company'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'email', 'VALUE' => $email, 'SIZE' => 45, 'TEXT' => 'Email'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'telephone', 'VALUE' => $telephone, 'SIZE' => 45, 'TEXT' => 'Telephone'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'fax', 'VALUE' => $fax, 'SIZE' => 45, 'TEXT' => 'Fax'));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'mobile', 'VALUE' => $mobile, 'SIZE' => 45, 'TEXT' => 'Mobile'));
$html_instance->add_form_field(array('TYPE' => 'textarea', 'NAME' => 'address', 'VALUE' => $address, 'COLS' => 60, 'ROWS' => 3, 'TEXT' => 'Address', 'SECTIONS' => 2));
$html_instance->add_form_field(array('TYPE' => 'textarea', 'NAME' => 'notes', 'VALUE' => $notes, 'COLS' => 60, 'ROWS' => 6, 'TEXT' => 'Notes', 'SECTIONS' => 2));
$html_instance->add_form_field(array('TYPE' => 'text', 'NAME' => 'url', 'VALUE' => $url, 'SIZE' => 45, 'TEXT' => 'Website'));
$html_instance->add_form_field(array('TYPE' => 'radio', 'NAME' => 'public', 'FIELD_ARRAY' => 'public_array', 'VALUE' => $public, 'TEXT' => 'Contact is'));
$html_instance->process();
            $error .= '<li> Title cannot be left blank';
        }
    }
    if ($text) {
        $text = trim($text);
        if (strlen($text) > 65535) {
            $error .= '<li> Text is too long (Max. 65535 Characters)';
        }
    } else {
        $error .= '<li> Message cannot be left blank';
    }
    if (!$error) {
        $datetime = $_POST['datetime'];
        $base_instance->query('INSERT INTO ' . $base_instance->entity['FORUM']['MAIN'] . ' (datetime,updated,text,title,followup,user) VALUES ("' . sql_safe($datetime) . '","' . sql_safe($datetime) . '","' . sql_safe($text) . '","' . sql_safe($title) . '",' . $followup . ',' . $userid . ')');
        if (_FORUM_NOTIFY == 1 && $userid != _ADMIN_USERID) {
            $msg = "New Forum Message:\n\n" . $title . "\n\n" . $text;
            $base_instance->send_email_from_admin('New Forum Message Notification', $msg, _ADMIN_EMAIL);
        }
        header('Location: show-forum.php');
        exit;
    } else {
        $html_instance->error_message = $error;
        $text = stripslashes($text);
        $title = stripslashes($title);
    }
}
$html_instance->add_parameter(array('ACTION' => 'show_form', 'HEADER' => 'New Forum Message', 'FORM_ACTION' => $_SERVER['PHP_SELF'], 'BODY' => 'onLoad="javascript:document.form1.title.focus()"', 'BUTTON_TEXT' => 'Post new Message'));
$html_instance->add_form_field(array('TYPE' => 'hidden', 'NAME' => 'followup', 'VALUE' => "{$followup}"));
$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' => 90, 'ROWS' => 11));
$html_instance->process();