This commit is contained in:
FrancescoUK
2017-01-31 23:03:53 +00:00
parent 87247333cc
commit be66258bfc
2 changed files with 7 additions and 4 deletions

View File

@@ -71,9 +71,12 @@ class Items extends Secure_Controller
if($ext == '')
{
$images = glob('./uploads/item_pics/' . $item->pic_filename . '.*');
$new_pic_filename = pathinfo($images[0], PATHINFO_BASENAME);
$item_data = array('pic_filename' => $new_pic_filename);
$this->Item->save($item_data, $item->item_id);
if(sizeof($images) > 0)
{
$new_pic_filename = pathinfo($images[0], PATHINFO_BASENAME);
$item_data = array('pic_filename' => $new_pic_filename);
$this->Item->save($item_data, $item->item_id);
}
}
}

View File

@@ -269,9 +269,9 @@ function get_item_data_row($item, $controller)
$tax_percents = substr($tax_percents, 0, -2);
$controller_name = strtolower(get_class($CI));
$image = NULL;
if ($item->pic_filename != '')
{
$image = '';
$ext = pathinfo($item->pic_filename, PATHINFO_EXTENSION);
if($ext == '')
{