'cf_leasing_metabox',
'title' => __('New Leasing Special','ar'),
'object_types' => array('leasing')
));
$cf_leasing->add_field(array(
'name' => __('Publishing Date','ar'),
'id' => 'cf_leasing_publish_date',
'type' => 'text_date',
));
$cf_leasing->add_field(array(
'name' => __('Expire Date','ar'),
'id' => 'cf_leasing_expire_date',
'type' => 'text_date',
));
$cf_leasing->add_field( array(
'name' => __('Description','ar'),
'id' => 'cf_leasing_description',
'type' => 'wysiwyg',
'options' => array('textarea_rows'=>5),
));
$cf_leasing->add_field(array(
'name' => __('Select Apartments','ar'),
'id' => 'cf_leasing_apartment',
'type' => 'multicheck',
'show_option_none' =>false,
'options' => Cf_Abr_Apartment::get_apartment_id_title_ARR()
));
}
/**
* @description This function will write the previous leasing
* records and make a csv file for same.
*
* @param Record This will be a array of record to insert
*
* @return True When csv will be created
* False When csv will not be created
*/
public function writeLeasingRecords( $record = '' ){
}
/**
* @description This function will download the csv file for previous
* leasing special records.
*
* @param File This will be the file name that needs to be
* downloaded.
*
* @return True When csv will be created
* False When csv will not be created
*/
public function downloadLesingFile(){
$file = ABR_PLUGIN_DIR_PATH.'admin/premium/downloadablefiles/previousleasing.csv';
if(file_exists($file)){
header('Content-Description: File Transfer');
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
}
}
add_action('plugins_loaded',array('CF_AR_Previous_Leasing_Special','init'));