Example #1
0
function windex()
{
    if (session_id() == "") {
        session_start();
    }
    logger($script_path . " index start:");
    validate_access_webnotes();
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $watch_demo = $config_params['watch_demo'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $header = header_html();
    //
    $footer = $config_params['footer'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $css = $config_params['css'];
    $google_analytics = $config_params['google_analytics'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $cookie_name = $config_params['cookie_name'];
    $ep4 = $config_params['ep4'];
    $docroot = $_SERVER['DOCUMENT_ROOT'];
    //    if (isset($_REQUEST['weditor'])) {
    //        $user = '******';
    //        $note = $_REQUEST['weditor'];
    //        $tag = $_REQUEST['tag'];
    //        $action = $_REQUEST['action'];
    //        $wid = $_REQUEST['wid'];
    //        print_r($_REQUEST); exit;
    //        $model = new TwextraModel();
    //        $model->saveNote($user, $note, $tag, $action, $wid);
    //    }
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    print $doctype;
    print "<html {$html_attribute} >";
    $message = "\n<head>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"{$css}\" />\n<title>Twextra- When you NEED more than 140 characters</title>";
    echo $message;
    $scripts = '';
    $scripts .= "<script type='text/javascript' src='/scripts/jquery/jquery-1.2.6.js'></script>\n";
    echo $scripts;
    $message = "\n<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n</head>\n<body>\n<div class='wrapper'>\n<div class='page'>";
    echo $message;
    $banner = banner($screen_name, 'banner_index');
    //(user, banner_class)
    echo $banner;
    $message = "<div style='float:left;clear:both;margin-left:auto;margin-right:auto;width:800px;'>\n<div style='margin-left:100px;'><a href='{$hostname}/webnotes/wrouter.php?wroute=create'>Create a webnote</a></div>\n<div style='margin-left:100px;'><a href='{$hostname}/webnotes/wrouter.php?wroute=display'>Display webnotes</a></div>\n<div style='margin-left:100px;'><a href='{$hostname}/webnotes/wrouter.php?wroute=search'>Search webnotes</a></div>\n</div>";
    echo $message;
    echo $footer;
    $message = "\n</div>\n</div>\n</body>\n</html>";
    echo $message;
}
Example #2
0
function search_display()
{
    if (session_id() == "") {
        session_start();
    }
    logger($script_path . " index start:");
    validate_access_webnotes();
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $watch_demo = $config_params['watch_demo'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $header = header_html();
    //
    $footer = $config_params['footer'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $css = $config_params['css'];
    $google_analytics = $config_params['google_analytics'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $cookie_name = $config_params['cookie_name'];
    $ep4 = $config_params['ep4'];
    $docroot = $_SERVER['DOCUMENT_ROOT'];
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    print $doctype;
    print "<html {$html_attribute} >";
    $message = "\n\n<head>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"{$css}\" />\n\n<title>Twextra- When you NEED more than 140 characters</title>";
    echo $message;
    $scripts = '';
    $scripts .= "<script type='text/javascript' src='/scripts/jquery/jquery-1.2.6.js'></script>\n";
    echo $scripts;
    $message = "\n\n<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n\n</head>\n\n<body>\n\n<div class='wrapper'>\n\n<div class='page'>";
    echo $message;
    $banner = banner($screen_name, 'banner_index');
    //(user, banner_class)
    echo $banner;
    $message = "<div style='float:left;clear:both;margin-left:auto;margin-right:auto;width:800px;'><form method='post' \n\naction='/webnotes/wrouter.php' accept-charset=\"utf-8\" >\n\n\t<input type='hidden' name='wroute' id='wroute' value='searchdisplay'> </input>\n\n\n\n\t<input id='tag' name='tag' style='width: 768px; border:solid black 1px;'></input> \n\n<div><input type='submit' name='save' id='save' value='Search' class='button'></input></div>\n\n\n\n</form></div>";
    echo $message;
    echo $footer;
    $message = "\n\n</div>\n\n</div>\n\n</body>\n\n</html>";
    echo $message;
}
Example #3
0
function notes_display()
{
    if (session_id() == "") {
        session_start();
    }
    logger($script_path . " index start:");
    validate_access_webnotes();
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $watch_demo = $config_params['watch_demo'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $header = header_html();
    //
    $footer = $config_params['footer'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $css = $config_params['css'];
    $google_analytics = $config_params['google_analytics'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $cookie_name = $config_params['cookie_name'];
    $ep4 = $config_params['ep4'];
    $docroot = $_SERVER['DOCUMENT_ROOT'];
    $user = $_SESSION['user'];
    //??
    $user = '******';
    if ($_REQUEST['action'] == 'searchdisplay') {
        $tag = $_REQUEST['tag'];
        $model = new TwextraModel();
        $notes_all_array = $model->searchNote($user, $tag);
    } else {
        $model = new TwextraModel();
        $notes_all_array = $model->getNotesAll($user);
    }
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    print $doctype;
    print "<html {$html_attribute} >";
    $message = "\n\n<head>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"{$css}\" />\n\n<title>Twextra- When you NEED more than 140 characters</title>";
    echo $message;
    $scripts = '';
    $scripts .= "<script type='text/javascript' src='/scripts/jquery/jquery-1.2.6.js'></script>\n";
    echo $scripts;
    $message = "\n\n<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n\n</head>\n\n<body>\n\n<div class='wrapper'>\n\n<div class='page'>";
    echo $message;
    $banner = banner($screen_name, 'banner_index');
    //(user, banner_class)
    echo $banner;
    $message = "<div style='clear:both;margin-left:auto;margin-right:auto;width:800px;'>\n\nYour webnotes are displayed below:";
    $message .= "<table class='w_display_table' >";
    $message .= "<tr class='w_display_tr' >\n\n<th class='w_display_th'>Note</th>\n\n<th class='w_display_th'>Tags</th>\n\n<th class='w_display_th'>Updated</th>\n\n<th class='w_display_th'>Actions</th></tr>";
    foreach ($notes_all_array as $entry) {
        $message .= "<tr class='w_display_tr' >\n\n    <td class='w_display_td'>{$entry['note']}</td>\n\n    <td class='w_display_td' >{$entry['tag']}</td>\n\n    <td class='w_display_td'>{$entry['created']}</td>\n\n    <td class='w_display_td'><a href={$hostname}/webnotes/wrouter.php?wid={$entry['wid']}&wroute=edit >Edit</a>\n\n        <span id='delete' style='color:blue;' onclick=_edit('{$hostname}',{$entry['wid']})>Delete</span>\n\n        <a href={$hostname}/webnotes/wrouter.php?wid={$entry['wid']}&wroute=share>Share</a>\n\n    </td></tr>";
    }
    $message .= "</table>";
    $message .= "</div>";
    echo $message;
    echo $footer;
    $message = "\n\n</div>\n\n</div>\n\n</body>\n\n</html>";
    echo $message;
}
Example #4
0
function create_display()
{
    if (session_id() == "") {
        session_start();
    }
    logger($script_path . " index start:");
    validate_access_webnotes();
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $watch_demo = $config_params['watch_demo'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $header = header_html();
    //
    $footer = $config_params['footer'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
    $css = $config_params['css'];
    $google_analytics = $config_params['google_analytics'];
    $godaddy_analytics = $config_params['godaddy_analytics'];
    $cookie_name = $config_params['cookie_name'];
    $ep4 = $config_params['ep4'];
    $screen_name = 'raj4126';
    $docroot = $_SERVER['DOCUMENT_ROOT'];
    $note = '';
    $tag = '';
    $wid = -1;
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') {
        $wid = $_REQUEST['wid'];
        $action = 'editsave';
        $model = new TwextraModel();
        $note_array = $model->getNote($wid);
        $note = $note_array['note'];
        $tag = $note_array['tag'];
    } else {
        $action = 'index';
        $wid = -1;
    }
    //echo 'action: ', $action; exit;
    //echo "user:note:tag:action:wid::<br>$user:$note:$tag:$action:$wid"; exit;
    //echo 'test2'; exit;
    header("Pragma: no-cache");
    header("cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    print $doctype;
    print "<html {$html_attribute} >";
    $message = "\n\n<head>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"{$css}\" />\n\n<title>Twextra- When you NEED more than 140 characters</title>";
    echo $message;
    $scripts = '';
    $scripts .= "<script type='text/javascript' src='/scripts/jquery/jquery-1.2.6.js'></script>\n";
    echo $scripts;
    $message = "\n\n<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n\n</head>\n\n<body>\n\n<div class='wrapper'>\n\n<div class='page'>";
    echo $message;
    $banner = banner($screen_name, 'banner_index');
    //(user, banner_class)
    echo $banner;
    $message = "<div style='clear:both;margin-left:auto;margin-right:auto;width:800px;'>\n\n<form method='post' action='/webnotes/wrouter.php' accept-charset=\"utf-8\" >\n\n<input type='hidden' name='wroute' id='wroute' value='{$action}'> </input>\n\n<input type='hidden' name='wid' id='wid' value='{$wid}'> </input>\n\n\n\nWeb note: \n\n<textarea id='weditor' name='weditor' rows='15' cols='100' style='width: 768px; border:solid black 1px;'>\n\n{$note}\n\n</textarea> \n\nTags: <input type='text' name='tag' id='tag' size='100' style='border:solid black 1px;' value='{$tag}'></input>\n\n<div>\n\n<input type='submit' name='save' id='save' value='Post Message' class='button'></input>\n\n</div>\n\n\n\n</form>\n\n</div>";
    echo $message;
    echo $footer;
    $message = "\n\n</div>\n\n</div>\n\n</body>\n\n</html>";
    echo $message;
}
Example #5
0
 function indexc($data)
 {
     validate_access_webnotes();
     if (isset($data['weditor'])) {
         $user = '******';
         $note = $data['weditor'];
         $tag = $data['tag'];
         $action = $data['action'];
         $wid = $data['wid'];
         $model = new TwextraModel();
         $model->saveNote($user, $note, $tag, $action, $wid);
     }
     header("Location:{$hostname}/webnotes/index.php");
     exit;
 }