<?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,cell,response_type);

$excluded=array(id_col);


$button_items=array(

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

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


array(
'label'=>'Proposal Link',
'link'=>$user_path."/view/proposal/",
'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-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Activity Log',
'link'=>$user_path."/view/updates/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'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'=>'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'=>'Print List',
'prefix'=>'ZaHeeN',
//'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 "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,'col11');

$excluded=array(id_col);


$button_items=array(


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



array(
'label'=>'Whatsapp E-Proposal',
'link'=>$user_path."/eprint/i2dprohost/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'blank',
),



array(
'label'=>'Whatsapp Msg',
'link'=>$user_path."/view/i2dmsg/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),



array(
'label'=>'Calling Script',
'link'=>$user_path."/make/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-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

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

array(
'label'=>'Edit',
'link'=>$user_path."/edit/quickentry/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),
/*
array(
'label'=>'Letter Head',
'link'=>$user_path."/eprint/i2dprohost/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'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'=>insertion_date,
'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',
),


array(
'col_heading'=>'Address',
'col_field'=>'col11',
'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 "pdf_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'=>'Fill Record',
'link'=>$user_path."/update/record/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),



/*
array(
'label'=>'Proposal Link',
'link'=>$user_path."/view/proposal/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'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(

);

$parameters=array(
'heading'=>'PDF 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 "prohost_letter_head_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'=>'Fill Record',
'link'=>$user_path."/update/record/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),
*/

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


/*
array(
'label'=>'Proposal Link',
'link'=>$user_path."/view/proposal/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'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(

);

$parameters=array(
'heading'=>'PDF 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 "quick_entries_edit":


//$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'=>'Edit',
'link'=>$user_path."/edit/quickentry/",
'class'=>'btn btn-warning 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(



);

$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'=>'Mark Status',
'link'=>$user_path."/add/update/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),


array(
'label'=>'History',
'link'=>$user_path."/record/updates/",
'class'=>'btn btn-primary 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_adv($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 "i2d_blue_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'=>'i2d Blue Link',
'link'=>$user_path."/view/i2dblue/",
'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-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Activity Log',
'link'=>$user_path."/view/updates/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'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'=>'i2d Blue 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 "i2d_smartshop_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'=>'i2d Smartshop Link',
'link'=>$user_path."/view/i2dsmartshop/",
'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-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Activity Log',
'link'=>$user_path."/view/updates/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'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'=>'i2d Smartshop 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 "i2d_webmini_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'=>'i2d Webmini Link',
'link'=>$user_path."/view/i2dwebmini/",
'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-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Activity Log',
'link'=>$user_path."/view/updates/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'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'=>'i2d Webmini 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 "i2d_medesk_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'=>'i2d Medesk Link',
'link'=>$user_path."/view/i2dmedesk/",
'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-warning btn-sm',
'active'=>'1',
'auth'=>'5',
'target'=>'not_blank',
),

array(
'label'=>'Activity Log',
'link'=>$user_path."/view/updates/",
'class'=>'btn btn-success btn-sm',
'active'=>'1',
'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'=>'i2d Medesk 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 "staff_list":


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

$fields=array(id_col,insertion_date,server_time,title,domain,status,person);

$excluded=array(id_col);


$button_items=array(




array(
'label'=>'Edit',
'link'=>$user_path."/edit/staff/",
'class'=>'btn btn-primary btn-sm',
'active'=>'1',
'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'=>'CNIC',
'col_field'=>person,
'width'=>'3%',
'col_encoding'=>'0',
),



);

$remote_cols=array(


);

$parameters=array(
'heading'=>'Staff 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 Staff",
'ref_val'=>routine_staff_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 "fuel_list":


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

$fields=array(id_col,insertion_date,server_time,title,domain,status,person,business_type,'position2');

$excluded=array(id_col);


$button_items=array(




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






);

$cols=array(


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

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

array(
'col_heading'=>'Cash / Online',
'col_field'=>'position2',
'width'=>'3%',
'col_encoding'=>'0',
),



);

$remote_cols=array(

array(
'col_heading'=>'Staff Name',
'col_field'=>business_type,
'col_remote_table'=>main_table,
'col_remote_table_id'=>id_col,
'col_remote_table_title'=>title,
'width'=>'3%',
'col_encoding'=>'0',
),


);

$parameters=array(
'heading'=>'Fuel 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 Fuel",
'ref_val'=>routine_fuel_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 "config_list":


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

$fields=array(id_col,insertion_date,title);

$excluded=array(id_col);


$button_items=array(




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






);

$cols=array(



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




);

$remote_cols=array(



);

$parameters=array(
'heading'=>'Config List',
'prefix'=>'#',
'simple_serial'=>'1',
'table_fields'=>$fields,
'this_table'=>main_table,
'id_col'=>id_col,
//'echo_sql'=>'1',
/*'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 Config",
'ref_val'=>routine_config_alias
);




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



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


}

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

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


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

$fields=array(id_col,business_type,insertion_date,server_time,title,domain,status);

$excluded=array(id_col);


$button_items=array(


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





);

$cols=array(

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

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


);

$remote_cols=array(


);

$parameters=array(
'heading'=>'Timeline List',
'prefix'=>'TL',
'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 "invoices_request_list":


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

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

$excluded=array(id_col);


$button_items=array(


array(
'label'=>'Edit',
'link'=>$user_path."/edit/invrequest/",
'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'=>'Service Type',
'col_field'=>'col2',
'width'=>'3%',
'col_encoding'=>'0',
),


);

$remote_cols=array(

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




);

$parameters=array(
'heading'=>'Invoice Request List',
'prefix'=>'REQ',
'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 Request",
'ref_val'=>routine_invoice_request_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";

?>