File "mevents.php"

Full Path: /home/ichhrkpd/public_html/idcm/application/models/database/mevents.php
File size: 3.1 KB
MIME-type: text/x-php
Charset: utf-8

<?php 
			
/**
 * Version 1.0.0
 * Creation date: 03/Oct/2016
 * @Written By: 
 *     IT Cell, HSTU
 */						
class Mevents extends GSModel{	
	var $ev_id;
	var $ev_date;
	var $ev_title;
	var $ev_desc;
	var $status;


		function __construct() {
			parent::__construct ();
			$this->SetValidation();	
			$this->tableName="events";
			$this->primaryKey="ev_id";
		}
			
	 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 
	}



}
?>