예제 #1
0
function return_parent()
{
    return get_parent(false);
}
예제 #2
0
 function breadcrumb_arrays($index, $id)
 {
     $crumb =& $crumb;
     if (isset($index[get_parent($index, $id)])) {
         $_name = dbarray(dbquery("SELECT weblink_cat_id, weblink_cat_name, weblink_cat_parent FROM " . DB_WEBLINK_CATS . " WHERE weblink_cat_id='" . $id . "'"));
         $crumb = array('link' => INFUSIONS . "weblinks/weblinks.php?cat_id=" . $_name['weblink_cat_id'], 'title' => $_name['weblink_cat_name']);
         if (isset($index[get_parent($index, $id)])) {
             if (get_parent($index, $id) == 0) {
                 return $crumb;
             }
             $crumb_1 = breadcrumb_arrays($index, get_parent($index, $id));
             $crumb = array_merge_recursive($crumb, $crumb_1);
             // convert so can comply to Fusion Tab API.
         }
     }
     return $crumb;
 }
예제 #3
0
/**
 * @depreciated as of 2.04
 */
function return_parent()
{
    return get_parent(FALSE);
}
예제 #4
0
function get_parent($parent)
{
    global $datefmt, $tblprefix, $strBorn, $strDied, $restrictdate, $level, $err_father, $err_mother, $grid, $strLivingPerson, $countlines, $outputstring, $htmlstring, $gridsize;
    $peep = new PersonDetail();
    $peep->person_id = $parent;
    $peep->queryType = Q_IND;
    $dao = getPeopleDAO();
    $dao->getPersonDetails($peep);
    // check if there is a parent
    if ($peep->numResults != 1) {
        return;
    } else {
        $per = $peep->results[0];
    }
    $level += 1;
    // ---- position father
    $fhtmlstring = "<div style=\"position: absolute; left: " . a2p($level) . "px;\">";
    $fhtmlstring .= "(" . $level . ") ";
    $nextfather = $per->father->person_id;
    $nextmother = $per->mother->person_id;
    if ($nextfather != 0) {
        get_parent($nextfather);
    }
    $fhtmlstring .= $per->getFullLink();
    $fhtmlstring .= "</div> \n";
    // ---- grid lines
    if ($level > 0) {
        for ($y = 1; $y <= $level - 1; $y += 1) {
            if ($grid[$y] != 0) {
                $fhtmlstring .= "<img alt=\"\" src=\"images/point.gif\" height=\"16\" width=\"1\" style=\"position: absolute; left: " . (a2p($y - 1) + 7) . "px;\" border=\"0\">\n";
            }
        }
        $fhtmlstring .= "<img alt=\"\" src=\"images/point-";
        if ($per->gender == "M") {
            $fhtmlstring .= "m";
            $grid[$level] = 1;
        } else {
            $fhtmlstring .= "f";
            $grid[$level] = 0;
        }
        $fhtmlstring .= ".gif\" height=\"16\" width=\"" . ($gridsize - 9) . "\" style=\"position: absolute; left: " . (a2p($y - 1) + 7) . "px;\" border=\"0\">\n";
    }
    // ---- end grid lines
    $fhtmlstring .= "<br> \n";
    $outputstring[] = $fhtmlstring;
    $countlines += 1;
    if ($nextmother != 0) {
        $grid[$level + 1] = 1;
        get_parent($nextmother);
    } else {
        $grid[$level + 1] = 0;
    }
    $level -= 1;
    // end get parents
}
예제 #5
0
/**
 * bootstrap_get_breadcrumbs()
 *
 * This creates the list for breadcrumbs to the current page. Requires
 * i18n Navigation plugin for full breadcrumbs list else it creates
 * a list with only Home / %parent% / %child%
 * This function support the following plugins:
 *   - i18n Navigation (Supported but doesn't format well unless modified)
 *   - SimpleBreadcrumbs v1.0+ (Preferred)
 * 
 * @return (string) : String containing HTML <ul> list of breadcrumb data
 */
function bootstrap_get_breadcrumbs()
{
    if (function_exists('get_breadcrumbs')) {
        # SimpleBreadcrumbs v1.0+
        get_breadcrumbs(return_page_slug());
    } elseif (!function_exists('get_i18n_breadcrumbs')) {
        # i18n Navigation plugin
        echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>';
        echo '<li class="current">';
        get_i18n_breadcrumbs(return_page_slug());
        echo '</li>';
    } else {
        # No supported plugins found!
        $parent = (string) get_parent(FALSE);
        echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>';
        if (!empty($parent) && $parent != 'index') {
            $file = GSDATAPAGESPATH . $parent . '.xml';
            if (file_exists($file)) {
                $p = getXML($file);
                $p_title = $p->title;
                $p_slug = $p->slug;
                echo '<li><a href="' . find_url($parent, '') . '">' . $p_title . '</a></li>';
            }
        }
        echo '<li class="active">' . get_page_clean_title(FALSE) . '</li>';
    }
}
예제 #6
0
파일: meta.php 프로젝트: synapticism/ubik
function get_data()
{
    if (!in_the_loop()) {
        return;
    }
    return ['type' => get_type(), 'parent' => get_parent(), 'categories' => get_categories(), 'tags' => get_tags(), 'taxonomies' => get_taxonomies(), 'author' => get_author(), 'published' => date_published(), 'updated' => date_updated()];
}
예제 #7
0
|--------------------|
*/
$equal_search = array('category_active_status', 'category_visibility_status');
$default_sort_by = "category_order";
$pgdata = page_init($equal_search, $default_sort_by);
// static/general.php
$page = $pgdata['page'];
$query_per_page = $pgdata['query_per_page'];
$sort_by = $pgdata['sort_by'];
$first_record = $pgdata['first_record'];
$search_parameter = $pgdata['search_parameter'];
$search_value = $pgdata['search_value'];
$search_query = $pgdata['search_query'];
$search = $pgdata['search'];
$parent_id = $_REQUEST['cid'];
$parent = get_parent($parent_id);
$full_order = count_category($parent['relation_level'] + 1, $parent_id, $search_query, $sort_by, $query_per_page);
$total_query = $full_order['total_query'];
$total_page = ceil($full_order['total_query'] / $query_per_page);
// CALL FUNCTION
$listing_order = get_categories($parent['relation_level'] + 1, $parent_id, $search_query, $sort_by, $first_record, $query_per_page);
// HANDLING ARROW SORTING
if ($_REQUEST['srt'] == "category_name DESC") {
    $arr_order_number = "<span class=\"sort-arrow-up\"></span>";
} else {
    if ($_REQUEST['srt'] == "category_name") {
        $arr_order_number = "<span class=\"sort-arrow-down\"></span>";
    } else {
        $arr_order_number = "<span class=\"sort-arrow-down\"></span>";
    }
}
예제 #8
0
function get_subtasks($parent, $level = 1, $type = "", $where = "", $orderby = "", $bg = "", $preview = false)
{
    //echo "$orderby<br />";
    global $db, $slave, $priorities, $parent_task_id, $expand_collapse, $target_path, $total_tasks;
    if ($orderby != "") {
        $parent = null;
    }
    //if (!is_null($parent)) echo "parent is $parent";
    $expand_collapse = array("expand", "collapse");
    $creator_id = $_SESSION['user_id'];
    if ($_SESSION['project_user_id']) {
        $creator_id = $_SESSION['project_user_id'];
    }
    if (($_GET['today'] or $_GET['user_id'] or $_GET['week']) and ($_GET['action'] != "complete" and $_GET['action'] != "log")) {
        $where2 = "LEFT OUTER JOIN Task_Acknowledgement as A ON T.Task_ID=A.Task_ID WHERE (A.Accepted=1 OR T.Creator_ID=" . $creator_id . ") AND ";
    } else {
        $where2 = "LEFT OUTER JOIN Task_Acknowledgement as A ON T.Task_ID=A.Task_ID WHERE ";
    }
    //$where2="WHERE ";
    if (!is_null($parent)) {
        if (strlen($where) == 4) {
            $where = "";
        }
        if ($parent === 0) {
            if ($_GET['assign']) {
                $where2 = $where2 . "(Parent_Task_ID={$parent} OR Parent_Task_ID NOT IN (SELECT Task_ID FROM Tasks as T2 LEFT OUTER JOIN User_Departments as D2 ON T2.Department_ID=D2.Department_ID LEFT OUTER JOIN Users as L2 ON D2.User_ID=L2.User_ID WHERE " . str_replace(".", "2.", substr($where, 4)) . ")) {$where}";
            } else {
                $where2 = $where2 . "(Parent_Task_ID={$parent} OR Parent_Task_ID NOT IN (SELECT Task_ID FROM Tasks as T2 LEFT OUTER JOIN User_Departments as D2 ON T2.Department_ID=D2.Department_ID LEFT OUTER JOIN Users as U2 ON D2.User_ID=U2.User_ID WHERE " . str_replace(".", "2.", substr($where, 4)) . ")) {$where}";
            }
        } else {
            $where2 = $where2 . "Parent_Task_ID={$parent} {$where}";
        }
    } else {
        $where2 = $where2 . substr($where, 4);
    }
    //$where2=$where2."T.Task_ID NOT IN (SELECT Parent_Task_ID FROM Tasks) $where"; //if (is_null($parent) AND $subtasks[$t]['Parent_Task_ID']>0)
    if ($type == "complete" and $orderby == "") {
        $orderby = "Log_date DESC, Task_Name";
    }
    //else if ($orderby=="" and $parent==0) $orderby="Task_Name";
    //else if ($orderby!="") $orderby=$orderby." Task_Name";
    if ($orderby and !strstr($orderby, "Task_Name")) {
        $orderby = "ORDER BY " . $orderby . " Task_Name";
    }
    if ($orderby and !strstr($orderby, "ORDER BY")) {
        $orderby = "ORDER BY " . $orderby;
    }
    if (!$orderby and $parent == 0) {
        $orderby2 = "ORDER BY Finish_Date IS NULL, Finish_Date";
    }
    if (!strstr($where, "L.User_ID")) {
        $log = "AND L.Log_Progress=100";
    }
    if (strstr($orderby, "Request_Username")) {
        $orderby = str_replace("Request_Username", "RL.Username", $orderby);
        $query = "SELECT T.*, Project_Name, Log_Date, AD.Department_Name as Affected_Department_Name, RL.Username FROM Login as RL, Users as U, Tasks as T LEFT OUTER JOIN Departments as AD ON T.Affected_Department=AD.Department_ID LEFT OUTER JOIN Projects as P ON T.Project_ID=P.Project_ID LEFT OUTER JOIN Task_Logs as L ON T.Task_ID=L.Task_ID {$log} LEFT OUTER JOIN User_Departments as D ON T.Department_ID=D.Department_ID LEFT OUTER JOIN Departments as M ON D.Department_ID=M.Department_ID LEFT OUTER JOIN Login as G ON T.User_ID=G.User_ID {$where2} AND U.User_ID=T.Request_User_ID AND U.User_ID=RL.User_ID GROUP BY T.Task_ID {$orderby} {$orderby2}";
        //echo $query;
    } elseif (strstr($orderby, "Username")) {
        $query = "SELECT T.*, Project_Name, Log_Date, AD.Department_Name as Affected_Department_Name FROM Tasks as T LEFT OUTER JOIN Departments as AD ON T.Affected_Department=AD.Department_ID LEFT OUTER JOIN Projects as P ON T.Project_ID=P.Project_ID LEFT OUTER JOIN Task_Logs as L ON T.Task_ID=L.Task_ID {$log} LEFT OUTER JOIN User_Departments as D ON T.Department_ID=D.Department_ID LEFT OUTER JOIN Departments as M ON D.Department_ID=M.Department_ID LEFT OUTER JOIN Users as U ON D.User_ID=U.User_ID LEFT OUTER JOIN Login as G ON T.User_ID=G.User_ID {$where2} GROUP BY T.Task_ID {$orderby} {$orderby2}";
    } else {
        $query = "SELECT T.*, Project_Name, Log_Date, AD.Department_Name as Affected_Department_Name FROM Tasks as T LEFT OUTER JOIN Departments as AD ON T.Affected_Department=AD.Department_ID LEFT OUTER JOIN Projects as P ON T.Project_ID=P.Project_ID LEFT OUTER JOIN Task_Logs as L ON T.Task_ID=L.Task_ID {$log} LEFT OUTER JOIN User_Departments as D ON T.Department_ID=D.Department_ID LEFT OUTER JOIN Users as U ON D.User_ID=U.User_ID {$where2} GROUP BY T.Task_ID {$orderby} {$orderby2}";
    }
    //echo $query;
    //exit;
    $subtasks = $slave->select($query);
    //where parents are not assigned to user
    if (is_null($parent)) {
        $query = "SELECT T.*, Project_Name, Log_Date, AD.Department_Name as Affected_Department_Name FROM Tasks as T LEFT OUTER JOIN Departments as AD ON T.Affected_Department=AD.Department_ID LEFT OUTER JOIN Projects as P ON T.Project_ID=P.Project_ID LEFT OUTER JOIN Task_Logs as L ON T.Task_ID=L.Task_ID {$log} LEFT OUTER JOIN User_Departments as D ON T.Department_ID=D.Department_ID LEFT OUTER JOIN Users as U ON D.User_ID=U.User_ID {$where2} GROUP BY T.Task_ID {$orderby} {$orderby2}";
    }
    /*
    $query="SELECT T.*, Project_Name, Log_Date FROM Tasks as T LEFT OUTER JOIN Projects as P ON T.Project_ID=P.Project_ID LEFT OUTER JOIN Task_Logs as L ON T.Task_ID=L.Task_ID $log LEFT OUTER JOIN User_Departments as D ON T.Department_ID=D.Department_ID LEFT OUTER JOIN Users as U ON D.User_ID=U.User_ID $where2 AND Finish_Date IS NULL GROUP BY T.Task_ID ORDER BY $orderby Task_Name";
    $subtasks2 = $slave->select($query);
    if ($subtasks2) {
    if ($subtasks) $subtasks=array_merge($subtasks,$subtasks2);
    else $subtasks=$subtasks2;
    }
    */
    //if ($_SESSION['user_id']==6) print_r($subtasks);
    $expand = true;
    if ($level == 0 and $type != "option") {
        if ($type == "date") {
            echo "<form action=\"tasks.php\" method=\"GET\" onSubmit=\"this.today.value=this.today.value.replace(/(\\d\\d)\\/(\\d\\d)\\/(\\d\\d\\d\\d)/, '\$3-\$1-\$2')\">\n";
            echo "View Date <input name=\"today\" type=\"text\" value=\"" . display_date($_GET['today']) . "\" onfocus=\"this.select();lcs(this)\" onclick=\"event.cancelBubble=true;this.select();lcs(this)\"/>";
            echo "<input type=\"submit\" value=\"Go\">";
            echo "</form>\n";
        }
        if ($type != "complete") {
            echo "<div id=\"expand\">";
            $expand = false;
            if ($_SESSION['expand']['all'] == 1) {
                echo "<a href=\"" . clean_url($expand_collapse) . "expand=none\"><img src=\"" . CDN . "img/collapse.png\" alt=\"Collapse\" /></a>";
            } else {
                echo "<a href=\"" . clean_url($expand_collapse) . "expand=all\"><img src=\"" . CDN . "img/expand.png\" alt=\"Expand\" /></a>";
            }
            echo " all</div>\n";
        }
    }
    if ($subtasks) {
        if ($level == 0 and $type != "option") {
            echo "<table><tr>";
            //if ($type!="complete") echo "<th><a href=".get_order_url('T.Progress',$dir).">Work</a></th>";
            echo "<th>&nbsp;</th>";
            echo "<th><a href=" . get_order_url('T.Priority', $dir) . ">Severity</a></th>";
            echo "<th><a href=" . get_order_url('T.Task_ID', $dir) . ">ID</a></th>";
            echo "<th><a href=" . get_order_url('Task_Name', $dir) . ">Task</a></th>";
            echo "<th><a href=" . get_order_url('Project_Name', $dir) . ">Project</a></th>";
            echo "<th><a href=" . get_order_url('Affected_Department_Name', $dir) . ">Department</a></th>";
            echo "<th>File</th>";
            echo "<th><a href=" . get_order_url('Username', $dir) . ">Assigned</a></th>";
            echo "<th>Last</th>";
            echo "<th><a href=" . get_order_url('Request_Username', $dir) . ">Request</a></th>";
            echo "<th nowrap><a href=" . get_order_url('T.Request_Date', $dir) . ">Req Date</a></th>";
            if ($type == "complete") {
                echo "<th><a href=" . get_order_url('L.Log_Date', $dir) . ">Completed</a></th>";
            } else {
                echo "<th><a href=" . get_order_url('T.Finish_Date', $dir) . ">Due</a></th>";
            }
            if ($type != "complete") {
                echo "<th>Days</th>";
            }
            echo "</tr>\n";
        }
        $space = str_repeat(' &nbsp; ', $level);
        $ptid = 0;
        for ($t = 0; $t < count($subtasks); $t++) {
            $total_tasks[$priorities[$subtasks[$t]['Priority']]['Name']]++;
            if ($type != "option" and $type != "complete" and (is_null($parent) or $parent === 0) and $subtasks[$t]['Parent_Task_ID'] > 0 and $subtasks[$t]['Parent_Task_ID'] != $ptid) {
                $ptid = $subtasks[$t]['Parent_Task_ID'];
                echo "<tr {$bg} class=\"gray\">";
                echo "<td>&nbsp;</td>";
                echo "<td>&nbsp;</td>";
                echo "<td>&nbsp;</td>";
                echo "<td colspan=\"10\"><small>";
                get_parent($ptid, true);
                echo "</small></td>";
                echo "</tr>\n";
            } else {
                $ptid = $subtasks[$t]['Parent_Task_ID'];
            }
            $small_img = $use_file = "";
            $expand = false;
            if ($preview == true or !$_SESSION['expand'] or $_SESSION['expand']['all'] == 1 and (!isset($_SESSION['expand'][$subtasks[$t]['Task_ID']]) or $_SESSION['expand'][$subtasks[$t]['Task_ID']] != 0) or $_SESSION['expand']['all'] == 0 and $_SESSION['expand'][$subtasks[$t]['Task_ID']] == 1) {
                $expand = true;
            }
            if ($type == "option") {
                echo "<option value=\"" . $subtasks[$t]['Task_ID'] . "\"";
                if ($subtasks[$t]['Task_ID'] == $parent_task_id) {
                    echo " selected";
                }
                echo ">" . $space . $subtasks[$t]['Task_Name'] . "</option>\n";
            } else {
                $num_sub = 0;
                $percent_sub = $subtasks[$t]['Progress'];
                if ($type == "complete") {
                    $finish_date = $subtasks[$t]['Log_Date'];
                } else {
                    $finish_date = $subtasks[$t]['Finish_Date'];
                }
                //if (!is_null($parent))
                list($num_sub, $percent_sub, $finish_date) = get_percent($subtasks[$t]['Task_ID'], $num_sub, $percent_sub, $finish_date);
                //$finish_date=$subtasks[$t]['Finish_Date'];
                //if ($subtasks[$t]['Log_Date']) $finish_date=$subtasks[$t]['Log_Date'];
                //if ($level==0) {
                //    if ($t%2==0) $bg="class=\"highlight\"";
                //    else $bg="";
                //}
                //$haschildren=$slave->select("SELECT * FROM Tasks WHERE Parent_Task_ID=".$subtasks[$t]['Task_ID']);
                //$users=$slave->select("SELECT IF (UD.User_ID IS NOT NULL, UD.User_ID, U.User_ID) AS User_ID, Username, U.First_Name, U.Last_Name, Department_Name FROM Task_Users as T LEFT OUTER JOIN User_Departments as UD ON T.Department_ID=UD.Department_ID AND UD.User_ID=6 LEFT OUTER JOIN Departments as D ON UD.Department_ID=D.Department_ID LEFT OUTER JOIN Users as U ON T.User_ID=U.User_ID AND U.User_ID=6 LEFT OUTER JOIN Login as L ON U.User_ID=L.User_ID WHERE Task_ID=".$subtasks[$t]['Task_ID']." ORDER BY IF (Department_Name IS NOT NULL, Department_Name, Username)");
                //if ((!$haschildren AND $user) OR ($haschildren)) {
                echo "<tr {$bg}>";
                //if ($type!="complete") {
                echo "<td align='right' nowrap>";
                if (!$preview and $num_sub > 0) {
                    //echo number_format($percent_sub/$num_sub,1)."% ";
                    if ($expand == true) {
                        echo "<a href=\"" . clean_url($expand_collapse) . "collapse=" . $subtasks[$t]['Task_ID'] . "\" class=\"expand\"><img src=\"" . CDN . "img/collapse.png\" alt=\"Collapse\" /></a>";
                    } else {
                        echo "<a href=\"" . clean_url($expand_collapse) . "expand=" . $subtasks[$t]['Task_ID'] . "\" class=\"expand\"><img src=\"" . CDN . "img/expand.png\" alt=\"Expand\" /></a>";
                    }
                }
                //else if ($type=="complete") echo $percent_sub."%";
                //else echo $percent_sub."%";
                //if ($percent_sub<100) echo " | <a href=\"tasks.php?work=".$subtasks[$t]['Task_ID']."\">Add</a>";
                echo "</td>";
                //}
                if ($preview) {
                    echo "<td></td><td></td>\n";
                } else {
                    echo "<td nowrap><small>";
                    if ($subtasks[$t]['High_Priority']) {
                        echo "<img src=\"" . CDN . "img/fire.png\" alt=\"High Priority\" />\n";
                    }
                    echo $subtasks[$t]['Priority'] . " " . $priorities[$subtasks[$t]['Priority']]['Name'] . "</small></td>";
                    echo "<td><small>" . $subtasks[$t]['Task_ID'] . "</small></td>";
                }
                echo "<td>";
                if ($preview) {
                    echo "<small>";
                }
                if ($type != "complete" and $level > 0) {
                    echo "{$space} - ";
                } elseif (is_null($parent) and $subtasks[$t]['Parent_Task_ID'] > 0) {
                    echo "{$space} - ";
                    //echo "…";
                }
                echo "<a href=\"tasks.php?task_id=" . $subtasks[$t]['Task_ID'] . "\"";
                if ($subtasks[$t]['Parent_Task_ID'] > 0) {
                    $pname = $slave->select("SELECT Task_Name FROM Tasks WHERE Task_ID=" . $subtasks[$t]['Parent_Task_ID']);
                    echo "title=\"" . $pname[0]['Task_Name'] . "\"";
                }
                if ($subtasks[$t]['Progress'] == 100) {
                    echo "><strike>" . $subtasks[$t]['Task_Name'] . "</strike></a>";
                } else {
                    echo ">" . $subtasks[$t]['Task_Name'] . "</a>";
                }
                //get_child($subtasks[$t]['Task_ID'],true);
                if ($preview) {
                    echo "</small>";
                }
                echo "</td>";
                echo "<td nowrap>";
                if ($subtasks[$t]['Project_ID']) {
                    echo "<small><a href=\"projects.php?project_id=" . $subtasks[$t]['Project_ID'] . "\">" . $subtasks[$t]['Project_Name'] . "</a></small></td>";
                } else {
                    echo "<small>Non Project Ticket</small>";
                }
                echo "</td>";
                echo "<td nowrap><small>";
                if ($subtasks[$t]['Affected_Department'] > 0) {
                    //$afdep=$slave->select("SELECT Department_Name FROM Departments WHERE Department_ID=".$subtasks[$t]['Affected_Department']);
                    echo $subtasks[$t]['Affected_Department_Name'];
                } else {
                    echo "No Department";
                }
                echo "</small></td>";
                echo "<td align=\"center\">";
                /*
                if ($handle = opendir($target_path)) {
                while (false !== ($file = readdir($handle))) {
                if (preg_match('/^'.$subtasks[$t]['Task_ID'].'.+/',$file)) {
                if (strstr($file,'_sm.jpg')) $small_img=$file;
                else $use_file=$file;
                }
                }
                closedir($handle);
                } else echo "could not open";
                
                if ($small_img) echo "<a href=\"${target_path}$use_file\" target=\"_blank\"><img src=\"".CDN."img/icons/111.png\" border=0 /></a>";
                else if ($use_file) echo "<a href=\"${target_path}$use_file\" target=\"_blank\"><img src=\"".CDN."img/icons/3.png\" border=0 /></a>";
                */
                $files = $slave->select("SELECT * FROM Files as F, File_Types as T WHERE F.File_Type_ID=T.File_Type_ID AND Task_ID=" . $subtasks[$t]['Task_ID'] . " ORDER BY Image");
                if ($files) {
                    $img = $multi = "";
                    foreach ($files as $f) {
                        if ($img != $f['Image'] or $img == 0) {
                            $img = $f['Image'];
                            if ($f['Image'] == 1) {
                                $icon = "111.png";
                                echo "<a href=\"" . CDN . "img.php?id=" . $subtasks[$t]['Task_ID'] . "\" alt=\"\" target=\"_blank\"><img src=\"" . CDN . "img/icons/{$icon}\" border=0 /></a>";
                            } else {
                                $icon = "3.png";
                                echo "<a href=\"{$target_path}" . $f['File_ID'] . "." . $f['Extention'] . "\" alt=\"\" target=\"_blank\"><img src=\"" . CDN . "img/icons/{$icon}\" border=0 /></a>";
                            }
                        } elseif ($img == 1) {
                            $mult = "+";
                        }
                    }
                    echo $mult;
                }
                echo "</td>";
                echo "<td><small>";
                $users = $slave->select("SELECT IF (UD.User_ID IS NOT NULL, UD.User_ID, U.User_ID) AS User_ID, Username, U.First_Name, U.Last_Name, Department_Name FROM Tasks as T LEFT OUTER JOIN User_Departments as UD ON T.Department_ID=UD.Department_ID LEFT OUTER JOIN Departments as D ON UD.Department_ID=D.Department_ID LEFT OUTER JOIN Users as U ON T.User_ID=U.User_ID LEFT OUTER JOIN Login as L ON U.User_ID=L.User_ID WHERE Task_ID=" . $subtasks[$t]['Task_ID'] . " ORDER BY IF (Department_Name IS NOT NULL, Department_Name, Username)");
                if ($users) {
                    $dep = "";
                    for ($u = 0; $u < count($users); $u++) {
                        if ($u > 0 && ($users[$u]['Department_Name'] == "" or $users[$u]['Department_Name'] != $dep)) {
                            echo ", ";
                        }
                        if ($users[$u]['Department_Name']) {
                            if ($users[$u]['Department_Name'] != $dep) {
                                $dep = $users[$u]['Department_Name'];
                                echo $users[$u]['Department_Name'];
                            }
                        } else {
                            echo $users[$u]['Username'];
                        }
                    }
                } else {
                    echo "none";
                }
                echo "</small></td>";
                echo "<td><small>";
                $users = $slave->select("SELECT U.User_ID, Username, U.First_Name, U.Last_Name FROM Tasks as T, Task_Logs as L, Users as U, Login as O WHERE T.Task_ID=L.Task_ID AND L.User_ID=U.User_ID AND O.User_ID=U.User_ID AND T.Task_ID=" . $subtasks[$t]['Task_ID'] . " ORDER BY Log_ID DESC LIMIT 1");
                if (!$users) {
                    $users = $slave->select("SELECT U.User_ID, Username, U.First_Name, U.Last_Name FROM Tasks as T, Users as U, Login as O WHERE T.Creator_ID=U.User_ID AND O.User_ID=U.User_ID AND T.Task_ID=" . $subtasks[$t]['Task_ID']);
                }
                if ($users) {
                    echo $users[0]['Username'];
                } else {
                    echo "none";
                }
                echo "</small></td>";
                echo "<td><small>";
                $users = $slave->select("SELECT U.User_ID, Username, U.First_Name, U.Last_Name FROM Tasks as T, Users as U, Login as L WHERE U.User_ID=L.User_ID AND T.Request_User_ID=U.User_ID AND Task_ID=" . $subtasks[$t]['Task_ID']);
                if ($users) {
                    echo $users[0]['Username'];
                } else {
                    echo "none";
                }
                echo "</small></td>";
                if (display_date($subtasks[$t]['Request_Date']) == "00/00/0000" or display_date($subtasks[$t]['Request_Date']) == "NULL") {
                    echo "<td>Not Set</td>";
                } else {
                    echo "<td><small>" . display_date($subtasks[$t]['Request_Date']) . "</small></td>";
                }
                //echo "<td>".$subtasks[$t]['Durration']."</td>";
                //$isparent=$slave->select("SELECT Task_ID FROM Tasks WHERE Parent_Task_ID=".$subtasks[$t]['Task_ID']);
                //if ($isparent) {
                //    echo "<td>&nbsp;</td>";
                //} else
                if (display_date($finish_date) == "NULL") {
                    echo "<td><small>Not Set</small></td>";
                    if ($type != "complete") {
                        echo "<td>-</td>";
                    }
                } else {
                    echo "<td><small>" . display_date($finish_date) . "</small></td>";
                    if ($type != "complete" and $subtasks[$t]['Progress'] < 100) {
                        echo "<td><small>" . dateDiff(date("Y-m-d"), $finish_date) . "</small></td>";
                    }
                }
                echo "</tr>\n";
                if ($expand == true and ($_GET['today'] or $_GET['week']) and !isset($parent_task_id)) {
                    get_subtasks($subtasks[$t]['Task_ID'], $level + 1, "", "AND T.Progress<100", "", "class=\"gray\"", true);
                }
                if ($expand == true and $parent === 0) {
                    get_subtasks($subtasks[$t]['Task_ID'], $level + 1, "", "AND T.Progress<100 AND NOT (T.User_ID=" . $_SESSION['user_id'] . " OR U.User_ID=" . $_SESSION['user_id'] . ")", "", "class=\"gray\"", true);
                }
                //}
            }
            if ($expand === true and !is_null($parent) and !$preview) {
                get_subtasks($subtasks[$t]['Task_ID'], $level + 1, $type, $where, $orderby, $bg);
            }
            //if ($add=="no")
            //$space=str_replace('/ &nbsp; $/','',$space);
        }
        if ($level == 0 and $type != "option") {
            echo "</table>";
            echo "<p>";
            $totaltt = 0;
            foreach ($total_tasks as $tk => $tv) {
                echo "Total {$tk} Tasks: {$tv}<br />";
                $totaltt = $totaltt + $tv;
            }
            echo "Grand Total: {$totaltt}";
            echo "</p>\n";
        }
    } else {
        if ($level == 0 and $type != "option") {
            echo "<h2 align=\"center\">No Tasks</h2>";
        }
        return false;
    }
}
예제 #9
0
 function forum_breadcrumb_arrays($index, $id, &$crumb = false)
 {
     if (isset($index[get_parent($index, $id)])) {
         $_name = dbarray(dbquery("SELECT forum_id, forum_name, forum_cat, forum_branch FROM " . DB_FORUMS . " WHERE forum_id='" . $id . "'"));
         $crumb = array('link' => INFUSIONS . "forum/index.php?viewforum&amp;forum_id=" . $_name['forum_id'] . "&amp;parent_id=" . $_name['forum_cat'], 'title' => $_name['forum_name']);
         if (isset($index[get_parent($index, $id)])) {
             if (get_parent($index, $id) == 0) {
                 return $crumb;
             }
             $crumb_1 = forum_breadcrumb_arrays($index, get_parent($index, $id));
             $crumb = array_merge_recursive($crumb, $crumb_1);
             // convert so can comply to Fusion Tab API.
         }
     }
     return $crumb;
 }
 function breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, $id)
 {
     $crumb =& $crumb;
     if (isset($tree_index[get_parent($tree_index, $id)])) {
         $_name = get_parent_array($tree_full, $id);
         $crumb = array('link' => isset($_name[$id_col]) ? clean_request($getname . "=" . $_name[$id_col], array("aid"), TRUE) : "", 'title' => isset($_name[$title_col]) ? \PHPFusion\QuantumFields::parse_label($_name[$title_col]) : "");
         if (get_parent($tree_index, $id) == 0) {
             return $crumb;
         }
         $crumb_1 = breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, get_parent($tree_index, $id));
         if (!empty($crumb_1)) {
             $crumb = array_merge_recursive($crumb, $crumb_1);
         }
     }
     return $crumb;
 }
예제 #11
0
 function breadcrumb_arrays($index, $id)
 {
     global $aidlink;
     $crumb =& $crumb;
     //$crumb += $crumb;
     if (isset($index[get_parent($index, $id)])) {
         $_name = dbarray(dbquery("SELECT link_id, link_name FROM " . DB_SITE_LINKS . " WHERE link_id='" . $id . "'"));
         $crumb = array('link' => FUSION_SELF . $aidlink . "&amp;link_cat=" . $_name['link_id'], 'title' => $_name['link_name']);
         if (isset($index[get_parent($index, $id)])) {
             if (get_parent($index, $id) == 0) {
                 return $crumb;
             }
             $crumb_1 = breadcrumb_arrays($index, get_parent($index, $id));
             $crumb = array_merge_recursive($crumb, $crumb_1);
             // convert so can comply to Fusion Tab API.
         }
     }
     return $crumb;
 }
예제 #12
0
function do_notify($user, $request, $method = NULL)
{
    $notify = array("from" => $user->id);
    if ($method != NULL) {
        // notification due to POST, PUT or DELETE
        $resource = $request;
        $notify = array("notify" => $method, "resource" => $resource, "type" => NULL, "entity" => NULL);
        if ($method == "PUT" || $method == "POST") {
            $result = mysql_query(sprintf("SELECT type, entity FROM resource WHERE rid='%s'", mysql_real_escape_string($resource)));
            if (!$result) {
                say("failed to get this resource");
                return array('code' => 'failed', 'reason' => 'failed to get this resource');
            }
            $result_count = mysql_numrows($result);
            if ($result_count) {
                $row = mysql_fetch_row($result);
                $notify["type"] = $row[0];
                $notify["entity"] = json_decode($row[1]);
            }
            //mysql_freeresult($result);
        }
        // TODO: also send to parent resource
    } else {
        // end to end notify from one client to others
        $notify = array("notify" => "NOTIFY", "resource" => $request["resource"], "data" => $request["data"], "from" => $user->id);
    }
    $param = json_encode($notify);
    $param = str_replace("\\/", "/", $param);
    $result = mysql_query(sprintf("SELECT cid FROM subscribe WHERE rid='%s'", mysql_real_escape_string($notify["resource"])));
    if (!$result) {
        say("failed to get this resource subscribers");
        return array('code' => 'failed', 'reason' => 'failed to get this resource subscribers');
    }
    $result_count = mysql_numrows($result);
    $sent_count = 0;
    for ($j = 0; $j < $result_count; ++$j) {
        $row = mysql_fetch_row($result);
        $target = getuserbyid($row[0]);
        if ($target == null) {
            say("invalid user for " . $row[0]);
        } else {
            send($target, $param);
            ++$sent_count;
        }
    }
    //mysql_freeresult($result);
    if ($method == "POST" || $method == "PUT" || $method == "DELETE") {
        $parent = get_parent($notify["resource"]);
        $change = array("notify" => "UPDATE", "resource" => $parent, "type" => $notify["type"], "entity" => $notify["entity"]);
        $child = $notify["resource"];
        $index = strrpos($child, "/");
        if ($index) {
            $child = substr($child, $index + 1);
        }
        if ($method == "POST") {
            $change["create"] = $child;
        } else {
            if ($method == "PUT") {
                $change["update"] = $child;
            } else {
                if ($method == "DELETE") {
                    $change["delete"] = $child;
                }
            }
        }
        $result = mysql_query(sprintf("SELECT cid FROM subscribe WHERE rid='%s'", mysql_real_escape_string($parent)));
        $result_count = mysql_numrows($result);
        $param = json_encode($change);
        // JSON specified escapting / but we don't accept that in Javascript
        $param = str_replace("\\/", "/", $param);
        say("change=" . $change . " param=" . $param);
        for ($k = 0; $k < $result_count; ++$k) {
            $row = mysql_fetch_row($result);
            $target = getuserbyid($row[0]);
            if ($target == null) {
                say("invalid user for " . $row[0]);
            } else {
                send($target, $param);
                ++$sent_count;
            }
            ++$sent_count;
        }
        //mysql_freeresult($result);
    }
    if ($sent_count == 0) {
        say('notify could not send to anyone');
        return array('code' => 'failed', 'reason' => 'no available user to send notification to');
    }
    say('notify sent to ' . count($sent_count) . ' items');
    return array('code' => 'success', 'sent_count' => $sent_count);
}
예제 #13
0
function get_comment_ancestor_set($commentid)
{
    $parentcomment = get_parent($commentid);
    if ($parentcomment) {
        $anc = get_comment_ancestor_set($parentcomment);
        $anc[$commentid] = true;
    } else {
        $anc = array($commentid => true);
    }
    return $anc;
}
예제 #14
0
 function breadcrumb_arrays($index, $id)
 {
     global $aidlink;
     $crumb = array('link' => array(), 'title' => array());
     if (isset($index[get_parent($index, $id)])) {
         $_name = dbarray(dbquery("SELECT forum_id, forum_name FROM " . DB_FORUMS . " WHERE forum_id='" . intval($id) . "'"));
         $crumb = array('link' => array(FUSION_SELF . $aidlink . "&amp;parent_id=" . $_name['forum_id']), 'title' => array($_name['forum_name']));
         if (isset($index[get_parent($index, $id)])) {
             if (get_parent($index, $id) == 0) {
                 return $crumb;
             }
             $crumb_1 = breadcrumb_arrays($index, get_parent($index, $id));
             $crumb = array_merge_recursive($crumb, $crumb_1);
             // convert so can comply to Fusion Tab API.
         }
     }
     return $crumb;
 }
예제 #15
0
        $replace = '<span class="jump" onclick="read_details(\'ikdoc\',\'' . $value . '\',\'D\',\'D\')">' . $_SESSION[$ssid]['MT']['ikdoc']->convertBBCodetoHTML($rowl['value']) . '</span>';
    } else {
        $replace = '<span class="jump" onclick="read_details(\'ikdoc\',\'' . $value . '\',\'D\',\'D\')">' . $out[2][$key] . '</span>';
    }
    $row["DETAILS"] = str_replace($out[0][$key], $replace, $row["DETAILS"]);
}
//==================================================================
//==================================================================
// Build path string
//==================================================================
$id = $id_item;
$tab_to_root = array();
$current = get_parent($ssid, $tree_id, $language, $link, $id);
while ($current[1] != '') {
    array_unshift($tab_to_root, array($current[0], $current[1], $current[2]));
    $current = get_parent($ssid, $tree_id, $language, $link, $current[1]);
}
$preference = '<div id="boutton_preference" class="boutton_preference" onClick="active_expand_tools_bar()" onmouseout="lib_hover(\'\')" onmouseover="lib_hover(\'' . js_protect($_SESSION[$ssid]['page_text'][3]['LT']) . '\')"></div>';
$path_to_root = $preference . '<div class="home_path" onclick="read_details(\'ikdoc\',\'1\',\'D\',\'D\')" onmouseout="lib_hover(\'\')" onmouseover="lib_hover(\'' . js_protect($_SESSION[$ssid]['page_text'][4]['LT']) . '\')"></div> : ';
$separator = '';
while (list($parent, $value) = each($tab_to_root)) {
    //==================================================================
    // Manage BBCode is setup on
    //==================================================================
    $value[2] = htmlentities($value[2], ENT_QUOTES);
    if ($_SESSION[$ssid]['MT']['ikdoc']->use_bbcode) {
        $value[2] = $_SESSION[$ssid]['MT']['ikdoc']->convertBBCodetoHTML($value[2]);
    }
    //==================================================================
    //$value[2] = $value[2].'!';
    $path_to_root = $path_to_root . '<span class="mouse" onclick="read_details(\'' . $tree_id . '\',\'' . $value[0] . '\',\'' . $mode . '\',\'D\')">' . $value[2] . '</span>' . $separator;
예제 #16
0
function get_parent($value, $id = '')
{
    if ($value != 0) {
        $sql = 'SELECT parent_id FROM ' . $GLOBALS['ecs']->table('category') . " WHERE cat_id = '{$value}'";
        $res = $GLOBALS['db']->getOne($sql);
        return get_parent($res, $value);
    } else {
        return $id;
    }
}
예제 #17
0
 function breadcrumb_arrays($index, $id)
 {
     $crumb =& $crumb;
     if (isset($index[get_parent($index, $id)])) {
         $_name = dbarray(dbquery("SELECT article_cat_id, article_cat_name, article_cat_parent FROM " . DB_ARTICLE_CATS . " " . (multilang_table("AR") ? "WHERE article_cat_language='" . LANGUAGE . "' and " : "where ") . "\n\t\t\t\tarticle_cat_id='" . intval($id) . "'"));
         $crumb = array('link' => INFUSIONS . "articles/articles.php?cat_id=" . $_name['article_cat_id'], 'title' => $_name['article_cat_name']);
         if (isset($index[get_parent($index, $id)])) {
             if (get_parent($index, $id) == 0) {
                 return $crumb;
             }
             $crumb_1 = breadcrumb_arrays($index, get_parent($index, $id));
             $crumb = array_merge_recursive($crumb, $crumb_1);
             // convert so can comply to Fusion Tab API.
         }
     }
     return $crumb;
 }
예제 #18
0
						<?php 
get_navigation(get_page_slug(FALSE));
?>
					</ul>
				</nav>
			</div>
		</div>
		
		<!-- breadcrumbs: only show when NOT on homepage -->
		<p class="breadcrumbs" >
			<span class="wrapper">
				<a href="<?php 
get_site_url();
?>
">Home</a> &nbsp;&nbsp;&#149;&nbsp;&nbsp; <?php 
Innovation_Parent_Link(get_parent(FALSE));
?>
 <b><?php 
get_page_clean_title();
?>
</b>
			</span>
		</p>
		
  </header> 
	<div id="site">
		<div id="header-wrapper">
			<div id="top-header-wrapper">
				<div id="top-nav">
					<p>hola	</p>	
				</div><!--top-nav-->
예제 #19
0
<?php

include '../view/header.php';
require_once '../model/database.php';
require_once '../model/parents_db.php';
$results = get_parent();
?>

			
				<div class="">
				<ul class="breadcrumb">
  					<li><a href="index.php">Home</a> <span class="divider">/</span></li>
					<li class="active">Parents</li>
				</ul>
				<table class="table table-condensed table-bordered table-striped">
					<tr>
						<th>Parent ID</th>
						<th>Student ID</th>
						<th>First Name</th>
						<th>Last Name</th>
					</tr>
					<?php 
foreach ($results as $parent) {
    ?>
					<tr>
						<td><?php 
    echo $parent['parent_id'];
    ?>
</td>
						<td><?php 
    echo $parent['s_id'];