1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
|
" codeBody "
if ($_POST [„het meest sendRequest“] == „savetodb“) {
// Toegang de waarde van de dynamische die variabele van het tekstgebied van flits wordt verzonden
$Full_Name = $_POST [„Full_Name“];
$SharesPur = $_POST [„purchase_shares“];
include_once „connect_to_mysql.php“;
$sql = mysql_query („SELECTEER * UIT stock_index WAAR Full_Name='$ Full_Name'");
terwijl ($row = mysql_fetch_array ($sql)) {
$Industry = $row [„Industrie“];
$Symbol = $row [„Symbool“];
$Movement = $row [„Beweging“];
$Shares = $row [„Aandelen“];
$Share_Volume = $row [„Share_Volume“];
$Starting_Value = $row [„Starting_Value“];
Current_Value = $row [„Current_Value“];
$Total_Cost = Current_Value * $Shares;
$sql1 = mysql_query („SELECTEER * UIT userreg WAAR id='$ id'");
terwijl ($row = mysql_fetch_array ($sql1)) {
$id = $row [„identiteitskaart“];
$username = $row [„gebruikersbenaming“];
$networth = $row [„networth“];
$calculate_balance = $networth-$Total_Cost;
$remaining_balance = number_format ($calculate_balance);
als ($networth < $Total_Cost) {
druk „errorMsg=success_no“;
} anders {
$query = de „UPDATE userreg PLAATSTE networth = „$calculate_balance“ WAAR id='$ id'";
mysql_query ($query);
$sql2 = mysql_query („TUSSENVOEGSEL IN portefeuille (gebruikersbenaming, user-id, Full_Name, Symbool, Aandelen, Bought_At, Starting_Value, Current_Value, Share_Volume, Beweging, Industrie, open_date)
WAARDEN („$username“, „$id“, „$Full_Name“, „$Symbol“, „$SharesPur“, „Current_Value“, „$Starting_Value“, „Current_Value“, „$Share_Volume“, „$Movement“, „$Industry“, nu ())“)
of matrijs (mysql_error ());
}
}
}
}
|