本文整理汇总了PHP中Contrat::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Contrat::create方法的具体用法?PHP Contrat::create怎么用?PHP Contrat::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contrat
的用法示例。
在下文中一共展示了Contrat::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testContratCreate
/**
* testContratCreate
*
* @return int
*/
public function testContratCreate()
{
global $conf, $user, $langs, $db;
$conf = $this->savconf;
$user = $this->savuser;
$langs = $this->savlangs;
$db = $this->savdb;
$localobject = new Contrat($this->savdb);
$localobject->initAsSpecimen();
$result = $localobject->create($user);
print __METHOD__ . " result=" . $result . "\n";
$this->assertLessThan($result, 0);
return $result;
}
示例2: trim
$object->fk_project = trim($_POST["projectid"]);
$object->remise_percent = trim($_POST["remise_percent"]);
$object->ref = trim($_POST["ref"]);
// Check
if (empty($datecontrat))
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")).'</div>';
$_GET["socid"]=$_POST["socid"];
$action='create';
}
if (! $error)
{
$result = $object->create($user,$langs,$conf);
if ($result > 0)
{
Header("Location: fiche.php?id=".$object->id);
exit;
}
else {
$mesg='<div class="error">'.$object->error.'</div>';
}
$_GET["socid"]=$_POST["socid"];
$action='create';
}
}
if ($action == 'classin')
{
示例3: Contrat
if (GETPOST("action") == 'add') {
$datect = @dol_mktime($_POST["datecthour"], $_POST["datectmin"], $_POST["datectsec"], $_POST["datectmonth"], $_POST["datectday"], $_POST["datectyear"]);
$contrat = new Contrat($db);
$contrat->local_id = GETPOST("local_id");
$contrat->locataire_id = GETPOST("locataire_id");
$contrat->date_entree = $datect;
$contrat->montant_tot = GETPOST("montant_tot");
$contrat->loy = GETPOST("loy");
$contrat->charges = GETPOST("charges");
$contrat->tva = GETPOST("tva");
$contrat->periode = GETPOST("periode");
$contrat->depot = GETPOST("depot");
$contrat->commentaire = GETPOST("commentaire");
$contrat->proprietaire_id = GETPOST("proprietaire_id");
$e_contrat = $contrat;
$res = $contrat->create($user);
if ($res == 0) {
} else {
if ($res == -3) {
$_error = 1;
$action = "create";
}
if ($res == -4) {
$_error = 2;
$action = "create";
}
}
Header("Location: " . DOL_URL_ROOT . "/immobilier/contrat.php");
} elseif (GETPOST("action") == 'maj') {
$error = 0;
$datect = dol_mktime(0, 0, 0, GETPOST('datectmonth', 'int'), GETPOST('datectday', 'int'), GETPOST('datectyear', 'int'));
示例4: setEventMessage
// For compatibility
if ($element == 'order') {
$element = $subelement = 'commande';
}
if ($element == 'propal') {
$element = 'comm/propal';
$subelement = 'propal';
}
$object->origin = $_POST['origin'];
$object->origin_id = $_POST['originid'];
// Possibility to add external linked objects with hooks
$object->linked_objects[$object->origin] = $object->origin_id;
if (is_array($_POST['other_linked_objects']) && !empty($_POST['other_linked_objects'])) {
$object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']);
}
$id = $object->create($user);
if ($id < 0) {
setEventMessage($object->error, 'errors');
}
if ($id > 0) {
dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
$classname = ucfirst($subelement);
$srcobject = new $classname($db);
dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
$result = $srcobject->fetch($object->origin_id);
if ($result > 0) {
$srcobject->fetch_thirdparty();
$lines = $srcobject->lines;
if (empty($lines) && method_exists($srcobject, 'fetch_lines')) {
$srcobject->fetch_lines();
$lines = $srcobject->lines;