function explodeCatz($filename) { $dir = dirname($filename); $f = file($filename); while (list($index, $line) = each($f)) { $line = trim($line); if (empty($line)) { continue; } if (sex($line)) { $sex[] = $line; unset($f[$index]); continue; } if (mixed_adult($line)) { $mixed[] = $line; unset($f[$index]); continue; } if (gamble($line)) { $gamble[] = $line; unset($f[$index]); continue; } if (games($line)) { $games[] = $line; unset($f[$index]); continue; } if (radio($line)) { $radio[] = $line; unset($f[$index]); continue; } if (music($line)) { $music[] = $line; unset($f[$index]); continue; } if (webtv($line)) { $webtv[] = $line; unset($f[$index]); continue; } if (movies($line)) { $movies[] = $line; unset($f[$index]); continue; } } @file_put_contents($filename, @implode($f)); @file_put_contents("{$dir}/" . time() . ".music.txt", @implode("\n", $music)); @file_put_contents("{$dir}/" . time() . ".radio.txt", @implode("\n", $radio)); @file_put_contents("{$dir}/" . time() . ".sex.txt", @implode("\n", $sex)); @file_put_contents("{$dir}/" . time() . ".movies.txt", @implode("\n", $movies)); @file_put_contents("{$dir}/" . time() . ".games.txt", @implode("\n", $games)); @file_put_contents("{$dir}/" . time() . ".webtv.txt", @implode("\n", $webtv)); @file_put_contents("{$dir}/" . time() . ".gamble.txt", @implode("\n", $gamble)); @file_put_contents("{$dir}/" . time() . ".mixed_adult.txt", @implode("\n", $mixed)); }
function create_patient(&$medics, &$errors) { $alertmsg = ""; $patient_pid = get_patientid($medics); $pubpid = trim($medics->pubpid); // ID must be valid or 'NEWPATIENT' if (empty($pubpid)) { array_push($errors, "Patient ID '{$pubpid}' missing, patient skipped! "); return $alertmsg; } if ($pubpid != 'NEWPATIENT') { // 1. validate patient $patient_pid = 0; $query = "SELECT pid FROM patient_data WHERE pubpid LIKE '{$pubpid}'"; $res = sqlStatement($query); $row = sqlFetchArray($res); if ($row) { $patient_pid = $row['pid']; if (sqlFetchArray($res)) { array_push($errors, "Patient ID '{$pubpid}' is ambiguous, patient skipped! "); return $alertmsg; } else { // array_push( $errors, "Patient ID '$pubpid' exists, updates/new encounters only. "); } } } // 2. validate insurance provider - REMOVED // 3. validate billing provider $tmp = array(); $tmp = fetchProviderInfo($medics); if (!array($tmp)) { array_push($errors, "Provider '{$tmp}' not found, patient skipped!"); return $alertmsg; } $patient_provider_id = $tmp['id']; $patient_provider_name = $tmp['username']; $patient_provider_facility = $tmp['facility_id']; // 4. get facility from // Move to function $row = sqlQuery("SELECT id, name, pos_code FROM facility WHERE id = '{$patient_provider_facility}'"); if (!$row['id']) { array_push($errors, "Facility '{$tmp}' not found, patient skipped! "); return $alertmsg; } $patient_facility_id = $row['id']; $patient_facility_name = $row['name']; $patient_facility_pos = $row['pos_code']; // 5. insert patient data if (!$patient_pid) { // Insert into patient_data. // $row = sqlQuery("SELECT max(pid)+1 AS pid FROM patient_data"); $patient_pid = $row['pid'] ? $row['pid'] : 1; // Combine street lines $patient_street = $medics->street . ' ' . $medics->street2; // Build array newPatientData('', '', form2db($medics->fname), form2db($medics->lname), form2db($medics->mname), sex($medics->sex), form2db($medics->dob), form2db($patient_street), '', '', '', form2db($medics->zip), form2db($medics->city), form2db($medics->state), '', '', '', form2db($medics->phone_home), form2db($medics->phone_alternate), '', '', '', '', '', '', '', form2db($medics->ethnicity), '', '', '', '', '', '0000-00-00 00:00:00', $patient_pid, $patient_pid, '', '', '', '', '', '', form2db($medics->hippa_notice), form2db($medics->hippa_notice), '', '', '', form2db($medics->hippa_notice), '', $dos = fixDate($medics->fromdate)); // Insert dummy row for employer_data. newEmployerData($patient_pid); // Update or Instest subscriber ins data if ($medics->pubpid == 'NEWPATIENT' || !empty($medics->policy_id)) { newInsuranceData($patient_pid, 'primary', $insurance_company_id, form2db($medics->policy_id), '', '', form2db($medics->lname), form2db($medics->mname), form2db($medics->fname), 'self', '', fixDate($medics->dob), form2db($medics->street), form2db($medics->zip), form2db($medics->city), form2db($medics->state), '', form2db($medics->phone_home), '', '', '', '', '', '', '', sex($medics->sex), fixDate($medics->eff_date)); } $tmp = $medics->lname . ',' . $medics->fname; $alertmsg .= "New Patient Added: '{$patient_pid}' / '{$tmp}' <br>\n"; } $medics->pid = $patient_pid; $history = array('history_father' => form2db($medics->familyinformation->father), 'history_mother' => form2db($medics->familyinformation->mother), 'history_spouse' => form2db($medics->familyinformation->spouse), 'history_siblings' => form2db($medics->familyinformation->siblings), 'history_offspring' => form2db($medics->familyinformation->offspring), 'relatives_cancer' => form2db($medics->medical->relativesexperience->cancer), 'relatives_tuberculosis' => form2db($medics->medical->relativesexperience->tuberculosis), 'relatives_diabetes' => form2db($medics->medical->relativesexperience->diabetes), 'relatives_high_blood_pressure' => form2db($medics->medical->relativesexperience->highbloodpressure), 'relatives_heart_problems' => form2db($medics->medical->relativesexperience->heartproblems), 'relatives_stroke' => form2db($medics->medical->relativesexperience->stroke), 'relatives_epilepsy' => form2db($medics->medical->relativesexperience->epilepsy), 'relatives_mental_illness' => form2db($medics->medical->relativesexperience->mentalillness), 'relatives_suicide' => form2db($medics->medical->relativesexperience->suicide), 'usertext12' => form2db($medics->medical->relativesexperience->other), 'coffee' => form2db($medics->medical->lifestyleusage->coffee), 'tobacco' => form2db($medics->medical->lifestyleusage->tobacco), 'alcohol' => form2db($medics->medical->lifestyleusage->alcohol), 'sleep_patterns' => form2db($medics->medical->lifestyleusage->sleep), 'exercise_patterns' => form2db($medics->medical->lifestyleusage->exercise), 'seatbelt_use' => form2db($medics->medical->lifestyleusage->seatbelt), 'counseling' => form2db($medics->medical->lifestyleusage->counseling), 'hazardous_activities' => form2db($medics->medical->lifestyleusage->hazardactivities), 'usertext13' => form2db($medics->medical->lifestyleusage->urinaryincontinence), 'usertext14' => form2db($medics->medical->lifestyleusage->fallhistory), 'additional_history' => form2db($medics->medical->lifestyleusage->other) . " " . form2db($medics->medical->lifestyleusage->generalnotes)); // Insert/Update into history_data. if ($medics->pubpid == 'NEWPATIENT') { newHistoryData($patient_pid, $history); } else { updateHistoryData($patient_pid, $history); } // Add or Update History data add_update_history($medics, $patient_pid, $errors); // Create or update an issue for each historical medication. // foreach ($medics->medical->medications->medication as $medication) { if (isempty($medication->name)) { continue; } $meds = array(); $meds['title'] = form2db($medication->name); $meds['dosage'] = form2db($medication->dosage); $meds['frequency'] = form2db($medication->frequency); $meds['duration'] = form2db($medication->duration); // TBD does not exsist in MEDICS $meds['id'] = form2db($medication->id); if (!isempty($meds['id'])) { $row = sqlQuery("SELECT id FROM lists WHERE id = " . $meds['id']); if (!$row) { create_issue($patient_pid, 'medication', $meds); } else { update_issue($patient_pid, 'medication', $meds); } } else { create_issue($patient_pid, 'medication', $meds); } } return $alertmsg; }
while ($donnees = mysql_fetch_array($reponse, MYSQL_ASSOC)) { $level = explode(' ', Securite::html($donnees['data'])); $niveau = $level[53]; $name = Securite::html($donnees['name']); $sex = explode(' ', Securite::html($donnees['data'])); $sex = dechex($sex[36]); $sex = str_pad($sex, 8, 0, STR_PAD_LEFT); $sex = $sex[3]; echo "<tr><td align=\"center\">"; echo "<a href=\"armurerie-select.php?perso=" . $name . "\">" . $name . "</a>"; echo "</td><td align=\"center\">"; echo $niveau; echo "</td><td align=\"center\">"; imgrace(Securite::html($donnees['race'])); echo "</td><td align=\"center\">"; imgclass(Securite::html($donnees['class'])); echo "</td><td align=\"center\">"; sex($sex); echo "</td><td align=\"center\">"; side(Securite::html($donnees['race'])); echo "</td></tr>"; } } echo "</TABLE>"; pagination($ParPage, $total, $truc, $adresse); } else { echo "<p>Cette page n'existe pas !</p>"; echo "<a href=\"index.php?module=guildes\">Retour</a>"; } break; }
{ if (!empty($sex)) { $msg = "sex = '{$sex}' "; return $msg; } } $top = "\n<table class=table id=tableentry>\n<thead>\n <tr>\n <th>S/N</th>\n <th>EMP NO</th>\n <th>TITLE</th>\n <th>FULLNAME</th>\n <th>STATE</th>\n <th>LGA</th>\n <th>ADDRESS</th>\n <th>PHONE</th>\n <th>DEPARTMENT</th>\n <th>SEX</th>\n <th>EMAIL</th>\n </tr>\n</thead>\n<tbody>"; $fac = fac($faculty); if (empty($dept) && empty($sex)) { $fac = "customer.faculty = '{$faculty}' "; } $dep = dept($dept); if (empty($sex) && !empty($dept)) { $dep = "dept = '{$dept}' "; } $sex = sex($sex); $query = $fac . $dep . $sex; $result = query("SELECT priviledge, employee_no, title, surname, firstname, dep_name, lga, state, customer.id, phone, address, email, sex FROM customer LEFT JOIN department ON customer.dept=department.id WHERE {$query}"); $i = 0; $body = ''; while ($row = mysql_fetch_array($result)) { ++$i; $emp_no = $row['employee_no']; $title = $row['title']; $name = $row['surname'] . " " . $row['firstname']; $state = $row['state']; $lga = $row['lga']; $dept = $row['dep_name']; $addr = $row['address']; $phone = $row['phone']; $sex = $row['sex'];
$i_phone = $sanitiser->sanitise($_POST["pphone"]); $i_adress = $sanitiser->sanitise($_POST["padress"]); $i_country = $sanitiser->sanitise($_POST["pcountry"]); if (isset($_POST["ptos"])) { $i_tos = $sanitiser->sanitise($_POST["ptos"]); } else { $i_tos = ''; } //Must agree to terms of service //Start Validating :D $valid = true; $valid = fName($i_firstname) && $valid; $valid = lName($i_lastname) && $valid; $valid = email($i_email) && $valid; $valid = dob($i_dob) && $valid; $valid = sex($i_sex) && $valid; $valid = tos() && $valid; if (!$valid) { header("location:register_form.php?errors={$errors}"); } else { //check user already exist $email = 'guest'; include_once "settings_guest.php"; $conn = mysqli_connect($host, $user, $pwd, $sql_db); if (!$conn) { header("location:error.php?type=database"); die; } $query = "SELECT Email FROM Student WHERE Email='{$i_email}';"; $result = mysqli_query($conn, $query); $row = mysqli_fetch_assoc($result);
//SQLを使ってデータの取得 $sql = 'SELECT * FROM user WHERE id=?'; $stmt = $dbh->prepare($sql); $data[] = $id; $stmt->execute($data); //$stmtから一行レコードを取り出し $rec = $stmt->fetch(PDO::FETCH_ASSOC); $name = $rec['name']; $email = $rec['email']; $sex = $rec['sex']; $age = $rec['age']; $main = $rec['main_language']; $sub = $rec['sub_language']; //項目を日本語に変換 //性別 $sex_jp = sex($sex); //得意な言語 $main_jp = main($main); //学びたい言語 $sub_jp = sub($sub); //DB接続を切断 $dbh = null; ?> 情報の更新 <br /> <br /> <form method="post" action="update_check.php" enctype="multipart/form-data"> お名前を入力してください。 <br /> <input type="text" name="name" style="width:200px" value="<?php print $name;
names(); break; case "name": names(); break; case "realname": realname(); break; case "grade": grade(); break; case "counts": counts(); break; case "sex": sex(); break; default: names(); break; } ?> <input name="types1" type="hidden" value="<?php if ($_POST[types] == "") { echo "name"; } else { echo $_POST[types]; } ?> ">