forked from Wavyzz/dolibarr
91 lines
2.2 KiB
PHP
91 lines
2.2 KiB
PHP
<?php
|
|
/* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
* Copyright (C) ---Put here your own copyright and developer email---
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
/**
|
|
\file dev/skeletons/skeleton_page.php
|
|
\ingroup mymodule othermodule1 othermodule2
|
|
\brief This file is an example of a php page
|
|
\version $Id$
|
|
\author Put author name here
|
|
\remarks Put here some comments
|
|
*/
|
|
require("./pre.inc.php");
|
|
require_once(DOL_DOCUMENT_ROOT."/../dev/skeletons/skeleton_class.class.php");
|
|
|
|
// Load traductions files requiredby by page
|
|
$langs->load("companies");
|
|
$langs->load("other");
|
|
|
|
// Get parameters
|
|
$myparam = isset($_GET["myparam"])?$_GET["myparam"]:'';
|
|
|
|
// Protection if external user
|
|
if ($user->societe_id > 0)
|
|
{
|
|
//accessforbidden();
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************
|
|
* ACTIONS
|
|
*
|
|
* Put here all code to do according to value of "action" parameter
|
|
********************************************************************/
|
|
|
|
if ($_REQUEST["action"] == 'add')
|
|
{
|
|
$myobject=new Skeleton_class($db);
|
|
$myobject->prop1=$_POST["field1"];
|
|
$myobject->prop2=$_POST["field2"];
|
|
$result=$myobject->create($user);
|
|
if ($result > 0)
|
|
{
|
|
// Creation OK
|
|
}
|
|
{
|
|
// Creation KO
|
|
$mesg=$myobject->error;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************
|
|
* PAGE
|
|
*
|
|
* Put here all code to build page
|
|
****************************************************/
|
|
|
|
llxHeader('MyPageName');
|
|
|
|
$form=new Form($db);
|
|
|
|
|
|
// Put here content of your page
|
|
// ...
|
|
|
|
|
|
// End of page
|
|
$db->close();
|
|
llxFooter('$Date$ - $Revision$');
|
|
?>
|