[eluser]charlie spider[/eluser]
from boot_model.php:
Code:
function update_boot_text($bootID, $number, $name, $type, $desc1, $desc2)
{
$data = array('catID' => $type, 'Nmbr' => $number, 'Name' => $name, 'desc1' => $desc1, 'desc2' => $desc2);
$this->db->where('bootID', $bootID);
if ( $this->db->update('boot_table', $data))
{ return true; }
}
from controller:
Code:
$rules['number'] = "trim|required|min_length[2]|max_length[12]";
$rules['name'] = "trim|required|min_length[4]|max_length[24]";
$rules['desc1'] = "trim|required|max_length[2048]";
$rules['desc2'] = "trim|required|max_length[4096]";
if ( $this->Boot_model->update_boot_text(
$this->input->post('bootID'),
$this->input->post('nmbr'),
$this->input->post('name'),
$this->input->post('boot_type'),
$this->input->post('shortDesc'),
$this->input->post('longDesc')
))
{
// go back to form
}
from admin section form:
Code:
echo heading ('Short Description (bold text)', 5) . '<br />';
$value = ($this->validation->desc1) != NULL ? $this->validation->desc1: $boot->desc1;
echo form_textarea(array('name' => 'desc1', 'class' => 'boot', 'value' => $value, 'cols'=>'12', 'rows'=>'4'));
echo '<br />';
echo heading ('Long Description', 5) . '<br />';
$value = ($this->validation->desc2) != NULL ? $this->validation->desc2: $boot->desc2;
echo form_textarea(array('name' => 'desc2', 'class' => 'boot', 'value' => $value, 'cols'=>'24', 'rows'=>'24'));
from PDF:
( this is the desc1 text )
Code:
A 10” lace-to-toe Stitch down boot with Vibram® Sierra oil resistant lug sole with urethane cushioned heel. The best easy entry style to fit high instep and special widths. CSA grade 1 steel toe and plate.