本文整理汇总了PHP中gaz_dbi_fetch_array函数的典型用法代码示例。如果您正苦于以下问题:PHP gaz_dbi_fetch_array函数的具体用法?PHP gaz_dbi_fetch_array怎么用?PHP gaz_dbi_fetch_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gaz_dbi_fetch_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMovements
function getMovements($account_ini,$account_fin,$date_ini,$date_fin)
{
global $gTables;
if ($account_ini==$account_fin || $account_fin==0 ) {
if ($account_fin==0) {
$account_fin=$account_ini;
}
$where = " codcon = $account_ini AND datreg BETWEEN $date_ini AND $date_fin";
$orderby = " datreg, id_tes ASC ";
$select = $gTables['tesmov'].".id_tes,".$gTables['tesmov'].".descri AS tesdes,datreg,codice,protoc,numdoc,datdoc,".$gTables['clfoco'].".descri,import*(darave='D') AS dare,import*(darave='A') AS avere";
} else {
$where = $gTables['clfoco'].".codice BETWEEN $account_ini AND $account_fin AND datreg BETWEEN $date_ini AND $date_fin GROUP BY ".$gTables['clfoco'].".codice";
$orderby = " codice ASC ";
$select = "codice,".$gTables['clfoco'].".descri AS tesdes, COUNT(id_rig) AS rows, SUM(import*(darave='D')) AS dare, SUM(import*(darave='A')) AS avere";
}
$table = $gTables['clfoco']." LEFT JOIN ".$gTables['rigmoc']." ON ".$gTables['clfoco'].".codice = ".$gTables['rigmoc'].".codcon "
."LEFT JOIN ".$gTables['tesmov']." ON ".$gTables['rigmoc'].".id_tes = ".$gTables['tesmov'].".id_tes ";
$m=array();
$rs=gaz_dbi_dyn_query ($select, $table, $where, $orderby);
while ($r = gaz_dbi_fetch_array($rs)) {
$m[] = $r;
}
return $m;
}
示例2: createNewTable
function createNewTable($table,$new_id)
{
global $table_prefix;
$results = gaz_dbi_query ("SHOW CREATE TABLE ".$table);
$row = gaz_dbi_fetch_array($results);
return(preg_replace("/$table_prefix\_[0-9]{3}/",$table_prefix.sprintf('_%03d',$new_id),$row['Create Table']).";\n\n");
}
示例3: getDocRef
function getDocRef($data){
global $gTables;
$r='';
switch ($data['caucon']) {
case "FAI":
case "FND":
case "FNC":
$tesdoc_result = gaz_dbi_dyn_query ('*',$gTables['tesdoc'],
"id_con = ".$data["id_tes"],
'id_tes DESC',0,1);
$tesdoc_r = gaz_dbi_fetch_array ($tesdoc_result);
if ($tesdoc_r) {
$r="../vendit/stampa_docven.php?id_tes=".$tesdoc_r["id_tes"];
}
break;
case "FAD":
$tesdoc_result = gaz_dbi_dyn_query ('*',$gTables['tesdoc'],
"tipdoc = \"".$data["caucon"]."\" AND seziva = ".$data["seziva"]." AND protoc = ".$data["protoc"]." AND numfat = '".$data["numdoc"]."' AND datfat = \"".$data["datdoc"]."\"",
'id_tes DESC');
$tesdoc_r = gaz_dbi_fetch_array ($tesdoc_result);
if ($tesdoc_r) {
$r="../vendit/stampa_docven.php?td=2&si=".$tesdoc_r["seziva"]."&pi=".$tesdoc_r['protoc']."&pf=".$tesdoc_r['protoc']."&di=".$tesdoc_r["datfat"]."&df=".$tesdoc_r["datfat"] ;
}
break;
case "RIB":
case "TRA":
$effett_result = gaz_dbi_dyn_query ('*',$gTables['effett'],"id_con = ".$data["id_tes"],'id_tes',0,1);
$effett_r = gaz_dbi_fetch_array ($effett_result);
if ($effett_r) {
$r="../vendit/stampa_effett.php?id_tes=".$effett_r["id_tes"];
}
break;
}
return $r;
}
示例4: getConfig
function getConfig($var)
{
global $table_prefix;
$query = "SELECT * FROM `".$gTables['company_config']."` WHERE var = '$var'";
$result = gaz_dbi_query ($query);
$data = gaz_dbi_fetch_array($result);
return $data;
}
示例5: getLastDoc
function getLastDoc($item_code)
{
global $gTables;
$rs=false;
$rs_last_doc = gaz_dbi_dyn_query("*", $gTables['files'], " item_ref ='".$item_code."'",'id_doc DESC',0,1);
$last_doc = gaz_dbi_fetch_array($rs_last_doc);
// se e' il primo documento dell'anno, resetto il contatore
if ($last_doc) {
$rs=$last_doc;
}
return $rs;
}
示例6: getLastId
function getLastId($date,$seziva)
{
global $gTables;
// ricavo l'ultimo id del giorno
$rs_last = gaz_dbi_dyn_query("id_tes", $gTables['tesdoc'], "tipdoc = 'VCO' AND datemi = '".$date."' AND seziva = ".intval($seziva),'numdoc DESC',0,1);
$last = gaz_dbi_fetch_array($rs_last);
$id = 0;
if ($last) {
$id = $last['id_tes'];
}
return $id;
}
示例7: getMovements
function getMovements($date_ini,$date_fin)
{
global $gTables,$admin_aziend;
$m=array();
$where="datreg BETWEEN $date_ini AND $date_fin";
$what=$gTables['movmag'].".*, ".
$gTables['caumag'].".codice, ".$gTables['caumag'].".descri, ".
$gTables['artico'].".codice, ".$gTables['artico'].".descri AS desart, ".$gTables['artico'].".unimis, ".$gTables['artico'].".scorta, ".$gTables['artico'].".catmer ";
$table=$gTables['movmag']." LEFT JOIN ".$gTables['caumag']." ON (".$gTables['movmag'].".caumag = ".$gTables['caumag'].".codice)
LEFT JOIN ".$gTables['artico']." ON (".$gTables['movmag'].".artico = ".$gTables['artico'].".codice)";
$rs=gaz_dbi_dyn_query ($what,$table,$where, 'datreg ASC, clfoco ASC');
while ($r = gaz_dbi_fetch_array($rs)) {
$m[] = $r;
}
return $m;
}
示例8: getMovements
function getMovements($date_ini,$date_fin,$num_ini=1,$num_fin=999999999)
{
global $gTables,$admin_aziend;
$m=array();
$where="scaden BETWEEN ".$date_ini." AND ".$date_fin." AND
progre BETWEEN ".$num_ini." AND ".$num_fin;
$what=$gTables['effett'].".*, ".
$gTables['clfoco'].".codice, ".
$gTables['banapp'].".descri AS desban, ".
$gTables['anagra'].".ragso1, ".$gTables['anagra'].".ragso2 ";
$table=$gTables['effett']." LEFT JOIN ".$gTables['clfoco']." ON ".$gTables['effett'].".clfoco = ".$gTables['clfoco'].".codice
LEFT JOIN ".$gTables['anagra']." ON ".$gTables['anagra'].".id = ".$gTables['clfoco'].".id_anagra
LEFT JOIN ".$gTables['banapp']." ON ".$gTables['banapp'].".codice = ".$gTables['effett'].".banapp";
$rs=gaz_dbi_dyn_query ($what,$table,$where,"tipeff ASC, scaden ASC, progre ASC");
while ($r = gaz_dbi_fetch_array($rs)) {
$m[] = $r;
}
return $m;
}
示例9: accountValue
function accountValue($last_closing,$date_closing) //funzione per la creazione dell'array dei conti con saldo diverso da 0 e ordinati per tipo e numero di conto
{
global $gTables;
$where = "datreg BETWEEN $last_closing AND $date_closing GROUP BY codcon";
$orderby = " codcon ASC ";
$select = $gTables['clfoco'].".descri AS name,codcon,(SUM(import*(darave='D')) - SUM(import*(darave='A'))) AS val";
$table = $gTables['clfoco']." LEFT JOIN ".$gTables['rigmoc']." ON ".$gTables['clfoco'].".codice = ".$gTables['rigmoc'].".codcon "
."LEFT JOIN ".$gTables['tesmov']." ON ".$gTables['rigmoc'].".id_tes = ".$gTables['tesmov'].".id_tes ";
$rs=gaz_dbi_dyn_query($select, $table, $where, $orderby);
$result=array();
$result['att']=array();
$result['pas']=array();
$result['cos']=array();
$result['ric']=array();
$result['tot']['cos']=0;
$result['tot']['ric']=0;
$result['tot']['att']=0;
$result['tot']['pas']=0;
while ($r = gaz_dbi_fetch_array($rs)) {
if ($r['val'] <> 0) {
$type='pas';
switch (substr($r['codcon'],0,1)) {
case 4: //economici
case 3:
if ($r['val'] > 0) {
$type='cos';
} else {
$type='ric';
}
break;
default: //patrimoniali
if ($r['val'] > 0) {
$type='att';
}
break;
}
$result[$type][$r['codcon']]=$r;
$result['tot'][$type]+=$r['val'];
}
}
return $result;
}
示例10: getErrors
function getErrors($year)
{
global $gTables,$admin_aziend;
$e=array();
$where="regiva > 0 and YEAR(datreg) = ".$year;
$orderby="seziva, regiva, datreg, protoc ";
$rs=gaz_dbi_dyn_query("*,(seziva*10+regiva) AS ctrl_sr, DATE_FORMAT(datdoc,'%d-%m-%Y') AS dd, DATE_FORMAT(datreg,'%d-%m-%Y') AS dr", $gTables['tesmov'],$where,$orderby);
$c_sr=0;
$c_p=0;
$c_ndoc=array();
while ($r=gaz_dbi_fetch_array($rs)) {
if ($c_sr!=($r['ctrl_sr'])){ // devo azzerare tutto perchè è cambiata la sezione o il registro
$c_sr=0;
$c_p=0;
$c_ndoc=array();
if ($r['protoc']<>1){ // errore: il protocollo non è 1
$e[]=array('err'=>'P','id'=>$r['id_tes'],'rg'=>$r['regiva'],'pr'=>$r['protoc'],'nd'=>$r['numdoc'],'dd'=>$r['dd'],'sz'=>$r['seziva'],'ty'=>$r['caucon'],'ex'=>1,'de'=>$r['descri'],'dr'=>$r['dr']);
}
} else {
$ex=$c_p+1;
if ($r['protoc']<>$ex){ // errore: il protocollo non è consecutivo
$e[]=array('err'=>'P','id'=>$r['id_tes'],'rg'=>$r['regiva'],'pr'=>$r['protoc'],'nd'=>$r['numdoc'],'dd'=>$r['dd'],'sz'=>$r['seziva'],'ty'=>$r['caucon'],'ex'=>$ex,'de'=>$r['descri'],'dr'=>$r['dr']);
}
}
if ($r['regiva']<4){ // il controllo sul numero solo per i registri delle fatture
if (isset($c_ndoc[$r['caucon']])){ // controllo se il numero precedente è questo-1
$ex=$c_ndoc[$r['caucon']]+1;
if ($r['numdoc']<>$ex){ // errore: il numero non è consecutivo
$e[]=array('err'=>'N','id'=>$r['id_tes'],'rg'=>$r['regiva'],'pr'=>$r['protoc'],'nd'=>$r['numdoc'],'dd'=>$r['dd'],'sz'=>$r['seziva'],'ty'=>$r['caucon'],'ex'=>$ex,'de'=>$r['descri'],'dr'=>$r['dr']);
}
} else { // dal primo documento di questo tipo ci si aspetta il n.1
if ($r['numdoc']<>1){ // errore: il numero non è 1
$e[]=array('err'=>'N','id'=>$r['id_tes'],'rg'=>$r['regiva'],'pr'=>$r['protoc'],'nd'=>$r['numdoc'],'dd'=>$r['dd'],'sz'=>$r['seziva'],'ty'=>$r['caucon'],'ex'=>1,'de'=>$r['descri'],'dr'=>$r['dr']);
}
}
}
$c_ndoc[$r['caucon']]=$r['numdoc'];
$c_sr=$r['ctrl_sr'];
$c_p=$r['protoc'];
}
return $e;
}
示例11: getMovements
function getMovements($date_ini,$date_fin)
{
global $gTables,$admin_aziend;
$where = "datreg BETWEEN $date_ini AND $date_fin GROUP BY seziva,regiva,codiva";
$orderby="seziva, regiva, datreg, protoc";
$rs=gaz_dbi_dyn_query("seziva,regiva,codiva,periva,operat,
SUM((imponi*(operat = 1) - imponi*(operat = 2))*(-2*(regiva > 5)+1)) AS imp,
SUM((impost*(operat = 1) - impost*(operat = 2))*(-2*(regiva > 5)+1)) AS iva,
".$gTables['aliiva'].".descri AS desvat,
".$gTables['aliiva'].".tipiva AS tipiva",
$gTables['rigmoi']." LEFT JOIN ".$gTables['tesmov']." ON ".$gTables['rigmoi'].".id_tes = ".$gTables['tesmov'].".id_tes
LEFT JOIN ".$gTables['aliiva']." ON ".$gTables['rigmoi'].".codiva = ".$gTables['aliiva'].".codice",$where,$orderby);
$m=array();
$m['tot']=0;
while ($r=gaz_dbi_fetch_array($rs)) {
if ($r['tipiva']=='D'){ // iva indetraibile
$r['isp']=0;
$r['ind']=$r['iva'];
$r['iva']=0;
} elseif ($r['tipiva']=='T'){ // iva split payment
$r['isp']=$r['iva'];
$r['ind']=0;
$r['iva']=0;
} else { // iva normale
$r['ind']=0;
$r['isp']=0;
}
$m['data'][]=$r;
if (!isset($m['tot_rate'][$r['codiva']])) {
$m['tot_rate'][$r['codiva']]=$r;
} else {
$m['tot_rate'][$r['codiva']]['imp']+=$r['imp'];
$m['tot_rate'][$r['codiva']]['iva']+=$r['iva'];
$m['tot_rate'][$r['codiva']]['ind']+=$r['ind'];
$m['tot_rate'][$r['codiva']]['isp']+=$r['isp'];
}
$m['tot']+=$r['iva'];
}
return $m;
}
示例12: selectCompany
function selectCompany($name,$val,$strSearch='',$val_hiddenReq='',$mesg,$class='FacetSelect')
{
global $gTables,$admin_aziend;
$table=$gTables['aziend'].' LEFT JOIN '. $gTables['admin_module'].' ON '.$gTables['admin_module'].'.enterprise_id = '.$gTables['aziend'].'.codice';
$where=$gTables['admin_module'].'.adminid=\''.$admin_aziend['Login'].'\' GROUP BY enterprise_id';
if ($val>0 && $val<1000) { // vengo da una modifica della precedente select case quindi non serve la ricerca
$co_rs=gaz_dbi_dyn_query("*",$table,'enterprise_id = '.$val.' AND '.$where,"ragso1 ASC");
$co=gaz_dbi_fetch_array($co_rs);
changeEnterprise(intval($val));
echo "\t<input type=\"hidden\" name=\"$name\" value=\"$val\">\n";
echo "\t<input type=\"hidden\" name=\"search[$name]\" value=\"%%\">\n";
echo "\t<input type=\"submit\" value=\"".$co['ragso1']."\" name=\"change\" onclick=\"this.form.$name.value='0'; this.form.hidden_req.value='change';\" title=\"$mesg[2]\">\n";
} else {
if (strlen($strSearch) >= 2) { //sto ricercando un nuovo partner
echo "\t<select name=\"$name\" class=\"FacetSelect\" onchange=\"this.form.hidden_req.value='$name'; this.form.submit();\">\n";
$co_rs=gaz_dbi_dyn_query("*",$table,"ragso1 LIKE '".addslashes($strSearch)."%' AND ". $where,"ragso1 ASC");
if ($co_rs){
echo "<option value=\"0\"> ---------- </option>";
while ($r = gaz_dbi_fetch_array($co_rs)) {
$selected = '';
if ($r['enterprise_id'] == $val) {
$selected = "selected";
}
echo "\t\t <option value=\"".$r['enterprise_id']."\" $selected >".intval($r['enterprise_id'])."-".$r["ragso1"]."</option>\n";
}
echo "\t </select>\n";
} else {
$msg = $mesg[0];
}
} else {
$msg = $mesg[1];
echo "\t<input type=\"hidden\" name=\"$name\" value=\"$val\">\n";
}
echo "\t<input type=\"text\" name=\"search[$name]\" value=\"".$strSearch."\" maxlength=\"15\" size=\"6\" class=\"FacetInput\">\n";
if (isset($msg)) {
echo "<input type=\"text\" style=\"color: red; font-weight: bold;\" size=\"".strlen($msg)."\" disabled value=\"$msg\">";
}
echo "\t<input type=\"image\" align=\"middle\" name=\"search_str\" src=\"../../library/images/cerbut.gif\">\n";
}
}
示例13: getData
function getData($id_rig)
{
/*
* restituisce tutti i dati relativi al rigo contabile del pagamento
*/
global $gTables;
$anagrafica = new Anagrafica();
$paymov = new Schedule;
$sqlquery= "SELECT ".$gTables['tesmov'].".*, ".$gTables['paymov'].".*, ".$gTables['rigmoc'].".import
FROM ".$gTables['rigmoc']." LEFT JOIN ".$gTables['paymov']." ON ".$gTables['paymov'].".id_rigmoc_pay = ".$gTables['rigmoc'].".id_rig
LEFT JOIN ".$gTables['tesmov']." ON ".$gTables['rigmoc'].".id_tes = ".$gTables['tesmov'].".id_tes
WHERE ".$gTables['rigmoc'].".id_rig = $id_rig ORDER BY expiry ASC";
$rs = gaz_dbi_query($sqlquery);
$a=array();
$i=1;
while ($r = gaz_dbi_fetch_array($rs)) {
$a[$i] = $r;
$a[$i]['t'] = $paymov->getDocumentData($r['id_tesdoc_ref']);
$i++;
}
return array('d'=>$a,'partner'=>$anagrafica->getPartner($a[1]['clfoco']));
}
示例14: gaz_dbi_get_row
$testata = gaz_dbi_get_row($gTables['tesdoc'], "id_tes", $_GET['id_tes']);
if (substr($testata['tipdoc'],0,2) == 'DD'){
$where = "tipdoc LIKE 'DD_' AND seziva = '".$testata['seziva']."' AND numfat = 0" ;
} elseif (substr($testata['tipdoc'],0,2) == 'AF'){
$where = "tipdoc LIKE 'AF_'";
} elseif (substr($testata['tipdoc'],0,2) == 'AD'){
$where = "tipdoc LIKE 'AD_'";
}
$rs_ultimo_documento = gaz_dbi_dyn_query("*", $gTables['tesdoc'], $where,"id_tes DESC",0,1);
$ultimo_documento = gaz_dbi_fetch_array($rs_ultimo_documento);
// ricavo il progressivo annuo, ma se e' il primo documento dell'anno, resetto il contatore
if ($ultimo_documento and $ultimo_documento['id_tes'] == $testata['id_tes']) {
//allora procedo all'eliminazione della testata e dei righi...
gaz_dbi_del_row($gTables['tesdoc'], "id_tes", $testata['id_tes']);
$rs_righidel = gaz_dbi_dyn_query("*", $gTables['rigdoc'], "id_tes = '".$testata['id_tes']."'","id_tes desc");
while ($a_row = gaz_dbi_fetch_array($rs_righidel)) {
gaz_dbi_del_row($gTables['rigdoc'], "id_rig", $a_row['id_rig']);
if (intval($a_row['id_mag']) > 0){ //se c'è stato un movimento di magazzino lo azzero
$upd_mm->uploadMag('DEL',$testata['tipdoc'],'','','','','','','','','','',$a_row['id_mag'],$admin_aziend['stock_eval_method']);
}
}
header("Location: ".$_POST['ritorno']);
exit;
} else {
$message = "Si stà tentando di eliminare un documento diverso dall'ultimo emesso !".$ultimo_documento['tipdoc'].$ultimo_documento['id_tes'];
}
}
if (isset($_POST['Return'])) {
header("Location: report_ddtacq.php");
exit;
示例15: getProtocol
function getProtocol($type,$year,$sezione) // questa funzione trova l'ultimo numero di protocollo
{ // controllando sia l'archivio documenti che il
global $gTables; // registro IVA acquisti
$rs_ultimo_tesdoc = gaz_dbi_dyn_query("*", $gTables['tesdoc'],"YEAR(datemi) = $year AND tipdoc LIKE '".substr($type,0,2)."_' AND seziva = $sezione","protoc DESC",0,1);
$ultimo_tesdoc = gaz_dbi_fetch_array($rs_ultimo_tesdoc);
$rs_ultimo_tesmov = gaz_dbi_dyn_query("*", $gTables['tesmov'],"YEAR(datreg) = $year AND regiva = 6 AND seziva = $sezione","protoc DESC",0,1);
$ultimo_tesmov = gaz_dbi_fetch_array($rs_ultimo_tesmov);
$lastProtocol=0;
if ($ultimo_tesdoc) {
$lastProtocol = $ultimo_tesdoc['protoc'];
}
if ($ultimo_tesmov) {
if ($ultimo_tesmov['protoc'] > $lastProtocol){
$lastProtocol = $ultimo_tesmov['protoc'];
}
}
return $lastProtocol+1;
}