~include('../site/admin.header.tmpl','Gestion modèle ~getpost('id')')
~if(~getpost('id')!='',
~list(~get('database'),
"SELECT id FROM topics_sections WHERE id='~addslashes(~getpost('id'))'",
'LF',~set('id',~fld('id'))
)
)
~if(~get('id')!='',
'Modification du modèle ~getpost('model')',
'Ajout du modèle ~getpost('model')'
) :
~set('ok',1)
~list(~get('database'),
"SELECT id FROM topics_sections
WHERE longname='~addslashes(~getpost('model'))'
~if(~get('id'), "AND id!='~get('id')'")
",
'LF','~set('ok',0)Le nom existe déjà'
)
~if(~get('ok')==1,
'~if(~get('id')=='',
~list(~get('database'),"INSERT INTO topics_sections(longname,template,state)
VALUES(
'~addslashes(~getpost('model'))',
'~addslashes(~getpost('template'))',
'~if(~getpost('state')!='','1','0')'
)")
,
~list(~get('database'),"UPDATE topics_sections SET
longname='~addslashes(~getpost('model'))',
template='~addslashes(~getpost('template'))',
state='~if(~getpost('state')!='','1','0')'
WHERE
id='~get('id')'
")
)
~if(~get('id')=='',~list(~get('database'),"SELECT last_insert_id() AS last FROM topics_sections LIMIT 1",'LF',~set('id',~fld('last'))))
OK !
Retour à l\'édition.
')
~include("../site/admin.footer.tmpl")