joinin.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * 物流自提服务站首页
  4. *
  5. ***/
  6. defined('InShopNC') or exit('Access Invalid!');
  7. class joininControl extends BaseAccountCenterControl{
  8. public function __construct(){
  9. parent::__construct();
  10. if (C('delivery_isuse') == 0) {
  11. showMessage('物流自提服务站功能未开启', 'index.php?act=login', '', 'error');
  12. }
  13. if ($_SESSION['delivery_login'] == 1) {
  14. @header('location: index.php?act=d_center');die;
  15. }
  16. }
  17. /**
  18. * 申请加入
  19. */
  20. public function indexOp() {
  21. Tpl::showpage('joinin');
  22. }
  23. /**
  24. * 保存申请
  25. */
  26. public function save_deliveryOp() {
  27. if (!chksubmit()) {
  28. showDialog(L('wrong_argument'));
  29. }
  30. $insert = array();
  31. $insert['dlyp_name'] = $_POST['dname'];
  32. $insert['dlyp_passwd'] = md5($_POST['dpasswd']);
  33. $insert['dlyp_truename'] = $_POST['dtruename'];
  34. $insert['dlyp_mobile'] = $_POST['dmobile'];
  35. $insert['dlyp_telephony'] = $_POST['dtelephony'];
  36. $insert['dlyp_address_name']= $_POST['daddressname'];
  37. $insert['dlyp_area_2'] = $_POST['area_id_2'];
  38. $insert['dlyp_area_3'] = $_POST['area_id'];
  39. $insert['dlyp_area_info'] = $_POST['area_info'];
  40. $insert['dlyp_address'] = $_POST['daddress'];
  41. $insert['dlyp_idcard'] = $_POST['didcard'];
  42. $insert['dlyp_addtime'] = time();
  43. $insert['dlyp_state'] = 10;
  44. $upload = new UploadFile();
  45. $upload->set('default_dir',ATTACH_DELIVERY);
  46. $result = $upload->upfile('didcardimg');
  47. if(!$result){
  48. showDialog($upload->error);
  49. }
  50. $insert['dlyp_idcard_image'] = $upload->file_name;
  51. $result = Model('delivery_point')->addDeliveryPoint($insert);
  52. if ($result) {
  53. showDialog('操作成功,等待管理员审核', 'index.php?act=login', 'succ');
  54. } else {
  55. showDialog(L('nc_common_op_fail'));
  56. }
  57. }
  58. /**
  59. * ajax验证用户名是否存在
  60. */
  61. public function checkOp() {
  62. $where = array();
  63. if ($_GET['dname'] != '') {
  64. $where['dlyp_name'] = $_GET['dname'];
  65. }
  66. if ($_GET['didcard'] != '') {
  67. $where['dlyp_idcard'] = $_GET['didcard'];
  68. }
  69. if ($_GET['dmobile'] != '') {
  70. $where['dlyp_mobile'] = $_GET['dmobile'];
  71. }
  72. $dp_info = Model('delivery_point')->getDeliveryPointInfo($where);
  73. if (empty($dp_info)) {
  74. echo 'true';die;
  75. } else {
  76. echo 'false';die;
  77. }
  78. }
  79. }