-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyDet.inc.php
executable file
·180 lines (177 loc) · 4.84 KB
/
myDet.inc.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?php
require_once 'chkLogIn.inc.php';
require_once 'connect.inc.php';
$isEdit=false;
if (isCompany() && isset($_POST['edit']))
{
if(isset($_POST['company_name']) && !empty($_POST['company_name']))
{
$ct_name=$_POST['company_name'];
if (strlen($ct_name)>0 && strlen($ct_name)<50) {
$isEdit = !setCompanyField('company_name',$ct_name);
}
else
{
$isEdit=true;
//please use less characters for company name :(
}
}
elseif (isset($_POST['company_name']) && empty($_POST['company_name']))
{
$isEdit=false;
}
else
{
$isEdit=true;
}
if( !$isEdit && isset($_POST['ph_no']) && !empty($_POST['ph_no']))
{
$ct_name=$_POST['ph_no'];
if (strlen($ct_name)>0 && strlen($ct_name)<20) {
$isEdit = !setCompanyField('phone_number',$ct_name);
}
else
{
$isEdit=true;
//please use less characters for company name :(
}
}
elseif (isset($_POST['ph_no']) && empty($_POST['ph_no']))
{
$isEdit=false;
}
else
{
$isEdit=true;
}
if(!$isEdit && isset($_POST['address']) && !empty($_POST['address']))
{
$ct_name=$_POST['address'];
if (strlen($ct_name)>0 && strlen($ct_name)<100) {
$isEdit = !setCompanyField('address',$ct_name);
}
else
{
$isEdit=true;
//please use less characters for company name :(
}
}
elseif (isset($_POST['address']) && empty($_POST['address']))
{
$isEdit=false;
}
else
{
$isEdit=true;
}
if(!$isEdit && isset($_POST['website']) && !empty($_POST['website']))
{
$ct_name=$_POST['website'];
if (strlen($ct_name)>0 && strlen($ct_name)<30) {
$isEdit = !setCompanyField('website',$ct_name);
}
else
{
$isEdit=true;
//please use less characters for website :(
}
}
elseif (isset($_POST['website']) && empty($_POST['website']))
{
$isEdit=false;
}
else
{
$isEdit=true;
}
}
else
{
$isEdit=false;
}
?>
<div class="panel-body">
<div class="col-sm-4 col-xs-offset-1 col-xs-10 col-sm-offset-0">
<img class="img-responsive" src="<?php echo './Logo/'.getCompanyField('comp_logo') ?>">
</div>
<div class="col-sm-8">
<form class="form-horizontal" role="form" method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<div class="form-group">
<label class="control-label col-xs-3" for="name">Company Name :</label>
<div class="col-xs-9 col-sm-7 col-md-5">
<?php
if (!$isEdit){
echo '<p class="form-control-static">'.getCompanyField('company_name').'</p>';
}
else{
echo '<input type="text" class="form-control" name="company_name" id="company_name" maxlength="50" placeholder="'.getCompanyField('company_name').'">';
}
?>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label" for="email">Email Id :</label>
<div class="col-md-5 col-xs-9 col-sm-7">
<p class="form-control-static"><?php echo getCompanyField('company_email_id'); ?></p>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3" for="number">Contact Num :</label>
<div class="col-md-5 col-xs-9 col-sm-7">
<?php
if (!$isEdit){
echo '<p class="form-control-static">'.getCompanyField('phone_number').'</p>';
}
else{
echo '<input type="text" class="form-control" name="ph_no" id="ph_no" maxlength="20" placeholder="'.getCompanyField('phone_number').'">';
}
?>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3" for="add">Address :</label>
<div class="col-xs-5 col-sm-4 col-md-3">
<?php
if (!$isEdit){
echo '<p class="form-control-static">'.getCompanyField('address').'</p>';
}
else{
echo '<input type="text" class="form-control" name="address" id="address" maxlength="100" placeholder="'.getCompanyField('address').'">';
}
?>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label" for="website">Website :</label>
<div class="col-md-5 col-xs-9 col-sm-7">
<?php
if (!$isEdit){
echo '<p class="form-control-static">'.getCompanyField('website').'</p>';
}
else{
echo '<input type="text" class="form-control" name="website" id="website" maxlength="100" placeholder="'.getCompanyField('website').'">';
}
?> </div>
</div>
<div class="form-group">
<?php
#projects submitted by the user
?>
</div>
<input type="hidden" value="<?php echo ($isEdit)?0:1; ?>" name="edit">
<div class="form-group">
<div class=" col-xs-offset-4 col-xs-4 col-md-offset-1 col-md-3">
<?php
if (!$isEdit)
{
echo '<input type="submit" class="btn btn-warning btn-block" value="Edit">';
}
else{
echo '<input type="submit" class="btn btn-success btn-block" value="Save">';
}
?>
</div>
</div>
</form>
</div>
</div>