i<?php
include_once"base_connect.php";

switch ($part) {

//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "entries_list":


$add_link=$user_path."/add/entry/";

$fields=array(id_col,insertion_date,server_time,title,status,
category_id,description,sub_category_id,response_type);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Edit',
'link'=>$user_path."/edit/record/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'View',
'link'=>$user_path."/view/record/",
'class'=>'btn btn-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Call',
'link'=>$user_path."/record/call/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Add Update',
'link'=>$user_path."/add/update/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'History',
'link'=>$user_path."/record/updates/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'Delete',
'link'=>$user_path."/del/record/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_status',
'auth'=>'5',
'target'=>'not_blank',
),



);

$cols=array(


array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Title',
'col_field'=>title,
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(

array(
'col_heading'=>'Category',
'col_field'=>category_id,
'col_remote_table'=>sub_table,
'col_remote_table_id'=>sub_table_id,
'col_remote_table_title'=>sub_table_title,
'width'=>'2%',
'col_encoding'=>'0',
),
array(
'col_heading'=>'Last Response',
'col_field'=>response_type,
'col_remote_table'=>sub_table,
'col_remote_table_id'=>sub_table_id,
'col_remote_table_title'=>sub_table_title,
'width'=>'3%',
'col_encoding'=>'0',
),




);

$parameters=array(
'heading'=>'Entries List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
//'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Entry",
'ref_val'=>routine_entry_alias
);




if(isset($id)){
if(isset($type)){

if($type==2){
$col=sub_category_id;	
}
else{
$col=category_id;	
}


	
}


$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "invoices_list":


$add_link=$user_path."/add/invoice/";

$fields=array(id_col,insertion_date,server_time,title,status,
category_id,description,sub_category_id,response_type,customer_id,ref_no);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Edit',
'link'=>$user_path."/edit/invoice/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'print',
'link'=>$user_path."/print/invoice/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'blank',
),

array(
'label'=>'rem',
'link'=>$user_path."/print/invoice/reminder/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'blank',
),

array(
'label'=>'overdue',
'link'=>$user_path."/print/invoice/overdue/",
'class'=>'btn btn-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'blank',
),


array(
'label'=>'Delete',
'link'=>$user_path."/del/record/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_status',
'auth'=>'5',
'target'=>'not_blank',
),



);

$cols=array(


array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Ref / Serial',
'col_field'=>ref_no,
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(

array(
'col_heading'=>'Customer',
'col_field'=>customer_id,
'col_remote_table'=>main_table,
'col_remote_table_id'=>id_col,
'col_remote_table_title'=>title,
'width'=>'2%',
'col_encoding'=>'0',
),
array(
'col_heading'=>'Invoice Type',
'col_field'=>invoice_type,
'col_remote_table'=>sub_table,
'col_remote_table_id'=>sub_table_id,
'col_remote_table_title'=>sub_table_title,
'width'=>'3%',
'col_encoding'=>'0',
),




);

$parameters=array(
'heading'=>'Invoice List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
//'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Entry",
'ref_val'=>routine_invoice_alias
);




if(isset($id)){
if(isset($type)){

if($type==2){
$col=sub_category_id;	
}
else{
$col=category_id;	
}


	
}


$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "rec_list":


$add_link=$user_path."/add/rec/";

$fields=array(id_col,insertion_date,server_time,title,status,'col2',
category_id,description,sub_category_id,response_type,customer_id,ref_no);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Edit',
'link'=>$user_path."/edit/rec/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'Delete',
'link'=>$user_path."/del/record/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_status',
'auth'=>'5',
'target'=>'not_blank',
),



);

$cols=array(


array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Ref / For Service',
'col_field'=>ref_no,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Amount',
'col_field'=>'col2',
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(

array(
'col_heading'=>'Customer',
'col_field'=>customer_id,
'col_remote_table'=>main_table,
'col_remote_table_id'=>id_col,
'col_remote_table_title'=>title,
'width'=>'2%',
'col_encoding'=>'0',
),




);

$parameters=array(
'heading'=>'Rec List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Entry",
'ref_val'=>routine_rec_alias
);




if(isset($id)){
if(isset($type)){

if($type==2){
$col=sub_category_id;	
}
else{
$col=category_id;	
}


	
}


$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "pay_list":


$add_link=$user_path."/add/pay/";

$fields=array(id_col,insertion_date,server_time,title,status,'col2',
category_id,description,sub_category_id,response_type,customer_id,ref_no);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Edit',
'link'=>$user_path."/edit/pay/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'Delete',
'link'=>$user_path."/del/record/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_status',
'auth'=>'5',
'target'=>'not_blank',
),



);

$cols=array(


array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Ref / Payment For',
'col_field'=>ref_no,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Amount',
'col_field'=>'col2',
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(






);

$parameters=array(
'heading'=>'Pay List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Entry",
'ref_val'=>routine_pay_alias
);




if(isset($id)){
if(isset($type)){

if($type==2){
$col=sub_category_id;	
}
else{
$col=category_id;	
}


	
}


$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "customers_list":


$add_link=$user_path."/add/customer/";

$fields=array(id_col,insertion_date,server_time,title,status,
cell,address,company,ref,person);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Edit',
'link'=>$user_path."/edit/customer/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),




array(
'label'=>'Delete',
'link'=>$user_path."/del/record/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_status',
'auth'=>'5',
'target'=>'not_blank',
),



);

$cols=array(


array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Business Name',
'col_field'=>company,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Owner Name',
'col_field'=>person,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Cell',
'col_field'=>cell,
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(





);

$parameters=array(
'heading'=>'Customer List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Customer",
'ref_val'=>routine_customer_alias
);




if(isset($id)){
if(isset($type)){

if($type==2){
$col=sub_category_id;	
}
else{
$col=category_id;	
}


	
}


$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "proposals_list":

$add_link=$user_path."/add/proposal/";

$fields=array(id_col,insertion_date,server_time,status,ref,domain,customer_id);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Edit',
'link'=>$user_path."/edit/proposal/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'View Link',
'link'=>$user_path."/view/proposal/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'blank',
),

array(
'label'=>'History',
'link'=>$user_path."/proposal/history/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'Delete',
'link'=>$user_path."/del/record/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_status',
'auth'=>'5',
'target'=>'not_blank',
),



);

$cols=array(


array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Domain',
'col_field'=>domain,
'width'=>'3%',
'col_encoding'=>'0',
),



);

$remote_cols=array(

array(
'col_heading'=>'Company Name',
'col_field'=>customer_id,
'col_remote_table'=>main_table,
'col_remote_table_id'=>id_col,
'col_remote_table_title'=>company,
'width'=>'3%',
'col_encoding'=>'0',
),



);

$parameters=array(
'heading'=>'Proposal List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Proposal",
'ref_val'=>routine_proposal_alias
);




if(isset($id)){
if(isset($type)){

if($type==2){
$col=sub_category_id;	
}
else{
$col=category_id;	
}


	
}


$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "quick_entries_list":


$add_link=$user_path."/add/quickentry/";

$fields=array(id_col,business_type,insertion_date,server_time,title,domain,status,
category_id,description,response_type,sub_category_id);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Call',
'link'=>$user_path."/make/call/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Fill Record',
'link'=>$user_path."/update/record/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Edit',
'link'=>$user_path."/edit/quickentry/",
'class'=>'btn btn-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'History',
'link'=>$user_path."/view/updates/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'Delete',
'link'=>$user_path."/del/entry/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_status',
'auth'=>'5',
'target'=>'not_blank',
),



);

$cols=array(

/*
array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),
*/
array(
'col_heading'=>'Title',
'col_field'=>title,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Domain',
'col_field'=>domain,
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(

array(
'col_heading'=>'Last Response',
'col_field'=>response_type,
'col_remote_table'=>sub_table,
'col_remote_table_id'=>sub_table_id,
'col_remote_table_title'=>sub_table_title,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Industry',
'col_field'=>business_type,
'col_remote_table'=>sub_table,
'col_remote_table_id'=>sub_table_id,
'col_remote_table_title'=>sub_table_title,
'width'=>'3%',
'col_encoding'=>'0',
),

);

$parameters=array(
'heading'=>'Quick Entries List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Quick Entry",
'ref_val'=>routine_quick_entry_alias
);




if(isset($id)){
$col='posted_by';	



$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "response_list":
    
    
$rt=db_ref(sub_table,sub_table_id,$id,sub_table_title);    


$add_link=$user_path."/add/entry/";

$fields=array(id_col,insertion_date,server_time,cell,title,status,
category_id,description,sub_category_id,response_type);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'View',
'link'=>$user_path."/view/record/",
'class'=>'btn btn-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Call',
'link'=>$user_path."/record/call/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Add Update',
'link'=>$user_path."/add/update/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'History',
'link'=>$user_path."/record/updates/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),




);

$cols=array(


array(
'col_heading'=>'Title',
'col_field'=>title,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Cell',
'col_field'=>cell,
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(

array(
'col_heading'=>'Last Response',
'col_field'=>response_type,
'col_remote_table'=>sub_table,
'col_remote_table_id'=>sub_table_id,
'col_remote_table_title'=>sub_table_title,
'width'=>'3%',
'col_encoding'=>'0',
),




);

$parameters=array(
'heading'=>$rt,
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
//'echo_sql'=>'1',
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
//'add_new_view'=>$add_link,
//'add_btn_text'=>"+ Add New Entry",
'ref_val'=>routine_all_alias
);




if(isset($id)){
if(isset($type)){

if($type==2){
$col=response_type;	
}
else{
$col=category_id;	
}


	
}


$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "feedback_list":


$add_link=$user_path."/add/category/";

$fields=array(sub_table_id,insertion_date,server_time,sub_table_title,sub_table_status,
ref,sub_table_parent_id);

$excluded=array(sub_table_id);


$button_items=array(

array(
'label'=>'View Entries',
'link'=>$user_path."/list/response/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),
/*
array(
'label'=>'Rename',
'link'=>$user_path."/edit/category/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Delete',
'link'=>$user_path."/del/entry/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_with_image',
'auth'=>'5',
'target'=>'not_blank',
),



*/
);

$cols=array(



array(
'col_heading'=>'Feedback Type',
'col_field'=>sub_table_title,
'width'=>'50%',
'col_encoding'=>'0',
),


);

$remote_cols=array(
);

$parameters=array(
'heading'=>'Feedback Types',
'prefix'=>'#',
'table_fields'=>$fields,
'this_table'=>sub_table,
'id_col'=>id_col,
'cols'=>$cols,
//'echo_sql'=>'1',
'simple_serial'=>'1',
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
//'count_table'=>main_table,
//'count_col'=>response_type,
//'add_new_view'=>$add_link,
//'add_btn_text'=>"+ Add New Category",
'ref_val'=>routine_response_alias
);




if(isset($id)){
$parameters['legend'] = $id; 
$parameters['where_col'] = sub_table_parent_id; 
}

view_list_tbl($parameters);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "industries_list":


$add_link=$user_path."/add/category/";

$fields=array(sub_table_id,insertion_date,server_time,sub_table_title,sub_table_status,
ref,sub_table_parent_id);

$excluded=array(sub_table_id);


$button_items=array(
/*
array(
'label'=>'View Entries',
'link'=>$user_path."/list/entries/1/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Rename',
'link'=>$user_path."/edit/category/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Delete',
'link'=>$user_path."/del/entry/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_with_image',
'auth'=>'5',
'target'=>'not_blank',
),



*/
);

$cols=array(



array(
'col_heading'=>'Industry',
'col_field'=>sub_table_title,
'width'=>'100%',
'col_encoding'=>'0',
),


);

$remote_cols=array(
);

$parameters=array(
'heading'=>'Industries List',
'prefix'=>'#',
'table_fields'=>$fields,
'this_table'=>sub_table,
'id_col'=>id_col,
'cols'=>$cols,
'simple_serial'=>'1',
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
//'add_new_view'=>$add_link,
//'add_btn_text'=>"+ Add New Category",
'ref_val'=>routine_industry_alias
);




if(isset($id)){
$parameters['legend'] = $id; 
$parameters['where_col'] = sub_table_parent_id; 
}

view_list_tbl($parameters);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "sub_categories_list":


$add_link=$user_path."/add/subcategory/";

$fields=array(sub_table_id,insertion_date,server_time,sub_table_title,sub_table_status,
ref,sub_table_parent_id);

$excluded=array(sub_table_id);


$button_items=array(

array(
'label'=>'View Entries',
'link'=>$user_path."/list/entries/2/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Rename',
'link'=>$user_path."/edit/subcategory/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Delete',
'link'=>$user_path."/del/entry/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_with_image',
'auth'=>'5',
'target'=>'not_blank',
),




);

$cols=array(


array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Sub-Category',
'col_field'=>sub_table_title,
'width'=>'100%',
'col_encoding'=>'0',
),


);

$remote_cols=array(

);

$parameters=array(
'heading'=>'Sub-Categories List',
'prefix'=>'#',
'table_fields'=>$fields,
'this_table'=>sub_table,
'id_col'=>id_col,
'simple_serial'=>'1',
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Category",
'ref_val'=>routine_sub_category_alias
);




if(isset($id)){
$parameters['legend'] = $id; 
$parameters['where_col'] = sub_table_parent_id; 
}

view_list_tbl($parameters);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "webmini_invoices_list":


$add_link=$user_path."/add/webminiinvoice/";

$fields=array(id_col,insertion_date,server_time,title,status,
category_id,description,sub_category_id,response_type,customer_id,ref_no);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Edit',
'link'=>$user_path."/edit/invoice/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'print',
'link'=>$user_path."/print/i2dwebmini/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'blank',
),


array(
'label'=>'Delete',
'link'=>$user_path."/del/record/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_status',
'auth'=>'5',
'target'=>'not_blank',
),



);

$cols=array(


array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Ref / Serial',
'col_field'=>ref_no,
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(

array(
'col_heading'=>'Customer',
'col_field'=>customer_id,
'col_remote_table'=>main_table,
'col_remote_table_id'=>id_col,
'col_remote_table_title'=>title,
'width'=>'2%',
'col_encoding'=>'0',
),
array(
'col_heading'=>'Invoice Type',
'col_field'=>invoice_type,
'col_remote_table'=>sub_table,
'col_remote_table_id'=>sub_table_id,
'col_remote_table_title'=>sub_table_title,
'width'=>'3%',
'col_encoding'=>'0',
),




);

$parameters=array(
'heading'=>'Invoice List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
//'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Entry",
'ref_val'=>routine_webmini_invoice_alias
);




if(isset($id)){
if(isset($type)){

if($type==2){
$col=sub_category_id;	
}
else{
$col=category_id;	
}


	
}


$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "web_invoices_list":


$add_link=$user_path."/add/web_invoice/";

$fields=array(id_col,insertion_date,server_time,title,status,
category_id,description,sub_category_id,response_type,customer_id,ref_no);

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Edit',
'link'=>$user_path."/edit/invoice/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'print',
'link'=>$user_path."/print/webinvoice/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'blank',
),


array(
'label'=>'Delete',
'link'=>$user_path."/del/record/",
'class'=>'btn btn-danger btn-sm',
'active'=>'1',
'delete'=>'1',
'delete_type'=>'del_rec_status',
'auth'=>'5',
'target'=>'not_blank',
),



);

$cols=array(


array(
'col_heading'=>'Date / Time',
'col_field'=>server_time,
'width'=>'3%',
'col_encoding'=>'0',
),

array(
'col_heading'=>'Ref / Serial',
'col_field'=>ref_no,
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(

array(
'col_heading'=>'Customer',
'col_field'=>customer_id,
'col_remote_table'=>main_table,
'col_remote_table_id'=>id_col,
'col_remote_table_title'=>title,
'width'=>'2%',
'col_encoding'=>'0',
),
array(
'col_heading'=>'Invoice Type',
'col_field'=>invoice_type,
'col_remote_table'=>sub_table,
'col_remote_table_id'=>sub_table_id,
'col_remote_table_title'=>sub_table_title,
'width'=>'3%',
'col_encoding'=>'0',
),




);

$parameters=array(
'heading'=>'Web Invoice List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
/*'photo_on'=>'1',
'photo_col'=>photo1,
'photo_path'=>SITE_IMAGES.photo_folder_absolute_doc,
'photo_type'=>"square",
'photo_percentage'=>"100%",*/
'cols'=>$cols,
'remote_cols'=>$remote_cols,
'buttons'=>$button_items,
//'add_new_view'=>$add_link,
'add_btn_text'=>"+ Add New Entry",
'ref_val'=>routine_web_invoice_alias
);




if(isset($id)){
if(isset($type)){

if($type==2){
$col=sub_category_id;	
}
else{
$col=category_id;	
}


	
}


$parameters['legend'] = $id; 
$parameters['where_col'] = $col; 


}

view_list_tbl($parameters);
//helloworld($id);

break;
/////////////////////////// CASE ENDS  ////////////////////////

default;
app_error("404!","Lists");
}

/////////////////////////////////////////////////////////////////////////////
include_once"../includes/app_bottom.php";

?>