Commit eefa4954 by tetiana yaremko

upload file on live server

parent 15980d02
......@@ -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';
......
......@@ -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;
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment