Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
tetiana yaremko
/
web-app-group2
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
eefa4954
authored
May 12, 2020
by
tetiana yaremko
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
upload file on live server
parent
15980d02
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
2 deletions
application/controllers/Admin.php
application/models/Admin_model.php
application/views/admin/add_product.php
application/views/admin/update_item.php
application/controllers/Admin.php
View file @
eefa4954
...
...
@@ -23,6 +23,7 @@ class Admin extends CI_Controller {
$this
->
form_validation
->
set_rules
(
"quantity"
,
"Quantity"
,
"required"
);
$this
->
form_validation
->
set_rules
(
"price"
,
"Price"
,
"required"
);
$this
->
form_validation
->
set_rules
(
"description"
,
"Description"
,
"required"
);
$this
->
form_validation
->
set_rules
(
"feature"
,
"Feature"
,
"required"
);
//$config['upload_path'] = './uploads/';
...
...
@@ -80,6 +81,7 @@ class Admin extends CI_Controller {
$this
->
form_validation
->
set_rules
(
"price"
,
"Price"
,
"required"
);
$this
->
form_validation
->
set_rules
(
"description"
,
"Description"
,
"required"
);
$this
->
form_validation
->
set_rules
(
"status"
,
"Status"
,
"required"
);
$this
->
form_validation
->
set_rules
(
"feature"
,
"Feature"
,
"required"
);
// $config['upload_path'] = './uploads/';
// $config['allowed_types'] = 'gif|jpg|png|jpeg';
...
...
application/models/Admin_model.php
View file @
eefa4954
...
...
@@ -37,7 +37,7 @@ class Admin_model extends CI_Model
'price'
=>
$this
->
input
->
post
(
'price'
),
'description'
=>
$this
->
input
->
post
(
'description'
),
'image'
=>
$image
,
'feature'
=>
$this
->
input
>
post
(
'feature'
),
'feature'
=>
$this
->
input
-
>
post
(
'feature'
),
'status_id'
=>
(
int
)
$status_id
->
id_status
);
return
$data
;
...
...
application/views/admin/add_product.php
View file @
eefa4954
...
...
@@ -139,6 +139,20 @@
<small>
<?php
echo
$error
;
?>
</small>
</td>
</tr>
<tr>
<td>
<?php
$error
=
form_error
(
"feature"
,
"<small class='text-danger'>"
,
'</small>'
);
?>
<label
for=
"feature"
>
Feature
</label>
</td>
<td>
<select
name=
"feature"
id=
"feature"
>
<option>
recommended
</option>
<option>
exclusive
</option>
</select>
<small>
<?php
echo
$error
;
?>
</small>
</td>
</tr>
</tbody>
</table>
<div
></div>
...
...
application/views/admin/update_item.php
View file @
eefa4954
...
...
@@ -128,7 +128,7 @@
<label
for=
"status"
>
Status
</label>
</td>
<td>
<select
name=
"status"
id=
"status"
value=
"
<?php
echo
set_value
(
'
price
'
,
$data
->
status
)
?>
"
>
<select
name=
"status"
id=
"status"
value=
"
<?php
echo
set_value
(
'
status
'
,
$data
->
status
)
?>
"
>
<option
value=
"in stock"
<?php
if
(
$data
->
status
==
'in stock'
)
echo
'selected="selected"'
;
?>
>
in stock
</option>
<option
value=
"sold"
<?php
if
(
$data
->
status
==
'sold'
)
echo
' selected="selected"'
;
?>
>
sold
</option>
<option
value=
"on hold"
<?php
if
(
$data
->
status
==
'on hold'
)
echo
' selected="selected"'
;
?>
>
on hold
</option>
...
...
@@ -136,6 +136,20 @@
<small>
<?php
echo
$error
;
?>
</small>
</td>
</tr>
<tr>
<td>
<?php
$error
=
form_error
(
"feature"
,
"<small class='text-danger'>"
,
'</small>'
);
?>
<label
for=
"feature"
>
Feature
</label>
</td>
<td>
<select
name=
"feature"
id=
"feature"
value=
"
<?php
echo
set_value
(
'feature'
,
$data
->
feature
)
?>
"
>
<option
<?php
if
(
$data
->
feature
==
'recommended'
)
echo
'selected="selected"'
;
?>
>
recommended
</option>
<option
<?php
if
(
$data
->
feature
==
'exclusive'
)
echo
'selected="selected"'
;
?>
>
exclusive
</option>
</select>
<small>
<?php
echo
$error
;
?>
</small>
</td>
</tr>
</tbody>
</table>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment