.tutorial

git-svn-id: svn://ultimatepp.org/upp/trunk@15660 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2021-01-08 14:33:02 +00:00
parent 7d0a076136
commit 496b646b2f
51 changed files with 0 additions and 1132 deletions

View file

@ -1,13 +0,0 @@
description "SKYLARK handlers and path patterns\377";
uses
Core,
Skylark;
file
favicon.png,
main.cpp;
mainconfig
"" = "MT";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 448 B

View file

@ -1,51 +0,0 @@
#include <Skylark/Skylark.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http << "<!DOCTYPE html><html><body>Hello world!</body></html>";
}
SKYLARK(Param, "*/param")
{
http << "<!DOCTYPE html><html><body>Parameter: " << http[0] << "</html></body>";
}
SKYLARK(Params, "params/**")
{
http << "<!DOCTYPE html><html><body>Parameters: ";
for(int i = 0; i < http.GetParamCount(); i++)
http << http[i] << " ";
http << "</html></body>";
}
SKYLARK(CatchAll, "**")
{
http.Redirect(HomePage);
}
SKYLARK(Favicon, "/favicon.ico")
{
http.ContentType("image/png") << LoadFile(GetDataFile("favicon.png"));
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}

View file

@ -1,13 +0,0 @@
description "Witz templates\377";
uses
Core,
Skylark;
file
index.witz,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html>
<body>
MyValue: $MyValue<br>
MyRawValue: $MyRawValue<br>
MyRawValue2: $raw(MyRawValue2)<br>
<br>MyArray:<br>
$for(i in MyArray)
$i._index. $i<br>
$endfor
<br>MyMap:<br>
$for(i in MyMap)
$i._index. $i._key: $i<br>
$endfor
</body>
</html>

View file

@ -1,40 +0,0 @@
#include <Skylark/Skylark.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
ValueArray va;
va.Add(1);
va.Add("Hello");
ValueMap m;
m.Add("key1", "first value");
m.Add("key2", "second value");
http("MyValue", "some value")
("MyRawValue", Raw("<b>raw <u>html</u></b>"))
("MyRawValue2", "<b>another raw <u>html</u></b>")
("MyArray", va)
("MyMap", m)
.RenderResult("Skylark02/index");
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}

View file

@ -1,15 +0,0 @@
description "Witz links to handlers\377";
uses
Core,
Skylark;
file
index.witz,
page2.witz,
param.witz,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,9 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<a href=$Page2>Link to page2</a><br>
$for(i in ["param_test", 123, "param_test3"])
<a href=$Param(i)>Param test: $i</a><br>
$endfor
</body>
</html>

View file

@ -1,38 +0,0 @@
#include <Skylark/Skylark.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http.RenderResult("Skylark03/index");
}
SKYLARK(Page2, "page2")
{
http.RenderResult("Skylark03/page2");
}
SKYLARK(Param, "paramtest/*")
{
http("PARAM", http[0]).RenderResult("Skylark03/param");
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}

View file

@ -1,6 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<a href=$HomePage()>Back to index</a><br>
</body>
</html>

View file

@ -1,7 +0,0 @@
<!DOCTYPE html>
<html>
<body>
Param: $PARAM<br>
<a href=$HomePage()>Back to index</a><br>
</body>
</html>

View file

@ -1,16 +0,0 @@
description "Combining Witz templates using #define and #include\377";
uses
Core,
Skylark,
plugin/jpg,
plugin/png;
file
base.witz,
index.witz,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,9 +0,0 @@
<!DOCTYPE html>
<html>
<title>#TITLE</title>
<body>
#BODY
</body>
</html>
#define TITLE Generic title

View file

@ -1,6 +0,0 @@
#include Skylark04/base
#define TITLE MyApp title
#define BODY
This is MyApp body html!

View file

@ -1,28 +0,0 @@
#include <Skylark/Skylark.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http.RenderResult("Skylark04/index");
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}

View file

@ -1,14 +0,0 @@
description "FORM GET\377";
uses
Core,
Skylark;
file
index.witz,
submit.witz,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<form action=$Submit method="get" accept-charset="utf-8" enctype="multipart/form-data">
<P>
<INPUT type="text" name="id">
<INPUT type="submit" value="Submit">
</P>
</form>
</body>
</html>

View file

@ -1,34 +0,0 @@
#include <Skylark/Skylark.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http.RenderResult("Skylark05/index");
}
SKYLARK(Submit, "submit")
{
http("RESULT", ToUpper((String)http["id"]))
.RenderResult("Skylark05/submit");
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}

View file

@ -1,7 +0,0 @@
<!DOCTYPE html>
<html>
<body>
Result: $RESULT<br>
<a href=$HomePage>Back to homepage</a>
</body>
</html>

View file

@ -1,14 +0,0 @@
description "FORM POST\377";
uses
Core,
Skylark;
file
index.witz,
submit.witz,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<form action=$Submit method="post" accept-charset="utf-8" enctype="multipart/form-data">
<P>
$post_identity()
<INPUT type="text" name="id">
<INPUT type="submit" value="Submit">
</P>
</form>
</body>
</html>

View file

@ -1,34 +0,0 @@
#include <Skylark/Skylark.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http.RenderResult("Skylark06/index");
}
SKYLARK(Submit, "submit:POST")
{
http("RESULT", ToUpper((String)http["id"]))
.RenderResult("Skylark06/submit");
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}

View file

@ -1,7 +0,0 @@
<!DOCTYPE html>
<html>
<body>
Result: $RESULT<br>
<a href=$HomePage>Back to homepage</a>
</body>
</html>

View file

@ -1,13 +0,0 @@
description "Session\377";
uses
Core,
Skylark;
file
index.witz,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<form action=$Submit method="post" accept-charset="utf-8" enctype="multipart/form-data">
<P>
$post_identity()
<INPUT type="text" name="id">
<INPUT type="submit" value="Add to list">
</P>
</form>
List ($count(.LIST)):<br>
$for(i in .LIST)
"$i"
$endfor
</body>
</html>

View file

@ -1,39 +0,0 @@
#include <Skylark/Skylark.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http.RenderResult("Skylark07/index");
}
SKYLARK(Submit, "submit:POST")
{
Value h = http[".LIST"];
ValueArray va;
if(IsValueArray(h))
va = h;
va.Add(http["id"]);
http.SessionSet(".LIST", va);
http.Redirect(HomePage);
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}

View file

@ -1,13 +0,0 @@
description "Ajax\377";
uses
Core,
Skylark;
file
index.witz,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html>
<script type="text/javascript" src="$static/Skylark/skylark.js"></script>
<body>
$js_identity()
<div id="numbers">
<INPUT type="text" id="number1">
<INPUT type="text" id="number2">
<INPUT type="button" value="Add" onclick='UxPost($Add, "numbers")'><br>
</div>
<div id="result"/>
</body>
</html>

View file

@ -1,35 +0,0 @@
#include <Skylark/Skylark.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http.RenderResult("Skylark08/index");
}
SKYLARK(Add, "add:POST")
{
String r = AsString(Nvl(http.Int("number1")) + Nvl(http.Int("number2")));
http.Ux("result", "The result is: " + r)
.UxSet("number1", r);
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}

View file

@ -1,15 +0,0 @@
description "Connecting SQL\377";
uses
Core,
Skylark,
plugin/sqlite3;
file
index.witz,
myapp.sch,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<table border="1">
<tr>
<th>No.</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
$for(i in PERSON)
<tr>
<td>$i._index.</td>
<td>$i.NAME</td>
<td>$i.LASTNAME</td>
</tr>
$/
</table>
</body>
</html>

View file

@ -1,95 +0,0 @@
#include <Skylark/Skylark.h>
#include <plugin/sqlite3/Sqlite3.h>
using namespace Upp;
#define MODEL <Skylark09/myapp.sch>
#define SCHEMADIALECT <plugin/sqlite3/Sqlite3Schema.h>
#include <Sql/sch_header.h>
#include <Sql/sch_schema.h>
#include <Sql/sch_source.h>
SKYLARK(HomePage, "")
{
Sql sql;
sql * Select(ID, NAME, LASTNAME)
.From(PERSON)
.OrderBy(LASTNAME, NAME);
ValueArray person;
ValueMap vm;
while(sql.Fetch(vm))
person.Add(vm);
http("PERSON", person)
.RenderResult("Skylark09/index");
}
struct MyApp : SkylarkApp {
virtual void WorkThread();
MyApp() {
root = "myapp";
threads = 1; // Sqlite3 does not like threads...
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
void InitModel()
{
#ifdef _DEBUG
SqlSchema sch(SQLITE3);
All_Tables(sch);
SqlPerformScript(sch.Upgrade());
SqlPerformScript(sch.Attributes());
sch.SaveNormal();
#endif
}
void OpenSQL(Sqlite3Session& sqlite3)
{
if(!sqlite3.Open(ConfigFile("db"))) {
LOG("Can't create or open database file\n");
Exit(1);
}
#ifdef _DEBUG
sqlite3.LogErrors();
sqlite3.SetTrace();
#endif
SQL = sqlite3;
}
void MyApp::WorkThread()
{
Sqlite3Session sqlite3;
OpenSQL(sqlite3);
RunThread();
}
void InitDB()
{
Sqlite3Session sqlsession;
OpenSQL(sqlsession);
SqlSchema sch(SQLITE3);
All_Tables(sch);
SqlPerformScript(sch.Upgrade());
SqlPerformScript(sch.Attributes());
SQL * Insert(PERSON)(NAME,"Joe")(LASTNAME,"Smith");
SQL * Insert(PERSON)(NAME,"Mike")(LASTNAME,"Carpenter");
SQL * Insert(PERSON)(NAME,"Jon")(LASTNAME,"Goober");
}
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
DeleteFile(ConfigFile("db")); // for this example, always create a new DB
InitDB();
MyApp().Run();
}

View file

@ -1,5 +0,0 @@
TABLE_(PERSON)
INT_ (ID) PRIMARY_KEY AUTO_INCREMENT
STRING_ (NAME, 200)
STRING_ (LASTNAME, 200)
END_TABLE

View file

@ -1,16 +0,0 @@
description "Advanced SQL\377";
uses
Core,
Skylark,
plugin/sqlite3;
file
index.witz,
dialog.witz,
myapp.sch,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<FORM action=$ACTION method="post" accept-charset="utf-8" enctype="multipart/form-data">
$post_identity()
<P>
First name: <INPUT type="text" name="name" value="$NAME"><BR>
Last name: <INPUT type="text" name="lastname" value="$LASTNAME"><BR>
<INPUT type="submit" value="Send" name="OK"/><BR>
</P>
</FORM>
</table>
</body>
</html>

View file

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<table border="1">
<tr>
<th>No.</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
$for(i in PERSON)
<tr>
<td>$(i._index + 1).</td>
<td>$i.NAME</td>
<td>$i.LASTNAME</td>
<td><a href=$Edit(i.ID)>Edit</a></td>
</tr>
$/
</table>
<a href=$New>Create new</a>
</body>
</html>

View file

@ -1,110 +0,0 @@
#include <Skylark/Skylark.h>
#include <plugin/sqlite3/Sqlite3.h>
using namespace Upp;
#define MODEL <Skylark09/myapp.sch>
#define SCHEMADIALECT <plugin/sqlite3/Sqlite3Schema.h>
#include <Sql/sch_header.h>
#include <Sql/sch_schema.h>
#include <Sql/sch_source.h>
SKYLARK(HomePage, "")
{
http("PERSON", Select(SqlAll()).From(PERSON).OrderBy(LASTNAME, NAME))
.RenderResult("Skylark10/index");
}
SKYLARK(SubmitNew, "create/submit:POST")
{
SQL * http.Insert(PERSON);
http.Redirect(HomePage);
}
SKYLARK(New, "create")
{
http("ACTION", SubmitNew)
.RenderResult("Skylark10/Dialog");
}
SKYLARK(SubmitEdit, "edit/submit/*:POST")
{
SQL * http.Update(PERSON).Where(ID == http.Int(0));
http.Redirect(HomePage);
}
SKYLARK(Edit, "edit/*")
{
int id = http.Int(0);
http
(Select(SqlAll()).From(PERSON).Where(ID == id))
("ID", id)
("ACTION", SubmitEdit, id)
.RenderResult("Skylark10/Dialog");
}
struct MyApp : SkylarkApp {
virtual void WorkThread();
MyApp() {
root = "myapp";
threads = 1; // Sqlite3 does not like threads...
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
void InitModel()
{
#ifdef _DEBUG
SqlSchema sch(SQLITE3);
All_Tables(sch);
SqlPerformScript(sch.Upgrade());
SqlPerformScript(sch.Attributes());
sch.SaveNormal();
#endif
}
void OpenSQL(Sqlite3Session& sqlite3)
{
if(!sqlite3.Open(ConfigFile("db"))) {
LOG("Can't create or open database file\n");
Exit(1);
}
#ifdef _DEBUG
sqlite3.LogErrors();
sqlite3.SetTrace();
#endif
SQL = sqlite3;
}
void MyApp::WorkThread()
{
Sqlite3Session sqlite3;
OpenSQL(sqlite3);
RunThread();
}
void InitDB()
{
Sqlite3Session sqlsession;
OpenSQL(sqlsession);
SqlSchema sch(SQLITE3);
All_Tables(sch);
SqlPerformScript(sch.Upgrade());
SqlPerformScript(sch.Attributes());
}
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
InitDB();
MyApp().Run();
}

View file

@ -1,5 +0,0 @@
TABLE_(PERSON)
INT_ (ID) PRIMARY_KEY AUTO_INCREMENT
STRING_ (NAME, 200)
STRING_ (LASTNAME, 200)
END_TABLE

View file

@ -1,16 +0,0 @@
description "Language support\377";
uses
Core,
Skylark,
plugin/sqlite3;
file
lang.witz,
index.witz,
index.cs-cz.witz,
main.cpp;
mainconfig
"" = "MT";

View file

@ -1,8 +0,0 @@
<!DOCTYPE html>
<html>
<body>
#include lang
Česká verze<br>
Hodnota proměnné: $VAR
</body>
</html>

View file

@ -1,8 +0,0 @@
<!DOCTYPE html>
<html>
<body>
#include lang
English version<br>
Variable value: $VAR
</body>
</html>

View file

@ -1,4 +0,0 @@
<a href=$SetLanguage("en-us")>EN</a>
<a href=$SetLanguage("cs-cz")>CZ</a>
<br>
Current language: $.language<br>

View file

@ -1,38 +0,0 @@
#include <Skylark/Skylark.h>
#include <plugin/sqlite3/Sqlite3.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http("VAR", t_("Aborted by user."))
.RenderResult("Skylark11/index");
}
SKYLARK(SetLanguage, "setlanguage/*")
{
int lang = LNGFromText(http[0]);
if(lang)
http.SetLanguage(lang);
http.Redirect(HomePage);
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
threads = 1; // Sqlite3 does not like threads...
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}

View file

@ -1,44 +0,0 @@
#include "Skylark12.h"
void CreateEditDelete::Create(Http& http)
{
http("ACTION", THISLINK(SubmitCreate))
.RenderResult(dialog);
}
void CreateEditDelete::SubmitCreate(Http& http)
{
SQL * http.Insert(table);
http.Redirect(back);
}
void CreateEditDelete::Edit(Http& http)
{
int id = http.Int(0);
http
(Select(columns).From(table).Where(key == id))
("ID", id)
("ACTION", THISLINK(SubmitEdit), id)
.RenderResult(dialog);
}
void CreateEditDelete::SubmitEdit(Http& http)
{
SQL * http.Update(table).Where(key == http.Int(0));
http.Redirect(back);
}
void CreateEditDelete::Delete(Http& http)
{
SQL * SqlDelete(table).Where(key == atoi(http[0]));
http.Redirect(back);
}
void CreateEditDelete::Use()
{
SKYLARK_METHOD(Create, "create");
SKYLARK_METHOD(SubmitCreate, "create_submit:POST");
SKYLARK_METHOD(Edit, "edit/*");
SKYLARK_METHOD(SubmitEdit, "submit_edit/*:POST");
SKYLARK_METHOD(Delete, "delete/*");
}

View file

@ -1,23 +0,0 @@
#include "Skylark12.h"
void HomePage(Http&);
SKYLARK_USE(CreateEditDelete, Person, "person")
{
Person.back = HomePage;
Person.table = PERSON;
Person.dialog = "Skylark12/dialog";
}
SKYLARK(HomePage, "")
{
http("PERSON", Select(ID, FIRSTNAME, LASTNAME, EMAIL).From(PERSON)
.OrderBy(LASTNAME, FIRSTNAME))
("CREATE", LINK(Person, Create))
.RenderResult("Skylark12/index");
}
SKYLARK(CatchAll, "**")
{
http.Redirect(HomePage);
}

View file

@ -1,59 +0,0 @@
#include "Skylark12.h"
#include <Sql/sch_schema.h>
#include <Sql/sch_source.h>
Skylark12::Skylark12()
{
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
threads = 1; // Sqlite3 does not work well with multiple threads
port = 8001;
}
void OpenSQL(Sqlite3Session& session)
{
if(!session.Open(ConfigFile("db.sqlite3"))) {
SKYLARKLOG("Can't create or open database file");
Exit(1);
}
#ifdef _DEBUG
session.LogErrors();
session.SetTrace();
#endif
SQL = session;
}
void InitModel()
{
#ifdef _DEBUG
Sqlite3Session session;
OpenSQL(session);
SqlSchema sch(SQLITE3);
All_Tables(sch);
SqlPerformScript(sch.Upgrade());
SqlPerformScript(sch.Attributes());
sch.SaveNormal();
#endif
}
void Skylark12::WorkThread()
{
Sqlite3Session session;
OpenSQL(session);
RunThread();
}
// Local server URL: 127.0.0.1:8001
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
InitModel();
Skylark12().Run();
}

View file

@ -1,6 +0,0 @@
TABLE_(PERSON)
INT_ (ID) PRIMARY_KEY AUTO_INCREMENT
STRING_ (FIRSTNAME, 200)
STRING_ (LASTNAME, 200)
STRING_ (EMAIL, 200)
END_TABLE

View file

@ -1,41 +0,0 @@
#ifndef _Skylark12_Skylark12_h
#define _Skylark12_Skylark12_h
#include <Skylark/Skylark.h>
#include <plugin/sqlite3/Sqlite3.h>
using namespace Upp;
#define MODEL <Skylark12/Model.sch>
#define SCHEMADIALECT <plugin/sqlite3/Sqlite3Schema.h>
#include <Sql/sch_header.h>
struct CreateEditDelete : SkylarkPack {
HandlerId back;
SqlId table;
SqlId key;
SqlSet columns;
String dialog;
void Create(Http& http);
void SubmitCreate(Http& http);
void Edit(Http& http);
void SubmitEdit(Http& http);
void Delete(Http& http);
typedef CreateEditDelete CLASSNAME;
void Use();
CreateEditDelete() { key = SqlId("ID"); columns = SqlSet(SqlAll()); }
};
class Skylark12 : public SkylarkApp {
public:
virtual void WorkThread();
typedef Skylark12 CLASSNAME;
Skylark12();
};
#endif

View file

@ -1,18 +0,0 @@
description "Skylark packs\377";
uses
Skylark,
plugin/sqlite3;
file
Skylark12.h,
Model.sch,
Ced.cpp,
Handlers.icpp,
index.witz,
dialog.witz,
Main.cpp;
mainconfig
"" = "MT";

View file

@ -1,12 +0,0 @@
#include Skylark/Base
#define BODY
<FORM action=$ACTION method="post" accept-charset="utf-8" enctype="multipart/form-data">
$post_identity()
<P>
First name: <INPUT type="text" name="firstname" value="$FIRSTNAME"><BR>
Last name: <INPUT type="text" name="lastname" value="$LASTNAME"><BR>
Email: <INPUT type="text" name="email" value="$EMAIL"><BR>
<INPUT type="submit" value="Send" name="OK"/><BR>
</P>
</FORM>

View file

@ -1,26 +0,0 @@
#include Skylark/Base
#define BODY
<table border="1" id="persons">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
</tr>
$for(i in PERSON)
<tr>
<td>$i.FIRSTNAME</td>
<td>$i.LASTNAME</td>
<td>$i.EMAIL</td>
<td>
<a href=$Person:Edit(i.ID)>Edit</a>
<a href=$Person:Delete(i.ID)>Delete</a>
</td>
</tr>
$/
</table>
<p/>
<a href=$Person:Create>Insert new person</a>
<a href=$CREATE>Insert new person using LINK</a>