function actionDeliveryDetailList() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('request', 'controller:string,action:string'); $this->_model =& FLEA::getSingleton('model_rep'); //出货表 $rep = $this->_model->find(array('ID' => $request['kcreport'], 'ID' => $request['actionDeliveryDetailList'])); if ($rep) { $this->_model =& FLEA::getSingleton('model_grid'); //表字段 $grid = $this->_model->findAll(array('RepID' => $rep['ID'])); //设置查询语句 $dbo =& FLEA::getDBO(); $this->sql = $rep['select FCustomerCode,FCustomerName,FDate,FSODate from v_delivery']; //查询条件-按日期查询 ///此处可修改>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $cond = new class_conditions(); $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d"); $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d"); $FCustomer = isset($request['FCustomer']) ? trim($this->u2gbk($request['FCustomer'])) : null; $cond->between($formdate, $todate, 'FDate', 'D', 2); $cond->equal($FCustomer, 'FCustomerCode', 'S', ' and '); ///此处可修改<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //排序 $order = new class_order($request); //获取当前页 $page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1; $page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20; echo $this->sql; //获取SQL查询的全部记录 $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder()); //获取SQL查询的记录总数 $page['count'] = count($alldata); //$allFProfit =$this->_count($alldata,'FProfit'); //$allFSaleAmount =$this->_count($alldata,'FSaleAmount'); //记录偏移量 $page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size']; $data = array_slice($alldata, $page['offset'], $page['size'], true); //处理查询结果 if (isset($data)) { ///此处可修改>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $this->_smarty->assign('formdate', $formdate); $this->_smarty->assign('todate', $todate); $this->_smarty->assign('FCustomer', $FCustomer); ///此处可修改<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $this->_smarty->assign('orderField', $order->getField()); $this->_smarty->assign('orderDirection', $order->getDirection()); $this->_smarty->assign('page', $page); $this->_smarty->assign('data', $data); $this->_smarty->assign('grid', $grid); $this->_smarty->assign('alldata', $alldata); $this->_smarty->assign('allFProfit', $allFProfit); $this->_smarty->assign('allFSaleAmount', $allFSaleAmount); $this->_smarty->display('kc.DeliveryDetailList.htm'); } } else { $this->_smarty->display('norepinfo.htm'); } }
function actionDeliveryDetail() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('get', 'controller:string,action:string'); //设置查询语句 $dbo =& FLEA::getDBO(); $this->sql = 'select FCustomerCode,FCustomerName,FDate,FAmount,FAllAmount from v_delivery'; //查询条件-按日期查询 $cond = new class_conditions(); $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d"); $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d"); $FCustomer = isset($request['FCustomer']) ? trim(rawurldecode($request['FCustomer'])) : null; $cond->equal($FCustomer, 'FCustomerCode', 'S', ' and '); $cond->between($formdate, $todate, 'fdate', 'D', 2); //排序 $order = new class_order($request); //获取SQL查询的全部记录 $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder()); $xls = new class_excel(); $xls->addArray($this->gethead($alldata)); $xls->addArray($this->getdata($alldata)); $xls->addArray($this->getfoot($alldata)); $xls->generateXML("DeliveryDetail"); }
function actionFCustomer() { $using = new class_using(); $request = $using->safeUsing('get', 'controller:string,action:string'); $cond = new class_conditions(); $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d"); $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d"); $cond->between($formdate, $todate, 'fdate', 'D', 2); $dbo =& FLEA::getDBO(); $sql = 'select fcustomercode,fcustomername from v_delivery' . $cond->getWhere() . ' order by fcustomercode'; $data = $dbo->getAll($sql); $this->_smarty->assign('data', $data); $this->_smarty->display('FCustomer.htm'); }
function actionflddelete() { $rbac =& FLEA::getSingleton('FLEA_Rbac'); $SE = $rbac->getUser(); if (!$SE) { $this->writeAjax('300', '你无权执行此操作!', '', '', ''); } $using = new class_using(); $request = $using->safeUsing('get', 'ID:int'); if (!isset($request['ID'])) { $this->writeAjax('300', '信息不完整', '', '', ''); } else { $ID = (int) $request['ID']; $this->_model =& FLEA::getSingleton('model_grid'); if ($this->_model->removeByPkv($ID)) { $this->writeAjax('200', '删除成功!', '', '', ''); } else { $this->writeAjax('300', '删除失败!', '', '', ''); } } }
function actionReceivable() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('post', 'controller:string,action:string'); //设置查询语句 $dbo =& FLEA::getDBO(); $this->sql = 'select * from v_pay'; //查询条件-按日期查询 $cond = new class_conditions(); $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d"); $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d"); //$cond->between($formdate,$todate,'fdate','D',2); //$cond->equal($FCustomercode,'FCustomercode','S',' and '); //排序 $order = new class_order($request); //获取当前页 $page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1; $page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20; //获取SQL查询的全部记录 $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder()); //获取SQL查询的记录总数 $page['count'] = count($alldata); //记录偏移量 $page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size']; $data = array_slice($alldata, $page['offset'], $page['size'], true); //处理查询结果 if (isset($data)) { $this->_smarty->assign('formdate', $formdate); $this->_smarty->assign('todate', $todate); $this->_smarty->assign('orderField', $order->getField()); $this->_smarty->assign('orderDirection', $order->getDirection()); $this->_smarty->assign('page', $page); $this->_smarty->assign('data', $data); $this->_smarty->assign('alldata', $alldata); $this->_smarty->display('repsale.Receivable.htm'); } }
function actionuserImport() { $rbac =& FLEA::getSingleton('FLEA_Rbac'); $SE = $rbac->getUser(); if (!$SE) { $this->writeAjax('300', '你无权执行此操作!', '', '', ''); } $using = new class_using(); $request = $using->safeUsing('post', 'UserID:string'); $dbo =& FLEA::getDBO(); $data = $dbo->getAll('select t_user.FName AS Username,password=1,IsSuperUser=0,t_user.FName as DisplayName from t_user where t_user.FName not in(select srep_user.Username as FName from srep_user) and t_user.FUserID > 16000 and t_user.FName<>' . "''"); $this->_model =& FLEA::getSingleton('model_user'); $this->_model->saveRowset($data); if (isset($data)) { $this->_smarty->assign('users', $data); $this->_smarty->display('userimport.htm'); } }
function actionDeliveryDetail() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('get', 'controller:string,action:string'); //设置查询语句 $dbo =& FLEA::getDBO(); $this->sql = 'select FCustomerType,sum(FSaleAmountIncludeTax) as FSaleAmountIncludeTax ,sum(FSaleAmount) as FSaleAmount,sum(FAmount) as FAmount,sum(FProfit) as FProfit,case when sum(FSaleAmount) = 0 then 0 else sum(FProfit)/sum(FSaleAmount) end FProfitRate from v_salesdetail'; //查询条件-按日期查询 $cond = new class_conditions(); $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d"); $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d"); $FCustomerType = isset($request['FCustomerType']) ? trim(rawurldecode($request['FCustomerType'])) : null; $cond->between($formdate, $todate, 'fdate', 'D', 2); $cond->equal($FCustomerType, 'FCustomerType', 'S', ' and '); //排序 $order = new class_order($request); //获取SQL查询的全部记录 $alldata = $dbo->getAll($this->sql . $cond->getWhere() . ' group by FCustomerType ' . $order->getOrder()); $xls = new class_excel(); $xls->addArray($this->gethead($alldata)); $xls->addArray($this->getdata($alldata)); $xls->addArray($this->getfoot($alldata)); $xls->generateXML("DeliveryDetail"); }
function actionrepsaleCombine() { //过滤语句 $using = new class_using(); $request = $using->safeUsing('post', 'controller:string,action:string'); //设置查询语句 $dbo =& FLEA::getDBO(); //查询条件-按日期查询 $cond = new class_conditions(); $formdate = isset($request['formdate']) ? $request['formdate'] : date("Y-m-d"); $todate = isset($request['todate']) ? $request['todate'] : date("Y-m-d"); $FA = isset($request['FA']) && !empty($request['FA']) ? trim($this->u2gbk($request['FA'])) : ''; $FB = isset($request['FB']) && !empty($request['FB']) ? trim($this->u2gbk($request['FB'])) : ''; $FB = $FA == $FB ? '' : $FB; $_FA = $FA == '' ? '' : $FA . ','; $_FB = $FB == '' ? '' : $FB . ','; $cond->between($formdate, $todate, 'fdate', 'D', 2); $this->sql = 'select ' . $_FA . $_FB . 'sum(FSaleAmountIncludeTax) as FSaleAmountIncludeTax ,sum(FSaleAmount) as FSaleAmount,sum(FAmount) as FAmount,sum(FProfit) as FProfit,case when sum(FSaleAmount) = 0 then 0 else sum(FProfit)/sum(FSaleAmount) end FProfitRate from v_salesdetail'; //排序 $order = new class_order($request); //获取当前页 $page['cid'] = isset($request['pageNum']) && intval($request['pageNum']) > 0 ? intval($request['pageNum']) : 1; $page['size'] = isset($request['numPerPage']) && intval($request['numPerPage']) > 0 ? intval($request['numPerPage']) : 20; if (trim($_FA . $_FB, ',') == '') { $alldata = $dbo->getAll($this->sql . $cond->getWhere() . $order->getOrder()); } else { $alldata = $dbo->getAll($this->sql . $cond->getWhere() . ' group by ' . trim($_FA . $_FB, ',') . $order->getOrder()); } //获取SQL查询的记录总数 $page['count'] = count($alldata); $allFProfit = $this->_count($alldata, 'FProfit'); $allFSaleAmount = $this->_count($alldata, 'FSaleAmount'); //记录偏移量 $page['offset'] = ($page['cid'] - 1) * $page['size'] > $page['count'] ? $page['count'] : ($page['cid'] - 1) * $page['size']; $data = array_slice($alldata, $page['offset'], $page['size'], true); //处理查询结果 if (isset($data)) { $this->_smarty->assign('formdate', $formdate); $this->_smarty->assign('todate', $todate); $this->_smarty->assign('FA', $FA); $this->_smarty->assign('FB', $FB); $this->_smarty->assign('orderField', $order->getField()); $this->_smarty->assign('orderDirection', $order->getDirection()); $this->_smarty->assign('page', $page); $this->_smarty->assign('data', $data); $this->_smarty->assign('alldata', $alldata); $this->_smarty->assign('allFProfit', $allFProfit); $this->_smarty->assign('allFSaleAmount', $allFSaleAmount); $this->_smarty->display('repsale.Combine.htm'); } }