Changeset 52 for www/finance/bills.php
- Timestamp:
- Feb 24, 2008, 3:18:56 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/finance/bills.php
r50 r52 39 39 $User['fullname'].'<br>'. 40 40 $User['street'].'<br>'. 41 $User['psc'].' '.$User['town'].'<br>'. 42 'IČO: '.$User['ico'].'<br>'. 41 $User['psc'].' '.$User['town'].'<br>'; 42 if($User['ico'] != 0) $Output .= 'IČO: '.$User['ico'].'<br>'; 43 $Output .= 43 44 '</td></tr>'. 44 45 '<tr><td colspan="2"><hr></td></tr>'. … … 82 83 global $Database; 83 84 84 $Database->insert('finance_bills', array('time_create' => 'NOW()', 'user_id' => $UserId, 'time_from' => TimeToMysqlDateTime($TimeFrom), 'time_to' => TimeToMysqlDateTime($TimeTo), 'time_due' => TimeToMysqlDateTime(time()+ 15*24*3600)));85 $Database->insert('finance_bills', array('time_create' => TimeToMysqlDateTime($TimeFrom), 'user_id' => $UserId, 'time_from' => TimeToMysqlDateTime($TimeFrom), 'time_to' => TimeToMysqlDateTime($TimeTo), 'time_due' => TimeToMysqlDateTime($TimeFrom + 15*24*3600))); 85 86 $BillId = $Database->insert_id; 86 87 foreach($Items as $Item) … … 122 123 $Output = shell_exec('echo "'.addslashes(from_utf8($HtmlCode)).'"|htmldoc --no-numbered --webpage --charset 8859-2 -t pdf -'); 123 124 return($Output); 125 } 126 127 function CustomGenerate() 128 { 129 global $Database; 130 131 $DbResult = $Database->select('finance_operations', '*', '(date="2008-02-01" AND comment="Poplatek za měsíc Únor") OR '. 132 '(date="2008-01-01" AND comment="Poplatek za měsíc Leden") OR (date="2007-12-01" AND comment="Poplatek za měsíc Prosinec") AND (bill_id = 0)'); 133 while($Row = $DbResult->fetch_array()) 134 { 135 echo($Row['id']."<br>\n"); 136 $Time = MysqlDateToTime($Row['date']); 137 $BillId = $this->CreateBill($Row['user'], array(array('description' => 'Poplatek za připojení k síti', 'price' => (-$Row['money']), 'quantity' => 1)), $Time, $Time + (date("t", time()) - 1) * 24 * 3600); 138 $Database->update('finance_operations', 'id='.$Row['id'], array('bill_id' => $BillId)); 139 } 124 140 } 125 141
Note:
See TracChangeset
for help on using the changeset viewer.