本文整理汇总了PHP中data类的典型用法代码示例。如果您正苦于以下问题:PHP data类的具体用法?PHP data怎么用?PHP data使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了data类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: data
function data($data)
{
if (!empty($data)) {
$dataF = new data($data);
return $dataF->dataBrasileira($dataF->tratarDataZend($data, "americano"));
}
}
开发者ID:hackultura,项目名称:novosalic,代码行数:7,代码来源:GerarimprimirpdfController.php
示例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');
}
开发者ID:com-itzcy,项目名称:hdjob,代码行数:28,代码来源:indexControl.php
示例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);
}
开发者ID:shoully,项目名称:scaffold-interface,代码行数:12,代码来源:Scaffold.php
示例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;
}
开发者ID:braddoro,项目名称:braddoro,代码行数:9,代码来源:howto_c.php
示例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;
}
开发者ID:braddoro,项目名称:braddoro,代码行数:10,代码来源:connect_lib_c.php
示例6: insert
function insert()
{
if (isset($_POST)) {
foreach ($_POST as $index => $valeur) {
$donnees[$index] = $valeur;
}
}
$data = new data();
$data->insert($donnees);
}
开发者ID:neewom,项目名称:recherche,代码行数:10,代码来源:insert.php
示例7: update
function update()
{
if (array_key_exists("id", $_POST)) {
foreach ($_POST as $index => $valeur) {
$donnees[$index] = $valeur;
}
}
$data = new data();
$data->update($donnees);
}
开发者ID:neewom,项目名称:recherche,代码行数:10,代码来源:modif.php
示例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);
}
开发者ID:s-kalaus,项目名称:ekernel,代码行数:14,代码来源:captcha.php
示例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);
}
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:25,代码来源:users.php
示例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'));
}
开发者ID:irenehilber,项目名称:kirby-base,代码行数:7,代码来源:translation.php
示例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';
}
开发者ID:hackultura,项目名称:novosalic,代码行数:38,代码来源:StatusDiligencia.php
示例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;
}
开发者ID:envylv,项目名称:home,代码行数:27,代码来源:fac.php
示例13: tearDown
public function tearDown()
{
$this->noPhpWebserver();
$this->noSelenium();
$this->module->_after($this->makeTest());
data::clean();
}
开发者ID:lenninsanchez,项目名称:donadores,代码行数:7,代码来源:SeleniumTest.php
示例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');
}
开发者ID:neewom,项目名称:recherche,代码行数:16,代码来源:index.php
示例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');
}
}
}
开发者ID:nsteiner,项目名称:kdoc,代码行数:28,代码来源:blueprint.php
示例16: update
public function update($id, array $values_array)
{
if (isset($values_array['password'])) {
$values_array['password'] = md5(data::escapeString($values_array['clave']));
}
return parent::update($id, $values_array);
}
开发者ID:reneolivo,项目名称:PHP-Toolkit,代码行数:7,代码来源:user.php
示例17: delete
public function delete()
{
if (file_exists(self::$example_file)) {
unlink(self::$example_file);
}
return data::success(array('file' => false));
}
开发者ID:soldair,项目名称:solumLite,代码行数:7,代码来源:example.class.php
示例18: write
public static function write($file, $data, $type = null)
{
// type autodetection
if (is_null($type)) {
$type = f::extension($file);
}
return f::write($file, data::encode($data, $type));
}
开发者ID:robinandersen,项目名称:robin,代码行数:8,代码来源:data.php
示例19: send
public function send()
{
if ($this->entry !== API_PASSWORD) {
$status = array('status' => 400, 'result' => 'Missing the required field to use the service');
print_r(json_encode($status));
exit;
}
// Mailer only accepts POST requests
if (strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') {
define('ACCESS', true);
//access to other classes
$form_data = filter_input_array(INPUT_POST, FILTER_UNSAFE_RAW);
//check if incoming params are correct
require_once '../helpers/Data.php';
$email_data_fields = new data($form_data);
$required_params = $email_data_fields->cleaner();
if (isset($required_params->error['error'])) {
$status = array('status' => 400, 'result' => 'Missing required fields (from, from_email, to, to_email, subject, text)');
print_r(json_encode($status));
} else {
//try mailgun
try {
$result = $this->call_mailgun($email_data_fields);
} catch (Exception $ex) {
}
//failed, try mandrill
if (isset($result['error']) || $ex) {
$man_result = $this->call_mandrill($email_data_fields);
//failed, both methods failed
if (isset($man_result['error'])) {
$status = array('status' => 400, 'result' => array("mailgun and mandrill failed" => array('mailgun' => $result, 'mandrill' => $man_result)));
print_r(json_encode($status));
} else {
//worked
print_r(json_encode($man_result));
}
} else {
print_r(json_encode($result));
}
}
} else {
$status = array('status' => 405, 'result' => "Wrong HTTP method(" . $_SERVER['REQUEST_METHOD'] . ")");
print_r(json_encode($status));
exit;
}
}
开发者ID:nylonthanh,项目名称:email_service,代码行数:46,代码来源:mailer.php
示例20: testAjax
public function testAjax()
{
$this->module->sendAjaxGetRequest('/info');
$this->assertNotNull(data::get('ajax'));
$this->module->sendAjaxPostRequest('/form/complex', array('show' => 'author'));
$this->assertNotNull(data::get('ajax'));
$post = data::get('form');
$this->assertEquals('author', $post['show']);
}
开发者ID:BatVane,项目名称:Codeception,代码行数:9,代码来源:PhpBrowserTest.php
注:本文中的data类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论