A few days ago, I basically finished the backend of HotNet, and I took some time to summarize the work.
In terms of design mode, I tried to use the mvc mode of development. Use smarty to control the display, use case statements to control various actions, and then write classes of various modules for action calls. This does provide better control over the code. For example, if you write the getAllMsg() function in class.message.php, then this function can be called by many actions. Then add the paging class. It is quite flexible in data processing.
Copy the code The code is as follows:
$db=new Db;
$sql="select * from com_info,hr_info where hr_info.ci_id=com_info.id and {$cate} like '%{$content} %'";
$totalArr=$db->execute($sql);
$url="hr.php?op=searchHrInfoAction&cate={$cate}&c
$totalItems=count($totalArr);
$currentPageNumber =(isset($_GET['page']))?$_GET['page']:1;
$pageNav=new PageNumber($currentPageNumber,$totalItems,3,3,$url);
$currentPageRs=$ pageNav->getRsPerPage(&$totalArr);
$pageNavigation=$pageNav->getPageNumber();
$smarty->assign("pageNavigation",$pageNavigation);
$smarty->assign("hr ",$currentPageRs);
$smarty->display("hr_get.htm");
The above introduces the PHP development model of smartprinter virtual printer smarty+adodb+ some custom classes, including the content of smartprinter virtual printer. I hope it will be helpful to friends who are interested in PHP tutorials.