<?php
include_once"base_connect.php";

switch ($part) {
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_
case "add_blog":

if(isset($type) && $type=="edit"){
$edit="1";
$lead_id=$id;
}
else{
$edit="0";
$lead_id="0";
}

$dropdowns=array(

'drops3'=>array(
'label'=>'Blog Category',
'table'=>mmh_sub_table,
'table_title'=>mmh_sub_table_title,
'table_id_col'=>mmh_sub_table_id,
'this_table_field'=>blog_cat_id,
'ref'=>'mmh_blog_cat',
'remote_tbl_title_col'=>mmh_sub_table_title,
'add_new'=>'1',
'other_id_col'=>'0',
'encoding'=>'0'),


);


$dropdowns2=array(

);

$mask1="'mask': '(999)-(9999999)'";
$mask2="'alias': 'numeric','digits': 2,'digitsOptional': false, 'placeholder': '0'";

$textfields=array(

array(
'label'=>'Blog Title',
'fname'=>blog_title,
'class'=>'col-md-12',
'encoding'=>'0',
'format'=>'words',
'masking'=>'off',
'required'=>'1'),

array(
'label'=>'Keywords / Tags',
'encoding'=>'0',
'required'=>'1',
'class'=>'col-md-12',
'format'=>'words',
'hint'=>"Comma Seperated",
'placeholder'=>"mmh,maryam memorial hospital,maryam hospital",
'fname'=>blog_keywords,
'masking'=>'off',
),




);


$integerfields=array(
);


$wysiwygfields=array(
array(
'label'=>'Blog Writeup',
'fname'=>blog_writeup,
'toolbar'=>'all',
'height'=>'400',
'required'=>'1')



);

$wysiwygfields_choice=array(


);



$checkboxfields=array(
);


$timepickfields=array(
);

$directfields=array(
array(
'fname'=>blogger_id,
'value'=>$_SESSION['id'])
);


$update_settings=array(
'update_flag'=>"Lead Edited",
'update_ref'=>"ims_update",
'update_email'=>0
);



$edit=array(
'edit'=>$edit,
'lead_id'=>$lead_id,
'e_ref'=>routine_blog_alias,
'table'=>mmh_table
);


$values=array(
'texts'=>$textfields,
'integers'=>$integerfields,
'dropdowns'=>$dropdowns,
'dropdowns2'=>$dropdowns2,
'checkboxes'=>$checkboxfields,
'timepicks'=>$timepickfields,
'wysiwygs'=>$wysiwygfields,
'wysiwygs_choice'=>$wysiwygfields_choice,
'directfields'=>$directfields,
'update_settings'=>$update_settings,
'datedfield'=>dated,
'dated_table'=>mmh_table,
'prefix'=>'BLOG-',
//'redirect'=>"/blog/list/",
'redirect_adv'=>"/blog/photo",
'form_table'=>mmh_table,
'form_heading'=>"Blogs",
'edit_heading'=>"0",
'alias'=>"mmh_blog"
);

if(isset($id)){
if(user_exists(mmh_table,blogger_id,$_SESSION['id'],$id)!=0) {
make_form($values,1,$edit);
}
else{
echo "Not Found!";
}
}
else{
make_form($values,1,$edit);	
}
break;
//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_//+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+__+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_


default;

echo "<h2>Service Does not Exist!</h2>";

}

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


?>