Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added view saved but not submitted responses by GCI participant Aaron…
… Schmitz git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@11568 b72ed6b6-b9f8-46b5-92b4-906544132732
- Loading branch information
Aaron Schmitz
committed
Dec 2, 2011
1 parent
246ba72
commit 44315b0
Showing
5 changed files
with
134 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php if ( ! defined('BASEPATH')) die('No direct script access allowed'); | ||
|
||
class Saved_control extends CActiveRecord { | ||
/** | ||
* Returns the table's name | ||
* | ||
* @access public | ||
* @return string | ||
*/ | ||
public function tableName() | ||
{ | ||
return '{{saved_control}}'; | ||
} | ||
|
||
/** | ||
* Returns the table's primary key | ||
* | ||
* @access public | ||
* @return string | ||
*/ | ||
public function primaryKey() | ||
{ | ||
return 'sid'; | ||
} | ||
|
||
/** | ||
* Return the static model for this table | ||
* | ||
* @static | ||
* @access public | ||
* @return CActiveRecord | ||
*/ | ||
public static function model() | ||
{ | ||
return parent::model(__CLASS__); | ||
} | ||
|
||
function getAllRecords($condition=FALSE) | ||
{ | ||
if ($condition != FALSE) | ||
{ | ||
$this->db->where($condition); | ||
} | ||
|
||
$data = $this->db->get('saved_control'); | ||
|
||
return $data; | ||
} | ||
|
||
function getSomeRecords($fields,$condition=FALSE) | ||
{ | ||
foreach ($fields as $field) | ||
{ | ||
$this->db->select($field); | ||
} | ||
if ($condition != FALSE) | ||
{ | ||
$this->db->where($condition); | ||
} | ||
|
||
$data = $this->db->get('saved_control'); | ||
|
||
return $data; | ||
} | ||
|
||
public function getCountOfAll($sid) | ||
{ | ||
$data = Yii::app()->db->createCommand("SELECT COUNT(*) AS countall FROM {{saved_control}} WHERE sid=$sid")->query(); | ||
$row = $data->read(); | ||
|
||
return $row['countall']; | ||
} | ||
|
||
function insertRecords($data) | ||
{ | ||
return $this->db->insert('saved_control', $data); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters