File: com.php

Recommend this page to a friend!
  Classes of Andras Toth   Simple JavaScript Windows   com.php   Download  
File: com.php
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Simple JavaScript Windows
Display draggable Windows on the browser
Author: By
Last change: Update of com.php
Date: 2 years ago
Size: 884 bytes
 

Contents

Class file image Download
<?php $order = $_REQUEST['order']; $param = $_REQUEST['param']; if($order == 'sql'){ require_once('mysql_db.php'); $db = Database::getInstance(); $db->connect(); $css = '<style type = "text/css">#tbl{width: 100%;background: beige;border-collapse: separate;border-spacing: 2px;}'; $css.= '#tbl th{padding:3px;background-color:steelblue;font-weight:bold;white-space: nowrap;}#tbl td{white-space: nowrap;background-color:white}</style>'; $sql = "SELECT * FROM yourtable WHERE id > (SELECT MAX(id) FROM counter) - $param ORDER BY date ASC"; $table = $db-> getHTMLtable($sql, 'tbl'); echo $css.$table; $db->disconnect(); }else if($order == 'note_write' && $param){ $name = 'note.txt'; $fh = fopen($name, 'w') or die("can't open file"); fwrite($fh, $param); fclose($fh); }else if($order == 'note_read'){ $name = 'note.txt'; $fh = file_get_contents($name); echo $fh; } ?>