ERROR: Name and Email fields are required!"; } elseif (!checkEmail($_POST['email'])) { echo indent()."ERROR: That email address is in an invalid format!"; } elseif (checkEmailDups($_POST['email'], $_POST['contributor_id'])) { // existing contrib record, still make sure they didn't change their email to an existing email address echo indent()."ERROR: That email address is already in our database. No duplicates allowed."; } elseif (!$_POST['contributor_id'] && !checkEmail($_POST['email'])) { // this is a new contrib record, so check if it's a duplicate email echo indent()."ERROR: That email address is already in our database. No duplicates allowed."; } else { // no errors above, continue updating/inserting $query = "INSERT INTO contributors (id,name,artist_name,address,city,county,postcode,country_id,phone,mobile,email,aim,pplid,skype,cae,biography,contract_songs1,contract_songs2,contract_advance1,contract_advance2,contract_perc,contract_titles,contract_excl,category_id,role_id,dob,myspace_id,twitter_id,facebook_id,soundcloud_id,instagram_id,apple_id,spotify_id,beatport_id,isni_id,bacs_agreed,active,system_entry_date,last_maint_date) VALUES (".($_POST['contributor_id'] ? $_POST['contributor_id'] : "null").",'".myAddSlashes($_POST['name'])."','".myAddSlashes($_POST['artist_name'])."','".myAddSlashes($_POST['address'])."','".myAddSlashes($_POST['city'])."','".myAddSlashes($_POST['county'])."','".myAddSlashes($_POST['postcode'])."',".myAddSlashes($_POST['country_id']).",'".myAddSlashes($_POST['phone'])."','".myAddSlashes($_POST['mobile'])."','".myAddSlashes($_POST['email'])."','".myAddSlashes($_POST['aim'])."','".myAddSlashes($_POST['pplid'])."','".myAddSlashes($_POST['skype'])."','".myAddSlashes($_POST['cae'])."','".myAddSlashes($_POST['biography'])."','".myAddSlashes($_POST['contract_songs1'])."','".myAddSlashes($_POST['contract_songs2'])."','".myAddSlashes($_POST['contract_advance1'])."','".myAddSlashes($_POST['contract_advance2'])."','".myAddSlashes($_POST['contract_perc'])."','".myAddSlashes($_POST['contract_titles'])."','".myAddSlashes($_POST['contract_excl'])."','".myAddSlashes($_POST['category_id'])."','".myAddSlashes($_POST['role_id'])."','".myAddSlashes($_POST['dob'])."','".myAddSlashes($_POST['myspace_id'])."','".myAddSlashes($_POST['twitter_id'])."','".myAddSlashes($_POST['facebook_id'])."','".myAddSlashes($_POST['soundcloud_id'])."','".myAddSlashes($_POST['instagram_id'])."','".myAddSlashes($_POST['apple_id'])."','".myAddSlashes($_POST['spotify_id'])."','".myAddSlashes($_POST['beatport_id'])."','".myAddSlashes($_POST['isni_id'])."','".myAddSlashes($_POST['bacs_agreed'])."','".myAddSlashes($_POST['active'])."',NOW(),NULL) ON DUPLICATE KEY UPDATE name=VALUES(name), artist_name=VALUES(artist_name), address=VALUES(address), city=VALUES(city), county=VALUES(county), postcode=VALUES(postcode), country_id=VALUES(country_id), phone=VALUES(phone), mobile=VALUES(mobile), email=VALUES(email), aim=VALUES(aim), pplid=VALUES(pplid), skype=VALUES(skype), cae=VALUES(cae), biography=VALUES(biography), contract_songs1=VALUES(contract_songs1), contract_songs2=VALUES(contract_songs2), contract_advance1=VALUES(contract_advance1), contract_advance2=VALUES(contract_advance2), contract_perc=VALUES(contract_perc), contract_titles=VALUES(contract_titles), contract_excl=VALUES(contract_excl), category_id=VALUES(category_id), role_id=VALUES(role_id), dob=VALUES(dob), myspace_id=VALUES(myspace_id), twitter_id=VALUES(twitter_id), facebook_id=VALUES(facebook_id), soundcloud_id=VALUES(soundcloud_id), instagram_id=VALUES(instagram_id), apple_id=VALUES(apple_id), spotify_id=VALUES(spotify_id), beatport_id=VALUES(beatport_id), isni_id=VALUES(isni_id), bacs_agreed=VALUES(bacs_agreed), active=VALUES(active), last_maint_date=NOW()"; $queryResult = mysqli_query($dblink, $query) or die(mysqli_error()); // if new record, create a users record as well if (!isset($_POST['contributor_id']) || !$_POST['contributor_id']) { // get last insert id and set it to $_POST $query = "SELECT LAST_INSERT_ID() AS last_id"; $queryResult = mysqli_query($dblink, $query) or die(mysqli_error()); $row = mysqli_fetch_assoc ($queryResult); $_POST['contributor_id'] = $row['last_id']; $pwd = createRandomPassword(); $query = "INSERT INTO users SET foreign_id={$row['last_id']}, password='".md5($pwd)."', user_type_id='{$_POST['user_type_id']}'"; $queryResult = mysqli_query($dblink, $query) or die(mysqli_error()); echo indent()."Successfully added new contributor:"; /* // send email notification of new account $msg = " Your account has been successfully created with the HighEQ Label Management System. We have included your login credentials below. Please save for your records. Username (your email): {$_POST['email']} Password: $pwd With this information you can currently update your details and view all payments recieved to date. We will soon be introducing the ability to also view your Release details (sales/costs etc). Thank you. ".LOGIN_URL; mail($_POST['email'], "Account Creation Successful", $msg, "From: ".ADMIN_EMAIL); */ } else { if (isset($_POST['user_type_id']) && $_POST['user_type_id']) { // existing record, update users table with user type $query = "UPDATE users SET user_type_id='{$_POST['user_type_id']}' WHERE foreign_id={$_POST['contributor_id']}"; $queryResult = mysqli_query($dblink, $query) or die(mysqli_error()); } echo indent()."Successfully updated contributor info:"; } } } elseif (isset($_POST['mode']) && $_POST['mode'] == "change_pwd") { // update password if (!$_POST['new_pwd_1'] || !$_POST['new_pwd_2']) { echo indent()."ERROR: Both password fields are required!"; } elseif ($_POST['new_pwd_1'] != $_POST['new_pwd_2']) { echo indent()."ERROR: Password fields must match!"; } else { // no errors above, continue updating/inserting $query = "UPDATE users SET password='".md5($_POST['new_pwd_1'])."' WHERE foreign_id={$_POST['contributor_id']}"; $queryResult = mysqli_query($dblink, $query) or die(mysqli_error()); echo indent()."Successfully updated your password:"; } } elseif (isset($_POST['mode']) && $_POST['mode'] == "reset_pwd") { // reset password and send email notif $pwd = createRandomPassword(); $query = "UPDATE users SET password='".md5($pwd)."' WHERE foreign_id={$_POST['contributor_id']}"; $queryResult = mysqli_query($dblink, $query) or die(mysqli_error()); echo indent()."Successfully reset password. An email notification has been sent to {$_POST['email']}."; // send email notification of new account $msg = " Your account password has been reset by an administrator. Your new login credentials are listed below: Username (your email): {$_POST['email']} Password: $pwd Thank you. ".LOGIN_URL; mail($_POST['email'], "Account Password Reset", $msg, "From: ".ADMIN_EMAIL); } elseif (isset($_POST['mode']) && $_POST['mode'] == "change_pic") { // update password if (0) { echo indent()."ERROR: Both password fields are required!"; } else { // no errors above, continue updating/inserting /* Begin Image Upload Code */ $source=""; $source = $_FILES['new_pic']['tmp_name']; $new_pic = "null"; if ($_POST['new_pic_delete']) { $new_pic = "null"; } else { if (($source != "none") && ($source != "" )) { $imagesize = getimagesize($source); if ($imagesize[2] == 2) { if($imagesize[0] > 2500 || $imagesize[1] > 2500) { $valid=false; echo indent()."ERROR: Uploaded images cannot be larger than 2500 x 2500 pixels"; } else { /* Image is a JPG, so proceed */ $new_pic = addslashes(fread(fopen($source, "r"), filesize($source))); } } else { $valid=false; $_SESSION["error"] = ""; echo indent()."ERROR: Uploaded images must be in JPG format"; } } else { if ($_FILES['new_pic']['error'] == 2) { $valid=false; echo indent()."ERROR: Uploaded images must be smaller than 128 kb"; } elseif ($_FILES['new_pic']['error'] == 4) { //$message .= "(no image uploaded, ignore this!)
"; } } } /* End Image Upload Code */ if($new_pic != "null") { $query = "UPDATE contributors SET picture = '$new_pic' WHERE id = {$_POST['contributor_id']}"; $queryResult = mysqli_query($dblink, $query); echo indent()."Successfully updated your picture:"; } if($_POST["new_pic_delete"] == "on") { $query = "UPDATE contributors SET picture = NULL WHERE id = {$_POST['contributor_id']}"; $queryResult = mysqli_query($dblink, $query); echo indent()."Successfully removed your picture:"; } } } /* ORIGINAL CODE elseif (isset($_POST['mode']) && $_POST['mode'] == "update_bank") { if (!trim($_POST['bank_name'])) { echo indent()."ERROR: Bank Name is required!

"; } else { $query = "INSERT INTO bank_info (id,contributor_id,bank_name,address,sortcode,accountname,accountno,code,iban,swiftbic,bacs_agreed,paypal_email,system_entry_date,last_maint_date) VALUES (".($_POST['bank_info_id'] ? $_POST['bank_info_id'] : "null").",".myAddSlashes($_POST['contributor_id']).",'".myAddSlashes($_POST['bank_name'])."','".myAddSlashes($_POST['address'])."','".myAddSlashes($_POST['sortcode'])."','".myAddSlashes($_POST['accountname'])."','".myAddSlashes($_POST['accountno'])."','".myAddSlashes($_POST['code'])."','".myAddSlashes($_POST['iban'])."','".myAddSlashes($_POST['swiftbic'])."','".myAddSlashes($_POST['bacs_agreed'])."','".myAddSlashes($_POST['paypal_email'])."', NOW(), NULL) ON DUPLICATE KEY UPDATE contributor_id=VALUES(contributor_id), bank_name=VALUES(bank_name), address=VALUES(address), sortcode=VALUES(sortcode), accountname=VALUES(accountname), accountno=VALUES(accountno), code=VALUES(code), iban=VALUES(iban), swiftbic=VALUES(swiftbic), bacs_agreed=VALUES(bacs_agreed), paypal_email=VALUES(paypal_email), last_maint_date=NOW()"; $queryResult = mysqli_query($dblink, $query) or die(mysqli_error()); echo indent()."Successfully updated Payment Details:

"; } } END ORIGINAL CODE */ if (isset($_POST['mode']) && $_POST['mode'] == "update_bank") { $query = "INSERT INTO bank_info (id,contributor_id,bank_name,address,sortcode,accountname,accountno,code,iban,swiftbic,bacs_agreed,paypal_email,system_entry_date,last_maint_date) VALUES (".($_POST['bank_info_id'] ? $_POST['bank_info_id'] : "null").",".myAddSlashes($_POST['contributor_id']).",'".myAddSlashes($_POST['bank_name'])."','".myAddSlashes($_POST['address'])."','".myAddSlashes($_POST['sortcode'])."','".myAddSlashes($_POST['accountname'])."','".myAddSlashes($_POST['accountno'])."','".myAddSlashes($_POST['code'])."','".myAddSlashes($_POST['iban'])."','".myAddSlashes($_POST['swiftbic'])."','".myAddSlashes($_POST['bacs_agreed'])."','".myAddSlashes($_POST['paypal_email'])."', NOW(), NULL) ON DUPLICATE KEY UPDATE contributor_id=VALUES(contributor_id), bank_name=VALUES(bank_name), address=VALUES(address), sortcode=VALUES(sortcode), accountname=VALUES(accountname), accountno=VALUES(accountno), code=VALUES(code), iban=VALUES(iban), swiftbic=VALUES(swiftbic), bacs_agreed=VALUES(bacs_agreed), paypal_email=VALUES(paypal_email), last_maint_date=NOW()"; $queryResult = mysqli_query($dblink, $query) or die(mysqli_error()); echo indent()."Successfully updated Payment Details:"; } } // gather data for output only if it's not a new record if (isset($_POST['contributor_id']) && $_POST['contributor_id']) { $query = "SELECT c.*, u.user_type_id FROM contributors AS c, users AS u WHERE c.id=u.foreign_id AND c.id={$_POST['contributor_id']}"; $queryResult = mysqli_query($dblink, $query) or die(mysqli_error()); $row = mysqli_fetch_assoc ($queryResult); } if (!isset($row) || !is_array($row)) { $row = array(); } $has_contributor_id = (isset($_POST['contributor_id']) && intval($_POST['contributor_id']) > 0); ?>

Add Contributor

Manage contributor profile, artist IDs, contract notes and payment details.
Admin Settings