База данных отдела маркетинга и сбыта ОАО "Бобруйсксельмаш"
Дипломная работа - Компьютеры, программирование
Другие дипломы по предмету Компьютеры, программирование
;($acc[edit][self]) $addsql[edit] = if(a.account_id=".(int)$this->out[m][id].",1,0) as editable ;($acc[del][all]) $addsql[del] = 1 as delable ;($acc[del][self]) $addsql[del] = if(a.account_id=".(int)$this->out[m][id].",1,0) as delable ;($acc[read][all]) $sql = ;($acc[read][self]) $sql = " AND a.account_id=".(int)$this->out[m][id]." ";(!$acc[read][all]&&!$acc[read][self]) $sql = " AND a.id!=a.id ";
$addsql = implode(,,$addsql);($addsql) $addsql = ,.$addsql;
out[ae]=sqlget("SELECT*".$addsql."FROM#archivea,#archive.langalWHEREa.id=al.idANDa.id=".(int)$this->out[id]."".$sql,true);(!$this->out[ae][editable])no_access();">$this->out[ae] = sqlget("SELECT * ".$addsql." FROM #archive a, #archive.lang al WHERE a.id=al.id AND a.id=".(int)$this->out[id]."".$sql,true);(!$this->out[ae][editable]) no_access();
}
out[customers]=sqlget("SELECTm.id,ml.titleFROM#member1m,#member1.langmlWHEREm.id=ml.idANDml.lang=".$this->lang."ANDm.`group`=userORDERBYml.title");(count($this->cor))foreach($this->coras$d)if(isset($this->out[ae][$d]))$this->out[ae][$d]=str_replace(00:00:00,,corect_date($this->out[ae][$d],true));">$this->out[customers] = sqlget("SELECT m.id, ml.title FROM #member1 m, #member1.lang ml WHERE m.id=ml.id AND ml.lang=".$this->lang." AND m.`group`=user ORDER BY ml.title");(count($this->cor)) foreach($this->cor as $d) if (isset($this->out[ae][$d])) $this->out[ae][$d] = str_replace(00:00:00,,corect_date($this->out[ae][$d],true));
out[products]=sqlget("SELECT*FROM#productsp,#products.langplWHEREp.id=pl.idORDERBYpl.title");">$this->out[products] = sqlget("SELECT * FROM #products p, #products.lang pl WHERE p.id=pl.id ORDER BY pl.title");
out[item_products]=sqlget("SELECT*FROM#archive.productWHEREid=".(int)$this->out[id]."");">$this->out[item_products] = sqlget("SELECT * FROM #archive.product WHERE id=".(int)$this->out[id]." ");
$this->out[files] = glob(dat.archive/.(int)$this->out[ae][id]./*);
$this->out[files] = array_map(basename,(array)$this->out[files]);
}
А.4 Реализация метода Del():del(){
$acc = $this->item_access();(!$acc[del][all] && !$acc[del][self]) no_access();(!$acc[del][all] && $acc[del][self]){(sqlget("SELECT account_id FROM #archive WHERE id=".(int)$this->out[id]."",true,account_id)!=$this->out[m][id]) no_access();
out[id]."");("DELETEFROM#archive.langWHEREid=".(int)$this->out[id]."");(?act=archive&mode=show_all&ok=1);">}("DELETE FROM #archive WHERE id=".(int)$this->out[id]."");("DELETE FROM #archive.lang WHERE id=".(int)$this->out[id]."");(?act=archive&mode=show_all&ok=1);
}
А.5 Реализация метода Search():search(){
out[customers]=sqlget("SELECTm.id,ml.titleFROM#member1m,#member1.langmlWHEREm.id=ml.idANDml.lang=".$this->lang."ANDm.`group`=userORDERBYml.title");($this->out[mode2]==new)unset($_SESSION[archive][search]);($this->out[sb_search]){">$this->out[customers] = sqlget("SELECT m.id, ml.title FROM #member1 m, #member1.lang ml WHERE m.id=ml.id AND ml.lang=".$this->lang." AND m.`group`=user ORDER BY ml.title");($this->out[mode2]==new) unset($_SESSION[archive][search]);($this->out[sb_search]){
$_SESSION[archive][search] = $this->out[ae];(?act=archive&mode=search&mode2=current);
}($this->out[sb_search] || $_SESSION[archive][search]){($this->out[mode2] == current && $_SESSION[archive][search]){
$this->out[ae] = $_SESSION[archive][search];
}
table_fields(#archive),al=>table_fields(#archive.lang));">$flds=array(a=>table_fields(#archive),al=>table_fields(#archive.lang));
$a = _fields($this->out[ae],$flds[a],false); $al= _fields($this->out[ae],$flds[al],false);
$_SESSION[archive][search] = $this->out[ae];$q = array();(count($a)) foreach($a as $k=>$v){(preg_match(/date/,$k) && preg_match(/(\d+)\/(\d+)\/(\d+)/,$v)) $v = $a[$k] = preg_replace(/(\d+)\/(\d+)\/(\d+)/,\3-\2-\1,$v);
$q[]=($k!=docid?("a.`".$k."`=".addslashes($v).""):prepare_string("a.`".$k."`",$v));
}(count($al)) foreach($al as $k=>$v) if($v) $q[] = prepare_string("al.`".$k."`",$v);(count($q)) $addsql = AND .implode( AND ,$q); else $addsql = ;
$acc = $this->item_access();(!$acc) no_access();
out[m][id].",1,0)aseditable;($acc[del][all])$addsq1[del]=1asdelable;($acc[del][self])$addsq1[del]=if(a.account_id=".(int)$this->out[m][id].",1,0)asdelable;(!$acc[read][all]&&$acc[read][self])$sql1="ANDa.account_id=".(int)$this->out[m][id]."";(!$acc[read][all]&&!$acc[read][self])$sql1="ANDa.id!=a.id";">$addsq1 = array();($acc[edit][all]) $addsq1[edit] = 1 as editable ;($acc[edit][self]) $addsq1[edit] = if(a.account_id=".(int)$this->out[m][id].",1,0) as editable ;($acc[del][all]) $addsq1[del] = 1 as delable ;($acc[del][self]) $addsq1[del] = if(a.account_id=".(int)$this->out[m][id].",1,0) as delable ;(!$acc[read][all] && $acc[read][self]) $sql1 = " AND a.account_id=".(int)$this->out[m][id]." ";(!$acc[read][all]&&!$acc[read][self]) $sql1 = " AND a.id!=a.id ";
$addsq1 = implode(,,$addsq1);($addsq1) $addsq1 = ,.$addsq1;
$this->out[acc] = $acc;($this->out[order]){ status: $this->out[order] = status; break; summ: $this->out[order] = summ; break;title:$this->out[order] = title; break;: $this->out[order] = docid; break;
}($this->out[dir]){ case DESC: $this->out[dir] = DESC;break; default: $this->out[dir] = ASC; break; }
$ordering = ($this->out[order]==title?ml.:a.).$this->out[order]. .$this->out[dir];
lang."".$sql1.$addsql.ORDERBY.$ordering;">$sql = "SELECT *, ml.title as customer $addsq1 FROM #archive a, #archive.lang al, #member1 m, #member1.lang ml WHERE m.id=ml.id AND ml.lang=al.lang AND m.id=a.customer_id AND a.id=al.id AND al.lang=".$this->lang." ".$sql1.$addsql. ORDER BY .$ordering;
$this->out[items] = sqlget($sql,&$this->out[paging]);(count($this->out[items])) foreach((array)$this->out[items] as $k=>$v){
out[items][$k][products]=sqlget("SELECT*FROM#archive.productap,#productsp,#products.langplWHEREap.product=p.idANDp.id=pl.idANDpl.lang=".$this->lang."ANDap.id=".(int)$v[id]."");">$this->out[items][$k][products] = sqlget("SELECT * FROM