本文整理匯總了PHP中Facture::exists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Facture::exists方法的具體用法?PHP Facture::exists怎麽用?PHP Facture::exists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Facture
的用法示例。
在下文中一共展示了Facture::exists方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Client
if (!isset($_GET['id_client']) or !isset($_GET['id_invoice'])) {
echo "Missing arguments";
exit;
}
if (!is_numeric($_GET['id_client']) or !is_numeric($_GET['id_invoice'])) {
echo "Wrong arguments";
exit;
}
$Client = new Client();
# check client and invoice
if (!$Client->exists($_GET['id_client'])) {
echo _("This client doesn't exist");
exit;
}
$Invoice = new Facture();
if ($Invoice->exists($_GET['id_invoice'])) {
$inv = $Invoice->getInfos($_GET['id_invoice']);
if ($inv->id_client != $_GET['id_client']) {
echo _("This invoice isn't yours!");
exit;
}
$Client = new Client($_GET['id_client']);
}
#site
$result = mysql_query("SELECT value FROM webfinance_pref WHERE type_pref='societe' AND owner=-1") or wf_mysqldie();
list($value) = mysql_fetch_array($result);
mysql_free_result($result);
$company = unserialize(base64_decode($value));
$site = "webfinance.dev.jexiste.org";
if (!empty($company->wf_url) and strlen($company->wf_url) > 3) {
$site = preg_replace('/^http:\\/\\//i', '', $company->wf_url);
示例2: header
}
/* else */
/* $_SESSION['message'] = _('Invoice updated'); */
if ($type_doc == "facture" || $type_doc == "devis" && $is_paye == "on") {
$Facture->updateTransaction($_POST['id_facture'], $type_prev);
/* $_SESSION['message'] .= "<br>"._('Transaction updated'); */
}
header("Location: edit_facture.php?id_facture=" . $_POST['id_facture']);
exit;
}
if ($action == "delete_facture") {
$id_client = "";
// delete_facture
// Suppression d'une facture
$Facture = new Facture();
if (is_numeric($_GET['id_facture']) and $Facture->exists($_GET['id_facture'])) {
$facture = $Facture->getInfos($_GET['id_facture']);
logmessage(_("Delete invoice") . " #{$facture->num_facture} for client:{$facture->id_client}", $facture->id_client);
$id_client = $facture->id_client;
mysql_query("DELETE FROM webfinance_invoices WHERE id_facture=" . $_GET['id_facture']) or wf_mysqldie();
$_SESSION['message'] = _('Invoice deleted');
//mysql_query("DELETE FROM webfinance_invoice_rows WHERE id_facture=".$_GET['id_facture']); <- ON DELETE CASCADE
mysql_query("DELETE FROM webfinance_transactions WHERE id_invoice=" . $_GET['id_facture'] . " AND type<>'real'") or wf_mysqldie();
$_SESSION['message'] .= "<br/>" . _('Transaction deleted');
}
header("Location: fiche_prospect.php?onglet=billing&tab=billing&id={$id_client}");
exit;
}
if ($action == "duplicate") {
extract($_GET);
$Invoice = new Facture();
示例3: Facture
(at your option) any later version.
Webfinance 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 Webfinance; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
include "../inc/main.php";
must_login();
$roles = 'manager,employee';
include "nav.php";
$Invoice = new Facture();
if (!isset($_GET['id']) or !is_numeric($_GET['id']) or !$Invoice->exists($_GET['id'])) {
echo "Invalid invoice id";
exit(1);
}
$facture = $Invoice->getInfos($_GET['id']);
if ($facture->is_paye) {
echo "Invoice has already been paid";
exit(1);
}
// Plan the invoice to be debited
mysql_query("INSERT INTO direct_debit_row " . "SET invoice_id = {$_GET['id']}, " . " state='todo'") or die(mysql_error());
// Flag invoice as paid
$Invoice->setPaid($_GET['id']);
header("Location: ../prospection/edit_facture.php?id_facture={$_GET['id']}");
exit;
示例4: Client
if (!isset($id_client) or !isset($id_invoice)) {
echo "Missing arguments";
exit;
}
if (!is_numeric($id_client) or !is_numeric($id_invoice)) {
echo "Wrong arguments";
exit;
}
$Client = new Client();
# check client and invoice
if (!$Client->exists($id_client)) {
echo _("This client doesn't exist");
exit;
}
$Invoice = new Facture();
if ($Invoice->exists($id_invoice)) {
$inv = $Invoice->getInfos($id_invoice);
if ($inv->id_client != $id_client) {
echo _("This invoice isn't yours!");
exit;
}
if ($inv->is_paye > 0) {
echo _("This invoice is already paid.");
exit;
}
$Client = new Client($id_client);
}
//insert the transation in the db
$ref_cmd = "WEBFINANCE;" . random_int(10);
$r = mysql_query("INSERT INTO webfinance_payment SET id_invoice={$inv->id_facture}, " . "email='" . $Client->email . "' , " . "reference='" . $ref_cmd . "' , " . "state='pending', " . "amount='{$inv->nice_total_ttc}' , " . "currency='EUR' , " . "id_payment_type='" . $paypal_params['id_payment_type'] . "' , " . "date=NOW() ") or die('212' . mysql_error());
?>