function saveBannerClient($option) { global $database; $row = new mosBannerClient($database); if (!$row->bind($_POST)) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } if (!$row->check()) { mosRedirect("index2.php?option={$option}&task=editclient&cid[]={$row->id}", $row->getError()); } if (!$row->store()) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } $row->checkin(); mosRedirect("index2.php?option={$option}&task=listclients"); }