当前位置: 首页>>代码示例>>PHP>>正文


PHP wf_mysqldie函数代码示例

本文整理汇总了PHP中wf_mysqldie函数的典型用法代码示例。如果您正苦于以下问题:PHP wf_mysqldie函数的具体用法?PHP wf_mysqldie怎么用?PHP wf_mysqldie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wf_mysqldie函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: compare_invoices_transaction

function compare_invoices_transaction($op)
{
    $indic = false;
    $amount = str_replace(',', '.', $op->montant);
    $tva = getTVA();
    $f = 1 + $tva / 100;
    $min = $amount / $f - 0.1;
    $max = $amount / $f + 0.1;
    // S'il s'agit d'un crédit, tenter de retrouver la facture correspondante
    //    $q = "SELECT id_facture, is_paye, date_facture, num_facture, ref_contrat, total_facture_ht, 1.196*total_facture_ht as total_facture FROM wf_view_invoices ".
    //  "WHERE total_facture_ht>=%s AND total_facture_ht<=%s ";
    $q = "SELECT " . "wf_in.id_facture, " . "is_paye, " . "date_facture, " . "num_facture, " . "ref_contrat, " . "SUM(qtt * prix_ht) as total_facture_ht, " . "{$f}*SUM(qtt * prix_ht) as total_facture " . "FROM webfinance_invoices wf_in , webfinance_invoice_rows wf_in_rows " . "WHERE wf_in_rows.id_facture=wf_in.id_facture " . "AND " . "( " . "SELECT SUM( qtt * prix_ht ) as total_facture_ht " . "FROM webfinance_invoice_rows, webfinance_invoices " . "WHERE webfinance_invoice_rows.id_facture = webfinance_invoices.id_facture " . "AND webfinance_invoice_rows.id_facture=wf_in.id_facture " . "GROUP BY webfinance_invoice_rows.id_facture " . ") " . "BETWEEN '%s' AND '%s' " . "GROUP BY id_facture";
    $query = sprintf($q, $min, $max);
    $result = mysql_query($query) or wf_mysqldie();
    if (mysql_num_rows($result) < 1) {
        print "<b style=\"color: red;\">Impossible de trouver la facture correspondante à ce virement ! Incohérence dans les factures ou paiement erroné !</b><br/>";
    } else {
        while ($invoice = mysql_fetch_assoc($result)) {
            //print_r($invoice);
            if ($invoice['is_paye'] < 1) {
                printf("<b style=\"color: green;\">%s</b><br/>", _('The related invoice is found, it\'s unpaid!'));
                printf("<input type='hidden' name='date_tr[%d]' value='%s'>", $invoice['id_facture'], $op->date);
                printf("<input type='hidden' name='id_tr[%d]' value='%s'>", $invoice['id_facture'], $op->id);
                printf("<input type='checkbox' name='invoices[]'  value='%d' >", $invoice['id_facture']);
                $indic = true;
            } else {
                printf("<b style=\"color: green;\">%s</b><br/>", _('The related invoice is found, it\'s paid!'));
            }
            printf("<a href='../prospection/edit_facture.php?id_facture=%d' target='_blank' ><span style='background-color: rgb(255, 102, 102);'>#%s : %s : %s&euro; : %s </span></a><br/>", $invoice['id_facture'], $invoice['num_facture'], $invoice['ref_contrat'], round($invoice['total_facture'], 3), strftime($invoice['date_facture']));
        }
    }
    return $indic;
}
开发者ID:lopacinski,项目名称:WebFinance,代码行数:33,代码来源:do_import.php

示例2: renum

function renum($id_facture, $id_facture_ligne, $order = 'DESC')
{
    $sens = $order == 'DESC' ? '<=' : '>=';
    $query = sprintf("SELECT id_facture_ligne, ordre " . "FROM webfinance_invoice_rows " . "WHERE id_facture = %d " . "AND ordre %s (" . "   SELECT ordre " . "   FROM webfinance_invoice_rows " . "   WHERE id_facture_ligne = %d " . ") " . "ORDER BY ordre %s LIMIT 2", $id_facture, $sens, $id_facture_ligne, $order);
    $result = mysql_query($query);
    if (mysql_num_rows($result) != 2) {
        return false;
    }
    $query = "UPDATE webfinance_invoice_rows " . "SET ordre = %d " . "WHERE id_facture_ligne = %d ";
    mysql_query(sprintf($query, mysql_result($result, 0, "ordre"), mysql_result($result, 1, "id_facture_ligne"))) or wf_mysqldie();
    mysql_query(sprintf($query, mysql_result($result, 1, "ordre"), mysql_result($result, 0, "id_facture_ligne"))) or wf_mysqldie();
}
开发者ID:lopacinski,项目名称:WebFinance,代码行数:12,代码来源:change_rows.php

示例3: renum

function renum()
{
    $result = mysql_query("SELECT id_facture FROM webfinance_invoice_rows") or wf_mysqldie();
    while (list($id_facture) = mysql_fetch_array($result)) {
        $count = 1;
        $result2 = mysql_query("SELECT id_facture_ligne FROM webfinance_invoice_rows WHERE id_facture={$id_facture} ORDER BY ordre") or wf_mysqldie();
        while (list($id_facture_ligne) = mysql_fetch_array($result2)) {
            mysql_query("UPDATE webfinance_invoice_rows SET ordre={$count} WHERE id_facture_ligne={$id_facture_ligne}") or wf_mysqldie();
            $count += 2;
        }
        mysql_free_result($result2);
    }
    mysql_free_result($result);
}
开发者ID:lopacinski,项目名称:WebFinance,代码行数:14,代码来源:save_facture.php

示例4: show_file

function show_file($id_transaction, $type)
{
    $result = mysql_query("SELECT " . "file, " . "file_type as type, " . "file_name as name " . "FROM webfinance_{$type} " . "WHERE id=" . $id_transaction) or wf_mysqldie();
    if (mysql_num_rows($result) > 0) {
        $afile = mysql_fetch_assoc($result);
        mysql_free_result($result);
        $file_name = $afile['name'];
        $file_type = $afile['type'];
        $file = $afile['file'];
        header('Content-type: $file_type');
        header("Content-Disposition: attachment; filename={$file_name}");
        echo $file;
        //echo base64_decode($afile['file']);
    } else {
        echo "File not found";
    }
    exit;
}
开发者ID:lopacinski,项目名称:WebFinance,代码行数:18,代码来源:file.php

示例5: _getInfos

 function _getInfos()
 {
     $query = sprintf(self::getRequest() . "WHERE c.id_client = %d", $this->id);
     $result = $this->SQL(sprintf($query, $this->id)) or wf_mysqldie("Client::_getInfos");
     if (mysql_num_rows($result)) {
         $data = mysql_fetch_assoc($result);
         foreach ($data as $n => $v) {
             $this->{$n} = $v;
         }
         $this->emails = explode(',', $this->email);
         mysql_free_result($result);
     }
     // If user specified data in the siren field it can be either the RCS number
     // (format 9 digits) or the INSEE code (format : same 9 digits + 5 digits for
     // address identifier).
     // See : https://fr.wikipedia.org/wiki/Codes_INSEE
     // sensible default value
     $this->link_societe = sprintf('<a href="http://www.societe.com/cgi-bin/liste?nom=%s&dep=%s">
                       <img src="/imgs/icons/societe.com.gif" class="bouton" onMouseOut="UnTip();" onmouseover="Tip(\'%s\');" /></a>', isset($this->nom) ? urlencode($this->nom) : '', isset($this->departement) ? $this->departement : '', addslashes(_('Cannot link to societe.com if no RCS or siren specified. Click icon to perform a search.')));
     if (isset($this->siren) and $this->siren != "") {
         // Trim non-digits from value
         $this->siren = preg_replace("/[^0-9]/", "", $this->siren);
         switch (strlen($this->siren)) {
             case 9:
                 // RCS
                 $this->link_societe = sprintf('<a href="http://www.societe.com/cgi-bin/recherche?rncs=%s"><img src="/imgs/icons/societe.com.gif" class="bouton" onMouseOut="UnTip();" onmouseover="Tip(\'%s\');" /></a>', $this->siren, addslashes(_('See financial info about this company on Societe.com')));
                 $this->siren = preg_replace("!([0-9]{3})([0-9]{3})([0-9]{3})!", '\\1 \\2 \\3', $this->siren);
                 break;
             case 14:
                 // INSEE
                 $this->link_societe = sprintf('<a href="http://www.societe.com/cgi-bin/recherche?rncs=%s"><img src="/imgs/icons/societe.com.gif" class="bouton" onMouseOut="UnTip();" onmouseover="Tip(\'%s\');" /></a>', substr($this->siren, 0, 9), addslashes(_('See financial info about this company on Societe.com')));
                 $this->siren = preg_replace("!([0-9]{3})([0-9]{3})([0-9]{3})([0-9]{5})!", '\\1 \\2 \\3 \\4', $this->siren);
                 break;
         }
     }
     $this->login = "";
     if (isset($this->id_user) and $this->id_user > 0) {
         $login_res = $this->SQL("SELECT login FROM webfinance_users WHERE id_user=" . $this->id_user);
         if (mysql_num_rows($login_res) > 0) {
             list($this->login) = mysql_fetch_array($login_res);
         }
     }
 }
开发者ID:lopacinski,项目名称:WebFinance,代码行数:43,代码来源:Client.php

示例6: _

  <input type="hidden" name="action" value="select"/>
  <tr style="text-align: center;" class="row_header">
   <td width="80"><?php 
echo _('Transaction');
?>
</td>
   <td colspan="3">
  <form action="expenses.php" id="main_form" onchange="this.submit();">
 	<select class="form" name="id_transaction">
  <option> ------------------ <?php 
echo _('Select a transaction');
?>
 ------------------ </option>
  <?php 
$result = mysql_query("SELECT id, date, text FROM webfinance_transactions ORDER BY date DESC") or wf_mysqldie();
while ($transaction = mysql_fetch_assoc($result)) {
    $len = 80;
    $text = $transaction['text'];
    if (strlen($transaction['text']) >= $len) {
        $text = substr($text, 0, $len) . " ...";
    }
    ?>
  <option value="<?php 
    echo $transaction['id'];
    ?>
" <?php 
    if ($_GET['id_transaction'] == $transaction['id']) {
        echo "selected";
    }
    ?>
开发者ID:lopacinski,项目名称:WebFinance,代码行数:30,代码来源:expenses.php

示例7: logmessage

function logmessage($msg, $id_client = 'NULL', $id_facture = 'NULL')
{
    $id = empty($_SESSION['id_user']) ? -1 : $_SESSION['id_user'];
    $msg = preg_replace("/'/", "\\'", $msg);
    $msg = preg_replace('/"/', "\\'", $msg);
    $query = sprintf("INSERT INTO webfinance_userlog " . " (log,date,id_user,id_client,id_facture) VALUES('%s', now(), %s, %s, %s) ", $msg, $id, $id_client, $id_facture);
    mysql_query($query) or wf_mysqldie();
}
开发者ID:lopacinski,项目名称:WebFinance,代码行数:8,代码来源:backoffice.php

示例8: createUser

 function createUser($data = null)
 {
     if (!$this->isAuthorized('admin,manager')) {
         $_SESSION['message'] = _("You aren't the Administrator");
         $_SESSION['error'] = 1;
         return false;
     }
     extract($data);
     if (!isset($disabled)) {
         $disabled = 'off';
     }
     $roles = implode(",", $data['role']);
     if ($this->existsLogin($login)) {
         $_SESSION['message'] = _("Sorry, this user already exists!");
         $_SESSION['error'] = 1;
         return -1;
     } else {
         if (empty($password)) {
             $password = $this->randomPass();
         }
         $q = sprintf("INSERT INTO webfinance_users (login, first_name, last_name, password, email, role, disabled,  modification_date, creation_date) " . "VALUES('%s', '%s', '%s', md5('%s'), '%s','%s',  %d, now(), now() )", $login, $first_name, $last_name, $password, $email, $roles, $disabled == "on" ? 1 : 0);
         mysql_query($q) or wf_mysqldie();
         $new_id_user = mysql_insert_id();
         logmessage("Created new user user:{$new_id_user} ({$last_name} {$first_name})");
         $_SESSION['message'] = _("User added");
         return $new_id_user;
     }
 }
开发者ID:lopacinski,项目名称:WebFinance,代码行数:28,代码来源:User.php

示例9: mysql_query

 print "<form action='save_transaction.php' method='post'>";
 print "<input type='hidden' name='action' value='update_invoices'>";
 //recherche de la catégorie unknow
 $id_default_category = 1;
 $result = mysql_query("SELECT COUNT(*) , id FROM webfinance_categories WHERE name RLIKE 'unknown' GROUP BY id") or wf_mysqldie();
 list($nb_matches, $id, $name) = mysql_fetch_array($result);
 if ($nb_matches == 1) {
     $id_default_category = $id;
 }
 foreach ($transactions as $op) {
     printf("Transaction de <b>%s&euro;</b> du <b>%s</b> intitulée <i>%s</i><div style=\"font-size: 10px; border-left: solid 4px #ceceff; margin-left: 10px; padding-left: 10px;\">\n", $op->montant, $op->date, $op->desc);
     // Dans tous les cas on essaie de retrouver la catégorie de la transaction
     // automagiquement.
     //default id category
     $id_categorie = $id_default_category;
     $result = mysql_query("SELECT COUNT(*) , id , name FROM webfinance_categories WHERE re IS NOT NULL AND '" . addslashes($op->desc) . "' RLIKE re GROUP BY id") or wf_mysqldie();
     list($nb_matches, $id, $name) = mysql_fetch_array($result);
     switch ($nb_matches) {
         case 0:
             print "<b style=\"color: orange;\">Aucune catégorie ne correspond, à vous de classer cette transaction</b><br/>";
             break;
         case 1:
             print "<b style=\"color: green;\">Correspondance avec la catégorie &laquo;&nbsp;{$name}&nbsp;&raquo;</b><br/>";
             $id_categorie = $id;
             break;
         default:
             print "<b style=\"color: orange;\">Plus d'une catégorie correspond, classement automatique impossible</b><br/>";
     }
     // Insertion de la transaction
     $erreur = 0;
     $q = sprintf("INSERT INTO webfinance_transactions (text,id_account,amount,type,date, id_category, comment) " . "VALUES('%s', %d, '%s', 'real', STR_TO_DATE('%s', '%%d/%%m/%%Y'), %d, '%s')", $op->desc, $id_account, $op->montant, $op->date, $id_categorie, "ref: " . $op->ref . " " . $op->comment);
开发者ID:lopacinski,项目名称:WebFinance,代码行数:31,代码来源:import_banque_populaire.php

示例10: barGraph

} else {
    $width = 700;
}
if (is_numeric($_GET['height'])) {
    $height = $_GET['height'];
} else {
    $height = 300;
}
if (is_numeric($_GET['nb_months'])) {
    $nb_months = $_GET['nb_months'];
} else {
    $nb_months = 12;
}
if (preg_match("!^[0-9]+(|,[0-9]+)\$!", $_GET['limit_clients'])) {
    // Matches 5 and 10,5 and nothing else
    $limit_clients = "LIMIT " . $_GET['limit_clients'];
} else {
    $limit_clients = "";
}
global $User;
$bar = new barGraph($width, $height, $User->prefs->graphgrid);
$bar->setFont($GLOBALS['_SERVER']['DOCUMENT_ROOT'] . "/css/themes/" . $User->prefs->theme . "/buttonfont.ttf");
$bar->setBarColor(103, 133, 195);
# NBI blue
$result = mysql_query("SELECT sum(fl.prix_ht*fl.qtt) as total, count(f.id_facture) as nb_factures, c.nom\n                       FROM webfinance_invoices as f, webfinance_invoice_rows as fl, webfinance_clients as c\n                       WHERE fl.id_facture=f.id_facture\n                       AND f.type_doc = 'facture'\n                       AND f.id_client = c.id_client\n                       AND f.date_facture>=DATE_SUB(now(), INTERVAL {$nb_months} MONTH)\n                       GROUP BY c.id_client\n                       ORDER BY total DESC\n                       {$limit_clients}") or wf_mysqldie();
$count = mysql_num_rows($result);
while ($billed = mysql_fetch_object($result)) {
    $billed->total = sprintf("%d", $billed->total);
    $bar->addValue($billed->total, $count--, $billed->nom . "\n" . preg_replace("/\\./", ",", sprintf("%.1f", $billed->total / 1000)) . "K€", preg_replace("/\\./", ",", sprintf("%.1f", $billed->total / 1000)) . "K€");
}
$bar->realise();
开发者ID:lopacinski,项目名称:WebFinance,代码行数:31,代码来源:clients_income.php

示例11: explode

 $var = explode("-", $start_date);
 $query_date_last_real = mysql_query("select UNIX_TIMESTAMP(max(date)) from webfinance_transactions where type='real' " . $query_account) or wf_mysqldie();
 $date_last_real = mysql_result($query_date_last_real, 0);
 $q = "SELECT amount, type, date, UNIX_TIMESTAMP(date) as ts_date , id_account, exchange_rate FROM webfinance_transactions ORDER BY date ";
 $res = mysql_query($q) or wf_mysqldie();
 $trs = array();
 while ($row = mysql_fetch_assoc($res)) {
     if (empty($row['exchange_rate'])) {
         $row['exchange_rate'] = 1;
     }
     $row['amount'] = $row['amount'] / $row['exchange_rate'];
     $trs[] = $row;
 }
 mysql_free_result($res);
 $q_real = "SELECT amount, type, date, UNIX_TIMESTAMP(date) as ts_date, id_account, exchange_rate FROM webfinance_transactions WHERE type='real' ORDER BY date ";
 $res_real = mysql_query($q_real) or wf_mysqldie();
 while ($row = mysql_fetch_assoc($res_real)) {
     if (empty($row['exchange_rate'])) {
         $row['exchange_rate'] = 1;
     }
     $row['amount'] = $row['amount'] / $row['exchange_rate'];
     $trs_real[] = $row;
 }
 mysql_free_result($res_real);
 for ($step = 0; $step <= $nb_day; $step++) {
     $current_date = mktime(0, 0, 0, $var[1], $var[2] + $step, $var[0]);
     $tmp[0] = $current_date;
     //prev
     $x = 0;
     $i = 0;
     $sum = 0;
开发者ID:lopacinski,项目名称:WebFinance,代码行数:31,代码来源:cashflow.php

示例12: switch

    switch ($_GET['sort']) {
        case "login":
            $critere = " login {$order} ";
            break;
        case "name":
            $critere = " first_name {$order}, last_name {$order} ";
            break;
        case "email":
            $critere = " email {$order} ";
            break;
        case "last_login":
            $critere = " last_login {$order}";
            break;
    }
}
$result = mysql_query("SELECT first_name,last_name,id_user,email,login, role, date_format(last_login,'%d/%m/%Y') as nice_last_login\n                       FROM webfinance_users ORDER by " . $critere) or wf_mysqldie();
$count = 1;
while ($user = mysql_fetch_object($result)) {
    $rowclass = $count % 2 == 0 ? "odd" : "even";
    if ($user->role != 'client') {
        print <<<EOF
<tr class="row_{$rowclass}">
  <td style="text-align: center">{$user->login}</td>
  <td>{$user->first_name} {$user->last_name}</td>
  <td><a href="mailto:{$user->email}">{$user->email}</a></td>
  <td>{$user->nice_last_login}</td>
  <td>
    <a href="javascript:confirmDeleteUser({$user->id_user});"><img src="/imgs/icons/delete.png" alt="<?= _('Delete')?>" /></a>
    <a href="#" onclick="inpagePopup(event, this, 280, 260, 'edit_user.php?id={$user->id_user}{$link}');" ><img src="/imgs/icons/edit.png" alt="Modifier" /></a>
  </td>
</tr>
开发者ID:lopacinski,项目名称:WebFinance,代码行数:31,代码来源:index.php

示例13: mysql_query

if (!isset($width)) {
    $width = 500;
}
if (!isset($height)) {
    $height = 400;
}
if (!isset($hidetitle)) {
    $hidetitle = 0;
}
$query_account = "";
$text = "";
if (!empty($_GET['account'])) {
    $query_account = " AND id_account=" . $_GET['account'];
    $query = mysql_query("SELECT " . "MIN(date) as min , " . "UNIX_TIMESTAMP(MIN(date)) as ts_min  , " . "MAX(date) as max , " . "UNIX_TIMESTAMP(MAX(date)) as ts_max " . "FROM webfinance_transactions WHERE id_account=" . $_GET['account']) or wf_mysqldie();
} else {
    $query = mysql_query("SELECT MIN(date) as min , " . "UNIX_TIMESTAMP(MIN(date)) as ts_min , " . "MAX(date) as max , " . "UNIX_TIMESTAMP(MAX(date)) as ts_max " . "FROM webfinance_transactions ") or wf_mysqldie();
}
$res = mysql_fetch_assoc($query);
if ($res['ts_min'] == 0) {
    $res['ts_min'] == mktime();
}
if ($res['ts_max'] == 0) {
    $res['ts_max'] == mktime();
}
if (isset($_GET['end_date']) and isset($_GET['start_date'])) {
    $end_date = $_GET['end_date'];
    $start_date = $_GET['start_date'];
    list($start_year, $start_month, $start_day) = explode("-", $start_date);
    list($end_year, $end_month, $end_day) = explode("-", $end_date);
    $start_date_ts = mktime(0, 0, 0, $start_month, $start_day, $start_year);
    $start_date = date("Y-m-d", $start_date_ts);
开发者ID:lopacinski,项目名称:WebFinance,代码行数:31,代码来源:income_outgo_all.php

示例14: getCurrency

function getCurrency($id_bank)
{
    $result = mysql_query("SELECT value FROM webfinance_pref WHERE id_pref={$id_bank}") or wf_mysqldie();
    list($value) = mysql_fetch_array($result);
    $account = unserialize(base64_decode($value));
    return array(isset($account->currency) ? $account->currency : "", isset($account->exchange) ? $account->exchange : "");
}
开发者ID:lopacinski,项目名称:WebFinance,代码行数:7,代码来源:main.php

示例15: _

echo _('Taxe');
?>
</td>
  <td><?php 
echo _('Value');
?>
</td>
  <td><?php 
echo _('Actions');
?>
</td>
</tr>

<?php 
$txt = _('Confirm ?');
$result = mysql_query("SELECT id_pref, type_pref, value FROM webfinance_pref WHERE type_pref RLIKE '^taxe_'") or wf_mysqldie();
while ($c = mysql_fetch_assoc($result)) {
    extract($c);
    $taxe_name = preg_replace('/^taxe_/', '', $type_pref);
    print <<<EOF
  <tr class="row_even">
   <td><input type="text" name="taxes[{$id_pref}][taxe]" value="{$taxe_name}" style="width: 100px;" /></td>
   <td><input type="text" name="taxes[{$id_pref}][value]" value="{$value}" style="width: 100px;" /></td>
   <td align="center"><a href="javascript:confirmDeleteTaxe({$id_pref},'{$txt}');"><img src="/imgs/icons/delete.gif" /></a>
  </tr>
EOF;
}
?>
<tr style="background: #ceffce;">
  <td><input type="text" name="taxes[new][taxe]" value="" style="width: 100px;" /></td>
  <td><input type="text" name="taxes[new][value]" value="" style="width: 100px;" /></td>
开发者ID:lopacinski,项目名称:WebFinance,代码行数:31,代码来源:pref_Taxes.php


注:本文中的wf_mysqldie函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。