[eluser]ede196620[/eluser]
Code:
protected $_primary_filter = 'intval';
$filter = $this->_primary_filter;
this is where the filter is
here is the input form:
Code:
<div class="modal-header">
<h3><?php echo empty($product->product_id) ? 'Add a new item' : 'Edit Item ' . $product->product_name; ?></h3>
</div>
<div class="modal-body">
<?php echo validation_errors(); ?>
<?php echo form_open_multipart('site_user/product_c/edit'); ?>
<?php echo form_hidden('id', $this->session->userdata('id')); ?>
<table class="table">
<tr>
<td>Product Name</td>
<td> <?php
echo form_input('product_name', set_value('product_name', $product->product_name));
?>
</td>
</tr>
<tr>
<td>Item Description:</td>
<td><?php
echo form_textarea('body', set_value('body', $product->body));
?></td>
</tr>
<tr>
<td>Category</td>
<td>
<?php
foreach ($category as $categorys) {
echo $categorys->category_name .form_radio('category_id', set_value('category', $categorys->category_id)).'</br>';
}
?>
</td>
</tr>
<tr>
<td>Sell/Trade</td>
<td>
<?php
$data_trade = array(
'name' => 'sell_or_trade',
'id' => 'trade',
'value' => 'trade',
'checked' => TRUE,
'style' => 'margin:10px',
);
$data_sell = array(
'name' => 'sell_or_trade',
'id' => 'sell',
'value' => 'sell',
'style' => 'margin:10px',
);
?>
<?php echo 'Sell' . form_radio($data_sell); ?>
<?php echo 'Trade' . form_radio($data_trade); ?>
<!-- <input type="radio" name="sell_or_trade" id="sell" value="sell">
<input type="radio" name="sell_or_trade" id="trade" value="trade">-->
</td>
</tr>
<tr>
<td><div class="text">Starting Price:</div></td>
<td>
<div class="text">
<!-- <input type="text" name="price" id="price" maxlength="30"> -->
<?php
$data = array(
'name' => 'price',
'id' => '',
'value' => $product->price,
'maxlength' => '100',
'size' => '50',
'style' => 'width:50%',
);
echo form_input($data);
?>
</div>
</td>
</tr>
<tr>
<td>Upload Photo:</td>
<td><input type="file" name="img_path" size="20" /></td>
</tr>
<tr>
<td><?php echo form_submit('submit', 'Save', 'class="btn btn-primary"'); ?></td>
</tr>
</table>
<?php echo form_close(); ?>
</div>