欢迎各位兄弟 发布技术文章
这里的技术是共享的
function _getItem_time($view,$display_id,$field){
$exposedContent = $view->get_exposed_input();
//假如暴露的过滤器有值,返回年月日时分秒的格式
if(!empty($exposedContent)){
$exposedDate = $exposedContent[$field]['value']['date'];
if(!empty($exposedDate)){
return date('Y-m-d H:i:s',strtotime($exposedDate));
}
return '';
}
else {
$item = $view->get_item($display_id, 'filter', $field);
if(!empty($item['value']['value'])){
$resultYMD = _toDMD($item['value']['value']);
}else if(!empty($item['value']['default_date'])){
$resultYMD = _toDMD($item['value']['value']);
}else if(!empty($item['default_date'])){
$resultYMD = _toDMD($item['value']['value']);
}else{
return '';
}
return date('Y-m-d H:i:s',$resultYMD);
}
}
//在视图执行sql语句前执行一些东西吧
//主要目的是为了 给吴中定金量设个值
//我如果在 init里语句里执行一下就可以了吧
/*
function shipingzhongcustom_views_pre_execute(&$view)
{
// $viewArr = _objectToArray($view);
// var_dump(array_keys($viewArr));exit;
//$filters = $view->display_handler->get_option('filters');
$arg0 = arg(0);
if($view->name=='allcontentview' && $view->current_display=='page_14' && ($arg0=='index' || $arg0=='listzongzong' || $arg0=='listzongwuzhong'))
{
//get_item 时间
$calcYMDHISStart = _getItem_time($view,'page_14','field_zong_time_value');
$calcYMDHISEnd = _getItem_time($view,'page_14','field_zong_time_value_1');
//搜出时间为 开始时间到结束时间的节点id 且正序排
$addSqlTimeStart = '';
!empty($calcYMDHISStart) && $addSqlTimeStart = " and ztime.field_zong_time_value>='".$calcYMDHISStart."'";
$addSqlTimeEnd = '';
!empty($calcYMDHISEnd) && $addSqlTimeEnd = " and ztime.field_zong_time_value<='".$calcYMDHISEnd."'";
$addlimitSql = 'limit 0,31';
//一页最大为31,因为一个月最大为31天
$page = $_GET['page'];
if(!empty($page)){
$addlimitSql = "limit ".(floatval($page)*31).",31";
}
$sql = "select n.nid,n.type from node n inner join content_field_zong_time ztime on n.nid=ztime.nid
where n.type='kefuzongbiaotype'".$addSqlTimeStart.$addSqlTimeEnd." order by ztime.field_zong_time_value asc ".$addlimitSql;
$result = db_query($sql);
$rowNids = array();
while($rowObj = db_fetch_object($result)) {
$node = node_load($rowObj->nid);
//判断客服表的字段是否是否为空
//本文件的约577行至579行 已进行 'presave'处理 .让在保存时 吴中客服组定金量=赵金梅定金量+王晶晶定金量
node_save($node);
}
}
}
*/
function select_date_query_tongji_form()
{
//开始日期
$calcYMDStart = _getCalcStartYMD();
//结束日期
$calcYMDEnd = _getCalcEndYMD();
if($_GET['form_id']!='select_date_query_tongji_nl_form'){
$postYMDStart = $_GET['date_start']['date'];
$postYMDEnd = $_GET['date_end']['date'];
if(!empty($postYMDStart)){
$calcYMDStart = $postYMDStart;
}
if(!empty($postYMDEnd)){
$calcYMDEnd = $postYMDEnd;
}
}
if($_GET['form_id']=='select_date_query_tongji_nl_form'){
$calcYMDStart = null;
$calcYMDEnd = null;
}
$form['date']['date_start'] = array(
'#title' => '开始时间',
'#type' => 'date_popup', // Provided by the date_popup module
'#date_format' => 'Y-m-d', // Uses the PHP date() format - http://php.net/manual/en/function.date.php
'#date_year_range' => '-10:+10', // Limits the year range to the next two upcoming years
'#required' => False,
'#default_value' => $calcYMDStart, // Default value must be in 'Y-m-d' format.
);
$form['date1']['date_end'] = array(
'#title' => '结束时间',
'#type' => 'date_popup', // Provided by the date_popup module
'#date_format' => 'Y-m-d', // Uses the PHP date() format - http://php.net/manual/en/function.date.php
'#date_year_range' => '-10:+10', // Limits the year range to the next two upcoming years
'#required' => False,
'#default_value' => $calcYMDEnd, // Default value must be in 'Y-m-d' format.
);
$form['date']['#attributes']['class'] = 'date_item';
$form['date1']['#attributes']['class'] = 'date_item';
$form['date2']['submit'] = array('#type' => 'submit', '#value' => '查询');
$form['#method'] = 'get';
return $form;
}
function _getNongli_date_start()
{
if($_GET['form_id']=='select_date_query_tongji_nl_form' && (!empty($_GET['date_start']['date'])) && (!empty($_GET['date_end']['date']))){
return $_GET['date_start']['date'];
}
return null;
}
function _getNongli_date_end()
{
if($_GET['form_id']=='select_date_query_tongji_nl_form' && (!empty($_GET['date_start']['date'])) && (!empty($_GET['date_end']['date']))){
return $_GET['date_end']['date'];
}
return null;
}
function select_date_query_tongji_nl_form(){
$form = select_date_query_tongji_form();
$form['date']['date_start']['#title'] = '农历开始时间';
// $calcYMDStart = $form['date']['date_start']['#default_value'];
// $calcYMDStart_nl = _getNongli($calcYMDStart);
$form['date']['date_start']['#default_value'] = _getNongli_date_start();
$form['date1']['date_end']['#title'] = '农历结束时间';
// $calcYMDEnd = $form['date1']['date_end']['#default_value'];
// $calcYMDEnd_nl = _getNongli($calcYMDEnd);
$form['date1']['date_end']['#default_value'] = _getNongli_date_end();
$form['date_nl'] = $form['date'];
$form['date_nl1'] = $form['date1'];
$form['date_nl2'] = $form['date2'];
unset($form['date']);
unset($form['date1']);
unset($form['date2']);
return $form;
}
function select_date_query_tongji_mx_form()
{
//得到昨天的年月日
$yesterDayYmd =_getCalcEndYMD();
//开始日期
$calcYMDStartMx = $yesterDayYmd;
//结束日期
$calcYMDEndMx = $yesterDayYmd;
$postYMDStartMx = $_GET['date_start_mx']['date'];
$postYMDEndMx = $_GET['date_end_mx']['date'];
if(!empty($postYMDStartMx)){
$calcYMDStartMx = $postYMDStartMx;
}
if(!empty($postYMDEndMx)){
$calcYMDEndMx = $postYMDEndMx;
}
$form['date']['date_start_mx'] = array(
'#title' => '开始时间',
'#type' => 'date_popup', // Provided by the date_popup module
'#date_format' => 'Y-m-d', // Uses the PHP date() format - http://php.net/manual/en/function.date.php
'#date_year_range' => '-30:+30', // Limits the year range to the next two upcoming years
'#required' => False,
'#default_value' => $calcYMDStartMx, // Default value must be in 'Y-m-d' format.
);
$form['date1']['date_end_mx'] = array(
'#title' => '结束时间',
'#type' => 'date_popup', // Provided by the date_popup module
'#date_format' => 'Y-m-d', // Uses the PHP date() format - http://php.net/manual/en/function.date.php
'#date_year_range' => '-30:+30', // Limits the year range to the next two upcoming years
'#required' => False,
'#default_value' => $calcYMDEndMx, // Default value must be in 'Y-m-d' format.
);
$form['date']['#attributes']['class'] = 'date_item';
$form['date1']['#attributes']['class'] = 'date_item';
$form['date2']['submit'] = array('#type' => 'submit', '#value' => '查询');
$form['#method'] = 'get';
return $form;
}
function shipingzhongcustom_views_pre_execute(&$view) {
if($view->name == 'allcontentview' && $view->current_display== 'page_30'){
global $user, $views_items_per_page;
$views_items_per_page = $view->pager['items_per_page'];
$sql = "select custom_pager from {custom_zhuqutelqq_pager} where uid='%d'";
$defaultValue = db_result(db_query($sql, $user->uid));
if(!empty($defaultValue)){
$view->pager['items_per_page'] = $defaultValue;
}
}
}
function custom_pager_form()
{
global $user, $views_items_per_page;
$sql = "select custom_pager from custom_zhuqutelqq_pager where uid='%d'";
$defaultValue = db_result(db_query($sql, $user->uid));
empty($defaultValue) && $defaultValue = $views_items_per_page;
$form['custompager'] = array(
'#type' => 'select',
'#title' => '分页数',
'#options' => array(10=>10, 20=>20, 50=>50,100=>100,200=>200,500=>500,1000=>1000),
'#default_value' => $defaultValue,
'#ahah' => array(
'event' => 'change',
'path' => 'user_custom_pager',
'wrapper' => 'user-dig-msg',
),
);
$form['cancel'] = array(
'#type' => 'markup',
'#value' => l('重新加载', $_GET['q'],array('attributes' => array('class'=>'custompager-chongxingjiazai-item'))),
);
$form['msg']= array(
'#prefix'=>'<div id="user-dig-msg">',
'#type'=>'item',
'#suffix'=>'</div>',
);
return $form;
}
function shipingzhongcustom_user_custom_pager() {
global $user;
$custompager = $_POST['custompager'];
$sql = "select custom_pager from {custom_zhuqutelqq_pager} where uid='%d'";
$defaultValue = db_result(db_query($sql, $user->uid));
if (empty($defaultValue)){
db_query("INSERT INTO {custom_zhuqutelqq_pager} (uid, custom_pager) VALUES('%d', '%d')", $user->uid, $custompager);
}else{
db_query("update {custom_zhuqutelqq_pager} set custom_pager='%d' where uid='%d' ", $custompager, $user->uid);
}
print drupal_json(array('status' => TRUE, 'data' => '<div></div>'));
exit();
}
function shipingzhongcustom_preprocess_page(&$variables) {
}
function _percentToFloat($value)
{
return (float)$value/100;
}
// $arr参数
// array('up'=>'bijiao-bad-up','down'=>'bijiao-ok-down','equal'=>'bijiao-equal')
// array('up'=>'bijiao-ok-up','down'=>'bijiao-bak-down','equal'=>'bijiao-equal')
//up表示 上升是 好事 还是坏事
function _biJiaoUpOrdown($nowValue,$lastValue,$arr){
$nowValue = _percentToFloat($nowValue);
$lastValue = _percentToFloat($lastValue);
if($nowValue>$lastValue){
return $arr['up'];
}
else if($nowValue<$lastValue){
return $arr['down'];
}
return $arr['equal'];
}
function _getOneMonthTongjiZgInfo($calcYMDStart,$calcYMDEnd='')
{
//框架户账面消费的计算方式 是 >=2016-03-01 时 比率是 1.3
// < 2016-03-01 时 比率是 1.25
$sql = "SELECT
sum(node_node_data_field_jingjiazong_node_data_field_zg_xiaofei.field_zg_xiaofei_value) as total_zg_baidu_xiaofei_value,
sum(node_node_data_field_jingjiazong_node_data_field_zg_xiaofei.field_zg_wm_xiaofei_value) as total_zg_baidu_wm_xiaofei_value,
sum(node_node_data_field_jingjiazong_node_data_field_zg_xiaofei.field_zg_kjh_sj_xiaofei_value) as total_zg_baidu_kjh_sj_xiaofei_value,
sum(node_node_data_field_jingjiazong_node_data_field_zg_xiaofei.field_zg_kjh_wm_sj_xiaofei_value) as total_zg_baidu_kjh_wm_sj_xiaofei_value,
sum(node_node_data_field_jingjiazong_node_data_field_zg_xiaofei.field_zg_kjh_sg_sj_xiaofei_value) as total_zg_sg_kjh_sj_xiaofei_value,
sum(node_node_data_field_jingjiazong_node_data_field_zg_xiaofei.field_zg_kjh_360_sj_xiaofei_value) as total_zg_360_kjh_sj_xiaofei_value,
sum(node_node_data_field_jingjiazong_node_data_field_zg_xiaofei.field_zg_sm_xiaofei_value) as total_zg_sm_xiaofei_value,
sum(node_node_data_field_kfzhong_node_data_field_kf_zg_zzx.field_kf_zg_zzx_value) AS total_kf_zg_zzx_value,
sum(node_node_data_field_kfzhong_node_data_field_kf_zg_zzx.field_kf_zg_yxzx_value) AS total_kf_zg_yxzx_value
FROM node node LEFT JOIN content_type_timezongtype node_data_field_seozong ON node.vid = node_data_field_seozong.vid
LEFT JOIN node node_node_data_field_seozong ON node_data_field_seozong.field_seozong_nid = node_node_data_field_seozong.nid
LEFT JOIN content_type_timezongtype node_data_field_kfzhong ON node.vid = node_data_field_kfzhong.vid
LEFT JOIN node node_node_data_field_kfzhong ON node_data_field_kfzhong.field_kfzhong_nid = node_node_data_field_kfzhong.nid
LEFT JOIN content_type_timezongtype node_data_field_jingjiazong ON node.vid = node_data_field_jingjiazong.vid
LEFT JOIN node node_node_data_field_jingjiazong ON node_data_field_jingjiazong.field_jingjiazong_nid = node_node_data_field_jingjiazong.nid
LEFT JOIN content_field_zong_time node_data_field_zong_time ON node.vid = node_data_field_zong_time.vid
LEFT JOIN content_type_jingjiazongbiaotype node_node_data_field_jingjiazong_node_data_field_zg_xiaofei ON node_node_data_field_jingjiazong.vid = node_node_data_field_jingjiazong_node_data_field_zg_xiaofei.vid
LEFT JOIN content_type_kefuzongbiaotype node_node_data_field_kfzhong_node_data_field_kf_zg_zzx ON node_node_data_field_kfzhong.vid = node_node_data_field_kfzhong_node_data_field_kf_zg_zzx.vid
WHERE (node.type in ('timezongtype')) AND (node_data_field_zong_time.field_zong_time_value >= '".$calcYMDStart."') AND (node_data_field_zong_time.field_zong_time_value <= '".$calcYMDEnd."')";
$result = db_query($sql);
$arrFormResult = db_fetch_array($result);
$totalXiaoFei = $zg_ZongXiaoFei = $arrFormResult['total_zg_baidu_xiaofei_value']
+$arrFormResult['total_zg_baidu_wm_xiaofei_value']
+$arrFormResult['total_zg_baidu_kjh_sj_xiaofei_value']
+$arrFormResult['total_zg_baidu_kjh_wm_sj_xiaofei_value']
+$arrFormResult['total_zg_sg_kjh_sj_xiaofei_value']
+$arrFormResult['total_zg_360_kjh_sj_xiaofei_value']
+$arrFormResult['total_zg_sm_xiaofei_value'];
//整骨的七个数据
$totalXiaoFei = round($totalXiaoFei,3);
$totalZongZiXun = $zg_ZongZiXun = $arrFormResult['total_kf_zg_zzx_value'];
$totalYouXiaoZiXun = $zg_YouXiaoZiXun = $arrFormResult['total_kf_zg_yxzx_value'];
$zg_ShangMenLiang = $arrFormResult['total_kf_wz_shanmenliang_value'];
$zg_BaoMingLiang = $arrFormResult['total_kf_wz_baomingliang_value'];
$zg_DinjinLiang = $arrFormResult['total_kf_wz_dinjinliang_value'];
$zg_BaoMingLiangAndDinjinLiang = $wz_BaoMingLiang+$wz_DinjinLiang;
//下面是各项成本
$chengBenZongZiXun = round($totalXiaoFei/$totalZongZiXun,3);
$chengBenYouXiaoZiXun = round($totalXiaoFei/$totalYouXiaoZiXun,3);
$chengBenShangMenLiang = round($totalXiaoFei/$totalShangMenLiang,3);
$chengBaoMingLiang = round($totalXiaoFei/$totalBaoMingLiang,3);
$chengBaoMingLiangJiaDinJingLiang = round($totalXiaoFei/($totalBaoMingLiangAndDinjinLiang),3);
$chengBen_wz_xq_ZongZiXun = round($wz_xq_ZongXiaoFei/$wz_xq_ZongZiXun,3);
$chengBen_wz_xq_YouXiaoZiXun = round($wz_xq_ZongXiaoFei/$wz_xq_YouXiaoZiXun,3);
$chengBen_wz_xq_ShangMenLiang = round($wz_xq_ZongXiaoFei/$wz_xq_ShangMenLiang,3);
$cheng_wz_xq_BaoMingLiang = round($wz_xq_ZongXiaoFei/$wz_xq_BaoMingLiang,3);
$cheng_wz_xq_BaoMingLiangJiaDinJingLiang = round($wz_xq_ZongXiaoFei/$wz_xq_BaoMingLiangAndDinjinLiang,3);
$chengBen_wz_ZongZiXun = round($wz_ZongXiaoFei/$wz_ZongZiXun,3);
$chengBen_wz_YouXiaoZiXun = round($wz_ZongXiaoFei/$wz_YouXiaoZiXun,3);
$chengBen_wz_ShangMenLiang = round($wz_ZongXiaoFei/$wz_ShangMenLiang,3);
$cheng_wz_BaoMingLiang = round($wz_ZongXiaoFei/$wz_BaoMingLiang,3);
$cheng_wz_BaoMingLiangJiaDinJingLiang = round($wz_ZongXiaoFei/$wz_BaoMingLiangAndDinjinLiang,3);
$chengBen_xq_ZongZiXun = round($xq_ZongXiaoFei/$xq_ZongZiXun,3);
$chengBen_xq_YouXiaoZiXun = round($xq_ZongXiaoFei/$xq_YouXiaoZiXun,3);
$chengBen_xq_ShangMenLiang = round($xq_ZongXiaoFei/$xq_ShangMenLiang,3);
$cheng_xq_BaoMingLiang = round($xq_ZongXiaoFei/$xq_BaoMingLiang,3);
$cheng_xq_BaoMingLiangJiaDinJingLiang = round($xq_ZongXiaoFei/$xq_BaoMingLiangAndDinjinLiang,3);
$chengBen_hd_ZongZiXun = round($hd_ZongXiaoFei/$hd_ZongZiXun,3);
$chengBen_hd_YouXiaoZiXun = round($hd_ZongXiaoFei/$hd_YouXiaoZiXun,3);
$chengBen_hd_ShangMenLiang = round($hd_ZongXiaoFei/$hd_ShangMenLiang,3);
$cheng_hd_BaoMingLiang = round($hd_ZongXiaoFei/$hd_BaoMingLiang,3);
$cheng_hd_BaoMingLiangJiaDinJingLiang = round($hd_ZongXiaoFei/$hd_BaoMingLiangAndDinjinLiang,3);
//下面是各项转化率
$zhuanHuaLiZongZiXunToYouXiaoZiXun = (round($totalYouXiaoZiXun/$totalZongZiXun,3)*100).'%';
$zhuanHuaLiYouXiaoZiXunToShangMenLiang = (round($totalShangMenLiang/$totalYouXiaoZiXun,3)*100).'%';
$zhuanHuaLiShangMenLiangToBaoMingLiang = (round($totalBaoMingLiang/$totalShangMenLiang,3)*100).'%';
$zhuanHuaLiShangMenLiangToBaoMingLiangJiaDinJingLiang = (round(($totalBaoMingLiangAndDinjinLiang)/$totalShangMenLiang,3)*100).'%';
$zhuanHuaLi_wz_xq_ZongZiXunToYouXiaoZiXun = (round($wz_xq_YouXiaoZiXun/$wz_xq_ZongZiXun,3)*100).'%';
$zhuanHuaLi_wz_xq_YouXiaoZiXunToShangMenLiang = (round($wz_xq_ShangMenLiang/$wz_xq_YouXiaoZiXun,3)*100).'%';
$zhuanHuaLi_wz_xq_ShangMenLiangToBaoMingLiang = (round($wz_xq_BaoMingLiang/$wz_xq_ShangMenLiang,3)*100).'%';
$zhuanHuaLi_wz_xq_ShangMenLiangToBaoMingLiangJiaDinJingLiang = (round($wz_xq_BaoMingLiangAndDinjinLiang/$wz_xq_ShangMenLiang,3)*100).'%';
$zhuanHuaLi_hd_ZongZiXunToYouXiaoZiXun = (round($hd_YouXiaoZiXun/$hd_ZongZiXun,3)*100).'%';
$zhuanHuaLi_hd_YouXiaoZiXunToShangMenLiang = (round($hd_ShangMenLiang/$hd_YouXiaoZiXun,3)*100).'%';
$zhuanHuaLi_hd_ShangMenLiangToBaoMingLiang = (round($hd_BaoMingLiang/$hd_ShangMenLiang,3)*100).'%';
$zhuanHuaLi_hd_ShangMenLiangToBaoMingLiangJiaDinJingLiang = (round($hd_BaoMingLiangAndDinjinLiang/$hd_ShangMenLiang,3)*100).'%';
$zhuanHuaLi_wz_ZongZiXunToYouXiaoZiXun = (round($wz_YouXiaoZiXun/$wz_ZongZiXun,3)*100).'%';
$zhuanHuaLi_wz_YouXiaoZiXunToShangMenLiang = (round($wz_ShangMenLiang/$wz_YouXiaoZiXun,3)*100).'%';
$zhuanHuaLi_wz_ShangMenLiangToBaoMingLiang = (round($wz_BaoMingLiang/$wz_ShangMenLiang,3)*100).'%';
$zhuanHuaLi_wz_ShangMenLiangToBaoMingLiangJiaDinJingLiang = (round($wz_BaoMingLiangAndDinjinLiang/$wz_ShangMenLiang,3)*100).'%';
$zhuanHuaLi_xq_ZongZiXunToYouXiaoZiXun = (round($xq_YouXiaoZiXun/$xq_ZongZiXun,3)*100).'%';
$zhuanHuaLi_xq_YouXiaoZiXunToShangMenLiang = (round($xq_ShangMenLiang/$xq_YouXiaoZiXun,3)*100).'%';
$zhuanHuaLi_xq_ShangMenLiangToBaoMingLiang = (round($xq_BaoMingLiang/$xq_ShangMenLiang,3)*100).'%';
$zhuanHuaLi_xq_ShangMenLiangToBaoMingLiangJiaDinJingLiang = (round($xq_BaoMingLiangAndDinjinLiang/$xq_ShangMenLiang,3)*100).'%';
$resultArr=compact('totalXiaoFei','totalZongZiXun','totalYouXiaoZiXun','totalShangMenLiang','totalBaoMingLiang',
'totalDinjinLiang','chengBenZongZiXun','chengBenYouXiaoZiXun','chengBenShangMenLiang',
'chengBaoMingLiang','chengBaoMingLiangJiaDinJingLiang','zhuanHuaLiZongZiXunToYouXiaoZiXun',
'zhuanHuaLiYouXiaoZiXunToShangMenLiang','zhuanHuaLiShangMenLiangToBaoMingLiang',
'zhuanHuaLiShangMenLiangToBaoMingLiangJiaDinJingLiang',
'wz_xq_ZongXiaoFei','wz_xq_ZongZiXun','wz_xq_YouXiaoZiXun','wz_xq_ShangMenLiang','wz_xq_BaoMingLiang',
'wz_xq_DinjinLiang','chengBen_wz_xq_ZongZiXun','chengBen_wz_xq_YouXiaoZiXun','chengBen_wz_xq_ShangMenLiang',
'cheng_wz_xq_BaoMingLiang','cheng_wz_xq_BaoMingLiangJiaDinJingLiang','zhuanHuaLi_wz_xq_ZongZiXunToYouXiaoZiXun',
'zhuanHuaLi_wz_xq_YouXiaoZiXunToShangMenLiang','zhuanHuaLi_wz_xq_ShangMenLiangToBaoMingLiang',
'zhuanHuaLi_wz_xq_ShangMenLiangToBaoMingLiangJiaDinJingLiang',
'hd_ZongXiaoFei','hd_ZongZiXun','hd_YouXiaoZiXun','hd_ShangMenLiang','hd_BaoMingLiang',
'hd_DinjinLiang','chengBen_hd_ZongZiXun','chengBen_hd_YouXiaoZiXun','chengBen_hd_ShangMenLiang',
'cheng_hd_BaoMingLiang','cheng_hd_BaoMingLiangJiaDinJingLiang','zhuanHuaLi_hd_ZongZiXunToYouXiaoZiXun',
'zhuanHuaLi_hd_YouXiaoZiXunToShangMenLiang','zhuanHuaLi_hd_ShangMenLiangToBaoMingLiang',
'zhuanHuaLi_hd_ShangMenLiangToBaoMingLiangJiaDinJingLiang',
'wz_ZongXiaoFei','wz_ZongZiXun','wz_YouXiaoZiXun','wz_ShangMenLiang','wz_BaoMingLiang',
'wz_DinjinLiang','chengBen_wz_ZongZiXun','chengBen_wz_YouXiaoZiXun','chengBen_wz_ShangMenLiang',
'cheng_wz_BaoMingLiang','cheng_wz_BaoMingLiangJiaDinJingLiang','zhuanHuaLi_wz_ZongZiXunToYouXiaoZiXun',
'zhuanHuaLi_wz_YouXiaoZiXunToShangMenLiang','zhuanHuaLi_wz_ShangMenLiangToBaoMingLiang',
'zhuanHuaLi_wz_ShangMenLiangToBaoMingLiangJiaDinJingLiang',
'xq_ZongXiaoFei','xq_ZongZiXun','xq_YouXiaoZiXun','xq_ShangMenLiang','xq_BaoMingLiang',
'xq_DinjinLiang','chengBen_xq_ZongZiXun','chengBen_xq_YouXiaoZiXun','chengBen_xq_ShangMenLiang',
'cheng_xq_BaoMingLiang','cheng_xq_BaoMingLiangJiaDinJingLiang','zhuanHuaLi_xq_ZongZiXunToYouXiaoZiXun',
'zhuanHuaLi_xq_YouXiaoZiXunToShangMenLiang','zhuanHuaLi_xq_ShangMenLiangToBaoMingLiang',
'zhuanHuaLi_xq_ShangMenLiangToBaoMingLiangJiaDinJingLiang'
);
return $resultArr;
}
/**
* @return array
*/
function _getMonthTongjiZgInfo()
{
global $onlyIndexTonjingFilter;
$onlyIndexTonjingFilter = true;
//假如农历表为空的时候 或其中任何一项为空 此时公历表起作用
/* if($_GET['form_id']!='select_date_query_tongji_nl_form' ||
($_GET['form_id']=='select_date_query_tongji_nl_form' && ((empty($_GET['date_start']['date'])) || (empty($_GET['date_end']['date'])))) ){*/
if(!($_GET['form_id']=='select_date_query_tongji_nl_form' && (!empty($_GET['date_start']['date'])) && (!empty($_GET['date_end']['date'])))){
//开始就是8日
$calcYMDStart = _getCalcStartYMD();
//结束就是前一天
$calcYMDEnd = _getCalcEndYMD();
$postYMDStart = $_GET['date_start']['date'];
$postYMDEnd = $_GET['date_end']['date'];
if(!empty($postYMDStart)){
$calcYMDStart = $postYMDStart;
}
if(!empty($postYMDEnd)){
$calcYMDEnd = $postYMDEnd;
}
}
else{ //此时农历表 提交 且农历表的开始时间 和结束时间都有值 //得到公历的值 进行计算
$postYMDStart_nl = $_GET['date_start']['date'];
$calcYMDEnd_nl = $_GET['date_end']['date'];
$calcYMDStart = _get_num_Gongli($postYMDStart_nl);
$calcYMDEnd = _get_num_Gongli($calcYMDEnd_nl);
}
//var_dump($calcYMDStart);
//var_dump($calcYMDEnd);
$thisMonthArr = _getOneMonthTongjiZgInfo($calcYMDStart,$calcYMDEnd);
$calcYMDLastMonthStart = _calcLastMonth($calcYMDStart);
//结束应该是前一天
$calcYMDLastMonthEnd = _calcLastMonth($calcYMDEnd);
$lastMonthArr = _getOneMonthTongjiZgInfo($calcYMDLastMonthStart,$calcYMDLastMonthEnd);
//开始应该是前一年的这一天 再加四天 现在是加11天 +11*24*60*60
//$calcYMDLastYearStart = _calcLastYear(date('Y-m-d',strtotime($calcYMDStart)+11*24*60*60));
//开始应该是前一年的这一天
$calcYMDLastYearStart = _calcLastYear(date('Y-m-d',strtotime($calcYMDStart)));
//结束应该是前一年的这一天 再加四天 现在是加11天 +11*24*60*60
//$calcYMDLastYearEnd = _calcLastYear(date('Y-m-d',strtotime($calcYMDEnd)+11*24*60*60));
$calcYMDLastYearEnd = _calcLastYear(date('Y-m-d',strtotime($calcYMDEnd)));
$lastYearArr = _getOneMonthTongjiZgInfo($calcYMDLastYearStart,$calcYMDLastYearEnd);
$yearMonthDay = $calcYMDStart.' 至 '.$calcYMDEnd;
$lastYearYearMonthDay = $calcYMDLastYearStart.' 至 '.$calcYMDLastYearEnd;
//得到昨天的年月日
$yesterDayYmd =_getCalcEndYMD();
//昨天明细日期
$mingxiCalcYMDEnd = $mingxiCalcYMDStart = $yesterDayYmd;
$postYMDStartMx = $_GET['date_start_mx']['date'];
$postYMDEndMx = $_GET['date_end_mx']['date'];
if(!empty($postYMDStartMx)){
$mingxiCalcYMDStart = $postYMDStartMx;
}
if(!empty($postYMDEndMx)){
$mingxiCalcYMDEnd = $postYMDEndMx;
}
//$resultArrs = compact('yearMonthDay','thisMonthArr','lastMonthArr','lastYearArr','zhouYanJunArr','zhuYunMeiArr','wangJinJinArr','zhaoJingMeiArr');
//下面 是根据公历求农历
$nongliCalcYMDStart = _getNongli($calcYMDStart);
$nongliCalcYMDEnd = _getNongli($calcYMDEnd);
$nongliCalcYMDLastYearStart = _getNongli($calcYMDLastYearStart);
$nongliCalcYMDLastYearEnd = _getNongli($calcYMDLastYearEnd);
$nongliYearMonthDay = $nongliCalcYMDStart.' 至 '.$nongliCalcYMDEnd;
$nongliLastYearYearMonthDay = $nongliCalcYMDLastYearStart.' 至 '.$nongliCalcYMDLastYearEnd;
$resultArrs = compact('yearMonthDay','nongliYearMonthDay','lastYearYearMonthDay','nongliLastYearYearMonthDay','thisMonthArr','lastMonthArr','lastYearArr');
return $resultArrs;
}
function shipingzhongcustom_theme(){
return array(
'custom_textarea_values' => array(
'arguments' => array('element' => NULL),
),
'custom_field_fangshi_values' => array(
'arguments' => array('element' => NULL),
),
'my_form_checkbox_element'=>array(
'arguments' => array('element' => NULL,'value'=>NULL),
)
);
}
function theme_custom_textarea_values($element) {
$field_name = $element['#field_name'];
$field = content_fields($field_name);
$output = '';
if ($field['multiple'] >= 1) {
$table_id = $element['#field_name'] .'_values';
$order_class = $element['#field_name'] .'-delta-order';
$required = !empty($element['#required']) ? '<span class="form-required" title="'. t('This field is required.') .'">*</span>' : '';
$header = array(
array(
'data' => t('!title: !required', array('!title' => $element['#title'], '!required' => $required)),
'colspan' => 2
),
t('Order'),
);
$rows = array();
// Sort items according to '_weight' (needed when the form comes back after
// preview or failed validation)
$items = array();
foreach (element_children($element) as $key) {
if ($key !== $element['#field_name'] .'_add_more') {
$items[] = &$element[$key];
}
}
usort($items, '_content_sort_items_value_helper');
// Add the items as table rows.
foreach ($items as $key => $item) {
$item['_weight']['#attributes']['class'] = $order_class;
$delta_element = drupal_render($item['_weight']);
$cells = array(
array('data' => '', 'class' => 'content-multiple-drag'),
drupal_render($item),
array('data' => $delta_element, 'class' => 'delta-order'),
);
$rows[] = array(
'data' => $cells,
'class' => 'draggable',
);
}
$output .= theme('table', $header, $rows, array('id' => $table_id, 'class' => 'content-multiple-table'));
$output .= $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '';
$output .= drupal_render($element[$element['#field_name'] .'_add_more']);
drupal_add_tabledrag($table_id, 'order', 'sibling', $order_class);
}
else {
foreach (element_children($element) as $key) {
unset($element[$key]['value']['#suffix']);
$element[$key]['value']['#cols'] = 35;
/*$export = kprint_r($element[$key]['value'], TRUE); // $vars - is a variable which you want to print.
print $export;*/
$output .= drupal_render($element[$key]);
}
}
return $output;
}
function theme_custom_field_fangshi_values($element) {
$field_name = $element['#field_name'];
$field = content_fields($field_name);
$output = '';
if ($field['multiple'] >= 1) {
$table_id = $element['#field_name'] .'_values';
$order_class = $element['#field_name'] .'-delta-order';
$required = !empty($element['#required']) ? '<span class="form-required" title="'. t('This field is required.') .'">*</span>' : '';
$header = array(
array(
'data' => t('!title: !required', array('!title' => $element['#title'], '!required' => $required)),
'colspan' => 2
),
t('Order'),
);
$rows = array();
// Sort items according to '_weight' (needed when the form comes back after
// preview or failed validation)
$items = array();
foreach (element_children($element) as $key) {
if ($key !== $element['#field_name'] .'_add_more') {
$items[] = &$element[$key];
}
}
usort($items, '_content_sort_items_value_helper');
// Add the items as table rows.
foreach ($items as $key => $item) {
$item['_weight']['#attributes']['class'] = $order_class;
$delta_element = drupal_render($item['_weight']);
$cells = array(
array('data' => '', 'class' => 'content-multiple-drag'),
drupal_render($item),
array('data' => $delta_element, 'class' => 'delta-order'),
);
$rows[] = array(
'data' => $cells,
'class' => 'draggable',
);
}
$output .= theme('table', $header, $rows, array('id' => $table_id, 'class' => 'content-multiple-table'));
$output .= drupal_render($element[$element['#field_name'] .'_add_more']);
$output .= $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '';
drupal_add_tabledrag($table_id, 'order', 'sibling', $order_class);
}
else {
foreach (element_children($element) as $key) {
$output .= drupal_render($element[$key]);
}
}
return $output;
}
function _xugenzong_ids($diqu,$days=0)
{
if($diqu==array('wz','xq')){
if(!empty($days)){ //假如天数不为空的时候
$row_nids = cache_get('jyyxgz_row_nids_'.$days,'cache');
}else{
$row_nids = cache_get('jyyxgz_row_nids','cache');
}
if(!empty($row_nids)){
return $row_nids->data;
}
}
else if($diqu==array('hd')){
if(!empty($days)){ //假如天数不为空的时候
$row_nids = cache_get('hd_row_nids_'.$days,'cache');
}else{
$row_nids = cache_get('hd_row_nids','cache');
}
if(!empty($row_nids)){
return $row_nids->data;
}
}
else if($diqu==array('zgy')){
if(!empty($days)){ //假如天数不为空的时候
$row_nids = cache_get('zgy_row_nids_'.$days,'cache');
}else{
$row_nids = cache_get('zgy_row_nids','cache');
}
if(!empty($row_nids)){
return $row_nids->data;
}
}
//减去时区相隔的秒数
$timestamp = strtotime(date('Y-m-d'))-date('Z');
if(!empty($days)) { //假如天数不为空的时候{
//$days*24*60*60 即为 $days*86400
$time = date('Y-m-d H:i:s',$timestamp+$days*24*60*60);
}
else{
$time = date('Y-m-d H:i:s',$timestamp);
}
//旧的 sql 运行速度不快
// $sql = "SELECT distinct n.nid,max(next_time.delta) as maxdelta,next_time.field_genzong_next_time_value from content_field_genzong_next_time next_time
// inner join node n on n.nid=next_time.nid
// inner join content_type_kefuchat kefuchat on n.nid=kefuchat.nid
// inner join content_field_is_baoming is_baoming on n.nid=is_baoming.nid
// inner join content_field_is_dingjing is_dingjing on n.nid=is_dingjing.nid
// where n.type='kefuchat' and kefuchat.field_chat_status_value='complete'
// and ((is_baoming.field_is_baoming_value is null or is_baoming.field_is_baoming_value='否' )
// and (is_dingjing.field_is_dingjing_value is null or is_dingjing.field_is_dingjing_value='否' ) )
// group by next_time.nid having next_time.field_genzong_next_time_value is not null
// and max(next_time.field_genzong_next_time_value)<='$time'";
$sql = "SELECT n.nid,max(next_time.delta) as maxdelta,next_time.field_genzong_next_time_value from content_field_genzong_next_time next_time
inner join node n on n.nid=next_time.nid
inner join content_type_kefuchat kefuchat on n.nid=kefuchat.nid
inner join content_field_is_baoming is_baoming on n.nid=is_baoming.nid
inner join content_field_is_dingjing is_dingjing on n.nid=is_dingjing.nid
where n.type='kefuchat' and kefuchat.field_chat_status_value='complete'
and ((is_baoming.field_is_baoming_value is null or is_baoming.field_is_baoming_value='否' )
and (is_dingjing.field_is_dingjing_value is null or is_dingjing.field_is_dingjing_value='否' ) )
and next_time.field_genzong_next_time_value is not null
group by next_time.nid having max(next_time.field_genzong_next_time_value)<='$time'";
//var_dump($sql);
$result = db_query($sql);
$row_objs = array();
/*
* //旧的 的语句执行时间太长 ,我使用 下面的语句 ,执行时短
//下面的主要目的 是判断 当 delta 的最大值的时候 field_genzong_next_time_value 它不为空
while($row_obj = db_fetch_object($result)) {
//var_dump("select field_genzong_next_time_value from content_field_genzong_next_time
// where nid=$row_obj->nid and delta=$row_obj->maxdelta and (field_genzong_next_time_value is not null
// or field_genzong_next_time_value!='')");
$max_delta_time = db_result(db_query("select max(delta) from {content_field_genzong_time} where nid=$row_obj->nid"));
// $sql_field_genzong_next_time_value = db_result(db_query("select field_genzong_next_time_value from content_field_genzong_next_time
// where nid=$row_obj->nid and delta=$row_obj->maxdelta and (field_genzong_next_time_value is not null
// or field_genzong_next_time_value!='')"));
//
$sql_field_genzong_next_time_value = db_result(db_query("select field_genzong_next_time_value from content_field_genzong_next_time
where nid=$row_obj->nid and delta=$max_delta_time and (field_genzong_next_time_value is not null
or field_genzong_next_time_value!='')"));
// if($row_obj->nid==450280){
// var_dump($row_obj->maxdelta);
// var_dump("select field_genzong_next_time_value from content_field_genzong_next_time
// where nid=$row_obj->nid and delta=$row_obj->maxdelta and (field_genzong_next_time_value is not null
// or field_genzong_next_time_value!='')");
// }
if(!empty($sql_field_genzong_next_time_value)){
$row_objs[] = $row_obj;
}
}
*/
$row_obj_nids = array();
while($row_obj = db_fetch_object($result)) {
$row_obj_nids[] = $row_obj->nid;
}
$row_obj_nids_str = implode(',',$row_obj_nids);
$sql = "select n.nid as nid,max(g_time.delta)as max_g_time_delta,max(next_g_time.delta)as max_next_g_time_delta from node n left join
content_field_genzong_time g_time on n.nid=g_time.nid left join content_field_genzong_next_time next_g_time on n.nid=next_g_time.nid
where n.nid in ($row_obj_nids_str)
and (g_time.field_genzong_time_value is not null and g_time.field_genzong_time_value!='')
and (next_g_time.field_genzong_next_time_value is not null and next_g_time.field_genzong_next_time_value!='')
group by n.nid ";
$result = db_query($sql);
while($row_obj = db_fetch_object($result)) {
//当最大的跟踪时间 和 最大的 下次跟踪时间相等的时候
if($row_obj->max_g_time_delta==$row_obj->max_next_g_time_delta){
$row_objs[] = $row_obj;
}
}
//var_dump($row_objs);exit;
$row_nids = array();
foreach($row_objs as $row_obj)
{
//把上门时间超过15天的(并且是自己接待的)去掉
$node = node_load($row_obj->nid); //整骨不用考虑 因为整骨的上门肯定为空
if($node->field_is_shangmen[0]['value']=='是'){
//分两种情况
//上门时间 有个15天上门后 最大的下次跟踪时间为空(就减掉它) 就到报名未跟踪显示
//上门时间 有个15天上门后 最大的下次跟踪时间不为空(且 不是 本校区填写的跟踪 ,吴中由华东来填 华东由吴中来填)
// 由 别人跟踪这里就不显示 就到报名未跟踪显示
$shangmeng_time = strtotime($node->field_shangmeng_time[0]['value'])+date('Z');
$diff_day = intval((time()-$shangmeng_time)/(60*60*24));
/* $export = kprint_r($node,TRUE);
print $export;*/
if($diff_day>=15){
//上门时间 有个15天上门后 最大的下次跟踪时间为空(就减掉它) 就到报名未跟踪显示
if(empty($node->field_genzong_next_time[count($node->field_genzong_next_time)-1]['value'])){
}
//上门时间 有个15天上门后 最大的下次跟踪时间不为空(且 最后一个跟踪填写人不是 本校区填写的跟踪 ,吴中由华东来填 华东由吴中来填)
else{
$user = user_load(array('name' => check_plain($node->field_genzong_writer[count($node->field_genzong_writer)-1]['value'])));
if (in_array('华东跟踪',$user->roles) && empty(array_diff($diqu,array('hd'))) ){
$row_nids[] = $row_obj->nid;
}
if (in_array('教育园跟踪',$user->roles) && empty(array_diff($diqu,array('wz','xq')))){
$row_nids[] = $row_obj->nid;
}
}
continue;
}
}
if(in_array($node->field_suozaixiaoqu[0]['value'],$diqu)){
$row_nids[] = $row_obj->nid;
}
}
$expire = 8*60*60; //缓存 8 个小时
//$seria_row_nids = serialize($row_nids);
if($diqu==array('wz','xq')){
//$_SESSION['jyyxgz_row_nids'] = $row_nids;
if(!empty($days)) { //假如天数不为空的时候
cache_set('jyyxgz_row_nids_'.$days, $row_nids, 'cache',time() + $expire);
}
else {
cache_set('jyyxgz_row_nids', $row_nids, 'cache',time() + $expire);
}
}else if($diqu==array('hd')){
//$_SESSION['hd_row_nids'] = $row_nids;
if(!empty($days)) { //假如天数不为空的时候
cache_set('hd_row_nids_'.$days, $row_nids, 'cache', time() + $expire);
}
else{
cache_set('hd_row_nids', $row_nids, 'cache', time() + $expire);
}
}else if($diqu==array('zgy')){
//$_SESSION['zgy_row_nids'] = $row_nids;
if(!empty($days)) { //假如天数不为空的时候
cache_set('zgy_row_nids_'.$days, $row_nids, 'cache',time() + $expire);
}else{
cache_set('zgy_row_nids', $row_nids, 'cache',time() + $expire);
}
}
return $row_nids;
}
function _yxwgz_genzong_num($diqu_arr=array())
{
if($diqu_arr==array('wz','xq')){
$yxwgz_genzong_num = cache_get('jyy_yxwgz_genzong_num','cache');
if(!empty($yxwgz_genzong_num)){
return $yxwgz_genzong_num->data;
}
}else if($diqu_arr==array('hd')){
$yxwgz_genzong_num = cache_get('hd_yxwgz_genzong_num','cache');
if(!empty($yxwgz_genzong_num)){
return $yxwgz_genzong_num->data;
}
}else if($diqu_arr==array('zgy')){
$yxwgz_genzong_num = cache_get('zgy_yxwgz_genzong_num','cache');
if(!empty($yxwgz_genzong_num)){
return $yxwgz_genzong_num->data;
}
}
$diqu = join(",",$diqu_arr); //这里 join 与 implode 是一样的
$diqu = "'".str_replace(",","','",$diqu)."'"; //这是把逗号 替换成 单引号 逗号 单引号
$timestamp = strtotime('2017-03-01')-date('Z');
$time = date('Y-m-d H:i:s',$timestamp);
//下面计算的是 有效且未跟踪的数目
$sql = "select count(n.nid) as count from node n inner join content_type_kefuchat kefuchat on n.nid=kefuchat.nid
inner join content_field_genzong_time genzong_time on n.nid=genzong_time.nid
inner join content_field_time field_time on n.nid=field_time.nid
inner join content_field_is_baoming is_baoming on n.nid=is_baoming.nid
inner join content_field_is_dingjing is_dingjing on n.nid=is_dingjing.nid
where n.type='kefuchat' and field_time.field_time_value >='$time' and kefuchat.field_suozaixiaoqu_value in ($diqu) and genzong_time.field_genzong_time_value is null
and kefuchat.field_chat_status_value='complete'
and ((is_baoming.field_is_baoming_value is null or is_baoming.field_is_baoming_value='否' ) and (is_dingjing.field_is_dingjing_value is null or is_dingjing.field_is_dingjing_value='否' ) ) ";
$yxwgz_genzong_num = db_result(db_query($sql));
empty($yxwgz_genzong_num) && $yxwgz_genzong_num = '0';
$expire = 8*60*60;
if($diqu_arr==array('wz','xq')){
//$_SESSION['jyy_yxwgz_genzong_num'] = $yxwgz_genzong_num;
cache_set('jyy_yxwgz_genzong_num', $yxwgz_genzong_num, 'cache',time() + $expire);
}else if($diqu_arr==array('hd')){
//$_SESSION['hd_yxwgz_genzong_num'] = $yxwgz_genzong_num;
cache_set('hd_yxwgz_genzong_num', $yxwgz_genzong_num, 'cache',time() + $expire);
}else if($diqu_arr==array('zgy')){
//$_SESSION['zgy_yxwgz_genzong_num'] = $yxwgz_genzong_num;
cache_set('zgy_yxwgz_genzong_num', $yxwgz_genzong_num, 'cache',time() + $expire);
}
return $yxwgz_genzong_num;
}
function shipingzhongcustom_listkefu_views_exposed_form_submit(&$form, &$form_state) {
// $export = kprint_r($form,TRUE);
// print $export;
// $export = kprint_r($form_state,TRUE);
// print $export;
$default_value = date('Y-m').'-01 00:00:00';
$default_default_date = date('Y-m').'-01';
//如果 开始时间 上门开始时间 报名开始时间 定金开始时间 都为空的话 防止取出数据库里的全部数据 我们就 设开始时间的默认值为 当前月的1日.
// if(empty($form_state['values']['field_time_value']['value']) && empty($form_state['values']['field_shangmeng_time_value']['value']) &&
// empty($form_state['values']['field_baoming_time_value']['value']) && empty($form_state['values']['field_dingjing_time_value']['value'])){
// $form['field_time_value']['value']['#value']['date'] = $default_default_date;
// $form['field_time_value']['default_date']['#post']['field_time_value']['value']['date'] = $default_default_date;
// $form['field_time_value']['#post']['field_time_value']['value']['date'] = $default_default_date;
// }
//如果 开始时间 上门开始时间 报名开始时间 定金开始时间 都为空的话 防止取出数据库里的全部数据 我们就 设开始时间的默认值为 当前月的1日.
if(empty(trim($form_state['values']['field_time_value']['value'])) && empty(trim($form_state['values']['field_shangmeng_time_value']['value'])) &&
empty(trim($form_state['values']['field_baoming_time_value']['value'])) && empty(trim($form_state['values']['field_dingjing_time_value']['value']))){
$form_state['values']['field_time_value']['value'] = $default_value;
$form_state['values']['field_time_value']['default_date'] = $default_default_date;
// $filters = &$form_state['view']->display_handler->get_option('filters');
// $filters['field_time_value']['default_date'] = $default_default_date;
// $form_state['view']->display_handler->override_option('filters', $filters);
}
foreach (array('field', 'filter') as $type) {
$handlers = &$form_state['view']->$type;
// if($type=='filter'){
// $export = kprint_r($form_state['view']->filter['field_time_value'],TRUE);
// print $export;
// }
foreach ($handlers as $key => $info) {
$handlers[$key]->exposed_submit($form, $form_state);
}
}
$form_state['view']->exposed_data = $form_state['values'];
$form_state['view']->exposed_raw_input = array();
foreach ($form_state['values'] as $key => $value) {
if (!in_array($key, array('q', 'submit', 'form_build_id', 'form_id', 'form_token', ''))) {
$form_state['view']->exposed_raw_input[$key] = $value;
}
}
}
function _get_days_hdxgz()
{
return [0=>'0',1=>1,2=>2,3=>3,4=>4,5=>5];
}
function select_days_jyyxgz_form()
{
$days_arr = _get_days_hdxgz();
if($_GET['form_id'] == 'select_days_jyyxgz_form'){
$days = $_GET['days'];
}else{
$days=0;
}
$form['xgz'] = array('#type' => 'hidden', '#value' => 'jyyxgz');
$form['days'] = array('#type' => 'select', '#default_value' => $days,'#options'=>$days_arr,
'#attributes' => array('onchange' => 'this.form.submit();'));
$form['#attributes'] = array('class'=>'form-inline');
$form['#action'] = url('listkefu');
$form['#method'] = 'get';
return $form;
}
function select_days_hdxgz_form()
{
$days_arr = _get_days_hdxgz();
if($_GET['form_id'] == 'select_days_hdxgz_form'){
$days = $_GET['days'];
}else{
$days=0;
}
$form['xgz'] = array('#type' => 'hidden', '#value' => 'hdxgz');
$form['days'] = array('#type' => 'select', '#default_value' => $days,'#options'=>$days_arr,
'#attributes' => array('onchange' => 'this.form.submit();'));
$form['#attributes'] = array('class'=>'form-inline');
$form['#action'] = url('listkefu');
$form['#method'] = 'get';
return $form;
}