db->queryOneRecord($sql); $masterTemplateId = $record['template_master']; /* * if the master-Template is custom there is NO changing */ if ($masterTemplateId > 0){ $sql = "SELECT * FROM client_template WHERE template_id = " . intval($masterTemplateId); $limits = $app->db->queryOneRecord($sql); } /* * TODO: Process the additional tempaltes here (add them to the limits * if != -1) * (like $limits['limit_database'] += $limitAdditional) */ /* * Write all back to the database */ $update = ''; foreach($limits as $k => $v){ if (strpos($k, 'limit') !== false){ if ($update != '') $update .= ', '; $update .= '`' . $k . "`='" . $v . "'"; } } $sql = 'UPDATE client SET ' . $update . " WHERE client_id = " . intval($clientId); $app->db->query($sql); } ?>