本文整理汇总了PHP中Facilities::getSupplier方法的典型用法代码示例。如果您正苦于以下问题:PHP Facilities::getSupplier方法的具体用法?PHP Facilities::getSupplier怎么用?PHP Facilities::getSupplier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facilities
的用法示例。
在下文中一共展示了Facilities::getSupplier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_supplier
public function get_supplier($facility_code = NULL)
{
//Get Supplier Based on Facility
$facility = Facilities::getSupplier($facility_code);
return strtolower($facility->supplier->name);
}
示例2: view_order
public function view_order($type = "cdrr", $id)
{
if ($type == "cdrr") {
$cdrr_array = array();
$sql = "SELECT c.*,ci.*,f.*,co.county as county_name,d.name as district_name,IF(c.code='D-CDRR',CONCAT('D-CDRR#',c.id),CONCAT('F-CDRR#',c.id)) as cdrr_label,c.status as status_name,sf.name as facility_name,ci.id as item_id,sf.code as facility_code\n\t\t\t\tFROM cdrr c\n\t\t\t\tLEFT JOIN cdrr_item ci ON ci.cdrr_id=c.id\n\t\t\t\tLEFT JOIN sync_facility sf ON sf.id=c.facility_id\n\t\t\t\tLEFT JOIN facilities f ON f.facilitycode=sf.code\n\t\t\t\tLEFT JOIN counties co ON co.id=f.county\n\t\t\t\tLEFT JOIN district d ON d.id=f.district\n\t\t\t\tWHERE c.id='{$id}'";
$query = $this->db->query($sql);
$cdrr_array = $query->result_array();
$data['cdrr_array'] = $cdrr_array;
$data['options'] = "view";
//echo "<pre>"; print_r($cdrr_array); die;
if ($cdrr_array[0]['code'] == "D-CDRR") {
$code = 0;
} else {
if ($cdrr_array[0]['code'] == "F-CDRR_units") {
$facility_code = $this->session->userdata("facility");
if ($cdrr_array[0]['facility_code'] == $facility_code) {
$code = 1;
} else {
$code = 2;
}
} else {
if ($cdrr_array[0]['code'] == "F-CDRR_packs") {
$code = 3;
}
}
}
$this->create_order($type, $code, $data);
} else {
if ($type == "maps") {
//
$facility_code = $this->session->userdata('facility');
$facility = Facilities::getSupplier($facility_code);
$supplier = $facility->supplier->name;
$facility_table = 'sync_facility';
$fmaps_array = array();
$sql = "SELECT m.*,mi.*,ml.*,f.*,co.county as county_name,d.name as district_name,IF(m.code='D-MAPS',CONCAT('D-MAPS#',m.id),CONCAT('F-MAPS#',m.id)) as maps_id,m.status as status_name,sf.name as facility_name,m.id as map_id,sf.code as facility_code\n\t\t\t \tFROM maps m\n\t\t\t \tLEFT JOIN maps_item mi ON mi.maps_id=m.id\n\t\t\t \tLEFT JOIN maps_log ml ON ml.maps_id=m.id\n\t\t\t \tLEFT JOIN {$facility_table} sf ON sf.id=m.facility_id\n\t\t\t\tLEFT JOIN facilities f ON f.facilitycode=sf.code\n\t\t\t \tLEFT JOIN counties co ON co.id=f.county\n\t\t\t\tLEFT JOIN district d ON d.id=f.district\n\t\t\t\tWHERE m.id='{$id}'";
$query = $this->db->query($sql);
$fmaps_array = $query->result_array();
$data['fmaps_array'] = $fmaps_array;
$data['options'] = "view";
if ($fmaps_array[0]['code'] == "D-MAPS") {
$code = 0;
} else {
if ($fmaps_array[0]['code'] == "F-MAPS") {
$facility_code = $this->session->userdata("facility");
$facility_type = Facilities::getType($facility_code);
if ($facility_type == 1) {
$code = 3;
} else {
if ($facility_type == 0) {
$code = 2;
} else {
$code = 1;
}
}
}
}
$this->create_order($type, $code, $data);
}
}
}