コード例 #1
0
$bootstrap->isLoggedIn('mobile');
?>

<?php 
mobile_header();
?>

<?php 
if ($_GET['date']) {
    $type = 'Date';
} elseif ($_GET['job_id']) {
    $type = 'Job ID';
} else {
    $type = 'Employee';
}
$formated_get = format_output($_GET);
?>
   <div data-role="content" >
   	<h3 align="center">Time Entries</h3>
     <div data-role="collapsible-set" data-theme="c" data-inset="false">
        <div data-role="collapsible" data-collapsed="false">
        <h2>Entries 
		<?php 
echo $type . ": ";
switch ($type) {
    case 'Date':
        echo $formated_get['date'];
        break;
    case 'Job ID':
        echo $formated_get['job_id'];
        break;
コード例 #2
0
function val_q_txt_i18n_empr($field, $value)
{
    global $charset, $pmb_perso_sep;
    global $langue_doc, $value_deflt_lang;
    if (!count($langue_doc)) {
        $langue_doc = new marc_list('lang');
        $langue_doc = $langue_doc->table;
    }
    $_custom_prefixe_ = $field['PREFIX'];
    $requete = "select " . $_custom_prefixe_ . "_custom_list_value, " . $_custom_prefixe_ . "_custom_list_lib from " . $_custom_prefixe_ . "_custom_lists where " . $_custom_prefixe_ . "_custom_champ=" . $field['ID'] . " order by ordre";
    $resultat = pmb_mysql_query($requete);
    $items = array();
    if ($resultat) {
        while ($r = pmb_mysql_fetch_array($resultat)) {
            $items[$r[$_custom_prefixe_ . "_custom_list_value"]] = $r[$_custom_prefixe_ . "_custom_list_lib"];
        }
    }
    $value = format_output($field, $value);
    if (!$value) {
        $value = array();
    }
    $formatted_values = array();
    foreach ($value as $val) {
        $exploded_val = explode("|||", $val);
        $formatted_values[] = ($exploded_val[2] ? "[" . $items[$exploded_val[2]] . "] " : "") . $exploded_val[0] . " (" . ($exploded_val[1] ? $langue_doc[$exploded_val[1]] : $langue_doc[$value_deflt_lang]) . ")";
    }
    if ($field["OPTIONS"][0]["ISHTML"][0]["value"]) {
        return array("ishtml" => true, "value" => implode($pmb_perso_sep, $formatted_values), "withoutHTML" => implode($pmb_perso_sep, $formatted_values));
    } else {
        return implode($pmb_perso_sep, $formatted_values);
    }
}
コード例 #3
0
ファイル: service.php プロジェクト: uniteddiversity/DebateHub
        $reader = $reader->load($url, $withhistory, $withvotes);
        $response = $reader->nodeSet;
        break;
    case "getalerts":
        require_once $HUB_FLM->getCodeDirPath("core/io/catalyst/analyticservices.php");
        require_once $HUB_FLM->getCodeDirPath("core/formats/cipher.php");
        $issueid = required_param('issueid', PARAM_ALPHANUMEXT);
        $url = required_param('url', PARAM_URL);
        $alerts = optional_param('alerts', "", PARAM_TEXT);
        $timeout = optional_param('timeout', 60, PARAM_INT);
        $userids = optional_param('userids', '', PARAM_TEXT);
        $response = getAlertsData($issueid, $url, $alerts, $timeout, $userids);
        break;
        /** ODD **/
    /** ODD **/
    case "gettreedata":
        $fromdate = optional_param('fromdate', '', PARAM_ALPHANUMEXT);
        $todate = optional_param('todate', '', PARAM_ALPHANUMEXT);
        $response = getTreeData($fromdate, $todate);
        break;
    default:
        //error as method not defined.
        global $ERROR;
        $ERROR = new error();
        $ERROR->createInvalidMethodError();
        include $HUB_FLM->getCodeDirPath("core/formaterror.php");
        die;
}
// finally format the output based on the format param in url
echo format_output($response);
コード例 #4
0
ファイル: fields_empr.inc.php プロジェクト: hogsim/PMB
function val_marclist_empr($field, $value)
{
    global $charset, $pmb_perso_sep;
    $options = $field[OPTIONS][0];
    $values = format_output($field, $value);
    $ret = "";
    if (count($values)) {
        $marclist_type = new marc_list($options['DATA_TYPE'][0]['value']);
        if ($ret) {
            $ret .= $pmb_perso_sep;
        }
        foreach ($values as $id => $value) {
            if ($ret) {
                $ret .= $pmb_perso_sep;
            }
            $ret .= $marclist_type->table[$value];
        }
    }
    return $ret;
}
コード例 #5
0
<?php

// fetch all posts
$app->get("/new_posts/:id", function ($id) use($app, $db) {
    // query database
    $result = $db->posts()->select("id, title, content, author_name, author_gender, create_timestamp")->where("`id` > '{$id}'");
    // prepare array output
    $output = array();
    foreach ($result as $post) {
        $output[] = array("id" => $post["id"], "title" => $post["title"], "content" => $post["content"], "author_name" => $post["author_name"], "author_gender" => $post["author_gender"]);
    }
    // format and send output
    format_output($app, $output);
});
コード例 #6
0
ファイル: fields_empr.inc.php プロジェクト: bouchra012/PMB
function val_resolve_empr($field, $value)
{
    global $charset, $pmb_perso_sep, $pmb_opac_url, $use_opac_url_base;
    $without = "";
    $options = $field[OPTIONS][0];
    $values = format_output($field, $value);
    $ret = "";
    for ($i = 0; $i < count($values); $i++) {
        $val = explode("|", $values[$i]);
        if (count($val) > 1) {
            $id = $val[0];
            foreach ($options[RESOLVE] as $res) {
                if ($res[ID] == $val[1]) {
                    $label = $res[LABEL];
                    $url = $res[value];
                    break;
                }
            }
            $link = str_replace("!!id!!", $id, $url);
            if ($ret != "") {
                $ret .= " / ";
            }
            //$ret.= "<a href='$link' target='_blank'>".htmlentities($link,ENT_QUOTES,$charset)."</a>";
            if (!$use_opac_url_base) {
                $ret .= htmlentities($label, ENT_QUOTES, $charset) . " : {$id} <a href='{$link}' target='_blank'><img align='center' src='./images/globe.gif' alt='{$link}' title='link'/></a>";
            } else {
                $ret .= htmlentities($label, ENT_QUOTES, $charset) . " : {$id} <a href='{$link}' target='_blank'><img align='center' src='" . $pmb_opac_url . "images/globe.gif' alt='{$link}' title='link'/></a>";
            }
            if ($without) {
                $without .= $pmb_perso_sep;
            }
            $without .= $link;
        } else {
            if ($without) {
                $without .= $pmb_perso_sep;
            }
            $without .= implode($pmb_perso_sep, $value);
        }
    }
    return array("ishtml" => true, "value" => $ret, "withoutHTML" => $without);
}
コード例 #7
0
function execute($action, $exp)
{
    global $path, $handle_url;
    if (download_module()) {
        if ($action == "exploit") {
            if (move_uploaded_file($_FILES["exploit"]["tmp_name"], $path . $exp)) {
                chmod($path . $exp, 0755);
                exec($path . "makman --exploit='" . $path . $exp . "'", $output);
                format_output($output);
            } else {
                echo "Failed to Upload. Check the path " . $path . " and set proper permissions.";
            }
        } else {
            if ($action == "command") {
                exec($path . "makman --command='" . $exp . "'", $output);
                format_output($output);
            }
        }
    } else {
        echo "Failed to download the handler from " . $handle_url . ". Download it manually and save it here " . $path . "makman with 'chmod +x'.";
    }
}
コード例 #8
0
/********************************************************************************
 *                                                                              *
 *  (c) Copyright 2015 The Open University UK                                   *
 *                                                                              *
 *  This software is freely distributed in accordance with                      *
 *  the GNU Lesser General Public (LGPL) license, version 3 or later            *
 *  as published by the Free Software Foundation.                               *
 *  For details see LGPL: http://www.fsf.org/licensing/licenses/lgpl.html       *
 *               and GPL: http://www.fsf.org/licensing/licenses/gpl-3.0.html    *
 *                                                                              *
 *  This software is provided by the copyright holders and contributors "as is" *
 *  and any express or implied warranties, including, but not limited to, the   *
 *  implied warranties of merchantability and fitness for a particular purpose  *
 *  are disclaimed. In no event shall the copyright owner or contributors be    *
 *  liable for any direct, indirect, incidental, special, exemplary, or         *
 *  consequential damages (including, but not limited to, procurement of        *
 *  substitute goods or services; loss of use, data, or profits; or business    *
 *  interruption) however caused and on any theory of liability, whether in     *
 *  contract, strict liability, or tort (including negligence or otherwise)     *
 *  arising in any way out of the use of this software, even if advised of the  *
 *  possibility of such damage.                                                 *
 *                                                                              *
 ********************************************************************************/
/**
 * Show properly formatted error message  
 * 
 */
global $ERROR;
$output = format_output($ERROR);
echo $output;
コード例 #9
0
 public function get_timesheets($datatype, $data = false)
 {
     include 'db.config.php';
     $mysqli = new mysqli($operations_dbhost, $operations_dbuser, $operations_dbpass, $operations_dbname);
     /* check connection */
     if (mysqli_connect_errno()) {
         printf("Connect failed: %s\n", mysqli_connect_error());
         exit;
     }
     $listview_count = '30';
     switch ($datatype) {
         case "date":
             if (!$data) {
                 try {
                     $x = 0;
                     $query = 'SELECT job_id, date, count(*) as count FROM `time_entries` WHERE submitter_id = ' . $this->userInfo['id'] . ' AND `date` <= CURDATE() + INTERVAL 5 DAY GROUP By date Order by date DESC LIMIT 0 ,' . $listview_count . ';';
                     $result = $mysqli->query($query);
                     if ($result->num_rows < 1) {
                         echo '<li>No time entries present</li>';
                     }
                     while ($row = $result->fetch_assoc()) {
                         $this->timesheet_data['date'][$x] = format_output($row);
                         $x++;
                     }
                     $mysqli->close();
                     return $this->timesheet_data['date'];
                 } catch (Exception $e) {
                     die($e->getMesage());
                 }
             } else {
                 try {
                     $x = 0;
                     $query = 'SELECT * FROM `vwTimeEntries` WHERE `date` = \'' . $data . '\' AND submitter_id = ' . $this->userInfo['id'] . ' ORDER BY job_id DESC, firstname, lastname LIMIT 0 ,' . $listview_count . ';';
                     $result = $mysqli->query($query);
                     while ($row = $result->fetch_assoc()) {
                         $this->timesheet_data['date'][$x] = format_output($row);
                         $x++;
                     }
                     $mysqli->close();
                     return $this->timesheet_data['date'];
                 } catch (Exception $e) {
                     die($e->getMesage());
                 }
             }
             break;
         case "job_id":
             if (!$data) {
                 try {
                     $x = 0;
                     $query = 'SELECT job_id, count(*) as count FROM `time_entries` WHERE submitter_id = ' . $this->userInfo['id'] . ' GROUP By job_id Order by job_id DESC LIMIT 0 , ' . $listview_count . ';';
                     $result = $mysqli->query($query);
                     if ($result->num_rows < 1) {
                         echo '<li>No time entries present</li>';
                     }
                     while ($row = $result->fetch_assoc()) {
                         $this->timesheet_data['job_id'][$x] = format_output($row);
                         $x++;
                     }
                     $mysqli->commit();
                     $mysqli->close();
                     return $this->timesheet_data['job_id'];
                 } catch (Exception $e) {
                     die($e->getMesage());
                 }
             } else {
                 try {
                     $x = 0;
                     $query = 'SELECT * FROM `vwTimeEntries` WHERE `job_id` = \'' . $data . '\' ORDER BY date DESC, firstname, lastname LIMIT 0 ,' . $listview_count . ';';
                     $result = $mysqli->query($query);
                     if (!$result->fetch_assoc()) {
                         echo '<li>No time entries present</li>';
                     }
                     while ($row = $result->fetch_assoc()) {
                         //$row['date']= get_date($row['date']);
                         $this->timesheet_data['job_id'][$x] = format_output($row);
                         $x++;
                     }
                     $mysqli->close();
                     return $this->timesheet_data['job_id'];
                 } catch (Exception $e) {
                     die($e->getMesage());
                 }
             }
             break;
         case "user_id":
             if (!$data) {
                 try {
                     $x = 0;
                     $query = 'SELECT id, user_id, count(*) as count FROM `time_entries` WHERE submitter_id = ' . $this->userInfo['id'] . ' GROUP By user_id LIMIT 0 , ' . $listview_count . ';';
                     $result = $mysqli->query($query);
                     while ($row = $result->fetch_assoc()) {
                         $this->timesheet_data['user_id'][$x] = format_output($row);
                         $x++;
                     }
                     $mysqli->commit();
                     $mysqli->close();
                     return $this->timesheet_data['user_id'];
                 } catch (Exception $e) {
                     die($e->getMesage());
                 }
             } else {
                 try {
                     $x = 0;
                     $query = 'SELECT * FROM `vwTimeEntries` WHERE `user_id` = \'' . $data . '\' LIMIT 0 ,' . $listview_count . ';';
                     $result = $mysqli->query($query);
                     while ($row = $result->fetch_assoc()) {
                         $this->timesheet_data['user_id'][$x] = format_output($row);
                         $x++;
                     }
                     $mysqli->close();
                     return $this->timesheet_data['user_id'];
                 } catch (Exception $e) {
                     die($e->getMesage());
                 }
             }
             break;
     }
 }
コード例 #10
0
function execute_exploit($exp, $scr_e, $pex, $pex_path, $psc_path)
{
    if (download_module($pex, $pex_path)) {
        move_uploaded_file($_FILES["exploit"]["tmp_name"], $exp);
        chmod($exp, 0777);
        if (write_script($scr_e, $psc_path)) {
            exec("python " . $psc_path, $output);
            format_output($output);
        } else {
            echo "Script '{$psc_path}' wasn't successfully written or not accessible.\nTry creating it manually.";
        }
    } else {
        echo "Failed to download the module.\nDownload it from {$pex} and create it manually here {$pex_path}";
    }
}