Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mah0001 committed Dec 20, 2022
2 parents 568e0d5 + 65d1524 commit 449e7c4
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions application/controllers/admin/Resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,35 +301,24 @@ function edit($id='add')
{
$db_result=$this->Survey_resource_model->insert($options);

//log
if ($db_result)
{
if ($db_result){
$this->db_logger->write_log('resource-added',$options['title'].'-'.$options['filename'],'resources',$survey_id);
}
}
else
{
//update db
$db_result=$this->Survey_resource_model->update($id,$options);

//log
if ($db_result)
{
if ($db_result){
$this->db_logger->write_log('resource-updated',$options['title'].'-'.$options['filename'],'resources',$survey_id);
}
}

if ($db_result===TRUE)
{
//update successful
if ($db_result!=false){
$this->session->set_flashdata('message', t('form_update_success') );

//redirect back to the list
redirect("admin/catalog/edit/$survey_id/resources");
}
else
{
//update failed
else{
$this->form_validation->set_error(t('form_update_fail'));
}
}
Expand Down

0 comments on commit 449e7c4

Please sign in to comment.