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


PHP Location::get_name方法代码示例

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


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

示例1: home

 public static function home()
 {
     $template = new HTMLTemplate("location/admin/location/list.html");
     $content_array = array();
     $location_root_array = Location::list_root_entries();
     if (is_array($location_root_array) and count($location_root_array) >= 1) {
         foreach ($location_root_array as $key => $value) {
             $location = new Location($value);
             $content_array[self::$home_list_counter]['padding'] = 0;
             $content_array[self::$home_list_counter]['name'] = $location->get_name(true);
             $paramquery = $_GET;
             $paramquery['action'] = "delete";
             $paramquery['id'] = $value;
             $params = http_build_query($paramquery, '', '&');
             $content_array[self::$home_list_counter]['delete_params'] = $params;
             $paramquery = $_GET;
             $paramquery['action'] = "add_child";
             $paramquery['id'] = $value;
             $params = http_build_query($paramquery, '', '&');
             $content_array[self::$home_list_counter]['create_child_params'] = $params;
             $paramquery = $_GET;
             $paramquery['action'] = "edit";
             $paramquery['id'] = $value;
             $params = http_build_query($paramquery, '', '&');
             $content_array[self::$home_list_counter]['edit_params'] = $params;
             $temp_counter = self::$home_list_counter;
             self::$home_list_counter++;
             $location_child_array = self::home_child_list($value, 1);
             if (is_array($location_child_array)) {
                 $content_array[$temp_counter]['show_line'] = true;
                 $content_array = $content_array + $location_child_array;
             }
         }
         $template->set_var("no_entry", false);
     } else {
         $template->set_var("no_entry", true);
     }
     $paramquery = $_GET;
     $paramquery['action'] = "add";
     unset($paramquery['nextpage']);
     $params = http_build_query($paramquery, '', '&');
     $template->set_var("add_params", $params);
     $template->set_var("location_array", $content_array);
     $template->output();
 }
开发者ID:suxinde2009,项目名称:www,代码行数:45,代码来源:admin_location.io.php

示例2: displayAllArchived

function displayAllArchived($locationTypes)
{
    //global the tool and make a tool bar for adding a client
    global $tool, $locationForm;
    if ($_SESSION['access'] >= 50) {
        $toolNames = array("Add New Location", "All Locations", "Location Types", "Room Types");
        $toolIcons = array("add", "location", "industry", "room");
        $toolHandlers = array("handleEvent('location.php?action=addLocation')", "handleEvent('location.php')", "handleEvent('location.php?action=showLocationTypes')", "handleEvent('location.php?action=showRoomTypes')");
    } else {
        $toolNames = array("All Locations", "Location Types", "Room Types");
        $toolIcons = array("location", "industry", "room");
        $toolHandlers = array("handleEvent('location.php')", "handleEvent('location.php?action=showLocationTypes')", "handleEvent('location.php?action=showRoomTypes')");
    }
    echo $tool->createNewTools($toolNames, $toolIcons, $toolHandlers);
    echo $tool->createNewFilters();
    //get all the client and display them all in the 2 sections: "Location Name" and "Location ID".
    //$allLocationTypes = $locationTypes->get_location_types(1);
    $allLocations = Location::get_locations(1);
    $keyHandlers = array();
    $keyTitle = array();
    $keyData = array();
    if (isset($allLocations)) {
        foreach ($allLocations as $id => $value) {
            $curLocation = new Location($id);
            array_push($keyHandlers, "handleEvent('location.php?action=showLocation&locationID={$id}')");
            array_push($keyTitle, $curLocation->get_name());
            $locationType = new LocationType($curLocation->get_location_type());
            array_push($keyData, $locationType->get_name(), $curLocation->get_country(), $curLocation->get_province(), $curLocation->get_city());
            //$curLocationType = new LocationType($id);
            //array_push($keyData, $curLocationType->get_desc());
        }
    } else {
        $locationForm->warning("There are NO location types available");
    }
    $headings = array("Locations", "Location Type", "Country", "Province", "City");
    $locationForm->setCols(5);
    $locationForm->setTableWidth("1024px");
    $locationForm->setTitles($keyTitle);
    $locationForm->setData($keyData);
    $locationForm->setEventHandler($keyHandlers);
    $locationForm->setHeadings($headings);
    $locationForm->setSortable(true);
    echo $locationForm->showAll();
}
开发者ID:precurse,项目名称:netharbour,代码行数:44,代码来源:location.php

示例3: change_location

 /**
  * @throws EquipmentTypeIDMissingException
  */
 public static function change_location()
 {
     if ($_GET['id']) {
         if ($_GET['nextpage'] == 1) {
             $page_1_passed = true;
         } else {
             $page_1_passed = false;
         }
         if ($page_1_passed == false) {
             $template = new HTMLTemplate("equipment/admin/equipment_type/change_location.html");
             $paramquery = $_GET;
             $paramquery['nextpage'] = "1";
             $params = http_build_query($paramquery, '', '&');
             $template->set_var("params", $params);
             $location_array = Location::list_entries();
             $result = array();
             $counter = 1;
             $location = new Location($value);
             $result[0]['value'] = 0;
             $result[0]['content'] = "none";
             foreach ($location_array as $key => $value) {
                 $location = new Location($value);
                 $result[$counter]['value'] = $value;
                 $result[$counter]['content'] = $location->get_name(true);
                 $counter++;
             }
             $template->set_var("option", $result);
             $template->output();
         } else {
             $equipment_type = new EquipmentType($_GET['id']);
             $paramquery = $_GET;
             $paramquery['action'] = "detail";
             unset($paramquery['nextpage']);
             $params = http_build_query($paramquery, '', '&');
             if ($equipment_type->set_location_id($_POST['location'])) {
                 Common_IO::step_proceed($params, "Equipment Type", "Operation Successful", null);
             } else {
                 Common_IO::step_proceed($params, "Equipment Type", "Operation Failed", null);
             }
         }
     } else {
         throw new EquipmentTypeIDMissingException();
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:47,代码来源:admin_equipment_type.io.php

示例4: Location

 function get_location_name()
 {
     if ($this->location === NULL) {
         return "";
     }
     $location = new Location($this->location);
     return $location->get_name();
 }
开发者ID:precurse,项目名称:netharbour,代码行数:8,代码来源:Vlan_manager.php

示例5: move

 /**
  * @throws SampleIDMissingException
  * @throws SampleSecurityAccessDeniedException
  */
 public static function move()
 {
     global $user, $sample_security;
     if ($_GET['sample_id']) {
         if ($sample_security->is_access(2, false)) {
             $sample_id = $_GET['sample_id'];
             $sample = new Sample($sample_id);
             if ($_GET['nextpage'] == 1) {
                 if (is_numeric($_POST['location'])) {
                     $page_1_passed = true;
                 } else {
                     $page_1_passed = false;
                     $error = "You must select a location.";
                 }
             } elseif ($_GET['nextpage'] > 1) {
                 $page_1_passed = true;
             } else {
                 $page_1_passed = false;
                 $error = "";
             }
             if ($page_1_passed == false) {
                 $template = new HTMLTemplate("sample/move.html");
                 $paramquery = $_GET;
                 $paramquery['nextpage'] = "1";
                 $params = http_build_query($paramquery, '', '&');
                 $template->set_var("params", $params);
                 $template->set_var("error", $error);
                 $result = array();
                 $counter = 0;
                 $sample_location_array = Location::list_entries();
                 if (is_array($sample_location_array) and count($sample_location_array) >= 1) {
                     foreach ($sample_location_array as $key => $value) {
                         $sample_location_obj = new Location($value);
                         $result[$counter]['value'] = $value;
                         $result[$counter]['content'] = $sample_location_obj->get_name(true);
                         $counter++;
                     }
                 } else {
                     $result[$counter]['value'] = "0";
                     $result[$counter]['content'] = "NO LOCATIONS FOUND!";
                 }
                 $template->set_var("option", $result);
                 $template->output();
             } else {
                 $paramquery = $_GET;
                 unset($paramquery['nextpage']);
                 $paramquery['run'] = "detail";
                 $params = http_build_query($paramquery);
                 if ($sample->add_location($_POST['location'])) {
                     Common_IO::step_proceed($params, "Move Sample", "Operation Successful", null);
                 } else {
                     Common_IO::step_proceed($params, "Move Sample", "Operation Failed", null);
                 }
             }
         } else {
             throw new SampleSecurityAccessDeniedException();
         }
     } else {
         throw new SampleIDMissingException();
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:65,代码来源:sample.io.php

示例6:

 function get_location_name()
 {
     return parent::get_name();
 }
开发者ID:precurse,项目名称:netharbour,代码行数:4,代码来源:PopLocations.php

示例7: type_detail

 /**
  * @throws EquipmentTypeIDMissingException
  */
 public static function type_detail($type_id, $owner_id)
 {
     if (is_numeric($type_id)) {
         $equipment_type = new EquipmentType($type_id);
         $equipment_owner = new User($owner_id);
         $template = new HTMLTemplate("equipment/detail.html");
         $template->set_var("name", $equipment_type->get_name());
         $template->set_var("category", $equipment_type->get_cat_name());
         if ($equipment_type->get_location_id() == null) {
             $template->set_var("location", "<span class='italic'>none</span>");
         } else {
             $location = new Location($equipment_type->get_location_id());
             $template->set_var("location", $location->get_name(true));
         }
         $template->set_var("owner", $equipment_owner->get_full_name(false));
         if ($equipment_type->get_description()) {
             $template->set_var("description", $equipment_type->get_description());
         } else {
             $template->set_var("description", "<span class='italic'>none</span>");
         }
         $user_array = $equipment_type->list_users();
         $user_content_array = array();
         $counter = 0;
         if (is_array($user_array) and count($user_array) >= 1) {
             foreach ($user_array as $key => $value) {
                 $user = new User($value);
                 $user_content_array[$counter]['username'] = $user->get_username();
                 $user_content_array[$counter]['fullname'] = $user->get_full_name(false);
                 $counter++;
             }
             $template->set_var("no_user", false);
         } else {
             $template->set_var("no_user", true);
         }
         $template->set_var("user", $user_content_array);
         $ou_array = $equipment_type->list_organisation_units();
         $ou_content_array = array();
         $counter = 0;
         if (is_array($ou_array) and count($ou_array) >= 1) {
             foreach ($ou_array as $key => $value) {
                 $organisation_unit = new OrganisationUnit($value);
                 $ou_content_array[$counter]['name'] = $organisation_unit->get_name();
                 $counter++;
             }
             $template->set_var("no_ou", false);
         } else {
             $template->set_var("no_ou", true);
         }
         $template->set_var("ou", $ou_content_array);
         $template->output();
     } else {
         throw new EquipmentTypeIDMissingException();
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:57,代码来源:equipment.io.php

示例8: Location

         $result_c_count++;
     } else {
         $result_p_count++;
     }
 }
 //create the search string
 $search_str = "";
 if ($_GET['title'] != "") {
     $search_str .= " Name = " . $_GET['title'] . ", ";
 }
 if ($_GET['tags'] != "") {
     $search_str .= " Tags = " . $_GET['tags'] . ", ";
 }
 if ($_GET['location'] != "") {
     $loc = new Location($_GET['location']);
     $search_str .= " Location = " . $loc->get_name() . ", ";
 }
 if ($_GET['owner'] != "") {
     $own = new Contact($_GET['owner']);
     $search_str .= " Owner = " . $own->get_name() . ", ";
 }
 if ($_GET['assigned'] != "") {
     $assign = new Contact($_GET['assigned']);
     $search_str .= " Assigned To = " . $assign->get_name() . ", ";
 }
 if ($_GET['status'] != "") {
     $search_str .= " Status = " . $_GET['status'] . ", ";
 }
 $search_str = rtrim($search_str, ", ");
 //display what is searched and what is found
 Form::success("Searched for:" . $search_str . " | Results Found: " . $result_c_count . " child network(s), " . $result_p_count . " parent network(s)");
开发者ID:precurse,项目名称:netharbour,代码行数:31,代码来源:content.php

示例9: get_current_location_name

 /**
  * @see SampleInterface::get_current_location_name()
  * @return string
  */
 public function get_current_location_name()
 {
     if ($this->sample_id and $this->sample) {
         $location_id = $this->get_current_location();
         $location = new Location($location_id);
         if ($location_name = $location->get_name(false)) {
             return $location_name;
         } else {
             return null;
         }
     } else {
         return null;
     }
 }
开发者ID:suxinde2009,项目名称:www,代码行数:18,代码来源:sample.class.php

示例10: get_content

 /**
  * @param integer $page
  * @return string
  * @throws BaseAssistantRequestPageNotExistsException
  */
 public static function get_content($page)
 {
     global $session, $user;
     switch ($page) {
         case "1":
             $sample_organ_unit = $session->read_value("SAMPLE_ORGANISATION_UNIT");
             $template = new HTMLTemplate("sample/new_sample_page_1.html");
             $result = array();
             $counter = 0;
             $organisation_unit_array = OrganisationUnit::list_entries();
             foreach ($organisation_unit_array as $key => $value) {
                 $organisation_unit = new OrganisationUnit($value);
                 if ($organisation_unit->is_permission($user->get_user_id()) and $organisation_unit->get_stores_data() == true) {
                     $result[$counter]['value'] = $value;
                     $result[$counter]['content'] = $organisation_unit->get_name();
                     if ($sample_organ_unit == $value) {
                         $result[$counter]['selected'] = "selected";
                     } else {
                         $result[$counter]['selected'] = "";
                     }
                     $result[$counter]['disabled'] = "";
                     $counter++;
                 }
             }
             if (!$result) {
                 $result[$counter]['value'] = "0";
                 $result[$counter]['content'] = "NO ORGANISATION UNIT FOUND!";
                 $result[$counter]['selected'] = "";
                 $result[$counter]['disabled'] = "disabled='disabled'";
             }
             $template->set_var("option", $result);
             return $template->get_string();
             break;
         case "2":
             $sample_template = $session->read_value("SAMPLE_TEMPLATE");
             $type_array = $session->read_value("SAMPLE_ITEM_TYPE_ARRAY");
             $template = new HTMLTemplate("sample/new_sample_page_2.html");
             if (!is_array($type_array) or count($type_array) == 0) {
                 $type_array = null;
             }
             $result = array();
             $counter = 0;
             $sample_template_array = SampleTemplate::list_entries();
             if (is_array($sample_template_array)) {
                 foreach ($sample_template_array as $key => $value) {
                     if ($type_array == null or in_array($value, $type_array)) {
                         $sample_sub_template = new SampleTemplate($value);
                         $result[$counter]['value'] = $value;
                         $result[$counter]['content'] = $sample_sub_template->get_name();
                         if ($sample_template == $value) {
                             $result[$counter]['selected'] = "selected";
                         } else {
                             $result[$counter]['selected'] = "";
                         }
                         $result[$counter]['disabled'] = "";
                         $counter++;
                     }
                 }
             } else {
                 $result[$counter]['value'] = "0";
                 $result[$counter]['content'] = "NO TEMPLATES FOUND!";
                 $result[$counter]['selected'] = "";
                 $result[$counter]['disabled'] = "disabled='disabled'";
             }
             $template->set_var("option", $result);
             if ($session->is_value("ADD_ITEM_TEMP_KEYWORDS_" . $_GET['idk_unique_id']) == true) {
                 $template->set_var("keywords", $session->read_value("ADD_ITEM_TEMP_KEYWORDS_" . $_GET['idk_unique_id']));
             } else {
                 $template->set_var("keywords", "");
             }
             if ($session->is_value("ADD_ITEM_TEMP_DESCRIPTION_" . $_GET['idk_unique_id']) == true) {
                 $template->set_var("description", $session->read_value("ADD_ITEM_TEMP_DESCRIPTION_" . $_GET['idk_unique_id']));
             } else {
                 $template->set_var("description", "");
             }
             return $template->get_string();
             break;
         case "3":
             $sample_template = $session->read_value("SAMPLE_TEMPLATE");
             $sample_name = $session->read_value("SAMPLE_NAME");
             $sample_manufacturer = $session->read_value("SAMPLE_MANUFACTURER_ID");
             $sample_manufacturer_name = $session->read_value("SAMPLE_MANUFACTURER_NAME");
             $sample_location = $session->read_value("SAMPLE_LOCATION");
             $sample_expiry = $session->read_value("SAMPLE_EXPIRY");
             $sample_expiry_warning = $session->read_value("SAMPLE_EXPIRY_WARNING");
             $sample_description = $session->read_value("SAMPLE_DESCRIPTION");
             $sample_template_obj = new SampleTemplate($sample_template);
             $information_fields = $sample_template_obj->get_information_fields();
             $template = new HTMLTemplate("sample/new_sample_page_3.html");
             if ($information_fields['manufacturer']['name'] and $information_fields['manufacturer']['requirement'] != "optional") {
                 $template->set_var("check_manufacturer", true);
             } else {
                 $template->set_var("check_manufacturer", false);
             }
             if ($information_fields['expiry']['name'] and $information_fields['expiry']['requirement'] != "optional") {
//.........这里部分代码省略.........
开发者ID:suxinde2009,项目名称:www,代码行数:101,代码来源:sample_create.ajax.php


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