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


PHP Device::getAll方法代码示例

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


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

示例1: die

    Device::save($device);
    die('1');
}
// Update
if (isset($_POST['update'])) {
    $device = new Device();
    $device->set_id((int) $_POST['id']);
    $device->set_uid((string) $_POST['uid']);
    $device->set_name((string) $_POST['name']);
    // Get default cost for device
    if ($_POST['default']) {
        foreach (System::getValue() as $r) {
            if ($r->get_var() == 'default_cost') {
                $device->set_cost($r->get_val());
            }
        }
    } else {
        $device->set_cost((double) $_POST['cost']);
    }
    $device->set_range((int) $_POST['range']);
    Device::save($device);
    die('1');
}
// Delete
if (isset($_POST['delete'])) {
    Device::delete((int) $_POST['id']);
    die('1');
}
$devices = Device::getAll();
$smarty->assign('devices', $devices);
$smarty->display('device.tpl');
开发者ID:nguyentien,项目名称:ps3,代码行数:31,代码来源:device.php

示例2:

include_once 'class/payment_menu.class.php';
$device_id = (int) $_GET['id'];
$start = 0;
$stop = 0;
// Get device by id for get cost only
$device = Device::getById($device_id);
// Get payment of device
$payment = Payment::getByDevice($device_id);
if ($payment) {
    if ($payment->get_start()) {
        $start = 1;
    }
    if ($payment->get_stop()) {
        $stop = 1;
    }
    // Assign list menu in payment
    $smarty->assign('list_payment_menu', Payment_Menu::getByPayment($payment->get_id()));
    // Assign payment
    $smarty->assign('payment', $payment);
}
// List menu
$list_menu = Menu::getAll();
// List device for switch device
$list_device = Device::getAll();
$smarty->assign('start', $start);
$smarty->assign('stop', $stop);
$smarty->assign('device', $device);
$smarty->assign('list_device', $list_device);
$smarty->assign('list_menu', $list_menu);
$smarty->assign('menu', 1);
$smarty->display('detail.tpl');
开发者ID:nguyentien,项目名称:ps3,代码行数:31,代码来源:detail.php

示例3: Device

if ($foo == 'delete') {
    $id = $_GPC['id'];
    $c = new Device();
    $c->remove($id);
    message('成功删除设备信息', $this->createWebUrl('devices', array('id' => $id)));
}
if ($foo == 'list') {
    $c = new Device();
    $filters = array();
    $filters['title'] = $_GPC['title'];
    $filters['uuid'] = $_GPC['uuid'];
    $filters['major'] = $_GPC['major'];
    $filters['minor'] = $_GPC['minor'];
    $filters['audit_status'] = $_GPC['audit_status'];
    $filters['audit_comment'] = $_GPC['audit_comment'];
    $filters['status'] = $_GPC['status'];
    $pindex = intval($_GPC['page']);
    $pindex = max($pindex, 1);
    $psize = 5;
    $total = 0;
    $ds = $c->getAll($filters, $pindex, $psize, $total);
    if (!empty($ds)) {
        $a = new Activity();
        foreach ($ds as &$row) {
            $row['activity'] = $a->getOne($row['activity']);
        }
        unset($row);
    }
    $pager = pagination($total, $pindex, $psize);
    include $this->template('device-list');
}
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:31,代码来源:devices.inc.php

示例4: count

<?php

include_once 'include/connect.php';
include_once 'class/range.class.php';
include_once 'class/device.class.php';
$results = Range::getAll();
$width = 0;
// Assign value for range
if ($results) {
    $width = (960 - count($results) * 20) / count($results);
}
$smarty->assign('ranges', $results);
$smarty->assign('devices', Device::getAll());
$smarty->assign('width', $width);
$smarty->assign('menu', 1);
$smarty->display('dashboard.tpl');
开发者ID:nguyentien,项目名称:ps3,代码行数:16,代码来源:dashboard.php

示例5: foreach

             }
         }
     }
     if ($_GPC['type'] == 'unbind') {
         foreach ($devices as $did) {
             $device = $d->getOne($did);
             if (!empty($device)) {
                 $ret = $api->setDevicePages($device['device_id'], array(intval($activity['page'])), false);
                 $d->touchActivity($did, 0);
             }
         }
     }
 }
 $filters = array();
 $filters['activity'] = $id;
 $binds = $d->getAll($filters);
 $filters = array();
 $filters['status'] = 'active';
 $filters['notactivity'] = $id;
 $unbinds = $d->getAll($filters);
 if (!empty($unbinds)) {
     foreach ($unbinds as &$row) {
         $row['activity'] = $a->getOne($row['activity']);
     }
     unset($row);
 }
 $url = $this->createMobileUrl('activity', array('actid' => $activity['actid']));
 $activity['surl'] = $url;
 $url = substr($url, 2);
 $url = $_W['siteroot'] . 'app/' . $url;
 $activity['url'] = $url;
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:31,代码来源:activity.inc.php


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