Menu

[r28]: / src / screens / delete.cs  Maximize  Restore  History

Download this file

45 lines (42 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#function postdelete_php project table_id
#query select name as application from `project` where project=?project?
#query select `sql` as tablesql, `where`, name as tablename, id_field from `table` where `table`=?table_id?
#print page_header 'delete' project table_id
#print '<?php\n'
#record select Code from actions where actions.`table`=?table_id? and Action='edit' and Part='allow'
#print '$test=true;\n'
#print Code ^ '\n'
#print 'if (!$test) { die(\'Onvoldoende rechten\'); }\n'
#end
# delete also related records
#query select `sql` as tablesql, `where`, name as tablename, id_field from `table` where `table`=?table_id?
#set tests=''
#record select name, field.sql as fieldsql, SessionVar from `field` where field.`table`=?table_id? and SessionVar<>'' and field.sql<>'' order by `order`
#if tests=''
#set tests=' WHERE '
#else
#set tests=tests ^ ' AND '
#end
#set tests=tests ^ '`' ^ fieldsql ^ '`=\'$' ^ SessionVar ^ '\''
#end
#print '$sql->Delete(\"delete from `' ^ tablesql ^ '`' ^ tests ^ '\");\n'
#print '$affected_rows = $sql->a_rows;\n'
#record select Code from actions where actions.`table`=?table_id? and Action='remove' and Part='onchange'
#print 'if ($affected_rows>0) {\n' ^ Code ^ '\n}\n'
#end
#print 'echo \"<P><FONT FACE=\\\"Verdana, sans-serif\\\"><FONT SIZE=1 STYLE=\\\"font-size: 8pt\\\">\";\n'
#print 'echo \"Er is/zijn $affected_rows records verwijderd<BR>\";\n'
#print 'echo \"</P>\";\n'
#print 'echo \"<script>window.opener.location.reload(true)</script>\";\n'
#print 'echo \"<script>window.close(self)</script>\";\n'
#print '?>\n'
#set screen='0'
#query select `screen` from `part` where part.`table`=?table_id? and type='record'
#if screen<>'0'
#query select `screen` as otherscreen from `part` where link=?screen? and type='list'
#query select `name` from `screen` where screen=?otherscreen?
#print '<INPUT TYPE=BUTTON VALUE=\"Close\" onClick=\"window.opener.location=' ^ name ^ ';self.close()\">\n'
#else
#print '<INPUT TYPE=BUTTON VALUE=\"Close\" onClick=\"window.opener.location.reload(true);self.close()\">\n'
#end
#end
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.