function deleteDepartment($deptid) { $MySQL = new iacMySQL(); $MySQL->esc($deptid); $MySQL->Execute("SELECT deptid FROM departments WHERE department = 'Default'"); $defaultid = $MySQL->FetchOne(); //var_dump($defaultid); $user_upd_statement = "UPDATE users SET\r\n\t\t\t\t\t\t\t\t\t\t\t\tdeptid = '{$defaultid['deptid']}'\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tdeptid = '{$deptid}'\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t"; $del_statement = "DELETE FROM departments WHERE deptid = '{$deptid}'"; return $MySQL->Execute($user_upd_statement) && $MySQL->Execute($del_statement); }
$domains = $MySQL->FetchAll(); $domains = make_select_array($domains, 'id', 'domain'); $smarty->assign('domains', $domains); $MySQL->Execute("SELECT email, id FROM users"); $emails = $MySQL->FetchAll(); $emails = make_select_array($emails, 'id', 'email'); $smarty->assign('emails', $emails); $smarty->assign('form', 'newalias'); $smarty->assign('errors', $errors); $smarty->display('home.tpl'); } } } else { if ($_REQUEST['alias_type'] == 'external_alias') { //Insert 'External' EMail Alias... $domain = $MySQL->esc($_REQUEST['domain']); $MySQL->Execute("SELECT domain FROM domains WHERE id = {$domain}"); $domain = $MySQL->FetchOne(); $new_alias = $_REQUEST['new_alias'] . "@" . $domain['domain']; if (!checkEmail($new_alias)) { $errors[] = "The Provided E-Mail Address is not valid. Please Provide a Valid E-Mail Alias."; } if (!$_REQUEST['email_address']) { $errors[] = 'No Destination E-Mail Address Provided. Please Provide a valid destination E-Mail Address.'; } if (!checkEmail($_REQUEST['email_address'])) { $errors = 'Provided Destination E-Mail Address was invalid. Please Provide a Valid Destination E-Mail Address.'; } if (count($errors) != 0) { $smarty->assign('new_alias', $_REQUEST['new_alias']); $smarty->assign('domain', $_REQUEST['domain']);