} $db->query($query); $db->next_record(); if ($db->f('count') > 0) { alloc_error("A project with that nickname already exists."); } if (!$TPL["message"]) { $project->set_value("projectComments", rtrim($project->get_value("projectComments"))); $project->save(); $projectID = $project->get_id(); interestedParty::make_interested_parties("project", $project->get_id(), $_POST["interestedParty"]); $client = new client(); $client->set_id($project->get_value("clientID")); $client->select(); if ($client->get_value("clientStatus") == 'Potential') { $client->set_value("clientStatus", "Current"); $client->save(); } if ($definitely_new_project) { $projectPerson = new projectPerson(); $projectPerson->currency = $project->get_value("currencyTypeID"); $projectPerson->set_value("projectID", $projectID); $projectPerson->set_value_role("isManager"); $projectPerson->set_value("personID", $current_user->get_id()); $projectPerson->save(); } alloc_redirect($TPL["url_alloc_project"] . "projectID=" . $project->get_id()); } } else { if ($_POST["delete"]) { $project->read_globals();
$_FORM["clientID"] = $clientID; // Restrict non-admin users records if (!$current_user->have_role("admin")) { $_FORM["personID"] = $current_user->get_id(); } $rows = invoice::get_list($_FORM); echo invoice::get_list_html($rows, $_FORM); } $client = new client(); $clientID = $_POST["clientID"] or $clientID = $_GET["clientID"]; if ($_POST["save"]) { if (!$_POST["clientName"]) { alloc_error("Please enter a Client Name."); } $client->read_globals(); $client->set_value("clientModifiedTime", date("Y-m-d")); $clientID = $client->get_id(); $client->set_values("client_"); if (!$client->get_id()) { // New client. $client->set_value("clientCreatedTime", date("Y-m-d")); $new_client = true; } if (!$TPL["message"]) { $client->save(); $clientID = $client->get_id(); $client->set_values("client_"); } } else { if ($_POST["save_attachment"]) { move_attachment("client", $clientID);
Postal Postcode Street Address Street Suburb Comment Main_Contact Main Contact Email */ $row = 1; if (($handle = fopen("../../David_Clients.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { foreach ($data as $key => $val) { $data[$key] = utf8_encode($data[$key]); } unset($comment_id, $cc_id); $client = new client(); $client->set_value("clientName", $data[0]); $client->set_value("clientPhoneOne", $data[1]); $client->set_value("clientFaxOne", $data[2]); $client->set_value("clientStreetAddressOne", $data[3]); $client->set_value("clientSuburbOne", $data[4]); $client->set_value("clientStateOne", $data[5]); $client->set_value("clientPostcodeOne", $data[6]); $client->set_value("clientStreetAddressTwo", $data[7]); $client->set_value("clientSuburbTwo", $data[8]); $client->set_value("clientStatus", "current"); $client->set_value("clientModifiedUser", $current_user->get_id()); $client->save(); if ($client->get_id()) { if (rtrim($data[9])) { $comment = new comment(); $comment->set_value("commentMaster", "client");