public function __construct($id = null)
 {
     parent::__construct();
     $this->_CI->load->model('Do_module');
     if (isset($id)) {
     }
     $this->_setById($id);
 }
Exemplo n.º 2
0
 public static function setData($data)
 {
     if ($data && is_array($data)) {
         self::$_data = $data;
         return true;
     }
     return false;
 }
 public function __construct()
 {
     parent::__construct();
     $this->_CI =& get_instance();
     $this->_CI->load->model('Do_hotel');
     $this->_portfolio = new Portfolio();
     $this->finances = new RevenueColl();
     $this->_revFilters = new FilterCollection();
     $this->_tags = new TagCollection();
     $this->_isRemoved = '0';
 }
 public function __construct($id = null)
 {
     parent::__construct();
     $this->_CI->load->model('Do_usergroup');
     if (isset($id)) {
         $result = $this->_CI->Do_usergroup->getById($id);
         if ($result) {
             $this->setByData($result);
         } else {
             $this->errors['init'] = "Error encountered initializing with id: " . $id;
         }
     }
 }
 public function __construct($usrgrpId = 0, $moduleId = 0, Accessright $accessrights = null)
 {
     parent::__construct();
     $this->_CI->load->model('Do_userright');
     //var_dump($usrgrpId);var_dump($moduleId);var_dump($accessrights);die();
     if (!empty($usrgrpId) && !empty($moduleId) && !isset($accessrights)) {
         $this->_setByUsergrpModule($usrgrpId, $moduleId);
     } else {
         $this->_usergroup = $usrgrpId;
         $this->_module = $moduleId;
         if (isset($accessrights)) {
             $this->_accessright = $accessrights;
         } else {
             $this->_accessright = new Accessright();
         }
     }
 }
Exemplo n.º 6
0
 public function getFriend($id)
 {
     $db = new DB();
     $db->table("user")->pk("id");
     $rs = $db->find($id);
     var_dump($rs);
     parent::setData($rs);
     // $this->username = '******';
     $this->age = 20;
     var_dump($this->getData());
     $db->save($this->getData());
     // $db->save();
 }
Exemplo n.º 7
0
require "header.php";
?>

<?php 
$id = test_input($_GET['av']);
if (strlen($id) == 0 || !is_numeric($id)) {
    header("location:index.php");
} else {
    $im = infoMgr::getInstance();
    $tm = new detailMgr($im);
    $gb = new getBase();
    $url = new urlMgr();
    $urlAvailable = $url->getContextUrl($id);
    $jsonData = $tm->getJSON($gb, $urlAvailable);
    $jsonArray = $tm->getContext(new decodeJSON($jsonData));
    $dataParser = new DataObj($jsonArray, DataObj::BODY);
    $stories = $dataParser->getSingleNew();
    if (!$stories) {
        header("location:index.php");
    } else {
        //print_r($stories);
        //echo $dataParser->getImages();
        $allContents = $dataParser->getBody();
        $newsTitle = $dataParser->getTitle();
        $keyTitle = array("整", "点", "儿", "新", "闻");
        $flag = 0;
        foreach ($keyTitle as $key => $value) {
            if (stripos($newsTitle, $value)) {
                $flag++;
            }
        }
Exemplo n.º 8
0
require "header.php";
?>

		<div class="body-content">

		<?php 
//ini
$im = infoMgr::getInstance();
$tm = new detailMgr($im);
$gb = new getBase();
//print today
$jsonData = $tm->getJSON($gb);
$jsonArray = $tm->getContext(new decodeJSON($jsonData));
//print_r($jsonArray);
$dataParser = new DataObj($jsonArray, DataObj::_LIST);
//echo $dataParser->getDate();
$stories = $dataParser->getStories();
foreach ($stories as $key => $value) {
    $singleNew = $dataParser->getSingleNew($key);
    echo '			<div class="content-main-box">
				<div class="main-box-img">
					<img src="' . $dataParser->getImages() . '" alt="' . $dataParser->getID() . '" />
				</div>
				<div class="main-box-content">
					<div class="main-title">
						<a href="read.php?av=' . $dataParser->getID() . '">' . $dataParser->getTitle() . '</a>
					</div>
					<div class="main-time">' . $dataParser->getDate() . '</div>
				</div>
				<div class="main-box-footer">