当前位置: 首页>>代码示例>>PHP>>正文


PHP Contract::getName方法代码示例

本文整理汇总了PHP中Contract::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Contract::getName方法的具体用法?PHP Contract::getName怎么用?PHP Contract::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Contract的用法示例。


在下文中一共展示了Contract::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showForContract

 /**
  * Print the contract costs
  *
  * @param $contract               Contract object
  * @param $withtemplate  boolean  Template or basic item (default '')
  *
  * @return Nothing (call to classes members)
  **/
 static function showForContract(Contract $contract, $withtemplate = '')
 {
     global $DB, $CFG_GLPI;
     $ID = $contract->fields['id'];
     if (!$contract->getFromDB($ID) || !$contract->can($ID, READ)) {
         return false;
     }
     $canedit = $contract->can($ID, UPDATE);
     echo "<div class='center'>";
     $query = "SELECT *\n                FROM `glpi_contractcosts`\n                WHERE `contracts_id` = '{$ID}'\n                ORDER BY `begin_date`";
     $rand = mt_rand();
     if ($canedit) {
         echo "<div id='viewcost" . $ID . "_{$rand}'></div>\n";
         echo "<script type='text/javascript' >\n";
         echo "function viewAddCost" . $ID . "_{$rand}() {\n";
         $params = array('type' => __CLASS__, 'parenttype' => 'Contract', 'contracts_id' => $ID, 'id' => -1);
         Ajax::updateItemJsCode("viewcost" . $ID . "_{$rand}", $CFG_GLPI["root_doc"] . "/ajax/viewsubitem.php", $params);
         echo "};";
         echo "</script>\n";
         echo "<div class='center firstbloc'>" . "<a class='vsubmit' href='javascript:viewAddCost" . $ID . "_{$rand}();'>";
         echo __('Add a new cost') . "</a></div>\n";
     }
     if ($result = $DB->query($query)) {
         echo "<table class='tab_cadre_fixehov'>";
         echo "<tr><th colspan='5'>" . self::getTypeName($DB->numrows($result)) . "</th></tr>";
         if ($DB->numrows($result)) {
             echo "<tr><th>" . __('Name') . "</th>";
             echo "<th>" . __('Begin date') . "</th>";
             echo "<th>" . __('End date') . "</th>";
             echo "<th>" . __('Budget') . "</th>";
             echo "<th>" . __('Cost') . "</th>";
             echo "</tr>";
             Session::initNavigateListItems(__CLASS__, sprintf(__('%1$s = %2$s'), Contract::getTypeName(1), $contract->getName()));
             $total = 0;
             while ($data = $DB->fetch_assoc($result)) {
                 echo "<tr class='tab_bg_2' " . ($canedit ? "style='cursor:pointer' onClick=\"viewEditCost" . $data['contracts_id'] . "_" . $data['id'] . "_{$rand}();\"" : '') . ">";
                 $name = empty($data['name']) ? sprintf(__('%1$s (%2$s)'), $data['name'], $data['id']) : $data['name'];
                 echo "<td>";
                 printf(__('%1$s %2$s'), $name, Html::showToolTip($data['comment'], array('display' => false)));
                 if ($canedit) {
                     echo "\n<script type='text/javascript' >\n";
                     echo "function viewEditCost" . $data['contracts_id'] . "_" . $data["id"] . "_{$rand}() {\n";
                     $params = array('type' => __CLASS__, 'parenttype' => 'Contract', 'contracts_id' => $data["contracts_id"], 'id' => $data["id"]);
                     Ajax::updateItemJsCode("viewcost" . $ID . "_{$rand}", $CFG_GLPI["root_doc"] . "/ajax/viewsubitem.php", $params);
                     echo "};";
                     echo "</script>\n";
                 }
                 echo "</td>";
                 echo "<td>" . Html::convDate($data['begin_date']) . "</td>";
                 echo "<td>" . Html::convDate($data['end_date']) . "</td>";
                 echo "<td>" . Dropdown::getDropdownName('glpi_budgets', $data['budgets_id']) . "</td>";
                 echo "<td class='numeric'>" . Html::formatNumber($data['cost']) . "</td>";
                 $total += $data['cost'];
                 echo "</tr>";
                 Session::addToNavigateListItems(__CLASS__, $data['id']);
             }
             echo "<tr class='b noHover'><td colspan='3'>&nbsp;</td>";
             echo "<td class='right'>" . __('Total cost') . '</td>';
             echo "<td class='numeric'>" . Html::formatNumber($total) . '</td></tr>';
         } else {
             echo "<tr><th colspan='5'>" . __('No item found') . "</th></tr>";
         }
         echo "</table>";
     }
     echo "</div><br>";
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:74,代码来源:contractcost.class.php

示例2: Contract

                     $html .= '<td><a href="' . edkURI::page('system_detail', $row['id'], 'sys_id') . '">' . $row['name'] . "</td><td align=center><button id=submit name=submit onClick=\"window.location.href='" . $editURL . "'\">Select</button></td>";
                     break;
             }
             $html .= "</tr>";
         }
         if ($qry->recordCount()) {
             $html .= "</table>";
         }
     }
 } else {
     $page->setTitle("Administration - Edit Campaign");
     $contract = new Contract($ctrID);
     $html .= "<div class=block-header2>Details</div>";
     $html .= '<form id=detail_edit name=detail_edit method=post action="' . edkuri::build(array(array('ctr_id', $ctrID, false), array('op', 'edit', false))) . '">';
     $html .= "<table class=kb-subtable width=98%>";
     $html .= "<tr><td width=80><b>Name:</b></td><td><input type=text name=ctr_name id=ctr_name size=38 maxlength=38 value=\"" . htmlspecialchars($contract->getName(), ENT_QUOTES) . "\"></td></tr>";
     $html .= "<tr><td width=80><b>Start date:</b></td><td><input type=text name=ctr_started id=ctr_started size=10 maxlength=10 value=\"" . substr($contract->getStartDate(), 0, 10) . "\"> (yyyy-mm-dd)</td></tr>";
     $html .= "<tr><td width-80><b>End date:</b></td><td><input type=text name=ctr_ended id=ctr_ended size=10 maxlength=10 value=\"" . substr($contract->getEndDate(), 0, 10) . "\"> (yyyy-mm-dd or blank)</td></tr>";
     $html .= "<tr><td><b>Comment:</b></td><td><input type='text' name='ctr_comment' value='" . htmlspecialchars($contract->getComment(), ENT_QUOTES) . "' size='100'/></td></tr>";
     $html .= "<tr><td></td></tr>";
     $html .= "<tr><td></td><td><input type=submit name=detail_submit value=\"Save\"></td></tr>";
     $html .= "</table>";
     $html .= "</form>";
     $html .= "<div class=block-header2>Targets</div>";
     $html .= "<table class=kb-table cellspacing=1>";
     $html .= "<tr class=kb-table-header><td class=kb-table-cell width=160>Target</td><td class=kb-table-cell width=80 align=center>Corporation</td><td class=kb-table-cell width=80 align=center>Alliance</td><td class=kb-table-cell width=80 align=center>Region</td><td class=kb-table-cell width=80 align=center>System</td><td class=kb-table-cell width=80 align=center>Action</td></tr>";
     $c = 0;
     while ($contracttarget = $contract->getContractTarget()) {
         $c++;
         $type = $contracttarget->getType();
         $typeURL = false;
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:admin_cc.php

示例3: intval

popup| <?php 
/**
 * @package EDK
 */
require_once 'mods/forum_post/class.killsummarytable.php';
if (isset($_GET['ctr_id'])) {
    $ctr_id = intval($_GET['ctr_id']);
    $contract = new Contract($ctr_id);
    $klist = $contract->getKillList();
    $llist = $contract->getLossList();
    $killsummary = new KillSummaryTable($klist, $llist);
    $killsummary->setBreak(6);
    if ($_GET['view'] == "") {
        $killsummary->setFilter(false);
    }
    $name = $contract->getName();
}
if (isset($_GET['kll_id'])) {
    $kll_id = intval($_GET['kll_id']);
    // this is a fast query to get the system and timestamp
    $rqry = DBFactory::getDBQuery();
    $rsql = 'SELECT kll_timestamp, kll_system_id from kb3_kills where kll_id = ' . $kll_id;
    $rqry->execute($rsql);
    $rrow = $rqry->getRow();
    $system = new SolarSystem($rrow['kll_system_id']);
    // now we get all kills in that system for +-12 hours
    $query = 'SELECT kll.kll_timestamp AS ts FROM kb3_kills kll WHERE kll.kll_system_id=' . $rrow['kll_system_id'] . '
            AND kll.kll_timestamp <= date_add( \'' . $rrow['kll_timestamp'] . '\', INTERVAL \'12\' HOUR )
            AND kll.kll_timestamp >= date_sub( \'' . $rrow['kll_timestamp'] . '\', INTERVAL \'12\' HOUR )
            ORDER BY kll.kll_timestamp ASC';
    $qry = DBFactory::getDBQuery();
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:forum_post.php


注:本文中的Contract::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。