本文整理汇总了PHP中Mobile::isTablet方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile::isTablet方法的具体用法?PHP Mobile::isTablet怎么用?PHP Mobile::isTablet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile::isTablet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_order
/**
* @param $customer_id
* @param $total
* @return mixed
*/
public function add_order($customer_id, $delivery_id, $total)
{
$detect = new Mobile();
$device_type = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer';
$np_city_ref = Arr::get($_POST, 'np_city_ref');
$np_address_ref = Arr::get($_POST, 'np_address_ref');
$city = Arr::get($_POST, 'city');
$address = Arr::get($_POST, 'address');
if ($delivery_id = 1) {
$obj_city = ORM::factory('Novaposhta_City', ['Ref' => $np_city_ref]);
if ($obj_city->loaded()) {
$city = $obj_city->DescriptionRu;
}
$obj_warehouse = ORM::factory('Novaposhta_Warehouse', ['Ref' => $np_address_ref]);
if ($obj_warehouse->loaded()) {
$address = $obj_warehouse->DescriptionRu;
}
}
$obj_order = ORM::factory('Shop_Order');
$obj_order->customer_id = $customer_id;
$obj_order->delivery_id = $delivery_id;
$obj_order->total = $total;
$obj_order->checked = 0;
$obj_order->device_type = $device_type;
$obj_order->oblast = Arr::get($_POST, 'oblast');
$obj_order->region = Arr::get($_POST, 'region');
$obj_order->city = $city;
$obj_order->address = $address;
$obj_order->np_city_ref = $np_city_ref;
$obj_order->np_address_ref = $np_address_ref;
$obj_order->postcode = Arr::get($_POST, 'postcode');
$obj_order->save();
$obj_order->number = $obj_order->id . Text::random('nozero', 4);
$obj_order->save();
return $obj_order->id;
}