File "mvolunteers.php"
Full Path: /home/ichhrkpd/public_html/application/models/database/mvolunteers.php
File size: 14.78 KB
MIME-type: text/x-php
Charset: utf-8
<?php
/**
* Version 1.0.0
* Creation date: 04/Jan/2018
* @Written By: S.M. Sarwar Hasan
* Genuity Systems
*/
class Mvolunteers extends GSModel{
var $volunteer_id;
var $first_name;
var $last_name;
var $address;
var $city;
var $state;
var $zip;
var $home_phone;
var $work_phone;
var $cell_phone;
var $email;
var $employer_name;
var $race_type_if_participate;
var $is_prev_volunteer;
var $from_time;
var $to_time;
var $age_range;
var $emergency_name;
var $emergency_phone;
var $reference;
var $comments;
var $assign_role;
var $ip;
var $creation_date;
function __construct() {
parent::__construct ();
$this->SetValidation();
$this->tableName="volunteers";
$this->primaryKey="volunteer_id";
}
function Reset(){
$this->volunteer_id=$this->first_name=$this->last_name=$this->address=$this->city=null;
$this->state=$this->zip=$this->home_phone=$this->work_phone=$this->cell_phone=null;
$this->email=$this->employer_name=$this->race_type_if_participate=$this->is_prev_volunteer=$this->from_time=null;
$this->to_time=$this->age_range=$this->emergency_name=$this->emergency_phone=$this->reference=null;
$this->comments=$this->assign_role=$this->ip=$this->creation_date=null;
}
function SetValidation(){
$this->validations=array(
"volunteer_id"=>array("Text"=>"volunteer_id", "Rule"=>"required|xss_clean"),
"first_name"=>array("Text"=>"first_name", "Rule"=>"required|xss_clean"),
"last_name"=>array("Text"=>"last_name", "Rule"=>"required|xss_clean"),
//"address"=>array("Text"=>"address", "Rule"=>""),
"city"=>array("Text"=>"city", "Rule"=>"required|xss_clean"),
//"state"=>array("Text"=>"state", "Rule"=>""),
"zip"=>array("Text"=>"zip", "Rule"=>"required|xss_clean"),
//"home_phone"=>array("Text"=>"home_phone", "Rule"=>""),
//"work_phone"=>array("Text"=>"work_phone", "Rule"=>""),
//"cell_phone"=>array("Text"=>"cell_phone", "Rule"=>""),
"email"=>array("Text"=>"email", "Rule"=>"required|xss_clean"),
//"employer_name"=>array("Text"=>"employer_name", "Rule"=>""),
//"race_type_if_participate"=>array("Text"=>"race_type_if_participate", "Rule"=>""),
//"is_prev_volunteer"=>array("Text"=>"is_prev_volunteer", "Rule"=>""),
//"from_time"=>array("Text"=>"from_time", "Rule"=>""),
//"to_time"=>array("Text"=>"to_time", "Rule"=>""),
//"age_range"=>array("Text"=>"age_range", "Rule"=>""),
//"emergency_name"=>array("Text"=>"emergency_name", "Rule"=>""),
//"emergency_phone"=>array("Text"=>"emergency_phone", "Rule"=>""),
//"reference"=>array("Text"=>"reference", "Rule"=>""),
//"comments"=>array("Text"=>"comments", "Rule"=>""),
//"assign_role"=>array("Text"=>"assign_role", "Rule"=>""),
//"ip"=>array("Text"=>"ip", "Rule"=>""),
"creation_date"=>array("Text"=>"creation_date", "Rule"=>"")
);
}
function GetAddForm($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="volunteer_id"><?php _e("Volunteer Id"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="11" value="<?php echo $mainobj->GetPostValue("volunteer_id");?>" class="form-control" id="volunteer_id" name="volunteer_id" placeholder="Volunteer Id" data-bv-notempty="true" data-bv-notempty-message="<?php _e("Volunteer Id is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="first_name"><?php _e("First Name"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="100" value="<?php echo $mainobj->GetPostValue("first_name");?>" class="form-control" id="first_name" name="first_name" placeholder="First Name" data-bv-notempty="true" data-bv-notempty-message="<?php _e("First Name is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="last_name"><?php _e("Last Name"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="100" value="<?php echo $mainobj->GetPostValue("last_name");?>" class="form-control" id="last_name" name="last_name" placeholder="Last Name" data-bv-notempty="true" data-bv-notempty-message="<?php _e("Last Name is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="address"><?php _e("Address"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="100" value="<?php echo $mainobj->GetPostValue("address");?>" class="form-control" id="address" name="address" placeholder="Address" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="city"><?php _e("City"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="50" value="<?php echo $mainobj->GetPostValue("city");?>" class="form-control" id="city" name="city" placeholder="City" data-bv-notempty="true" data-bv-notempty-message="<?php _e("City is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="state"><?php _e("State"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="2" value="<?php echo $mainobj->GetPostValue("state");?>" class="form-control" id="state" name="state" placeholder="State" data-bv-notempty="true" data-bv-notempty-message="<?php _e("State is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="zip"><?php _e("Zip"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="5" value="<?php echo $mainobj->GetPostValue("zip");?>" class="form-control" id="zip" name="zip" placeholder="Zip" data-bv-notempty="true" data-bv-notempty-message="<?php _e("Zip is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="home_phone"><?php _e("Home Phone"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="15" value="<?php echo $mainobj->GetPostValue("home_phone");?>" class="form-control" id="home_phone" name="home_phone" placeholder="Home Phone" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="work_phone"><?php _e("Work Phone"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="15" value="<?php echo $mainobj->GetPostValue("work_phone");?>" class="form-control" id="work_phone" name="work_phone" placeholder="Work Phone" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="cell_phone"><?php _e("Cell Phone"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="15" value="<?php echo $mainobj->GetPostValue("cell_phone");?>" class="form-control" id="cell_phone" name="cell_phone" placeholder="Cell Phone" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="email"><?php _e("Email"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="100" value="<?php echo $mainobj->GetPostValue("email");?>" class="form-control" id="email" name="email" placeholder="Email" data-bv-notempty="true" data-bv-notempty-message="<?php _e("Email is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="employer_name"><?php _e("Employer Name"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="100" value="<?php echo $mainobj->GetPostValue("employer_name");?>" class="form-control" id="employer_name" name="employer_name" placeholder="Employer Name" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="race_type_if_participate"><?php _e("Race Type If Participate"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="1" value="<?php echo $mainobj->GetPostValue("race_type_if_participate");?>" class="form-control" id="race_type_if_participate" name="race_type_if_participate" placeholder="Race Type If Participate" data-bv-notempty="true" data-bv-notempty-message="<?php _e("Race Type If Participate is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="is_prev_volunteer"><?php _e("Is Prev Volunteer"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="1" value="<?php echo $mainobj->GetPostValue("is_prev_volunteer");?>" class="form-control" id="is_prev_volunteer" name="is_prev_volunteer" placeholder="Is Prev Volunteer" data-bv-notempty="true" data-bv-notempty-message="<?php _e("Is Prev Volunteer is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="from_time"><?php _e("From Time"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="15" value="<?php echo $mainobj->GetPostValue("from_time");?>" class="form-control" id="from_time" name="from_time" placeholder="From Time" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="to_time"><?php _e("To Time"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="15" value="<?php echo $mainobj->GetPostValue("to_time");?>" class="form-control" id="to_time" name="to_time" placeholder="To Time" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="age_range"><?php _e("Age Range"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="1" value="<?php echo $mainobj->GetPostValue("age_range");?>" class="form-control" id="age_range" name="age_range" placeholder="Age Range" data-bv-notempty="true" data-bv-notempty-message="<?php _e("Age Range is required");?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="emergency_name"><?php _e("Emergency Name"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="100" value="<?php echo $mainobj->GetPostValue("emergency_name");?>" class="form-control" id="emergency_name" name="emergency_name" placeholder="Emergency Name" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="emergency_phone"><?php _e("Emergency Phone"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="15" value="<?php echo $mainobj->GetPostValue("emergency_phone");?>" class="form-control" id="emergency_phone" name="emergency_phone" placeholder="Emergency Phone" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="reference"><?php _e("Reference"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="" value="<?php echo $mainobj->GetPostValue("reference");?>" class="form-control" id="reference" name="reference" placeholder="Reference" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="comments"><?php _e("Comments"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="" value="<?php echo $mainobj->GetPostValue("comments");?>" class="form-control" id="comments" name="comments" placeholder="Comments" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="assign_role"><?php _e("Assign Role"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="" value="<?php echo $mainobj->GetPostValue("assign_role");?>" class="form-control" id="assign_role" name="assign_role" placeholder="Assign Role" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="ip"><?php _e("Ip"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="100" value="<?php echo $mainobj->GetPostValue("ip");?>" class="form-control" id="ip" name="ip" placeholder="Ip" >
</div>
</div>
<div class="form-group">
<label class="control-label col-md-<?php echo $label_col;?>" for="creation_date"><?php _e("Creation Date"); ?></label>
<div class="col-md-<?php echo $input_col;?>">
<input type="text" maxlength="" value="<?php echo $mainobj->GetPostValue("creation_date");?>" class="form-control" id="creation_date" name="creation_date" placeholder="Creation Date" data-bv-notempty="true" data-bv-notempty-message="<?php _e("Creation Date is required");?>">
</div>
</div>
<?php
}
}
?>