function do_inc_log_report($the_ticket_id) { // 3/18/10 global $types; global $w_tiny, $w_small, $w_medium, $w_large; // 4/14/11 global $nature, $disposition, $patient, $incident, $incidents; // 4/21/11 $tickets = $actions = $patients = $unit_names = $un_status = $unit_types = $users = $facilities = $fac_status = $fac_types = array(); $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}ticket`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); // $str_lgth_max = 10; // $tick_str = ((strlen($tickets[$row['id']])) > $str_lgth_max) ? substr($row['street'], 0, $str_lgth_max). " ..." : $tickets[$row['id']] ; while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $tickets[$row['id']] = substr($row['scope'], 0, 10) . "/" . substr($row['street'], 0, 10); } $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}action`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $actions[$row['id']] = substr($row['description'], 0, 20); } $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}patient`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $patients[$row['id']] = substr($row['description'], 0, 20); } $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}responder`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $unit_names[$row['id']] = $row['name']; } $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}un_status`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $un_status[$row['id']] = $row['status_val']; } $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}unit_types`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $unit_types[$row['id']] = $row['name']; } $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}user`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $users[$row['id']] = $row['user']; } $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}facilities`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $facilities[$row['id']] = $row['name']; } $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}fac_status`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $fac_status[$row['id']] = $row['status_val']; } $query = "SELECT *FROM `{$GLOBALS['mysql_prefix']}fac_types`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { $fac_types[$row['id']] = $row['name']; } // ______________________________________________________________________________ $query = "SELECT *,\n\t\t\tUNIX_TIMESTAMP(problemstart) AS problemstart,\n\t\t\tUNIX_TIMESTAMP(problemend) AS problemend,\n\t\t\tUNIX_TIMESTAMP(booked_date) AS booked_date,\t\t\n\t\t\tUNIX_TIMESTAMP(date) AS date,\n\t\t\tUNIX_TIMESTAMP(`{$GLOBALS['mysql_prefix']}ticket`.`updated`) AS updated,\n\t\t\t `{$GLOBALS['mysql_prefix']}ticket`.`description` AS `tick_descr`,\n\t\t\t `{$GLOBALS['mysql_prefix']}ticket`.`lat` AS `lat`,\n\t\t\t `{$GLOBALS['mysql_prefix']}ticket`.`lng` AS `lng`,\n\t\t\t `{$GLOBALS['mysql_prefix']}ticket`.`_by` AS `call_taker`,\n\t\t\t `{$GLOBALS['mysql_prefix']}facilities`.`name` AS `fac_name`,\n\t\t\t `rf`.`name` AS `rec_fac_name`,\n\t\t\t `rf`.`lat` AS `rf_lat`,\n\t\t\t `rf`.`lng` AS `rf_lng`,\n\t\t\t `{$GLOBALS['mysql_prefix']}facilities`.`lat` AS `fac_lat`,\n\t\t\t `{$GLOBALS['mysql_prefix']}facilities`.`lng` AS `fac_lng` FROM `{$GLOBALS['mysql_prefix']}ticket` \n\t\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}in_types` `ty` ON (`{$GLOBALS['mysql_prefix']}ticket`.`in_types_id` = `ty`.`id`)\t\t\n\t\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}facilities` ON (`{$GLOBALS['mysql_prefix']}facilities`.`id` = `{$GLOBALS['mysql_prefix']}ticket`.`facility`)\n\t\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}facilities` `rf` ON (`rf`.`id` = `{$GLOBALS['mysql_prefix']}ticket`.`rec_facility`) \n\t\t\tWHERE `{$GLOBALS['mysql_prefix']}ticket`.`id`= '{$the_ticket_id}' LIMIT 1"; // 7/24/09 10/16/08 Incident location 10/06/09 Multi point routing $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); $theRow = stripslashes_deep(mysql_fetch_array($result)); $tickno = get_variable('serial_no_ap') == 0 ? " <I>(#" . $theRow['id'] . ")</I>" : ""; // 1/25/09 switch ($theRow['severity']) { //color tickets by severity case $GLOBALS['SEVERITY_MEDIUM']: $severityclass = 'severity_medium'; break; case $GLOBALS['SEVERITY_HIGH']: $severityclass = 'severity_high'; break; default: $severityclass = 'severity_normal'; break; } $print = "<TABLE BORDER='0' STYLE = 'width:800px'>\n"; // $print .= "<TR CLASS='even'><TD ALIGN='left' CLASS='td_data' COLSPAN=2 ALIGN='center'><B>{$incident}: <I>{$theRow['scope']}</B>{$tickno}</TD></TR>\n"; $print .= "<TR CLASS='odd' ><TD ALIGN='left'>Priority:</TD> <TD ALIGN='left' CLASS='" . $severityclass . "'>" . get_severity($theRow['severity']); $print .= " {$nature}: " . get_type($theRow['in_types_id']); $print .= "</TD></TR>\n"; $print .= "<TR CLASS='even' ><TD ALIGN='left'>Protocol:</TD> <TD ALIGN='left' CLASS='{$severityclass}'>{$theRow['protocol']}</TD></TR>\n"; // 7/16/09 $print .= "<TR CLASS='odd' ><TD ALIGN='left'>Address:</TD>\t\t<TD ALIGN='left'>{$theRow['street']}"; $print .= " {$theRow['city']} {$theRow['state']}</TD></TR>\n"; $print .= "<TR CLASS='even' VALIGN='top'><TD ALIGN='left'>Description:</TD>\t<TD ALIGN='left'>" . nl2br($theRow['tick_descr']) . "</TD></TR>\n"; // 8/12/09 $end_date = intval($theRow['problemend']) > 1 ? $theRow['problemend'] : time() - get_variable('delta_mins') * 60; $elapsed = my_date_diff($theRow['problemstart'], $end_date); // 5/13/10 $print .= "<TR CLASS='odd'><TD ALIGN='left'>Status:</TD>\t\t<TD ALIGN='left'>" . get_status($theRow['status']) . " ({$elapsed})</TD></TR>\n"; $print .= "<TR CLASS='even'><TD ALIGN='left'>Reported by:</TD>\t<TD ALIGN='left'>{$theRow['contact']}"; $print .= " Phone: " . format_phone($theRow['phone']) . "</TD></TR>\n"; $by_str = $theRow['call_taker'] == 0 ? "" : " by " . get_owner($theRow['call_taker']) . " "; // 1/7/10 $print .= "<TR CLASS='odd'><TD ALIGN='left'>Written:</TD>\t\t<TD ALIGN='left'>" . format_date($theRow['date']) . $by_str; $print .= " Updated: " . format_date($theRow['updated']) . "</TD></TR>\n"; $print .= empty($theRow['booked_date']) ? "" : "<TR CLASS='odd'><TD ALIGN='left'>Scheduled date:</TD>\t\t<TD ALIGN='left'>" . format_date($theRow['booked_date']) . "</TD></TR>\n"; // 10/6/09 $print .= !is_int($theRow['facility']) ? "" : "<TR CLASS='odd' ><TD ALIGN='left'>{$incident} at Facility:</TD>\t\t<TD ALIGN='left'>{$theRow['fac_name']}</TD></TR>\n"; // 8/1/09 $print .= !is_int($theRow['rec_facility']) ? "" : "<TR CLASS='even' ><TD ALIGN='left'>Receiving Facility:</TD>\t\t<TD ALIGN='left'>{$theRow['rec_fac_name']}</TD></TR>\n"; // 10/6/09 $print .= empty($theRow['comments']) ? "" : "<TR CLASS='odd' VALIGN='top'><TD ALIGN='left'>{$disposition}:</TD>\t<TD ALIGN='left'>" . nl2br($theRow['comments']) . "</TD></TR>\n"; $print .= "<TR CLASS='even' ><TD ALIGN='left'>Run Start:</TD><TD ALIGN='left'>" . format_date($theRow['problemstart']); $print .= " End: " . format_date($theRow['problemend']) . " Elapsed: {$elapsed}\n\t\t\t</TD></TR>\n"; $locale = get_variable('locale'); // 08/03/09 switch ($locale) { case "0": $grid_type = " USNG " . LLtoUSNG($theRow['lat'], $theRow['lng']); break; case "1": $grid_type = " OSGB " . LLtoOSGB($theRow['lat'], $theRow['lng']); // 8/23/08, 10/15/08, 8/3/09 break; case "2": $coords = $theRow['lat'] . "," . $theRow['lng']; // 8/12/09 $grid_type = " UTM " . toUTM($coords); // 8/23/08, 10/15/08, 8/3/09 break; default: print "ERROR in " . basename(__FILE__) . " " . __LINE__ . "<BR />"; } $print .= "<TR CLASS='odd'><TD ALIGN='left'>Position: </TD><TD ALIGN='left'>" . get_lat($theRow['lat']) . " " . get_lng($theRow['lng']) . $grid_type . "</TD></TR>\n"; // 9/13/08 $print .= "<TR><TD> </TD></TR></TABLE>\n"; print $print; print show_actions($the_ticket_id, "date", FALSE, TRUE); // ($the_id, $theSort="date", $links, $display) $query = "\n\t\t\tSELECT *, `u`.`user` AS `thename` , \n\t\t\t\t`l`.`info` AS `log_info` , \n\t\t\t\t`l`.`id` AS `log_id` , \n\t\t\t\t`l`.`responder_id` AS `the_unit_id`,\n\t\t\t\tUNIX_TIMESTAMP( `l`.`when` ) AS `when`\n\t\t\tFROM `{$GLOBALS['mysql_prefix']}log` `l`\n\t\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}ticket` t ON ( `t`.`id` = `l`.`ticket_id` )\n\t\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}user` u ON ( `l`.`who` = `u`.`id` )\n\t\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}assigns` a ON ( `a`.`ticket_id` = `t`.`id` )\n\t\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}responder` `r` ON ( `r`.`id` = `a`.`responder_id` )\n\t\t\tWHERE `code` >= '{$GLOBALS['LOG_INCIDENT_OPEN']}'\n\t\t\tAND `l`.`ticket_id` ={$the_ticket_id}\n\t\t\tORDER BY `log_id` ASC"; // dump($query); $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); $evenodd = array("even", "odd"); $i = 0; echo "<TABLE ALIGN='left' CELLSPACING = 1 border=0 STYLE = 'width:800px'>"; $do_hdr = TRUE; $day_part = ""; $last_id = ""; while ($row = stripslashes_deep(mysql_fetch_assoc($result))) { if ($row['log_id'] != $last_id) { $last_id = $row['log_id']; // dupe preventer if ($do_hdr) { echo "<TR CLASS='odd'><TD> </TD></TR>"; echo "<TR CLASS='even'><TH COLSPAN=99> {$incident} Log</TH></TR>"; echo "<TR CLASS='odd'>\n\t\t\t\t\t\t<TD></TD>\n\t\t\t\t\t\t<TD ALIGN='left'><b> Time</b></TD>\n\t\t\t\t\t\t<TD ALIGN='left'><b> Log code</b></TD>\n\t\t\t\t\t\t<TD ALIGN='left'><b> " . get_text("Unit") . "/Fac'y</b></TD>\n\t\t\t\t\t\t<TD ALIGN='left'><b> Data</b></TD>\n\t\t\t\t\t\t<TD ALIGN='left'><b> By</b></TD>\n\t\t\t\t\t\t<TD ALIGN='left'><b> From</b></TD>\n\t\t\t\t\t\t</TR>"; $do_hdr = FALSE; } $temp = explode(" ", format_date($row['when'])); $show_day = $temp[0] == $day_part ? "" : $temp[0]; $day_part = $temp[0]; echo "<TR CLASS = '{$evenodd[$i % 2]}'>\n\t\t\t\t<TD ALIGN='left'>{$show_day}</TD>\n\t\t\t\t<TD ALIGN='left'> {$temp[1]} </TD>\n\t\t\t\t<TD><b> {$types[$row['code']]} </b></TD>"; switch ($row['code']) { case $GLOBALS['LOG_INCIDENT_OPEN']: case $GLOBALS['LOG_INCIDENT_CLOSE']: case $GLOBALS['LOG_INCIDENT_CHANGE']: case $GLOBALS['LOG_INCIDENT_DELETE']: print "<TD></TD><TD></TD>"; break; case $GLOBALS['LOG_ACTION_ADD']: case $GLOBALS['LOG_ACTION_DELETE']: $act_str = array_key_exists($row['log_info'], $actions) ? $actions[$row['log_info']] : "[{$row['log_info']}]"; print "<TD></TD><TD> {$act_str} </TD>"; break; case $GLOBALS['LOG_PATIENT_ADD']: case $GLOBALS['LOG_PATIENT_DELETE']: $pat_str = array_key_exists($row['log_info'], $patients) ? $patients[$row['log_info']] : "[{$row['log_info']}]"; print "<TD></TD><TD> {$pat_str} </TD>"; break; case $GLOBALS['LOG_UNIT_STATUS']: case $GLOBALS['LOG_UNIT_COMPLETE']: case $GLOBALS['LOG_UNIT_CHANGE']: $the_unit = array_key_exists($row['the_unit_id'], $unit_names) ? $unit_names[$row['the_unit_id']] : "?? {$row['the_unit_id']}"; $the_status = array_key_exists($row['log_info'], $un_status) ? $un_status[$row['log_info']] : "?? {$row['the_unit_id']}"; print "<TD> {$the_unit} </TD><TD>{$the_status}</TD>"; break; case $GLOBALS['LOG_CALL_DISP']: case $GLOBALS['LOG_CALL_RESP']: case $GLOBALS['LOG_CALL_ONSCN']: case $GLOBALS['LOG_CALL_CLR']: case $GLOBALS['LOG_CALL_RESET']: // dump($row); $the_unit = array_key_exists($row['the_unit_id'], $unit_names) ? $unit_names[$row['the_unit_id']] : "?? {$row['the_unit_id']}"; print "<TD> {$the_unit} </TD><TD></TD>"; break; case $GLOBALS['LOG_CALL_REC_FAC_SET']: case $GLOBALS['LOG_CALL_REC_FAC_CHANGE']: case $GLOBALS['LOG_CALL_REC_FAC_UNSET']: case $GLOBALS['LOG_CALL_REC_FAC_CLEAR']: case $GLOBALS['LOG_FACILITY_INCIDENT_OPEN']: case $GLOBALS['LOG_FACILITY_INCIDENT_CLOSE']: case $GLOBALS['LOG_FACILITY_INCIDENT_CHANGE']: case $GLOBALS['LOG_FACILITY_DISP']: case $GLOBALS['LOG_FACILITY_RESP']: case $GLOBALS['LOG_FACILITY_ONSCN']: case $GLOBALS['LOG_FACILITY_CLR']: case $GLOBALS['LOG_FACILITY_RESET']: $the_facy = array_key_exists($row['facility'], $facilities) ? $facilities[$row['facility']] : "?? {$row['facility']}"; print "<TD>{$the_facy}</TD><TD></TD>"; break; default: print "<TD>ERROR {$row['code']} : {$row['log_id']} </TD"; } // end switch() echo "\n\t\t\t\t\t<TD> {$row['thename']} </TD>\n\t\t\t\t\t<TD> {$row['from']} </TD>"; echo "</TR>\n"; $i++; } } // end while() echo "<TR><TD COLSPAN=99 ALIGN='center'><HR STYLE = 'color: blue; size: 1; width: 50%'></TD></TR>"; echo "</TABLE>"; }
$own = get_group($v); if(!empty($own)) $owners[$own] = true; $mod = get_rights($v); $mods[$mod] = true; if(d_is_file($v)) $fsizes[] = show_size($v, false); else $dsizes[] = show_size($v, false); } light_message('<h3>Properties for selected items</h3> <p>size of '.sizeof($fsizes).' selected files: <b>'.show_size(0,false,array_sum($fsizes)).'</b></p> <p>size of '.sizeof($dsizes).' selected dirs: <b>'.show_size(0,false,array_sum($dsizes)).'</b></p> <p>total size: <b>'.show_size(0,false,array_sum($fsizes)+array_sum($dsizes)).'</b></p> '.(sizeof($mods)==1 ? '<p>mod: <b>'.get_rights($v,false).' ('.get_rights($v).')</b></p>' : '').' '.(sizeof($owners)==1 ? '<p>owner: <b>'.get_owner($v).'</b></p>' : '').' '.(sizeof($groups)==1 ? '<p>group: <b>'.get_group($v).'</b></p>' : '') ); } break; case 'terminal': if(!empty($_REQUEST['cmd'])) { $res = exec_command($_REQUEST['cmd']); }else { $res = array('cmd'=>'', 'output'=>'', 'dir'=> getcwd_short()); } light_message('<form action="?act=terminal" method="POST" style="margin: 0px; padding: 0px;"><h3>'.$res['dir'].'</h3>
} } } else { $message = 'Please login to manage collections'; echo 'Please login to manage collections'; } break; case 'updatecollectionitem': if (isset($_SESSION['user_name'])) { $collection_id = filter_input(INPUT_POST, 'collectionid', FILTER_VALIDATE_INT); if ($collection_id == NULL || $collection_id == FALSE) { $message = 'That Collection doesnt exist'; include 'home.php'; } else { $collection = get_collection($collection_id); $ownerinfo = get_owner($collection_id); $edit = false; $owner = true; $collection_items = get_collection_items($collection_id); $collection_item_ids = array(); $amounts = array(); $collection_item_ids = filter_input(INPUT_POST, 'collection_item_id', FILTER_VALIDATE_INT, FILTER_REQUIRE_ARRAY); $amounts = filter_input(INPUT_POST, 'amount', FILTER_VALIDATE_INT, FILTER_REQUIRE_ARRAY); for ($i = 0; $i < count($collection_item_ids); $i++) { $collection_item_id = $collection_item_ids[$i]; $amount = $amounts[$i]; if ($collection_item_id == NULL || $collection_item_id == false) { $message = 'ID field cannot be Empty'; die; } else { if ($amount <= 0) {
* @author Andreas Gohr <*****@*****.**> * @version $Id: borrowask.php,v 2.13 2008/06/15 13:58:13 andig2 Exp $ */ require_once './core/functions.php'; // Auth-Checks $user_id = get_current_user_id(); $user = get_username($user_id); if (empty($user)) { errorpage('Access denied', 'You don\'t have enough permissions to access this page try to <a href="login.php">login</a> first. (This feature is not available in Single User Mode)'); } if (empty($id) || empty($diskid)) { errorpage('Error', 'No Ids given'); } $owner = get_owner($diskid, true); $result = runSQL('SELECT email FROM ' . TBL_USERS . " WHERE name = '" . addslashes($owner) . "'"); $owner_email = $result[0]['email']; $result = runSQL('SELECT email FROM ' . TBL_USERS . " WHERE id = '" . addslashes($user_id) . "'"); $user_email = $result[0]['email']; $result = runSQL('SELECT title FROM ' . TBL_DATA . " WHERE id = '" . addslashes($id) . "'"); $title = $result[0]['title']; $mail = $lang['msg_borrowaskmail']; $subject = $lang['msg_borrowasksubject']; $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . '/show.php?id=' . $id; // replace place holders $mail = str_replace('%id%', $id, $mail); $mail = str_replace('%diskid%', $diskid, $mail); $mail = str_replace('%owner%', $owner, $mail); $mail = str_replace('%ownermail%', $owner_email, $mail); $mail = str_replace('%user%', $user, $mail);
print "<TD>" . get_single_option("severity", $row[severity]) . " </TD>\n"; if (get_variable('abbreviate_description')) { $wrap_var = " NOWRAP "; if (strlen($row[description]) > get_variable('abbreviate_description')) { $row[description] = substr($row[description], 0, get_variable('abbreviate_description')) . '...'; } } if (get_variable('abbreviate_affected')) { $wrap_var = " NOWRAP "; if (strlen($row[affected]) > get_variable('abbreviate_affected')) { $row[affected] = substr($row[affected], 0, get_variable('abbreviate_affected')) . '...'; } } print '<TD><A HREF="' . $GLOBALS['MAIN_PAGE'] . '.php?id=' . $row[id] . '">' . $row[description] . '</A></TD>'; print "<TD>" . $row[affected] . "</TD>\n"; print "<TD>" . get_owner($row[owner]) . " </TD>\n"; print "<TD>" . get_single_option("status", $row[status]) . " </TD></TR\n"; } print '</TABLE><BR><BR>'; break; } if ($action_is_activated) { /************************************************************ ***** ***** All this section needs serious fixin'. It's just a copy-paste/place-holder thing. ***** ************************************************************/ //actions //$query = "SELECT *,UNIX_TIMESTAMP(date) AS date FROM action WHERE description REGEXP '$_POST[frm_query]'"; $query = "SELECT *, DATE_FORMAT(t_date,' %m/%d/%Y') AS `t_date` "; $query = $query . " FROM `action` WHERE `description` REGEXP '{$_POST['frm_query']}'";
function show_actions($the_id, $theSort = "date", $links, $display) { /* list actions and patient data belonging to ticket */ if ($display) { $evenodd = array("even", "odd"); // class names for display table row colors } else { $evenodd = array("plain", "plain"); // print } $query = "SELECT `id`, `name`, `handle` FROM `{$GLOBALS['mysql_prefix']}responder`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); $responderlist = array(); $responderlist[0] = "NA"; while ($act_row = stripslashes_deep(mysql_fetch_assoc($result))) { $responderlist[$act_row['id']] = $act_row['handle']; } $print = "<TABLE BORDER='0' ID='patients' width=" . max(320, intval($_SESSION['scr_width'] * 0.4)) . ">"; /* list patients */ // $query = "SELECT *,UNIX_TIMESTAMP(date) AS `date`,UNIX_TIMESTAMP(updated) AS `updated` FROM `$GLOBALS[mysql_prefix]patient` WHERE `ticket_id`='$the_id' ORDER BY `date`"; $query = "SELECT *,UNIX_TIMESTAMP(date) AS `date`, UNIX_TIMESTAMP(updated) AS `updated`,\n\t\t\t`p`.`id` AS `patient_id`\n\t\tFROM `{$GLOBALS['mysql_prefix']}patient` `p` \n \t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}insurance` `i` ON (`i`.`id` = `p`.`insurance_id` )\n \t\tWHERE `ticket_id`='{$the_id}' ORDER BY `date`"; $result = mysql_query($query) or do_error('', 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__); $caption = get_text("Patient") . ": "; $actr = 0; // $genders = array("M", "F", "T", "U"); $genders = array("", "M", "F", "T", "U"); while ($act_row = stripslashes_deep(mysql_fetch_assoc($result))) { $the_gender = $genders[$act_row['gender']]; $the_patient_id = $act_row['patient_id']; $tipstr = addslashes("Name: {$act_row['name']}<br> Fullname: {$act_row['fullname']}<br> DOB: {$act_row['dob']}<br> Gender: {$the_gender}<br>Insurance_id: {$act_row['ins_value']}<br>Facility_contact: {$act_row['facility_contact']}<br> Date: {$act_row['date']}<br> Description: {$act_row['description']}"); $print .= "<TR CLASS='{$evenodd[$actr % 2]}' WIDTH='100%' onmouseout=\"UnTip();\" onmouseover=\"Tip('{$tipstr}');\">\n\t\t\t<TD VALIGN='top' NOWRAP CLASS='td_label'>" . $caption . "</TD>"; $print .= "<TD NOWRAP>" . $act_row['name'] . "</TD><TD NOWRAP>" . format_date($act_row['updated']) . "</TD>"; $print .= "<TD NOWRAP> by <B>" . get_owner($act_row['user']) . "</B>"; $print .= ($act_row['action_type'] != $GLOBALS['ACTION_COMMENT'] ? "*" : "-") . "</TD>\n\t\t\t<TD>" . shorten($act_row['description'], 24) . "</TD>"; if ($links) { $print .= "<TD> [<A HREF='patient.php?ticket_id={$the_id}&id=" . $act_row['id'] . "&action=edit'>edit</A>|\n\t\t\t\t<A HREF='patient.php?id={$the_patient_id}&ticket_id={$the_id}&action=delete'>delete</A>]</TD></TR>\n"; } $caption = ""; // once only $actr++; } /* list actions */ $query = "SELECT *,UNIX_TIMESTAMP(date) AS `date`,UNIX_TIMESTAMP(updated) AS `updated` FROM `{$GLOBALS['mysql_prefix']}action` WHERE `ticket_id`='{$the_id}' ORDER BY `date`"; $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__); if (mysql_affected_rows() + $actr == 0) { // 8/6/08 return ""; } else { $caption = "Actions: "; $pctr = 0; while ($act_row = stripslashes_deep(mysql_fetch_assoc($result))) { $tipstr = addslashes($act_row['description']); $print .= "<TR CLASS='{$evenodd[$pctr % 2]}' WIDTH='100%' onmouseout=\"UnTip();\" onmouseover=\"Tip('{$tipstr}');\" >\n\t\t\t\t<TD VALIGN='top' NOWRAP CLASS='td_label'>{$caption}</TD>"; $responders = explode(" ", trim($act_row['responder'])); // space-separated list to array $sep = $respstring = ""; for ($i = 0; $i < count($responders); $i++) { // build string of responder names if (array_key_exists($responders[$i], $responderlist)) { $respstring .= $sep . "• " . $responderlist[$responders[$i]]; $sep = "<BR />"; } } $print .= "<TD CLASS='normal_text' NOWRAP>" . $respstring . "</TD><TD CLASS='normal_text' NOWRAP>" . format_date($act_row['updated']) . "</TD>"; // 3/15/11 $print .= "<TD CLASS='normal_text' NOWRAP>by <B>" . get_owner($act_row['user']) . "</B> "; // 3/15/11 $print .= $act_row['action_type'] != $GLOBALS['ACTION_COMMENT'] ? '*' : '-'; $print .= "</TD><TD CLASS='normal_text' WIDTH='100%'>" . nl2br($act_row['description']) . "</TD>"; // 3/15/11 if ($links) { $print .= "<TD><NOBR> [<A HREF='action.php?ticket_id={$the_id}&id=" . $act_row['id'] . "&action=edit'>edit</A>|\n\t\t\t\t\t<A HREF='action.php?id=" . $act_row['id'] . "&ticket_id={$the_id}&action=delete'>delete</A>]</NOBR></TD></TR>\n"; } $caption = ""; $pctr++; } // end if/else (...) $print .= "</TABLE>\n"; return $print; } // end else }
} ?> <?php if (isset($collection_results)) { ?> <div class="collectionresults"> <a href="?action=collectionsearch">Search again</a> <h1>Results</h1> <ul> <?php foreach ($collection_results as $collection_result) { ?> <?php //var_dump($collection_result); $collection = get_collection($collection_result['collection_id']); $collection_owner = get_owner($collection_result['collection_id']); ?> <li><a href="<?php echo '.?action=collection&collectionid=' . $collection['collection_id']; ?> "><?php echo $collection['collection_name'] . ' by ' . $collection_owner['user_name']; ?> </a></li> <?php } ?> </ul> </div> <?php
function check_aws_settings($hostid) { if (check_template($hostid, "AmazonEC2")) { $owner = get_owner($hostid); if (!empty($owner)) { $owner_hostid = $owner["hostid"]; } else { return false; } } elseif (check_template($hostid, "AWSAccount")) { $owner_hostid = $hostid; } else { return false; } // check credentials $access_key = get_macro($owner_hostid, '{$KEY}'); $secret_key = get_macro($owner_hostid, '{$SECRET}'); if (!empty($access_key) && !empty($secret_key)) { return true; } return false; }
<INPUT TYPE="hidden" NAME="sortdir" VALUE=0 /> <TABLE BORDER="0" ALIGN="center"> <TR CLASS="even" VALIGN="top"><TD COLSPAN="2" ALIGN="CENTER"><FONT SIZE="+1">Table 'Unit types' - View Entry</FONT></TD></TR> <TR><TD> </TD></TR> <TR VALIGN="baseline" CLASS="odd"><TD CLASS="td_label" ALIGN="right">Type name:</TD> <TD><?php print $row['name']; ?> </TD></TR> <TR VALIGN="baseline" CLASS="even"><TD CLASS="td_label" ALIGN="right">Description:</TD> <TD><?php print $row['description']; ?> </TD></TR> <TR VALIGN="baseline" CLASS="odd"><TD CLASS="td_label" ALIGN="right">Icon:</TD> <TD><IMG ID='ID3' SRC="<?php print './our_icons/' . $sm_icons[$row['icon']]; ?> "></TD></TR> <TR VALIGN="baseline" CLASS="even"><TD CLASS="td_label" ALIGN="right">By:</TD> <TD><?php print get_owner($row['_by']); ?> </TD></TR> <TR VALIGN="baseline" CLASS="odd"><TD CLASS="td_label" ALIGN="right">From:</TD> <TD><?php print $row['_from']; ?> </TD></TR> <TR VALIGN="baseline" CLASS="even"><TD CLASS="td_label" ALIGN="right">On:</TD> <TD><?php print $row['_on']; ?> </TD></TR>
ini_set("display_errors", 1); //echo "<pre>"; //Example #1 clearstatcache() example $file = 'output_log.txt'; //touch($file); function get_owner($file) { $stat = stat($file); //print_r($stat) . PHP_EOL; $user = posix_getpwuid($stat['uid']); //print_r($user) . PHP_EOL; return $user['name']; } $format = "UID @ %s: %s\n"; printf($format, date('r'), get_owner($file)) . PHP_EOL; shell_exec("sudo chown daka $file"); printf($format, date('r'), get_owner($file)). PHP_EOL; clearstatcache(); printf($format, date('r'), get_owner($file)). PHP_EOL; ?>
} else { ?> <div class="login" id="loginDiv"> <form method="post" action="."> <input type="hidden" name="action" value="login"> <input type="email" name="email" placeholder="Email" required> <input type="password" name="password" placeholder="Password" required> <input type="submit" value="Login"> </form> <a href=".?action=signupform">Signup</a> </div> <?php } ?> <h3>Top 10 Collections</h3> <ul class="top10list"> <?php $collections_10 = get_top_collections(); //var_dump($collections_10); foreach ($collections_10 as $collection_data) { $collection_data = get_collection($collection_data['collection_id']); $collection_owner = get_owner($collection_data['collection_id']); echo '<li><a href=".?action=collection&collectionid=' . $collection_data['collection_id'] . '">' . $collection_data['collection_name'] . ' by ' . $collection_owner['user_name'] . '</a></li> '; } ?> </ul> <a href="?action=collectionsearch">Search Collections</a> </div>
$GLOBALS['phpgw']->template->parse('fieldshandle', 'fields', True); } $GLOBALS['phpgw']->template->set_var('csv_field', 'Categories'); $GLOBALS['phpgw']->template->set_var('csv_idx', 'cat_id'); $GLOBALS['phpgw']->template->set_var('trans', ''); $GLOBALS['phpgw']->template->set_var('addr_fields', get_categories()); $GLOBALS['phpgw']->template->parse('fieldshandle', 'fields', True); $GLOBALS['phpgw']->template->set_var('csv_field', 'Access'); $GLOBALS['phpgw']->template->set_var('csv_idx', 'access'); $GLOBALS['phpgw']->template->set_var('trans', ''); $GLOBALS['phpgw']->template->set_var('addr_fields', get_access()); $GLOBALS['phpgw']->template->parse('fieldshandle', 'fields', True); $GLOBALS['phpgw']->template->set_var('csv_field', 'Owner'); $GLOBALS['phpgw']->template->set_var('csv_idx', 'owner'); $GLOBALS['phpgw']->template->set_var('trans', ''); $GLOBALS['phpgw']->template->set_var('addr_fields', get_owner()); $GLOBALS['phpgw']->template->parse('fieldshandle', 'fields', True); $GLOBALS['phpgw']->template->set_var('lang_start', lang('Startrecord')); $GLOBALS['phpgw']->template->set_var('start', $_POST['start']); $GLOBALS['phpgw']->template->set_var('lang_max', lang('Number of records to read (<=200)')); $GLOBALS['phpgw']->template->set_var('max', 200); $GLOBALS['phpgw']->template->parse('ffooterhandle', 'ffooter'); fclose($fp); $old = $csvfile; $csvfile = $GLOBALS['phpgw_info']['server']['temp_dir'] . '/addrbook_import_' . $GLOBALS['phpgw_info']['user']['account_id'] . '_' . basename($csvfile); rename($old, $csvfile); $GLOBALS['phpgw']->session->appsession('import_data', 'addressbook', $csvfile); //$hiddenvars .= '<input type="hidden" name="csvfile" value="'.$csvfile.'">'; $mktime_lotus = "{$PSep}0?([0-9]+)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*)[ .:-]+0?([0-9]*).*{$ASep}@mktime({$VPre}4,{$VPre}5,{$VPre}6,{$VPre}2,{$VPre}3,{$VPre}1)"; $help_on_trans = "<a name=\"help\"></a><b>How to use Translation's</b><p>" . "Translations enable you to change / adapt the content of each CSV field for your needs. <br />" . "General syntax is: <b>pattern1 {$ASep} replacement1 {$PSep} ... {$PSep} patternN {$ASep} replacementN</b><br />" . "If the pattern-part of a pair is ommited it will match everything ('^.*\$'), which is only " . "usefull for the last pair, as they are worked from left to right.<p>" . "First example: <b>1{$ASep}private{$PSep}public</b><br />" . "This will translate a '1' in the CSV field to 'privat' and everything else to 'public'.<p>" . "Patterns as well as the replacement can be regular expressions (the replacement is done via ereg_replace). " . "If, after all replacements, the value starts with an '@' the whole value is eval()'ed, so you " . "may use all php, phpgw plus your own functions. This is quiet powerfull, but <u>circumvents all ACL</u>.<p>" . "Example using regular expressions and '@'-eval(): <br /><b>{$mktime_lotus}</b><br />" . "It will read a date of the form '2001-05-20 08:00:00.00000000000000000' (and many more, see the regular expr.). " . "The [ .:-]-separated fields are read and assigned in different order to @mktime(). Please note to use " . "{$VPre} insted of a backslash (I couldn't get backslash through all the involved templates and forms.) " . "plus the field-number of the pattern.<p>" . "In addintion to the fields assign by the pattern of the reg.exp. you can use all other CSV-fields, with the " . "syntax <b>{$CPre}CSV-FIELDNAME{$CPos}</b>. Here is an example: <br />" . "<b>.+{$ASep}{$CPre}Company{$CPos}: {$CPre}NFamily{$CPos}, {$CPre}NGiven{$CPos}{$PSep}{$CPre}NFamily{$CPos}, {$CPre}NGiven{$CPos}</b><br />" . "It is used on the CSV-field 'Company' and constructs a something like <i>Company: FamilyName, GivenName</i> or " . "<i>FamilyName, GivenName</i> if 'Company' is empty.<p>" . "You can use the 'No CSV #'-fields to assign csv-values to more than on field, the following example uses the " . "csv-field 'Note' (which gots already assingned to the description) and construct a short subject: " . "<b>@substr({$CPre}Note{$CPos},0,60).' ...'</b><p>" . "Their is one important user-function for the Info Log:<br />" . "<b>@addr_id({$CPre}NFamily{$CPos},{$CPre}NGiven{$CPos},{$CPre}Company{$CPos})</b> " . "searches the addressbook for an address and returns the id if it founds an exact match of at least " . "<i>NFamily</i> AND (<i>NGiven</i> OR <i>Company</i>). This is necessary to link your imported InfoLog-entrys " . "with the addressbook.<br />" . "<b>@cat_id(Cat1,...,CatN)</b> returns a (','-separated) list with the cat_id's. If a category isn't found, it " . "will be automaticaly added.<p>" . "I hope that helped to understand the features, if not <a href='mailto:RalfBecker@outdoor-training.de'>ask</a>."; $GLOBALS['phpgw']->template->set_var('help_on_trans', lang($help_on_trans));
function get_info($f) { global $descr; if(!isset($_REQUEST['type'])) $_REQUEST['type'] = determine_type($f); if(isset($_REQUEST['file'])) $f = clean($_REQUEST['file'], true); if($f == lang('My computer')) { $_RESULT = array( 'name' => 'details', 'filename' => htmlspecialchars($f), 'dir' => false, 'type' => lang('System folder'), ); }else if(in_array($_REQUEST['type'],array(tDIR,tFILE))) { if(!@lstat($f)) return null; $ext=pathinfo($f); @$ext=strtolower($ext['extension']); $imgext = array('jpeg','jpe','gif','png','jpg'); if(preg_match('/Darwin/is', PHP_OS)) $imgext = array_merge($imgext, explode(' ','pdf doc docx ppt pptx xls xlsx tiff tif bmp mov avi mpg mp4 tga psd svg eps key pages html')); $img=in_array($ext,$imgext); //echo $f; $real_link = $link_raw = @is_link($f) && function_exists('readlink') ? readlink($f) : false; if($link_raw !== false && $link_raw[0] != '/') // not absolute link { $link_raw = abs_path( dirname($f).'/'.$link_raw ); } $_RESULT=array( 'name' => 'details', 'filename' => htmlspecialchars(basename($f)), 'filename_encoded' => rawurlencode($f), 'fullpath' => $f, 'link' => $link_raw !== false ? htmlspecialchars($real_link) : false, 'link_raw' => $link_raw, 'md5(filename)' => md5($f), 'dir' => d_is_dir($f), 'type' => (d_is_dir($f) ? false : get_type($f)), 'changed' => ((@$t=filemtime($f)) ? date('d F Y, H:i',$t) : false), 'size' => ( (d_is_dir($f) && !SHOW_DIRSIZE) ? (/*no subdirectories*/!empty($GLOBALS['files']) && sizeof($GLOBALS['dirs'])==0 && !empty($GLOBALS['sz']) ? show_size(true,true,$GLOBALS['sz']) : false) : show_size($f)), 'size_bytes' => d_filesize($f), 'thumb' => ($img ? '<div style="padding-bottom: 10px;" align="center"><img src="system/preview.php?file='.rawurlencode($f).'&size=small" align="center"></div>' : false), 'id3' => (($img && d_filesize($f) < 15*1024*1024 && @$sz=getimagesize($f)) ? 'Dimensions: '.$sz[0].'x'.$sz[1] : ''), 'owner' => get_owner($f), 'group' => get_group($f), 'rights' => d_get_rights($f, false), ); }else if($_REQUEST['type']==tDRIVE) { $_RESULT=array( 'name' => 'details', 'filename' => !empty($_REQUEST['name']) ? $_REQUEST['name'] : $_SESSION['DIR'], 'type' => $descr[$_REQUEST['icon']], 'dir' => false, ); if(!empty($_REQUEST['fs'])) $_RESULT['fs'] = $_REQUEST['fs']; if($s = disk_free_space($f)) $_RESULT['free']=show_size(true,true,$s); if($s = disk_total_space($f)) $_RESULT['total']=show_size(true,true,$s); } return $_RESULT; }
global $messages, $USER, $CFG; $action = optional_param('action', ''); $comment_form_type = optional_param('comment_form_type', ''); if ($action) { switch ($action) { // Create a comment case "comment:add": $ok = false; $comment = new StdClass(); $comment->object_id = optional_param('object_id', 0, PARAM_INT); $comment->object_type = optional_param('object_type', ''); $comment->body = trim(optional_param('new_comment')); $comment->postedname = trim(optional_param('postedname')); $commentbackup = $comment; if (!empty($comment->object_id) && !empty($comment->body) && !empty($comment->postedname)) { $object_owner = get_owner($comment->object_id, $comment->object_type); $where = run("users:access_level_sql_where", $USER->ident); if ($comment_form_type == 'integrated') { $redirect_url = get_url($comment->object_id, $comment->object_type); } elseif ($comment_form_type == 'separate') { $redirect_url = $CFG->wwwroot . "mod/generic_comments/comment_page.php?object_id={$comment->object_id}&object_type={$comment->object_type}"; } if (run("spam:check", $comment->body) != true) { // If we're logged on or comments are public, add one if (isloggedin() || !$CFG->disable_publiccomments && user_flag_get("publiccomments", $object_owner)) { $comment->owner = $USER->ident; $comment->posted = time(); $comment = plugin_hook("comment", "create", $comment); if (!empty($comment)) { $insert_id = insert_record('comments', $comment); $comment->ident = $insert_id;
function show_actions($the_id, $theSort = "date", $links, $display) { /* list actions and patient data belonging to ticket */ if ($display) { $evenodd = array("even", "odd"); // class names for display table row colors } else { $evenodd = array("plain", "plain"); // print } $query = "SELECT `id`, `name` FROM `{$GLOBALS['mysql_prefix']}responder`"; $result = mysql_query($query) or do_error($query, $query, mysql_error(), basename(__FILE__), __LINE__); $responderlist = array(); $responderlist[0] = "NA"; while ($act_row = stripslashes_deep(mysql_fetch_assoc($result))) { $responderlist[$act_row['id']] = $act_row['name']; } $print = "<TABLE BORDER='0' ID='patients' width=" . max(320, intval($_SESSION['scr_width'] * 0.4)) . ">"; /* list patients */ $query = "SELECT *,UNIX_TIMESTAMP(date) AS `date`,UNIX_TIMESTAMP(updated) AS `updated` FROM `{$GLOBALS['mysql_prefix']}patient` WHERE `ticket_id`='{$the_id}' ORDER BY `date`"; $result = mysql_query($query) or do_error('', 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__); $caption = get_text("Patient") . ": "; $actr = 0; while ($act_row = stripslashes_deep(mysql_fetch_assoc($result))) { $print .= "<TR CLASS='" . $evenodd[$actr % 2] . "' WIDTH='100%'><TD VALIGN='top' NOWRAP CLASS='td_label'>" . $caption . "</TD>"; $print .= "<TD NOWRAP>" . $act_row['name'] . "</TD><TD NOWRAP>" . format_date($act_row['updated']) . "</TD>"; $print .= "<TD NOWRAP> by <B>" . get_owner($act_row['user']) . "</B>"; $print .= ($act_row['action_type'] != $GLOBALS['ACTION_COMMENT'] ? "*" : "-") . "</TD><TD>" . nl2br($act_row['description']) . "</TD>"; if ($links) { $print .= "<TD> [<A HREF='patient.php?ticket_id={$the_id}&id=" . $act_row['id'] . "&action=edit'>edit</A>|\n\t\t\t\t<A HREF='patient.php?id=" . $act_row['id'] . "&ticket_id={$the_id}&action=delete'>delete</A>]</TD></TR>\n"; } $caption = ""; // once only $actr++; } /* list actions */ $query = "SELECT *,UNIX_TIMESTAMP(date) AS `date`,UNIX_TIMESTAMP(updated) AS `updated` FROM `{$GLOBALS['mysql_prefix']}action` WHERE `ticket_id`='{$the_id}' ORDER BY `date`"; $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__); if (mysql_affected_rows() + $actr == 0) { // 8/6/08 return ""; } else { $caption = "Actions: "; $pctr = 0; while ($act_row = stripslashes_deep(mysql_fetch_assoc($result))) { $print .= "<TR CLASS='" . $evenodd[$pctr % 2] . "' WIDTH='100%'><TD VALIGN='top' NOWRAP CLASS='td_label'>{$caption}</TD>"; $responders = explode(" ", trim($act_row['responder'])); // space-separated list to array $sep = $respstring = ""; for ($i = 0; $i < count($responders); $i++) { // build string of responder names if (array_key_exists($responders[$i], $responderlist)) { $respstring .= $sep . "• " . $responderlist[$responders[$i]]; $sep = "<BR />"; } } $print .= "<TD NOWRAP>" . $respstring . "</TD><TD NOWRAP>" . format_date($act_row['updated']) . "</TD>"; $print .= "<TD NOWRAP>by <B>" . get_owner($act_row['user']) . "</B> "; $print .= $act_row['action_type'] != $GLOBALS['ACTION_COMMENT'] ? '*' : '-'; $print .= "</TD><TD WIDTH='100%'>" . nl2br($act_row['description']) . "</TD>"; if ($links) { $print .= "<TD><NOBR> [<A HREF='action.php?ticket_id={$the_id}&id=" . $act_row['id'] . "&action=edit'>edit</A>|\n\t\t\t\t\t<A HREF='action.php?id=" . $act_row['id'] . "&ticket_id={$the_id}&action=delete'>delete</A>]</NOBR></TD></TR>\n"; } $caption = ""; $pctr++; } // end if/else (...) $print .= "</TABLE>\n"; return $print; } // end else }
function do_ticket($theRow, $theWidth, $search = FALSE, $dist = TRUE) { // returns table - 6/26/10 global $iw_width, $nature, $disposition, $patient, $incident, $incidents; // 12/3/10 $tickno = get_variable('serial_no_ap') == 0 ? " <I>(#" . $theRow['id'] . ")</I>" : ""; // 1/25/09 switch ($theRow['severity']) { //color tickets by severity case $GLOBALS['SEVERITY_MEDIUM']: $severityclass = 'severity_medium'; break; case $GLOBALS['SEVERITY_HIGH']: $severityclass = 'severity_high'; break; default: $severityclass = 'severity_normal'; break; } $print = "<TABLE BORDER='0' ID='left' width='" . $theWidth . "'>\n"; // $print .= "<TR CLASS='even'><TD ALIGN='left' CLASS='td_data' COLSPAN=2 ALIGN='center'><B>{$incident}: <I>" . highlight($search, $theRow['scope']) . "</B>" . $tickno . "</TD></TR>\n"; $print .= "<TR CLASS='odd' ><TD ALIGN='left'>" . get_text("Addr") . ":</TD>\t\t<TD ALIGN='left'>" . highlight($search, $theRow['tick_street']) . "</TD></TR>\n"; $print .= "<TR CLASS='even' ><TD ALIGN='left'>" . get_text("City") . ":</TD>\t\t\t<TD ALIGN='left'>" . highlight($search, $theRow['tick_city']); $print .= " " . highlight($search, $theRow['tick_state']) . "</TD></TR>\n"; $print .= "<TR CLASS='odd' ><TD ALIGN='left'>" . get_text("Priority") . ":</TD> <TD ALIGN='left' CLASS='" . $severityclass . "'>" . get_severity($theRow['severity']); $print .= " {$nature}: " . get_type($theRow['in_types_id']); $print .= "</TD></TR>\n"; $print .= "<TR CLASS='even' VALIGN='top'><TD ALIGN='left'>" . get_text("Synopsis") . ":</TD>\t<TD ALIGN='left'>" . replace_quotes(highlight($search, nl2br($theRow['tick_descr']))) . "</TD></TR>\n"; // 8/12/09 $print .= "<TR CLASS='odd' ><TD ALIGN='left'>" . get_text("Protocol") . ":</TD> <TD ALIGN='left' CLASS='{$severityclass}'>{$theRow['protocol']}</TD></TR>\n"; // 7/16/09 $print .= "<TR CLASS='even' VALIGN='top'><TD ALIGN='left'>" . get_text("911 Contacted") . ":</TD>\t<TD ALIGN='left'>" . highlight($search, nl2br($theRow['nine_one_one'])) . "</TD></TR>\n"; // 6/26/10 $print .= "<TR CLASS='odd'><TD ALIGN='left'>" . get_text("Reported by") . ":</TD>\t<TD ALIGN='left'>" . highlight($search, $theRow['contact']) . "</TD></TR>\n"; $print .= "<TR CLASS='even' ><TD ALIGN='left'>" . get_text("Phone") . ":</TD>\t\t\t<TD ALIGN='left'>" . format_phone($theRow['phone']) . "</TD></TR>\n"; $end_date = intval($theRow['problemend']) > 1 ? $theRow['problemend'] : time() - intval(get_variable('delta_mins')) * 60; $elapsed = my_date_diff($theRow['problemstart'], $end_date); $elaped_str = intval($theRow['problemend']) > 1 ? "" : " ({$elapsed})"; $print .= "<TR CLASS='odd'><TD ALIGN='left'>" . get_text("Status") . ":</TD>\t\t<TD ALIGN='left'>" . get_status($theRow['status']) . "{$elaped_str}</TD></TR>\n"; $by_str = $theRow['call_taker'] == 0 ? "" : " by " . get_owner($theRow['call_taker']) . " "; // 1/7/10 $print .= "<TR CLASS='even'><TD ALIGN='left'>" . get_text("Written") . ":</TD>\t\t<TD ALIGN='left'>" . format_date($theRow['date']) . $by_str; $print .= " Updated: " . format_date($theRow['updated']) . "</TD></TR>\n"; $print .= empty($theRow['booked_date']) ? "" : "<TR CLASS='odd'><TD ALIGN='left'>Scheduled date:</TD>\t\t<TD ALIGN='left'>" . format_date($theRow['booked_date']) . "</TD></TR>\n"; // 10/6/09 $print .= "<TR CLASS='even' ><TD ALIGN='left' COLSPAN='2'> \t<TD ALIGN='left'></TR>\n"; // separator $print .= empty($theRow['fac_name']) ? "" : "<TR CLASS='odd' ><TD ALIGN='left'>{$incident} at Facility:</TD>\t\t<TD ALIGN='left'>" . highlight($search, $theRow['fac_name']) . "</TD></TR>\n"; // 8/1/09 $print .= empty($theRow['rec_fac_name']) ? "" : "<TR CLASS='even' ><TD ALIGN='left'>Receiving Facility:</TD>\t\t<TD ALIGN='left'>" . highlight($search, $theRow['rec_fac_name']) . "</TD></TR>\n"; // 10/6/09 $print .= empty($theRow['comments']) ? "" : "<TR CLASS='odd' VALIGN='top'><TD ALIGN='left'>{$disposition}:</TD>\t<TD ALIGN='left'>" . replace_quotes(highlight($search, nl2br($theRow['comments']))) . "</TD></TR>\n"; $print .= "<TR CLASS='even' ><TD ALIGN='left'>" . get_text("Run Start") . ":</TD>\t\t\t\t\t<TD ALIGN='left'>" . format_date($theRow['problemstart']); $elaped_str = intval($theRow['problemend']) > 1 ? $elapsed : ""; $print .= " End: " . format_date($theRow['problemend']) . " ({$elaped_str})</TD></TR>\n"; $locale = get_variable('locale'); // 08/03/09 switch ($locale) { case "0": $grid_type = " USNG " . LLtoUSNG($theRow['lat'], $theRow['lng']); break; case "1": $grid_type = " OSGB " . LLtoOSGB($theRow['lat'], $theRow['lng']); // 8/23/08, 10/15/08, 8/3/09 break; case "2": $coords = $theRow['lat'] . "," . $theRow['lng']; // 8/12/09 $grid_type = " UTM " . toUTM($coords); // 8/23/08, 10/15/08, 8/3/09 break; default: print "ERROR in " . basename(__FILE__) . " " . __LINE__ . "<BR />"; } $print .= "<TR CLASS='odd'><TD ALIGN='left' onClick = 'javascript: do_coords(" . $theRow['lat'] . "," . $theRow['lng'] . ")'><U>" . get_text("Position") . "</U>: </TD>\n\t\t<TD ALIGN='left'>" . get_lat($theRow['lat']) . " " . get_lng($theRow['lng']) . $grid_type . "</TD></TR>\n"; // 9/13/08 $print .= "<TR><TD colspan=2 ALIGN='left'>"; $print .= show_log($theRow[0]); // log $print .= "</TD></TR>"; $print .= "<TR STYLE = 'display:none;'><TD colspan=2><SPAN ID='oldlat'>" . $theRow['lat'] . "</SPAN><SPAN ID='oldlng'>" . $theRow['lng'] . "</SPAN></TD></TR>"; $print .= "</TABLE>\n"; $print .= show_assigns(0, $theRow[0]); // 'id' ambiguity - 7/27/09 $print .= show_actions($theRow[0], "date", FALSE, FALSE); return $print; }
foreach ($medias['media']['nodes'] as $img) { $pics[$img['id']] = array("id" => $img['id'], "code" => $img['code'], "thumb" => $img['thumbnail_src'], "full" => $img['display_src']); if ($db->alreadyExistsPicture($img['id'])) { $cont = false; } } $turns++; if (1) { echo "turn: {$turns}, count: " . count($pics) . ", id: {$id}" . ", start: " . $medias['media']['page_info']['start_cursor'] . ", end: " . $medias['media']['page_info']['end_cursor'] . "<br />\n"; } $id = $medias['media']['page_info']['end_cursor']; sleep(0.5); } while ($cont && $turns < 50 && $medias['media']['page_info']['start_cursor'] != $medias['media']['page_info']['end_cursor']); foreach ($pics as $p) { if (!$db->alreadyExistsPicture($p['id'])) { $p['owner'] = get_owner($tmpfname, $ua, $p['code']); $db->storePicture($p['id'], $tag, $p['code'], $p['thumb'], $p['full'], $p['owner']); echo "<a href='https://www.instagram.com/p/{$p[code]}/' target='_blank'>"; echo "<img src='{$p[thumb]}' alt='{$tag} #{$p[id]}' width='128px' /></a>"; } } function get_owner($tmpfname, $ua, $code) { $url = "https://www.instagram.com/p/" . $code . "/"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_COOKIEJAR, $tmpfname); curl_setopt($curl, CURLOPT_COOKIEFILE, $tmpfname); curl_setopt($curl, CURLOPT_USERAGENT, $ua); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLINFO_HEADER_OUT, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);