/
corpdef.php
110 lines (110 loc) · 4.39 KB
/
corpdef.php
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/*****************************************************************
* DO NOT REMOVE *
* ============= *
*PetClinic Management Software *
*Copyrighted 2015-2016 by Michael Avila *
*Distributed under the terms of the GNU General Public License *
*This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
*****************************************************************/
session_start();
$background = "3";
$logFileName = "user";
$headerTitle="USER LOG";
require_once "includes/header1.inc";
require_once "includes/header2.inc";
require_once "includes/common.inc";
$mysqli = new mysqli('localhost', $_SESSION["user"], mc_decrypt($_SESSION["up"], ps_key), '');
$sql="SELECT * FROM `petcliniccorp`.`preferences` WHERE `sequence` = 3";
$result = $mysqli->query($sql);
if ($result == FALSE)
{
put_errormsg("Internal Error");
redirect("corpmenu.php");
exit();
}
$row_cnt = $result->num_rows;
if ($row_cnt == 0) {
put_errormsg("Internal Error");
redirect("corpmenu.php");
exit();
}
$row = $result->fetch_row();
$preload = $row[1];
$state = $row[2];
$autosalesprice = $row[3];
$row = $result->fetch_row();
$sql="SELECT `pref1` FROM `petcliniccorp`.`preferences` WHERE `sequence` = 4";
$result = $mysqli->query($sql);
if ($result == FALSE)
{
put_errormsg("Internal Error");
redirect("corpmenu.php");
exit();
}
$row_cnt = $result->num_rows;
if ($row_cnt == 0) {
put_errormsg("Internal Error");
redirect("criticalerror.php?m=corpdef.php&ec=0");
exit();
}
$row = $result->fetch_row();
$procedures = $row[0];
echo "<form method=\"post\" action=\"corpdef1.php\">";
echo "<center><font size=\"+2\"><b><u>Preferences</u></b></font>";
echo "<br>Application Default Settings</center><br>";
echo "<center><table width=\"55%\">";
echo "<tr><td align=\"right\"> Preload Defaults </td><td><select name=\"preload\" size=\"2\"><option value=\"Y\">Yes</option><option value=\"N\">No</option></td></tr>";
echo "<tr><td align=\"right\">Default State for Data Entry </td><td><select name=\"state\" size = \"5\">";
$mysqlis = new mysqli('localhost', $_SESSION["user"], mc_decrypt($_SESSION["up"], ps_key), '');
$sqlstate = "SELECT * FROM `petclinic`.`code_state` ORDER BY `statedesc`";
$resultstate = $mysqlis->query($sqlstate);
if ($resultstate == FALSE)
{
put_errormsg("Acquiring States Error");
redirect("corpmenu.php");
exit();
}
$row_cnt_state = $resultstate->num_rows;
if ($row_cnt_state == 0) {
put_errormsg("Acquiring States Error");
redirect("corpmenu.php");
exit();
}
for ($i = 0; $i < $row_cnt_state; $i++) {
echo $i;
$rowstate = $resultstate->fetch_row();
echo '<option value=".$rowstate[0]."';
if (strlen($state) > 0) {
if ($rowstate[0] == $state)
echo " SELECTED ";
}
echo " >".$rowstate[1]."</option>";
}
echo "\"></select>";
echo "</td></tr>";
echo "<tr><td align=\"right\"> Automatically Update Medicine Sales Price</td><td> <select name=\"autosalesprice\" size=\"2\">";
echo "<option value=\"Y\">Yes</option><option value=\"N\">No</select></td></tr>";
echo "<tr><td align=\"right\"> Time Zone</td><td> <select name=\"timezone\" size=\"4\">";
$file_handle = fopen("data/timezones.txt", "r");
while (!feof($file_handle)) {
$line = fgets($file_handle);
echo "<option value=\"".$line."\">".$line."</option>";
}
fclose($file_handle);
echo "</select></td></tr>";
echo "<tr><td align=\"right\">Which Procedures Database do you want to be the default </td><td>";
if(substr($procedures,1,1) == "V")
echo "<input type='radio' name='defproc[]' value='V'> VeNom ";
if(substr($procedures,2,1) == "P")
echo "<input type='radio' name='defproc[]' value='P'> Your Own Procedures </table>";
echo "<br>PLEASE NOTE: The Default Procedure Database will be the only Procedure to be displayed. However, you can change the Default Procedure Database any time.</tr>";
echo "</center><br><br><center><input type=\"submit\" value=\"Update Preferences\"></center></form>";
echo "<form action=\"corpmenu.php\"><br><br><center><input type=\"submit\" value=\"Return to Company Information menu\"></center</form>";
require_once "includes/helpline.inc";
help("corpdef.php");
$display = "corpdef";
require_once "includes/footer.inc";
?>