本文整理汇总了PHP中data类的典型用法代码示例。如果您正苦于以下问题:PHP data类的具体用法?PHP data怎么用?PHP data使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了data类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: data
function data($data)
{
if (!empty($data)) {
$dataF = new data($data);
return $dataF->dataBrasileira($dataF->tratarDataZend($data, "americano"));
}
}
示例2: company
function company()
{
if (!isset($_GET['id']) or $_GET['id'] == 1) {
$this->error('没有该企业的信息');
}
$uid = intval($_GET['id']);
//企业ID
$db = M('company_info');
$company = $db->where('uid=' . $uid)->find();
if (!$company) {
$this->error('没有该企业的信息');
}
$cond = array('uid' => $uid, 'expiration_time>' . time(), 'verify=1', 'state=1');
$recruits = $db->table('recruit')->where($cond)->field('recruit_id,start_time,recruit_name')->findall();
$data = new data('recruit');
$company = $data->convert($company);
$this->assign('company', $company);
$this->assign('recruits', $recruits);
if (empty($company['tpl_style'])) {
$company['tpl_style'] = 'skyblue';
//默认风格
}
if (!empty($_GET['style']) && $uid == $_SESSION['uid']) {
//企业预览模板
$company['tpl_style'] = $_GET['style'];
}
$this->display(PATH_ROOT . '/templates/company_tpl/' . $company['tpl_style'] . '/index');
}
示例3: __construct
/**
* Create new Scaffold instance
*
* @param Array $data
*/
public function __construct($data)
{
$this->data = new DataSystem($data);
$this->names = new NamesGenerate($data);
$this->paths = new Paths($this->names);
$this->generator = new Generator($this->data->dataScaffold('view'), $this->data->dataScaffold('migration'), $this->names, $this->paths);
}
示例4: outputHowTo
public function outputHowTo($i_howtoID)
{
$objThis_M = new data();
$s_sql = "select\r\n\t\t\t D.howtoName,\r\n\t\t\t C.chapterID, \r\n\t\t\t C.chapterName, \r\n\t\t\t C.displayOrder,\r\n\t\t\t H.headingID,\r\n\t\t\t H.displayOrder,\r\n\t\t\t H.headingName,\r\n\t\t\t T.contentID,\r\n\t\t\t T.contentTitle,\r\n\t\t\t T.displayOrder,\r\n\t\t\t T.howtoContent\r\n\t\t\tfrom cms.dyn_howto_document D\r\n\t\t\tinner join cms.dyn_howto_content T\r\n\t\t\t on D.howtoID = T.howtoID\r\n\t\t\tleft join cms.cfg_howto_headings H\r\n\t\t\t on T.headingID = H.headingID \r\n\t\t\tinner join cms.cfg_howto_chapters C\r\n\t\t\t on T.chapterID = C.chapterID \r\n\t\t\twhere D.howtoID = {$i_howtoID} \r\n\t\t\torder by\r\n\t\t\t C.displayOrder,\r\n\t\t\t H.displayOrder,\r\n\t\t\t T.displayOrder,\r\n\t\t\t T.howtoContent;";
$q_getData = $objThis_M->runSQL($s_sql);
$objThis_V = new view();
$s_main = $objThis_V->outputHowTo($q_getData);
return $s_main;
}
示例5: dataDropdown
function dataDropdown($name, $id, $currentValue, $sql)
{
include "test_lib_m.php";
$objThis_S = new data();
$q_data = $objThis_S->getData($sql = $sql);
include "test_lib_v.php";
$objThis_V = new display();
$tmpX = $objThis_V->showBox($name = $name, $id = $id, $q_query = $q_data, $currentValue = $currentValue);
return $tmpX;
}
示例6: insert
function insert()
{
if (isset($_POST)) {
foreach ($_POST as $index => $valeur) {
$donnees[$index] = $valeur;
}
}
$data = new data();
$data->insert($donnees);
}
示例7: update
function update()
{
if (array_key_exists("id", $_POST)) {
foreach ($_POST as $index => $valeur) {
$donnees[$index] = $valeur;
}
}
$data = new data();
$data->update($donnees);
}
示例8: __construct
public function __construct($name, $param = array())
{
parent::__construct($name, $param);
if (!file_exists(PATH_ROOT . '/' . DIR_CACHE . '/captcha')) {
mkdir(PATH_ROOT . '/' . DIR_CACHE . '/captcha');
chmod(PATH_ROOT . '/' . DIR_CACHE . '/captcha', 0777);
}
$opt = new data(array('font' => PATH_ROOT . '/' . DIR_LIBRARY . '/font/arial.ttf', 'imgDir' => PATH_ROOT . '/' . DIR_CACHE . '/captcha', 'imgUrl' => '/' . DIR_CACHE . '/captcha', 'wordlen' => 4, 'dotNoiseLevel' => 0, 'lineNoiseLevel' => 0, 'fsize' => 20, 'width' => 100, 'height' => 60));
if (isset($param['captcha'])) {
$opt->set($param['captcha']);
}
$this->captcha = new Zend\Captcha\Image($opt->to_array());
$this->validator['captcha'] = array('captcha' => $this->captcha);
}
示例9: form
protected function form($user = null)
{
$mode = $user ? 'edit' : 'add';
$fields = data::read(panel()->roots()->forms() . DS . 'user.' . $mode . '.php', 'yaml');
$content = $user ? $user->data() : array();
// add all languages
$fields['language']['options'] = array();
$fields['language']['default'] = kirby()->option('panel.language', 'en');
foreach (panel()->languages() as $code => $lang) {
$fields['language']['options'][$code] = $lang->title();
}
// add all roles
$fields['role']['options'] = array();
$fields['role']['default'] = site()->roles()->findDefault()->id();
foreach (site()->roles() as $role) {
$fields['role']['options'][$role->id()] = $role->name();
}
// make the role selector readonly when the user is not an admin
if (!site()->user()->isAdmin()) {
$fields['role']['readonly'] = true;
}
// make sure the password is never shown in the form
unset($content['password']);
return new Form($fields, $content);
}
示例10: info
public function info()
{
if (!is_null($this->info)) {
return $this->info;
}
return $this->info = new Obj(data::read($this->root . DS . 'package.json'));
}
示例11: statusDiligencia
/**
* Método para verificar o status da diligencia
* @access public
* @param integer $idPronac
* @return string
*/
public function statusDiligencia($idPronac = null, $idProduto = null)
{
if (isset($idPronac) && !empty($idPronac)) {
$where['idPronac = ?'] = $idPronac;
}
if (isset($idProduto) && !empty($idProduto)) {
$where['idProduto = ?'] = $idProduto;
}
$diligencias = array();
$Diligencia = new Diligencia();
$buscar = $Diligencia->buscar($where);
foreach ($buscar as $d) {
if ($d[0]->DtSolicitacao && $d[0]->DtResposta == NULL) {
$diligencias['img'] = "notice.png";
$diligencias['msg'] = "Diligenciado";
} else {
if ($d[0]->DtSolicitacao && $d[0]->DtResposta != NULL) {
$diligencias['img'] = "notice3.png";
$diligencias['msg'] = "Diligencia respondida";
} else {
if ($d[0]->DtSolicitacao && round(data::CompararDatas($d[0]->DtDistribuicao)) > $d[0]->tempoFimDiligencia) {
$diligencias['img'] = "notice2.png";
$diligencias['msg'] = "Diligencia não respondida";
} else {
$diligencias['img'] = "notice1.png";
$diligencias['msg'] = "A Diligenciar";
}
}
}
}
return 'Não terminei';
}
示例12: makeHtml
public function makeHtml($id, $path)
{
self::filter($path);
$array = data::getData($path);
$html = '';
$total = '';
foreach ($array as $k => $v) {
if ($k) {
$t = $id ? $id . '_' . $k : $k;
$name = $v[0] !== '-' ? '<a href="javascript:;" id="a_' . $t . '" path="' . $path . '">' . $v[1] . '</a>' : $v[1];
if ($id) {
$blank = "";
$b_count = count(explode("_", $id));
for ($i = 1; $i < $b_count; $i++) {
$blank .= " ";
}
$name = $blank . $name;
}
$name = $id ? " " . $name : $name;
$html .= "<div id='d_" . $t . "'>\n\t<span class='content' style='width:30px;text-align: center'><input type='checkbox' id='c_" . $t . "'/></span>\n\t<span class='content' style='width:680px;padding-left: 20px'>" . $name . "</span>\n\t<span class='content' style='width:150px'>" . $v[2] . "</span>\n\t<span class='content' style='width:80px;text-align: right'>" . $v[3] . "</span>\n</div>";
} else {
$total_t = $id ? $id . "_total" : "total";
$total = "<div id='d_" . $total_t . "'>\n\t<span class='content' style='width:30px;text-align: center'></span>\n\t<span class='content' style='width:680px;padding-left: 20px'></span>\n\t<span class='content' style='width:150px'></span>\n\t<span class='content' style='width:80px;text-align: right'>总计:" . $v . "</span>\n</div>";
}
}
return $html . $total;
}
示例13: tearDown
public function tearDown()
{
$this->noPhpWebserver();
$this->noSelenium();
$this->module->_after($this->makeTest());
data::clean();
}
示例14: init
function init()
{
$data = new data();
$donnees = $data->getIndexData();
foreach ($donnees->fetchAll(PDO::FETCH_ASSOC) as $key => $value) {
foreach ($value as $key2 => $value2) {
if ($key2 == "reponse") {
$value[$key2] = $data->getStatus($value2);
}
}
$list[$key] = $value;
}
$smarty = new Smarty();
$smarty->assign(array('list' => $list, 'tpl_name' => "index"));
$smarty->display('base.tpl');
}
示例15: load
public function load($name)
{
// make sure there's no path included in the name
$name = basename(strtolower($name));
if (isset(static::$cache[$name])) {
$this->file = static::$cache[$name]['file'];
$this->name = static::$cache[$name]['name'];
$this->yaml = static::$cache[$name]['yaml'];
return true;
}
// find the matching blueprint file
$file = kirby()->get('blueprint', $name);
if ($file) {
$this->file = $file;
$this->name = $name;
$this->yaml = data::read($this->file, 'yaml');
// remove the broken first line
unset($this->yaml[0]);
static::$cache[$name] = array('file' => $this->file, 'name' => $this->name, 'yaml' => $this->yaml);
return true;
} else {
if ($name == 'default') {
throw new Exception(l('blueprints.error.default.missing'));
} else {
return $this->load('default');
}
}
}