Beispiel #1
0
					$selected = $pdf_external_id == $template->id ? "selected='selected'" : "";
					$selectTemplateHtml .= "<option value='". $template->id ."'".$selected.">". $template->name ."</option>";
				}
			}
		}
		
		//get variables
		$vars = Array();
		switch($local_template['name']){
			case 'Account summary':
				$userModel = new App\Model\User(new DBConnection());
				
		        $vars = $userModel->getTemplateFields();
				break;
			case 'Stock trade':
				$tradeModel = new App\Model\StockTrades(new DBConnection());
        
		        $vars = $tradeModel->getTemplateFields();
				break;
			case 'Options trade':
				$tradeModel = new App\Model\Trades(new DBConnection());
        
		        $vars = $tradeModel->getTemplateFields();
				break;
			case 'Transfer (deposit)':
			case 'Transfer (withdraw)':
				$transferModel = new App\Model\Transfer(new DBConnection());
        
		        $vars = $transferModel->getTemplateFields();
				break;
			default:
Beispiel #2
0
			
			$query='DELETE FROM stock_trades WHERE trade_ref="'.$_GET['sellid'].'"';
			$db->rq($query);
			
			$uDetails=$db->getRow('users','user_account_num="'.$row['user_account_num'].'"','user_firstname, user_lastname, user_account_num');
			global $tradesSellStatuses;
			addLog('Back-end','Stock Trades',''.$uDetails['user_firstname'].' '.$uDetails['user_lastname'].' ('.$uDetails['user_account_num'].')',''.$_SESSION['admin']['name'].' ('.$_SESSION['admin']['refnum'].')','Sell deleted '.($row['trade_ref']+0).' ('.$tradesSellStatuses[$row['trade_status']].')');
			
			$db->close();
			header('Location: strades.php');
			exit();
		}
		break;
    case 'pdf':
        $db         = new DBConnection();
        $tradeModel = new App\Model\StockTrades($db);
        
        $trade      = $tradeModel->getTradeByRef($_GET['ref']);
        $tradeTypes = $tradeModel->getTypes();
        
        $trade['trade_type'] = $tradeTypes[$trade['trade_type']];
        $trade = $tradeModel->formatPriceValues($trade);
        
        $mpdf = new mPDF(null, 'A4', null, null, 8, 8, 40, 20, 8, 8);
        $pdf  = new App\Utility\Pdf($db);
        
        $mpdf->SetHTMLHeader($pdf->getHeader());
        $mpdf->SetHTMLFooter($pdf->getFooter());
        
        $mpdf->WriteHTML($pdf->getBody('stock_trade', $trade));