Changeset 456
- Timestamp:
- Oct 31, 2012, 4:52:38 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Database.php
r448 r456 12 12 function fetch_assoc() 13 13 { 14 return($this->PDOStatement->fetch( ));14 return($this->PDOStatement->fetch(PDO::FETCH_ASSOC)); 15 15 } 16 16 17 17 function fetch_array() 18 18 { 19 return($this->PDOStatement->fetch( ));19 return($this->PDOStatement->fetch(PDO::FETCH_BOTH)); 20 20 } 21 21 22 22 function fetch_row() 23 23 { 24 return($this->PDOStatement->fetch( ));24 return($this->PDOStatement->fetch(PDO::FETCH_NUM)); 25 25 } 26 26 } -
trunk/finance/user_state.php
r453 r456 32 32 33 33 if(!array_key_exists('show', $_GET)) $_GET['show'] = ''; 34 $DbResult = $this->Database->query('SELECT * FROM Member LEFT JOIN MemberPayment ON MemberPayment.Member=Member.Id WHERE Member.Subject='.$Subject['Id']); 34 $DbResult = $this->Database->query('SELECT Member.*, MemberPayment.MonthlyPlus AS MonthlyPlus '. 35 'FROM Member LEFT JOIN MemberPayment ON MemberPayment.Member=Member.Id WHERE Member.Subject='.$Subject['Id']); 35 36 $Member = $DbResult->fetch_assoc(); 36 37 $TarifName = $Finance->Tariffs[$Member['InternetTariffCurrentMonth']]['Name']; … … 122 123 $DbResult = $this->Database->query('SELECT Product.Name AS Name, Product.Consumption AS Consumption '. 123 124 'FROM StockItem JOIN Product ON Product.Id = StockItem.Product '. 124 'WHERE Location='.$Member['Id'].' AND (TimeElimination IS NULL)');125 'WHERE (StockItem.Location='.$Member['Id'].') AND (StockItem.TimeElimination IS NULL)'); 125 126 $TotalW = 0; 126 127 $TotalPrice = 0; -
trunk/temp/product.php
r453 r456 16 16 'Consumption' => $DbRow['Consumption'], 'UnitOfMeasure' => 1, 'VAT' => 20)); 17 17 $ProductId = $System->Database->insert_id; 18 if($DbRow['Used'] == 0) $Elimination = 'NULL'; 19 else $Elimination = $DbRow['TimeElimination']; 18 //print_r($DbRow); 19 switch($DbRow['Used']) 20 { 21 case 0: $Elimination = '0000-00-00'; break; 22 case 1: $Elimination = NULL; break; 23 case 2: $Elimination = NULL; break; 24 } 25 26 // else $Elimination = $DbRow['TimeElimination']; 27 if($DbRow['Used'] == 2) $DbRow['User'] = NULL; 28 echo($DbRow['Used'].'"'.$Elimination.'"<br/>'); 29 // print_r(array('Stock' => 1, 'Product' => $ProductId, 'Amount' => $DbRow['Count'], 30 // 'Segment' => $DbRow['Segment'], 'TimeEnlistment' => $DbRow['Date'], 'TimeElimination' => $Elimination, 31 // 'SerialNumber' => $DbRow['DeviceId'], 'BuyPrice' => $DbRow['Price'], 'SellPrice' => $DbRow['Price'], 32 // 'Location' => $DbRow['User'], 'Info' => $DbRow['Info'])); 20 33 $Database->insert('StockItem', array('Stock' => 1, 'Product' => $ProductId, 'Amount' => $DbRow['Count'], 21 34 'Segment' => $DbRow['Segment'], 'TimeEnlistment' => $DbRow['Date'], 'TimeElimination' => $Elimination,
Note:
See TracChangeset
for help on using the changeset viewer.