Example #1
0
/**
 * generates a Link for the mainmenu
 */
function generateMainMenuItem($catdir)
{
    $xmlParser = NULL;
    if (file_exists("content/{$catdir}/directory.xml")) {
        $xmlParser = new XPath("content/{$catdir}/directory.xml");
        $title = getCategoryName($xmlParser, $catdir);
    } else {
        $title = $catdir;
    }
    $link = $catdir . "/" . getCategoryMainpage($catdir, $xmlParser);
    return "<a href=\"index.php?p={$link}\">{$title}</a>\n";
}
Example #2
0
                <?php 
    foreach ($products as $k => $v) {
        ?>
                    <?php 
        $n++;
        ?>
                    <tr class="<?php 
        echo $n % 2 == 0 ? "even" : "odd";
        ?>
">
                        <td><?php 
        echo $v->title;
        ?>
</td>
                        <td><?php 
        echo getCategoryName($v->category);
        ?>
</td>
                        <td class="max-width">
                            <div class="max-width">
                                <?php 
        echo $v->properties;
        ?>
                            </div>
                        </td>
                        <td class="max-width">
                            <div class="max-width">
                            <?php 
        echo $v->feature;
        ?>
                            </div>
Example #3
0
    $i = $i + 1;
    $remindTime = $lists['remindTime'];
    $dateline = $lists['dateline'];
    ?>
  <li> 
  	<h2><?php 
    echo $i;
    ?>
.  <?php 
    echo $lists['userid'];
    ?>
 <?php 
    echo date("Y-m-d", strtotime($dateline));
    ?>
 <?php 
    echo getCategoryName("servicetype", $lists['type']);
    ?>
 
  		<span style="flot:left"><a data-ajax="false" href="customer_ok.php?act=delService2&sid=<?php 
    echo $lists['id'];
    ?>
&id=<?php 
    echo $id;
    ?>
" onClick="javascript:return confirm('确实要删除吗?')"><img src="../images/del.gif" border="0" /></a></spen></h2>
  <p><?php 
    echo $lists['name'];
    ?>
</p> 
 </li>
  <?php 
function create_sefurl($url)
{
    global $boardurl, $modSettings, $PortaMxSEF;
    if (!empty($modSettings['pmxportal_disabled']) || !empty($modSettings['pmxsef_disabled'])) {
        return $url;
    }
    // Init..
    $sefstring = $sefstring1 = $sefstring2 = '';
    $query_parts = array();
    // Get the query string
    $params = array();
    $url_parts = parse_url($url);
    // security .. check illegal url's
    parse_str(!empty($url_parts['query']) ? preg_replace('~&(\\w+)(?=&|$)~', '&$1=', strtr($url_parts['query'], array('&amp;' => '&', ';' => '&'))) : '', $params);
    if (!empty($params)) {
        // check ingnore actions
        if (!empty($params['action']) && in_array($params['action'], $PortaMxSEF['ignoreactions'])) {
            return $url;
        }
        // check ingnore requests
        $tmp = array_intersect(array_keys($params), array_keys($PortaMxSEF['ignorerequests']));
        if (count($tmp) == 1 && ($tmp = current($tmp)) && $params[$tmp] == $PortaMxSEF['ignorerequests'][$tmp]) {
            return $url;
        }
        // boards or topics
        if (isset($params['board'])) {
            $sefstring .= getBoardName($params['board']);
            unset($params['board']);
        } elseif (isset($params['topic'])) {
            $sefstring .= getTopicName($params['topic']);
            unset($params['topic']);
        }
        // actions
        if (isset($params['action'])) {
            if (in_array($params['action'], array_values($PortaMxSEF['aliasactions']))) {
                $acts = array_flip($PortaMxSEF['aliasactions']);
                $params['action'] = $acts[$params['action']];
            } elseif (!in_array($params['action'], array_merge($PortaMxSEF['actions'], array('theme', 'language')))) {
                preg_match('/[a-zA-Z0-9\\_\\-]+/', $params['action'], $action);
                if (!empty($action[0])) {
                    $PortaMxSEF['actions'][] = $action[0];
                }
            }
            $sefstring .= $params['action'] . '/';
            unset($params['action']);
            // user
            if (isset($params['u'])) {
                $sefstring .= $params['u'] == 'all' ? $params['u'] . '.0/' : getUserName($params['u']);
                unset($params['u']);
            }
        } elseif (isset($params['cat'])) {
            // root cat
            if (isset($params['cat'])) {
                $sefstring .= getCategoryName($params['cat']);
                unset($params['cat']);
            }
            //child cat?
            if (isset($params['child'])) {
                $sefstring .= getCategoryName($params['child'], true);
                unset($params['child']);
            }
            // have article?
            if (isset($params['art'])) {
                $sefstring .= getArticleName($params['art']);
                unset($params['art']);
            }
        } elseif (isset($params['art'])) {
            $sefstring .= getArticleName($params['art']);
            unset($params['art']);
        } elseif (isset($params['spage'])) {
            $sefstring .= getPageName($params['spage']);
            unset($params['spage']);
        }
        // single request token
        foreach ($PortaMxSEF['singletoken'] as $key) {
            if (array_key_exists($key, $params) && $params[$key] == '') {
                $sefstring2 .= $key . '/';
                unset($params[$key]);
            }
        }
        // do the rest
        foreach ($params as $key => $value) {
            if ($key == 'start') {
                $sefstring2 .= $value != '' ? $key . '/' . $value . '/' : '';
            } elseif (is_array($value)) {
                $sefstring1 .= $key . '[' . key($value) . ']/' . $value[key($value)] . '/';
            } else {
                $sefstring1 .= $key . '/' . $value . '/';
            }
        }
        // Build the URL
        if (isset($query_parts['action'])) {
            $sefstring .= $query_parts['action'] . '/';
        }
        $sefstring .= $sefstring1 . $sefstring2;
    }
    return $boardurl . '/' . $sefstring . (!empty($url_parts['fragment']) ? '#' . $url_parts['fragment'] : '');
}
Example #5
0
        break;
    case 'addtocart':
    case 'deletefromcart':
    case 'emptycart':
    case 'showcart':
        echo "<hr /><h1>Your shopping cart</h1>";
        showCart($_SESSION['cart'], $mode);
        break;
    case 'image':
        showCategories($mode);
        echo "<h1>Large Product Image</h1>";
        showImage($ASIN, $mode);
        break;
    case 'search':
        showCategories($mode);
        echo "<h1>Search Results For " . $search . "</h1>";
        showSearch($search, $page, $mode);
        break;
    case 'browsenode':
    default:
        showCategories($mode);
        $category = getCategoryName($browseNode);
        if (!$category || $category == 'Best Selling Books') {
            echo "<h1>Current Best Sellers</h1>";
        } else {
            echo "<h1>Current Best Sellers in " . $category . "</h1>";
        }
        showBrowseNode($browseNode, $page, $mode);
        break;
}
require 'bottom.php';
/**
 * Helper to display userdata content
 */
function showUserdataField($userId, $settingName, $defaultValue = '')
{
    global $db;
    if (!is_numeric($userId)) {
        return false;
    }
    if (!is_numeric($settingName)) {
        $userdata = getUserdataFieldByName($settingName);
        if (!$userdata) {
            return $defaultValue;
        }
    }
    $q = 'SELECT settingValue FROM tblSettings WHERE ownerId=' . $userId . ' AND settingType=' . SETTING_USERDATA . ' AND settingName="' . $userdata['fieldId'] . '"';
    $result = $db->getOneItem($q);
    switch ($userdata['fieldType']) {
        case USERDATA_TYPE_RADIO:
        case USERDATA_TYPE_SELECT:
        case USERDATA_TYPE_GENDER:
        case USERDATA_TYPE_THEME:
            $val = getCategoryName(CATEGORY_USERDATA, $result);
            break;
        case USERDATA_TYPE_IMAGE:
            if (!$result) {
                return false;
            }
            // TODO: Make this an optional setting
            if (isInQueue($result, MODERATION_PRES_IMAGE)) {
                return false;
            }
            $val = showThumb($result, $settingName, 270, 200);
            break;
        default:
            $val = $result;
    }
    return $val;
}
<h2>These are the requests this month</h2> 
<?php 
/*  display current month ID  */
$curr_month = date('m', time());
$curr_year = date('y', time());
$curr_month_ID = sprintf("%02d", $curr_month) . $curr_year;
echo "ID of this month " . $curr_month_ID;
/*  
		Loop to display one block for every Category,
		Inside, for every category display the Name of the category
		And the list of requests for this month
*/
for ($k = 0; $k < getCatNum(); ++$k) {
    echo "<h3><a href=";
    echo getCategoryURL($k);
    echo ">";
    echo getCategoryName($k);
    echo "</a></h3>";
    displayThisMonthRequests($curr_month_ID, $k + 1);
}
 $req_select .= "RIGHT OUTER JOIN " . constant('_VM_TABLE_PREFIX_') . "_order_item item ON item.product_id=prod_categ.product_id ";
 $req_select .= "WHERE item.order_id='" . $order_id . "' ";
 if ($order_item_id != "") {
     $req_select .= "AND item.order_item_id='" . $order_item_id . "' ";
 }
 $req_select .= "AND category_name != ''";
 //echo $req_select;
 $req = mysql_query($req_select) or die('\\nInvalid query: ' . $req_select . ' ' . mysql_error());
 if (mysql_num_rows($req) > 0) {
     $xml = '<xml>';
     while ($row = mysql_fetch_assoc($req)) {
         $xml .= '<object>';
         foreach ($row as $fieldname => $fieldvalue) {
             if ($fieldname == 'category') {
                 $categ_id = $row['id'];
                 $category_path = getCategoryPath($categ_id, $parent_id = 0) . "/" . getCategoryName($categ_id);
                 $category_path = constant('_COLLECTION_CIM_ID_') . "" . $category_path;
                 $xml .= '<' . $fieldname . '>' . $category_path . '</' . $fieldname . '>';
             } else {
                 $xml .= '<' . $fieldname . '>' . $fieldvalue . '</' . $fieldname . '>';
             }
         }
         $xml .= '</object>';
     }
     if ($order_item_id != "") {
         $xml .= getProductAttributeFormattedList($order_item_id);
     }
     $xml .= '</xml>';
     header('Content-type: text/xml');
     echo $xml;
 } else {
 function doaddShare()
 {
     $type['typeId'] = 9;
     $type['typeName'] = '话题';
     $type['alias'] = 'topic';
     $info = h($_REQUEST['info']);
     $aimId = intval($_REQUEST['aimId']);
     $data = D('Topic')->getThread($aimId);
     $data['cid'] = $this->groupinfo['cid0'];
     $data['catagory'] = getCategoryName($data['cid']);
     $data['groupName'] = $this->groupinfo['name'];
     $intro = str_replace("&amp;nbsp;", "", t($data['content']));
     $data['intro'] = $this->_getBlogShort($intro, 120);
     unset($data['content']);
     //$data['title'] = h($_REQUEST['title']);
     $fids = $_REQUEST['fids'];
     $result = $this->api->share_addShare($type, $aimId, $data, $info, 0, $fids);
     echo $result;
 }
Example #10
0
    echo $list['id'];
    ?>
</td>
    <td height="24" align="center" valign="middle" bgcolor="#f8f8f8"><a href="admin_mod.php?id=<?php 
    echo $list['id'];
    ?>
"><?php 
    echo $list['username'];
    ?>
</a></td>
	  <td height="24" align="center" valign="middle" bgcolor="#f8f8f8"><?php 
    echo $list['usermenu'];
    ?>
</td>
    <td height="24" align="center" valign="middle" bgcolor="#f8f8f8"><?php 
    echo getCategoryName('role', $list['supermanager']);
    ?>
</td>
    <td height="24" align="center" valign="middle" bgcolor="#f8f8f8"><?php 
    echo get_supermanager($list['pid']);
    ?>
</td>
    <td height="24" align="center" valign="middle" bgcolor="#f8f8f8"><?php 
    echo $list['loginip'];
    ?>
</td>
    <td height="24" align="center" valign="middle" bgcolor="#f8f8f8"><?php 
    echo $list['logintime'];
    ?>
</td>
    <td height="24" align="center" valign="middle" bgcolor="#f8f8f8"><?php 
Example #11
0
if ($category == '' || empty($category) || is_null($category) || $category == '0' || $category == 0 || $category == '0.00' || $category == 'Not Available') {
    ?>
                            <div class="row-form clearfix">
                                <div class="span3">Category</div>
                                <div class="span9"><input type="text" id="caste" name="caste" value="<?php 
    echo $defaultstr;
    ?>
" readonly="true"/><span style="display:none" id="error13" class="required">This is required</span></div>
                            </div>
                        <?php 
} else {
    ?>
                            <div class="row-form clearfix">
                                <div class="span3">Category</div>
                                <div class="span9"><input type="text" id="caste" name="caste" value="<?php 
    echo getCategoryName($category);
    ?>
" readonly="true"/><span style="display:none" id="error13" class="required">This is required</span></div>
                            </div>

                       <?php 
}
if ($blood_group == '' || empty($blood_group) || is_null($blood_group) || $blood_group == '0' || $blood_group == '0.00' || $blood_group == 'Not Available') {
    ?>
                            <div class="row-form clearfix">
                                <div class="span3">Blood Group</div>
                                <div class="span9"><input type="text" id="bgrp" name="bgrp" value="<?php 
    echo $defaultstr;
    ?>
" readonly="true"/><span style="display:none" id="error13" class="required">This is required</span></div>
                            </div> 
Example #12
0
$var['file_ext'] = extractFileExt($var['filename']);
switch ($var['file_ext']) {
    case "html":
    case "xhtml":
        $var['content'] = html_output($xmlParser);
        break;
    case "xml":
        $var['content'] = generateContentFromXml($xmlParser);
        break;
}
// category directory stuff
if (file_exists($var['catdir'] . "/directory.xml")) {
    // generate some stuff with directory.xml
    $xmlParser = new XPath($var['catdir'] . "/directory.xml");
    // get category name
    $var['category'] = getCategoryName($xmlParser, $catdir);
    // generate (sub)menu
    if ($xmlParser->match("/directory[1]/menu[1]")) {
        $var['catmenu'] = menuFromXml($xmlParser->exportAsXml("/directory[1]/menu[1]"), $var['catdir']);
    } else {
        $var['catmenu'] = menuFromCatdir($var['catdir']);
    }
    // get category stylesheet
    if ($xmlParser->match("/directory/stylesheet")) {
        $var['stylesheet'] = $xmlParser->getData("/directory/stylesheet");
    }
} else {
    // generate all "by hand"
    $var['category'] = getPathElement($var['catdir'], 1);
    $var['catmenu'] = menuFromCatdir($var['catdir']);
}
 function defaultsubcatlevel($catid, $catlevel)
 {
     $lvl2subcats = modApiFunc("Catalog", "getSubCategories", $catid);
     // Checking for subcategories which have level greater than 1
     if ($catlevel > 1) {
         $catname = getCategoryName($catid);
         $catlink = getCategoryLink($catid);
         $value = "";
         $value .= "<li><a href='{$catlink}'><span>" . $catname . "</span></a><div><ul>";
     }
     //Get subcategories for level2 and below
     $count = count($lvl2subcats) - 1;
     while ($count >= 0) {
         $value .= $this->defaultsubcatlevel(getCategoryID($lvl2subcats[$count]["category_id"]), 2);
         $count = $count - 1;
     }
     if ($catlevel > 1) {
         $value .= "</ul></div>";
     }
     return $value;
 }
Example #14
0
             $report_subcat = $Prod['subcategory_id'];
             if($report_subcat==0 && $report_cat==0)
             {
                 $cat_colspan=3;
             }
             $sku_id = $Prod['sku_id'];
             $report_productname=$Prod['product_name'];
             $report_productprice=$Prod['price'];
             ?>
     
             <?php /* if($cat_colspan!=1) { ?> colspan="<?php echo $cat_colspan; ?>" <?php } */ ?>
 
             <tr id="order_<?php echo $id; ?>">
                 <td width="35"  align="center" valign="middle" bgcolor="<?php echo $rowColor; ?>" class="pad_btm"><?php echo $i; ?></td>
                 <td width="85" align="left" valign="middle" bgcolor="<?php echo $rowColor1; ?>" class="pad_btm" style="padding-left: 5px;"><?php echo getSuperCategoryName($report_supercat); ?></td>
                 <td width="85" align="left" valign="middle" bgcolor="<?php echo $rowColor; ?>"  class="pad_btm" style="padding-left: 5px;"><?php echo getCategoryName($report_cat); ?></td>
                 <td width="85" style="padding-left: 5px;" align="left" valign="middle" bgcolor="<?php echo $rowColor1; ?>"  class="pad_btm"><?php echo getSuperCategoryName($report_subcat); ?></td>
                 <td width="75"  align="left" valign="middle" bgcolor="<?php echo $rowColor; ?>" class="pad_btm" style="padding-left: 5px;"><?php echo $report_productname; ?></td>
                 <td width="24"  align="left" valign="middle" bgcolor="<?php echo $rowColor1; ?>" class="pad_btm" style="padding-left: 5px;">$<?php echo $report_productprice; ?></td>                                                                
                 <td width="24"  align="left" valign="middle" bgcolor="<?php echo $rowColor; ?>" class="pad_btm"><?php echo $sku_id; ?></td>
             </tr>
             <?php
             $i++;
         }
     } else {
         ?>
         <tr align="center">
             <td colspan="8">There is no orders</td>
         </tr>
         <?php
     }
Example #15
0
                                                <?php
                                                $i = 1;
                                                if (count($SubCategory) > 0) {
                                                    foreach ($SubCategory as $Cate) {
                                                        $rowColor = ($i % 2 != 0) ? '#dfdfdf' : '#eeeeee';
                                                        $rowColor1 = ($i % 2 != 0) ? '#eeeeee' : '#f6f2f2';
                                                        $id = $Cate['id'];
                                                        $name = $Cate['category_name'];
                                                        $parent = $Cate['parent_id'];
                                                        $super_id = $Cate['super_id'];
                                                        $status = ($Cate['status'] == 1) ? 'active' : 'de-active';
                                                        ?>
                                                        <tr  style="font-size: 14px;" id="order_<?php echo $id; ?>">
                                                            <td width="80" height="36" align="center" bgcolor="<?php echo $rowColor; ?>" valign="middle"><?php echo $i; ?></td>
                                                            <td width="180" height="36" align="left" bgcolor="<?php echo $rowColor1; ?>" valign="middle" class="pad_lft"><?php echo $name; ?></td>
                                                            <td width="249" height="36" align="left" bgcolor="<?php echo $rowColor; ?>" valign="middle" class="pad_lft"><?php echo getCategoryName($parent); ?></td>
                                                            <td width="249" height="36" align="left" bgcolor="<?php echo $rowColor1; ?>" valign="middle" class="pad_lft"><?php echo getSuperCategoryName($super_id); ?></td>
                                                            <td width="100" height="36" align="center" bgcolor="<?php echo $rowColor; ?>" valign="middle"><a href="subcategory.php?status_id=<?php echo $id; ?>&change_id=<?php echo $Cate['status']; ?>" onclick="return confirm('Are you change the status in this category?');"><img src="images/<?php echo $status; ?>.png" width="22" height="22"  alt="Status" title="Status"/></a></td>
                                                            <td width="140" height="36" align="center" bgcolor="<?php echo $rowColor1; ?>" valign="middle"><a class="fancybox fancybox.iframe" href="edit_sub.php?id=<?php echo $id; ?>"><img src="images/edit.png"  alt="Edit" title="Edit" width="22" height="22"/></a><a href="subcategory.php?delete_id=<?php echo $id; ?>" onclick="return confirm('Are you delete this subcategory?');"><img src="images/del.png"  alt="Delete" title="Delete" width="22" height="22" class="mar_lft"/></a></td>
                                                        </tr>

                                                        <?php
                                                        $i++;
                                                    }
                                                } else {
                                                    ?>
                                                    <tr  bgcolor="<?php echo $rowColor; ?>">
                                                        <td colspan="5" align="center">There is no sub categories</td>
                                                    </tr>
                                                <?php } ?>
                                            </table></td>
Example #16
0
        $status = $Cate['status'] == 1 ? 'active' : 'de-active';
        ?>
                                                        <tr bgcolor="<?php 
        echo $rowColor;
        ?>
">
                                                            <td width="80" height="36" align="center" valign="middle"><?php 
        echo $i;
        ?>
</td>
                                                            <td width="230" height="36" align="center" valign="middle"><?php 
        echo $name;
        ?>
</td>
                                                            <td width="209" height="36" align="center" valign="middle"><?php 
        echo $cName = getCategoryName($parent);
        ?>
</td>
                                                            <td width="100" height="36" align="center" valign="middle"><img src="images/<?php 
        echo $status;
        ?>
.png" width="22" height="22"  alt=""/></td>
                                                            <td width="140" height="36" align="center" valign="middle"><a style="border: 0;" href="edit_subcategory.php?id=<?php 
        echo $id;
        ?>
"><img src="images/edit.png"  alt="" width="22" height="22"/></a><a href="subcategory.php?delete_id=<?php 
        echo $id;
        ?>
" onclick="return confirm('Are you delete this subcategory?');"><img src="images/del.png"  alt="" width="22" height="22" class="mar_lft"/></a></td>
                                                        </tr>
                                                        <?php 
  <?php 
while ($row = mysqli_fetch_assoc($product)) {
    ?>
  
  <tr>
    <td><?php 
    echo $row['ID'];
    ?>
</td>
    <td> ---</td>
    <td><?php 
    echo $row['productName'];
    ?>
</td>
    <td><?php 
    echo getCategoryName($row['categoryID']);
    ?>
</td>
    <td><?php 
    echo $row['productPrice'];
    ?>
</td>
    <td>
		<a href="edit.php?id=<?php 
    echo $row['ID'];
    ?>
">Edit </a> | 
    	<a onclick="return confirm('Really Want to Delete?');" href="?action=delete&id=<?php 
    echo $row['ID'];
    ?>
">Delete </a>
function createSpellDetails($spell)
{
    global $lang;
    echo '<table class=details width=600><tbody>';
    echo '<tr><td colspan=4 class=head>' . $lang['detail_info'] . '</td></tr>';
    echo '<tr><th>Name</th><td colspan=2>' . $spell['SpellName'] . '</td><td align=right>' . $spell['Rank'] . '</td></tr>';
    if ($spell['Description']) {
        echo '<tr><th width=60>Info:</th><td colspan=3>' . getSpellDesc($spell) . '</td></tr>';
    }
    if ($spell['ToolTip']) {
        echo '<tr><th>Buff:</th><td colspan=3>' . getSpellBuff($spell) . '</td></tr>';
    }
    // Стоимость и длительность
    $cost = getSpellCostText($spell);
    $duration = getSpellDurationText($spell);
    if ($cost or $duration) {
        echo '<tr><th>Cost</th><td>' . ($cost ? $cost : 'No Cost') . '</td><th>Duration</th><td>' . $duration . '</td></tr>';
    }
    echo '<tr>';
    echo '<th width=13%>Level</th>';
    echo '<td width=37%>Base ' . $spell['baseLevel'] . ', Max ' . $spell['maxLevel'] . ', Spell ' . $spell['spellLevel'] . '</td>';
    echo '<th width=20%>Range</th>';
    echo '<td width=30%>' . getRangeText($spell['rangeIndex']) . '</td>';
    echo '</tr>';
    // Время квста и школа (выводятся всегда)
    echo '<tr><th>Cast time</th><td>' . getCastTimeText($spell) . '</td><th>School</th><td>' . getSpellSchool($spell['SchoolMask']) . '</td></tr>';
    $skillAbility = getSkillLineAbility($spell['id']);
    if ($skillAbility or $spell['Category']) {
        echo '<tr>';
        echo '<th>Skill</th>';
        if ($skillAbility) {
            echo '<td>' . getSkillName($skillAbility['skillId']) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Category</th>';
        if ($spell['Category']) {
            echo '<td>' . getCategoryName($spell['Category']) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод механики и диспелла
    if ($spell['Mechanic'] or $spell['Dispel']) {
        echo '<tr>';
        echo '<th>Mechanic</th><td>' . getMechanicName($spell['Mechanic']) . '</td>';
        echo '<th>Dispel type</th><td>' . getDispelName($spell['Dispel']) . '</td>';
        echo '</tr>';
    }
    // Вывод кулдаунов
    $cooldown = getSpellCooldown($spell);
    if ($cooldown or $spell['StartRecoveryCategory'] or $spell['StartRecoveryTime']) {
        echo '<tr>';
        echo '<th>Cooldown</th>';
        if ($cooldown) {
            echo '<td>' . getTimeText($cooldown / 1000) . '</td>';
        } else {
            echo '<td>No cooldown</td>';
        }
        echo '<th>Global cooldown</th>';
        if ($spell['StartRecoveryCategory'] or $spell['StartRecoveryTime']) {
            echo '<td>';
            echo 'Affected';
            if ($spell['StartRecoveryTime']) {
                echo ', ' . getTimeText($spell['StartRecoveryTime'] / 1000);
            } else {
                echo ', Not start';
            }
            echo '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод требований форм
    $stances = $spell['Stances'];
    $stancesNot = $spell['StancesNot'];
    if ($stances or $stancesNot) {
        echo '<tr>';
        echo '<th>Req form</th>';
        if ($stances) {
            echo '<td>' . getAllowableForm($stances) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Not in form</th>';
        if ($stancesNot) {
            echo '<td>' . getAllowableForm($stancesNot) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод требований одетого снаряжения
    $itemClass = $spell['EquippedItemClass'];
    $itemSubClass = $spell['EquippedItemSubClassMask'];
    $inventoryTypeMask = $spell['EquippedItemInventoryTypeMask'];
    if ($itemClass >= 0 or $inventoryTypeMask) {
        echo '<tr>';
        echo '<th>Req item</th>';
        if ($itemClass >= 0) {
            echo '<td>';
            if ($itemSubClass) {
                echo getClassName($itemClass, 0) . ': ' . getSubclassList($itemClass, $itemSubClass);
            } else {
                echo getClassName($itemClass);
            }
            echo '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Inv type</th>';
        if ($inventoryTypeMask) {
            echo '<td>' . getInventoryTypeList($inventoryTypeMask) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод тотм категорий и спеллфокуса
    $totem1 = $spell['TotemCategory_1'];
    $totem2 = $spell['TotemCategory_2'];
    $focus = $spell['RequiresSpellFocus'];
    if ($totem1 or $totem2 or $focus) {
        echo '<tr>';
        echo '<th>Tools</th>';
        if ($totem1 or $totem2) {
            echo '<td>';
            if ($totem1) {
                echo getTotemCategory($totem1);
            }
            if ($totem2) {
                echo ', ' . getTotemCategory($totem2);
            }
            echo '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Spell Focus</th>';
        if ($focus) {
            echo '<td>' . getSpellFocusName($focus, 2) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    $area = $spell['AreaGroupId'];
    if ($area) {
        echo '<tr>';
        echo '<th>Area</th>';
        if ($area) {
            echo '<td>' . $area . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод требований целей
    $targets = $spell['Targets'];
    $targetCreature = $spell['TargetCreatureType'];
    if ($targets or $targetCreature) {
        echo '<tr>';
        echo '<th>Targets</th>';
        if ($targets) {
            echo '<td>' . getTargetsList($targets) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Creature type</th>';
        if ($targetCreature) {
            echo '<td>' . getCreatureTypeList($targetCreature) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    if ($spell['Reagent_1'] or $spell['Reagent_2'] or $spell['Reagent_3'] or $spell['Reagent_4'] or $spell['Reagent_5'] or $spell['Reagent_6'] or $spell['Reagent_7'] or $spell['Reagent_8']) {
        echo '<tr>';
        echo '<th>Reagents</th>';
        echo '<td colspan=3>';
        r_spellReagents($spell);
        echo '</td>';
        echo '</tr>';
    }
    // Вывод эффектов
    showEffectData($spell, 1);
    showEffectData($spell, 2);
    showEffectData($spell, 3);
    echo '</tbody></table>';
}
<?php

include "Includes/Connection_inc.php";
include "Includes/Functions.php";
include "DataGen.php";
//This method writes the sales by product data for a given category for a given year
$intYear = $_GET['year'];
$intCatId = $_GET['catId'];
//XML Data container
$strXML = "<chart caption='" . getCategoryName($intCatId) . " - Product wise sales in " . $intYear . "' PYAXisName='Revenue' SYAxisName='Units Sold' xAxisName='Products' palette='" . getPalette() . "' animation='" . getAnimationState() . "' showValues='0' formatNumberScale='0' numberPrefix='\$' labelDisplay='STAGGER' seriesNameInToolTip='0'>";
//Add the data
$strXML .= getSalesByProdCatXML($intYear, $intCatId, true);
$strXML .= "<styles><definition><style type='font' name='CaptionFont' size='15' color='" . getCaptionFontColor() . "' /><style type='font' name='SubCaptionFont' bold='0' /></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles>";
$strXML .= "</chart>";
//Output it
header('Content-type: text/xml');
echo $strXML;
Example #20
0
            </div>

            <?php 
} else {
    $categoryId = $_GET['categoryId'];
    ?>
            <div class="row">
                <div class="span9">
                    <h4 class="title"><span class="text"><strong>Recent</strong> Products</span></h4>
                    <ul class="thumbnails listing-products">

                        <?php 
    $items = getItemsByCategoryId($categoryId);
    foreach ($items as $item) {
        $categoryname = getCategoryName($item['CategoryId']);
        $isinstock = isItemInStock($item['MedicineId']);
        $medicineId = $item['MedicineId'];
        ?>
                            <li class="span3">
                                <div class="product-box">
                                    <span class="sale_tag"></span>
                                    <a href="<?php 
        echo 'product_detail.php?medicineId=' . $medicineId;
        ?>
">
                                        <img alt=""
                                             src="<?php 
        echo './images/products/' . $medicineId . '.jpg';
        ?>
"/></a>
Example #21
0
$totalpage = ceil($totalnum / $pagesize);
if ($page > $totalpage) {
    $page = $totalpage;
}
//current page data list
$datalist = $db->fetch_all($sQuery);
#var_dump($datalist);die();
$outputdata['sEcho'] = intval($_GET['sEcho']);
$outputdata['iTotalRecords'] = count($datalist);
$outputdata['iTotalDisplayRecords'] = $totalnum;
$outputdata['aaData'] = array();
foreach ($datalist as $datatemp) {
    $item = array();
    $item[] = $datatemp['id'];
    $item[] = $datatemp['title'];
    $tempcategory = getCategoryName($db, $datatemp['categoryid']);
    $item[] = $tempcategory['name'];
    $item[] = $datatemp['city'];
    $item[] = $datatemp['status'] == 0 ? '未发布' : '已发布';
    $item[] = '&yen;' . $datatemp['money'];
    $item[] = '&yen;' . $datatemp['leftmoney'];
    $item[] = '&yen;' . $datatemp['minprice'] . ' ~ ' . '&yen;' . $datatemp['maxprice'];
    $item[] = $datatemp['clicknum'];
    $item[] = $datatemp['addtime'];
    $item[] = '<a target="_blank" href="http://www.zhuangxiuji.com.cn/cms/admin/content.php?id=' . $datatemp['id'] . '">
                <i></i>
                详细&nbsp;
            </a>
            <a  href="edit.php?id=' . $datatemp['id'] . '">
                <i></i>
                &nbsp;编辑&nbsp;
Example #22
0
                <tr>
                    <th><label>所属分类</label></th>
                    <td>
                        <select name="category">
                            <option value="0" <?php 
echo $v->category == 0 ? "selected=\"selected\"" : "";
?>
><?php 
echo getCategoryName(0);
?>
</option>
                            <option value="1" <?php 
echo $v->category == 1 ? "selected=\"selected\"" : "";
?>
><?php 
echo getCategoryName(1);
?>
</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th><label>总重量</label></th>
                    <td>
                        <input type="text" name="weight" data-validate="required,number" value="<?php 
echo $v->weight;
?>
" />(单位: 克)
                    </td>
                </tr>
                <tr>
Example #23
0
include_once 'simple_html_dom.php';
$nikkei_page_list = getNiikeiUrlList();
$result = array();
foreach ($nikkei_page_list as $category => $page_url) {
    $html = file_get_html($page_url);
    $count = 0;
    foreach ($html->find('.cmn-article_title') as $element) {
        foreach ($element->find('a') as $url) {
            $result[$category][$count]['url'] = "http://www.nikkei.com" . $url->href;
            $result[$category][$count]['title'] = $url->plaintext;
            $count++;
        }
    }
}
$category_name = getCategoryName();
$contents = "本日の重要記事一覧 (" . date("Y年m月d日 H:i:s") . ") \r\n";
foreach ($result as $category => $news_list) {
    $contents .= "\r\n [" . $category_name[$category] . "] ( " . $nikkei_page_list[$category] . " )\r\n";
    foreach ($news_list as $no => $news) {
        $contents .= $no . " : " . $news['title'] . "(" . $news['url'] . ") \r\n";
    }
}
sendMail($contents);
exit;
function getNiikeiUrlList()
{
    $list = array();
    $list['economy'] = "http://www.nikkei.com/news/category/?at=DGXZZO0195164008122009000000";
    $list['internation'] = "http://www.nikkei.com/news/category/?at=DGXZZO0195570008122009000000";
    $list['company'] = "http://www.nikkei.com/news/category/?at=DGXZZO0195165008122009000000";
Example #24
0
                                                    <td width="140" height="28" align="center" valign="middle" class="td_brdr" bgcolor="#f99b3e">action</td>
                                                </tr>
                                                <?php
                                                $i = 1;
                                                if (count($SubCategory) > 0) {
                                                    foreach ($SubCategory as $Cate) {
                                                        $rowColor = ($i % 2 != 0) ? '#f9f9f9':'#dfdfdf'; 
                                                        $id = $Cate['id'];
                                                        $name = $Cate['category_name'];
                                                        $parent = $Cate['parent_id'];
                                                        $status = ($Cate['status'] == 1) ? 'active' : 'de-active';
                                                        ?>
                                                        <tr bgcolor="<?php echo $rowColor; ?>">
                                                            <td width="80" height="36" align="center" valign="middle"><?php echo $i; ?></td>
                                                            <td width="230" height="36" align="center" valign="middle"><?php echo $name; ?></td>
                                                            <td width="209" height="36" align="center" valign="middle"><?php echo $cName = getCategoryName($parent); ?></td>
                                                            <td width="100" height="36" align="center" valign="middle"><img src="images/<?php echo $status; ?>.png" width="22" height="22"  alt=""/></td>
                                                            <td width="140" height="36" align="center" valign="middle"><a style="border: 0;" href="edit_subcategory.php?id=<?php echo $id; ?>"><img src="images/edit.png"  alt="" width="22" height="22"/></a><a href="subcategory.php?delete_id=<?php echo $id; ?>" onclick="return confirm('Are you delete this subcategory?');"><img src="images/del.png"  alt="" width="22" height="22" class="mar_lft"/></a></td>
                                                        </tr>
                                                        <?php
                                                        $i++;
                                                    }
                                                } else {
                                                    ?>
                                                    <tr >
                                                        <td colspan="5">There is no sub categories</td>
                                                    </tr>

                                                <?php }
                                                ?>
Example #25
0
/**
 * Tries to determine what language the input text is written in
 *
 * @param $text text to analyze
 * @return array of info about the guess
 */
function guessLanguage($text)
{
    if (!$text) {
        return false;
    }
    $sentences = parseText($text);
    $result = array();
    $tot = 0;
    for ($i = 0; $i < count($sentences); $i++) {
        //Split up the sentences in array of words separated by space
        $words = explode(' ', $sentences[$i]);
        for ($j = 0; $j < count($words); $j++) {
            //For each word, check what language it maches in the database
            $list = getWordMatches($words[$j]);
            for ($k = 0; $k < count($list); $k++) {
                if (!isset($result[$list[$k]['lang']])) {
                    $result[$list[$k]['lang']] = 0;
                }
                $result[$list[$k]['lang']]++;
                $tot++;
            }
        }
    }
    foreach ($result as $lang => $cnt) {
        if (!$lang) {
            echo 'Unknown';
        } else {
            echo getCategoryName(CATEGORY_LANGUAGE, $lang);
        }
        echo ': ' . round($cnt / $tot * 100, 2) . '%<br/>';
    }
    return $result;
}