Пример #1
0
		function journal($id, $isLive = false) {
			global $db, $auth, $insertstatements;

			if ($isLive) {
				$id = translateState($id, 10, false);
			}

			$this->id = $id;
			$this->userId = $auth->userId;

			$jnlCreated = getDBCell("journal", "CREATED", "ITEM_ID = $this->id");

			if ($jnlCreated == 0) {
				$nextSlot = count($insertstatements);

				$journalInsert = new InsertSet("journal");

				$journalInsert->setPK("JOURNAL_ID");

				$journalInsert->add("ITEM_ID", $this->id, "NUMBER");
				$journalInsert->add("CREATED", time(), "NUMBER");

				$insertstatements[$nextSlot] = $journalInsert;

				$this->itemStatus["created"]["time"] = 0;
				//$this->itemStatus["created"]["by"] = $rstJournal->getValue("CREATED_BY");
				$this->itemStatus["launched"]["time"] = 0;
				//$this->itemStatus["launched"]["by"] = $rstJournal->getValue("LAUNCHED_BY");
				$this->itemStatus["expired"]["time"] = 0;
				//$this->itemStatus["expired"]["by"] = $rstJournal->getValue("EXPIRED_BY");
				$this->itemStatus["changed"]["time"] = 0;
				//$this->itemStatus["changed"]["by"] = $rstJournal->getValue("CHANGED_BY");
				$this->itemStatus["deleted"]["time"] = 0;
				//$this->itemStatus["deleted"]["by"] = $rstJournal->getValue("DELETED_BY");
				$this->itemStatus["staged"]["time"] = 0;
				//$this->itemStatus["staged"]["by"] = $rstJournal->getValue("STAGED_BY");
				$this->itemStatus["locked"]["time"] = 0;
				$this->itemStatus["locked"]["by"] = 0;
			} else {
				$rstJournal = new Recordset("journal", "*", "ITEM_ID = $this->id");

				$this->itemStatus["created"]["time"] = $rstJournal->getValue("CREATED");
				//$this->itemStatus["created"]["by"] = $rstJournal->getValue("CREATED_BY");
				$this->itemStatus["launched"]["time"] = $rstJournal->getValue("LAUNCHED");
				//$this->itemStatus["launched"]["by"] = $rstJournal->getValue("LAUNCHED_BY");
				$this->itemStatus["expired"]["time"] = $rstJournal->getValue("EXPIRED");
				//$this->itemStatus["expired"]["by"] = $rstJournal->getValue("EXPIRED_BY");
				$this->itemStatus["changed"]["time"] = $rstJournal->getValue("CHANGED");
				//$this->itemStatus["changed"]["by"] = $rstJournal->getValue("CHANGED_BY");
				$this->itemStatus["deleted"]["time"] = $rstJournal->getValue("DELETED");
				//$this->itemStatus["deleted"]["by"] = $rstJournal->getValue("DELETED_BY");
				$this->itemStatus["staged"]["time"] = $rstJournal->getValue("STAGED");
				//$this->itemStatus["staged"]["by"] = $rstJournal->getValue("STAGED_BY");
				$this->itemStatus["locked"]["time"] = $rstJournal->getValue("LOCKED");
				$this->itemStatus["locked"]["by"] = $rstJournal->getValue("LOCKED_BY");
			}
		}
Пример #2
0
 /**
  * the constructor takes the model and values passes in, assigns values to internal
  * vars, sets up the offset and limit on the model and use this->paginate
  * calls parent __construct
  * @param string $WaxModel 
  * @param string $page 
  * @param string $per_page 
  */
 public function __construct($model, $page, $per_page)
 {
     $this->per_page = $per_page;
     $this->current_page = $page;
     //setup model
     $this->model = $model;
     $this->model->_offset = ($page - 1) * $per_page;
     $this->model->_limit = $per_page;
     //paginate the model
     $rowset = $model->rows();
     $this->set_count($model->total_without_limits);
     parent::__construct($model, $rowset);
 }
 function kmImage($data = '')
 {
     if (is_array($data)) {
         parent::RecordSet($data);
     }
 }
Пример #4
0
 public function query($sql)
 {
     $result = mysql_query($sql);
     if (!$result) {
         if ($this->err_log_file) {
             $this->txt_log($this->err_log_file, $sql);
         }
         die('SQL query error');
     }
     $rs = new Recordset();
     $rs->result = $result;
     $rs->record_count = mysql_num_rows($result);
     $rs->move_next();
     return $rs;
 }