File "mres_and_forms.php"
Full Path: /home/ichhrkpd/public_html/application/examples/mres_and_forms.php
File size: 3.37 KB
MIME-type: text/x-php
Charset: utf-8
<?php
/**
* Version 1.0.0
* Creation date: 03/Oct/2016
* @Written By:
* IT Cell, HSTU
*
* `rid` int(5) NOT NULL AUTO_INCREMENT,
`rtitle` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`rdate` varchar(50) NOT NULL,
`rtype` char(1) NOT NULL DEFAULT 'R',
`status` char(1) NOT NULL DEFAULT 'A',
PRIMARY KEY (`rid`)
*/
class Mres_and_forms extends GSModel{
var $rid;
var $rtitle;
var $rdate;
var $rtype;
var $status;
function __construct() {
parent::__construct ();
$this->SetValidation();
$this->tableName="res_and_forms";
$this->primaryKey="rid";
}
function Reset(){
$this->id=$this->title=$this->description=$this->creation_date=$this->download_links=null;
$this->status=null;
}
function SetValidation(){
$this->validations=array(
"id"=>array("Text"=>"id", "Rule"=>"required|xss_clean"),
//"title"=>array("Text"=>"title", "Rule"=>""),
//"description"=>array("Text"=>"description", "Rule"=>""),
//"creation_date"=>array("Text"=>"creation_date", "Rule"=>""),
//"download_links"=>array("Text"=>"download_links", "Rule"=>""),
"status"=>array("Text"=>"status", "Rule"=>"")
);
}
function GetAddForm($isEdit,$label_col=5,$input_col=7,$mainobj=null){
if(!$mainobj){
$mainobj=$this;
}
?>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="title"><?php _e("Title"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="" value="<?php echo $mainobj->GetPostValue("title");?>" class="form-control" id="title" name="title" placeholder="Title" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="description"><?php _e("Description"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="" value="<?php echo $mainobj->GetPostValue("description");?>" class="form-control" id="description" name="description" placeholder="Description" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="download_links"><?php _e("Download Links"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="" value="<?php echo $mainobj->GetPostValue("download_links");?>" class="form-control" id="download_links" name="download_links" placeholder="Download Links" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="status"><?php _e("Status"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<select name="status" id="status" class="form-control">
<option <?php echo $mainobj->status=="A"?' selected="selected" ':"";?> value="A"><?php echo "Active";?></option>
<option <?php echo $mainobj->status=="I"?' selected="selected" ':"";?> value="I"><?php echo "Inactive";?></option>
</select>
</div>
</div>
<?php
}
}
?>