本文整理匯總了PHP中DiscountAbsolute::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP DiscountAbsolute::delete方法的具體用法?PHP DiscountAbsolute::delete怎麽用?PHP DiscountAbsolute::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DiscountAbsolute
的用法示例。
在下文中一共展示了DiscountAbsolute::delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DiscountAbsolute
} else {
$error++;
$mesg = '<div class="error">' . $soc->error . '</div>';
}
}
} else {
$mesg = '<div class="error">' . $langs->trans("ErrorFieldFormat", $langs->trans("NewGlobalDiscount")) . '</div>';
}
}
if (GETPOST("action") == 'confirm_remove' && GETPOST("confirm") == 'yes') {
//if ($user->rights->societe->creer)
//if ($user->rights->facture->creer)
$db->begin();
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(GETPOST("remid"));
$result = $discount->delete($user);
if ($result > 0) {
$db->commit();
header("Location: " . $_SERVER["PHP_SELF"] . '?id=' . GETPOST('id', 'int'));
// To avoid pb whith back
exit;
} else {
$mesg = '<div class="error">' . $discount->error . '</div>';
$db->rollback();
}
}
/*
* View
*/
$form = new Form($db);
$facturestatic = new Facture($db);
示例2: testDiscountDelete
/**
* testDiscountDelete
*
* @param int $id Id of discount
* @return int
*
* @depends testDiscountFetch
* The depends says test is run only if previous is ok
*/
public function testDiscountDelete($id)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$localobject=new DiscountAbsolute($this->savdb);
$result=$localobject->fetch($id);
$result=$localobject->delete($user);
print __METHOD__." id=".$id." result=".$result."\n";
$this->assertLessThan($result, 0);
return $result;
}