-
Notifications
You must be signed in to change notification settings - Fork 0
/
wxdumprelease.php
529 lines (509 loc) · 19.3 KB
/
wxdumprelease.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<!DOCTYPE html>
<?php
session_start();
include_once("system/model/db_fns.php"); //lj+
include_once('system/model/wood.php');
require_once('system/model/weixin.class.php');
$weixin = new class_weixin();
$signPackage = $weixin->GetSignPackage();
$portid=$_SESSION['portid'];
$phone=$_SESSION['phone'];
$username=$_SESSION['username'];
//error_log(date('Y-m-d H:i:s').'万里'."\n",3,$_SERVER['DOCUMENT_ROOT']."/log/run.log");
$wood= new wood($portid);
$wood->realrelease();
$stuff_array =$wood->stuff ;
$from_array =$wood->from;
?>
<html>
<head>
<meta http-equiv="Content-Type"content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<title>散货发布</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link rel="stylesheet" type="text/css" href="statics/css/yumleeM.css" />
<link rel="stylesheet" type="text/css" href="statics/css/mcr.css" />
<link rel="stylesheet" type="text/css" href="com/icomoon/style.css" />
<link rel="stylesheet" type="text/css" href="css/reminder.css" />
<link rel="stylesheet" type="text/css" href="css/upload.css" />
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
wx.config({
debug: false,
appId: '<?php echo $signPackage["appId"];?>',
timestamp: <?php echo $signPackage["timestamp"];?>,
nonceStr: '<?php echo $signPackage["nonceStr"];?>',
signature: '<?php echo $signPackage["signature"];?>',
jsApiList: [
/*
* 所有要调用的 API 都要加到这个列表中
* 这里以图像接口为例
*/
'chooseImage',
'uploadImage'
]
});
</script>
</head>
<body>
<header class="header">
<div><a href="javascript:history.back();"><i class="icon-arrow-back"></i></a></div>
<h1>散货发布</h1>
<div><a href="index.php"><i class="icon-home"></i></a></div>
</header>
<?php
//$dump_array=$wood->dumpposition; lj-
if(isset($_SESSION['user']) ){ //用户或管理员登录后才可以发表信息
$cdkey = $_GET["cdkey"];
$dump=array();
if($cdkey!="")
{
$isnew=0;
$sqlstr = "select userid,kindid,stuffid,productlen,diameterlen,wide,thinckness,"
."tolerance,widerange,thincknessrange,refcapacity,timber,"
."dry,newold,timbertype,knob,blue,worm,decay,climb,slash,ring,oil,black"
.",dumpposition,part,device,fromid,portid,publishtime,"
."updatetime,goodtype,cdkey,content,contact,contactphone from t_product where cdkey='".$cdkey."'";
$mydump = getdata($sqlstr);
if(!is_array($mydump))
{
echo "<p>对不起,没有查找到您要查找的内容!</p>";
return;
}
else
{
$dump =$mydump[0];
}
}
else
{
$isnew = 1;
$dump = array("refcapacity"=>"","refnum"=>"","refwight"=>"","contact"=>"","contactphone"=>"","diameterlen"=>"0","thinckness"=>"","price"=>"","wide"=>"","device"=>"","worm"=>"","decay"=>"","widerange"=>"","thincknessrange"=>"","xielie"=>"","huanlie"=>"","chouyou"=>"","heixin"=>"","content"=>"","display"=>"0","stuffid"=>"0","kindid"=>"0","productlen"=>"0","dumpposition"=>"0","timber"=>"0","timbertype"=>"0","tolerance"=>"-99","knob"=>"0","climb"=>"0","part"=>"0","dry"=>"0","newold"=>"0","blue"=>"0","slash"=>"0","oil"=>"0","black"=>"0","ring"=>"0","fromid"=>"0");
}
?>
<form class="onoff" id="submitform">
<ul class="list">
<li>
<ul class="upImg-display">
<li>
<input type="button" id="choose">
</li>
<li><a href="javascript:void(0);return false;" class="upload_delete" id="upload_delete"></a></li>
<li><a href="javascript:void(0);return false;" class="upload_delete" id="upload_delete"></a></li>
<li><a href="javascript:void(0);return false;" class="upload_delete" id="upload_delete"></a></li>
<li><a href="javascript:void(0);return false;" class="upload_delete" id="upload_delete"></a></li>
</ul>
</li>
<li class="flex">
<div>树种:</div>
<div>
<select name="stuffid" id="stuffid">
<option value="0">选树种</option>
<?php
if (!is_array($stuff_array)) {
echo "<p>No categories currently available</p>";
return;
}
foreach ($stuff_array as $row)
{
$stuffid = $row['stuffid'];
$stuffname = $row['stuffname'];
echo "<option value =".$stuffid." ".($stuffid==$dump['stuffid']?"selected=\"selected\"":"\"\"")." >".$stuffname."</option>";
}
?>
</select>
</div>
<?php
//$kind_array = array("原木","条子","口料","大方","大板","防腐材");
?>
<div>货种:</div>
<div>
<select name="typeOfGoods" id="kindid">
<option value="0">选货种</option>
<?php
$kind_array = $wood->kind; //货种 lja
// for($j=0;$j<count($kind_array);$j++) {
// echo "<option ".($dump['kindid'] == ($j+1)?"selected = 'selected'":"")." value =".($j+1).">".$kind_array[$j]."</option>";
//}
foreach($kind_array as $row) {
echo "<option ".($isnew?"":$dump['kindid'] == $row["kindid"]?"selected = 'selected'":"")." value =".$row["kindid"].">".$row["kindname"]."</option>";
}
?>
</select>
</div>
</li>
<li class="flex">
<?php $productlen_array = $wood->length; //货种 lja;?>
<div>长度(m):</div>
<div>
<select id="productlen" name="productlen">
<option value="0">选长度</option>
<?php
$len_array = $wood->length;
//foreach($len_array as $row)
foreach($len_array as $row)
{
echo "<option ".($dump["productlen"]==$row["lenid"]?"selected='selected'":"")." value = ".$row["lenid"].">".$row["lenname"]."</option>";
}
?>
</select>
</div>
<div>总货量(m³):</div><div><input type="tel" name="refcapacity" id="refcapacity" placeholder="立方米" value="<?php echo ($isnew==1 or $dump["refcapacity"]==0)?"":$dump["refcapacity"]; ?>"/></div>
</li>
<!--原木-->
<li class="flex op-1 hide">
<div>径级(φ):</div><div><input type="tel" placeholder="10~80" name="diameterlen" id="diameterlen" value="<?php echo ($isnew==1 or $dump["diameterlen"]==0)?"":$dump["diameterlen"]; ?>"/></div>
<div>材质:</div>
<div>
<select name="timberid" id ="timberid">
<option value="0">选材质</option>
<?php
$timber = $wood->timber;
foreach($timber as $row){
// for($j=0;$j<count($timber);$j++)
echo "<option ".($dump['timber'] == $row["timberid"]?"selected = 'selected'":"")." value =".$row["timberid"].">".$row["timbername"]."</option>";
}
?>
</select>
</div>
</li>
<li class="flex op-1 hide col1-3">
<div>纹理:</div>
<div>
<?php $timbertype_array = $wood->timbertype;?>
<select name="timbertypeid" id="timbertypeid">
<option value="0">选纹理</option>
<?php
//for($j=0;$j<count($timbertype_array);$j++)
foreach($timbertype_array as $row)
{
echo "<option ".($dump["timbertype"]== $row["timbertypeid"]?"selected = 'selected'":"")." value = ".$row["timbertypeid"].">".$row["timbertypename"]."</option>";
}
?>
</select>
</div>
</li>
<!--原木-->
<!--厚度-->
<li class="flex op-2 hide">
<div>厚度(mm):</div><div><input type="tel" placeholder="10~500" name="thinckness" id="thinckness" value="<?php echo ($isnew==1 or $dump["thinckness"]==0)?"":$dump["thinckness"];?>"/></div>
<div class="op-3 hide">厚度范围:</div>
<div class="op-3 hide">
<select name="thincknessrange" id="thincknessrange">
<option value="1" <?php echo $dump["thincknessrange"]==1?"selected = 'selected'":"";?>>固定值</option>
<option value="2" <?php echo $dump["thincknessrange"]==2?"selected = 'selected'":"";?>>起步值</option>
</select>
</div>
</li>
<li class="flex op-2 hide">
<div>宽度(mm):</div><div><input type="tel" placeholder="10~500" name="wide" id="wide" value="<?php echo ($isnew==1 or $dump["wide"]==0)?"":$dump["wide"];?>"/></div>
<div class="op-3 hide">宽度范围:</div>
<div class="op-3 hide">
<select name="widerange" id="widerange">
<option value="1" <?php echo $dump["widerange"]==1?"selected = 'selected'":"";?>>固定值</option>
<option value="2" <?php echo $dump["widerange"]==2?"selected = 'selected'":"";?>>起步值</option>
</select>
</div>
</li>
<!--厚度-->
<li class="flex col1-3"><div>货主:</div><div><input type="text" class="shipper" placeholder="货主姓名" name="contact" id="contact" value="<?php echo ($isnew==1 or $dump["contact"]=="0")?"":$dump["contact"]; ?>">
<button type="button" class="shipper_btn" id="shipper_btn">我是货主</button>
</div></li>
<li class="flex col1-3"><div>手机号:</div><div><input type="tel" name="contactphone" id="contactphone" value="<?php echo ($isnew==1 or $dump["contactphone"]==0)?"":$dump["contactphone"]; ?>"></div></li>
<li class="flex col1-3"><div>当前位置:</div><div><input type="text" placeholder="货物位置" name="dumpposition" id="dumpposition" value="<?php echo ($isnew==1 or $dump["dumpposition"]=="0")?"":$dump["dumpposition"]; ?>"/></div></li>
</ul>
<dl class="panel collapse">
<dt>详细信息<i class="icon-caret-down"></i></dt>
<dd>
<ul class="list">
<!--新增-->
<li class="flex op-2 hide">
<div>公差(mm):</div>
<div><!-- <input type="number" placeholder="-2~3" name="tolerance" id="tolerance"/> -->
<?php $tolerance_arr = $wood->tolerance;?>
<select name="tolerance" id="tolerance">
<option value=-99>选择公差</option>
<?php
//for($j=0;$j<count($tolerance_arr);$j++)
foreach($tolerance_arr as $row) {
echo "<option value=".$row["tolid"]." ".($dump["tolerance"]==$row["tolid"]?"selected = 'selected'":"").">".$row["tolname"]."</option>";
}
?>
</select>
</div>
<div>节巴:</div>
<div>
<?php $knodid_arr = $wood->knob;?>
<select name="knobid" id="knobid">
<option value="0">节巴 </option>
<?php
//for($j=0;$j<count($knodid_arr);$j++)
foreach($knodid_arr as $row)
{
echo "<option value=\"".$row["knobid"]."\" ".($dump["knob"]==$row["knobid"]?"selected = 'selected'":"").">".$row["knobname"]."</option>";
}
?>
</select>
</div>
</li>
<li class="flex op-2 hide">
<div>爬皮:</div>
<div>
<?php $climb_arr = $wood->climb; ?>
<select name="climbid" id="climbid">
<option value="0">爬皮</option>
<?php
foreach($climb_arr as $row)
{
echo "<option value=\"".$row["climbid"]."\" ".($dump["climb"]==$row["climbid"]?"selected = 'selected'":"").">".$row["climbname"]."</option>";
}
?>
</select>
</div>
<div>取材位置:</div>
<div>
<?php $partid_arr = $wood->part;?>
<select name="portid" id="part">
<option value="0">取材位置</option>
<?php
foreach($partid_arr as $row)
{
echo "<option value=\"".$row["positionid"]."\" ".($dump["part"]==$row["positionid"]?"selected = 'selected'":"").">".$row["positionname"]."</option>";
}
?>
</select>
</div>
</li>
<li class="flex op-2 hide">
<div>加工设备:</div>
<div>
<?php $device_arr = $wood->device;?>
<select name="deviceid" id="deviceid">
<option value="0">加工设备</option>
<?php
foreach($device_arr as $row) {
echo "<option value=\"".$row["deviceid"]."\" ".($dump["device"]==$row["deviceid"]?"selected = 'selected'":"").">".$row["devicename"]."</option>";
}
?>
</select>
</div>
<div class="op-4 hide">烘干:</div>
<div class="op-4 flex hide">
<input type="radio" name="honggan" value="是" id="hongganyes" <?php echo $dump["dry"]=="是"?"selected=\"selected\"":"";?>><label for="hongganyes">是</label>
<input type="radio" name="honggan" value="否" id="hongganno" <?php echo $dump["dry"]=="否"?"selected=\"selected\"":"";?>><label for="hongganno">否</label>
</div>
</li>
<!--新增-->
<li class="flex">
<div>新旧:</div>
<div>
<?php $newold_arr=$wood->newold;?>
<select name="newoldid" id="newoldid">
<option value="0">新旧</option>
<?php
foreach($newold_arr as $row){
echo "<option value=\"".$row["newoldid"]."\" ".($dump["newold"]==$row["newoldid"]?"selected = 'selected'":"").">".$row["newoldname"]."</option>";
}
?>
</select>
</div>
<div>蓝变:</div>
<div>
<?php $blue_arr= $wood->blue;?>
<select name="blueid" id="blueid">
<option value="0">蓝变</option>
<?php
foreach($blue_arr as $row){
echo "<option value=\"".$row["blueid"]."\" ".($dump["blue"]==$row["blueid"]?"selected = 'selected'":"").">".$row["bluename"]."</option>";
}
?>
</select>
</div>
</li>
<li class="flex">
<div>虫眼:</div>
<div>
<?php $worm_arr = $wood->worm;?>
<select name="wormid" id="wormid">
<option value="0">虫眼</option>
<?php
foreach($worm_arr as $row){
echo "<option value=\"".$row["wormid"]."\" ".($dump["worm"]==$row["wormid"]?"selected = 'selected'":"").">".$row["wormname"]."</option>";
}
?>
</select>
</div>
<div>腐朽:</div>
<div>
<?php $decay_arr = $wood->decay;?>
<select name="decayid" id="decayid">
<option value="0">腐朽</option>
<?php
foreach($decay_arr as $row) {
echo "<option value=\"".$row["decayid"]."\" ".($dump["decay"]==$row["decayid"]?"selected = 'selected'":"").">".$row["decayname"]."</option>";
}
?>
</select>
</div>
</li>
<li class="flex">
<div>斜裂:</div>
<div class="flex">
<input type="radio" name="xielie" value="有" id="xielieyes" <?php echo $dump["slash"]=="有"?"checked":"";?>><label for="xielieyes">有</label>
<input type="radio" name="xielie" value="无" id="xielieno" <?php echo $dump["slash"]=="无"?"checked":"";?>><label for="xielieno">无</label>
</div>
<div>环裂:</div>
<div class="flex">
<input type="radio" name="huanlie" value="有" id="huanlieyes" <?php echo $dump["ring"]=="有"?"checked":"";?>><label for="huanlieyes">有</label>
<input type="radio" name="huanlie" value="无" id="huanlieno" <?php echo $dump["ring"]=="无"?"checked":"";?>><label for="huanlieno">无</label>
</div>
</li>
<li class="flex">
<div>抽油:</div>
<div class="flex">
<input type="radio" name="chouyou" value="有" id="chouyouyes" <?php echo $dump["oil"]=="有"?"checked":"";?>><label for="chouyouyes">有</label>
<input type="radio" name="chouyou" value="无" id="chouyouno" <?php echo $dump["oil"]=="无"?"checked":"";?>><label for="chouyouno">无</label>
</div>
<div>黑心:</div>
<div class="flex">
<input type="radio" name="heixin" value="有" id="heixinyes" <?php echo $dump["black"]=="有"?"checked":"";?>><label for="heixinyes">有</label>
<input type="radio" name="heixin" value="无" id="heixinno" <?php echo $dump["black"]=="无"?"checked":"";?>><label for="heixinno">无</label>
</div>
</li>
<li class="flex col1-3 hide">
<div>产地:</div>
<div>
<select name="fromid" id="fromid">
<option value="0">产地</option>
<?php
if (!is_array($from_array)) {
echo "<p>No categories currently available</p>";
return;
}
foreach ($from_array as $row)
{
$fromid = $row['fromid'];
$fromname = $row['fromname'];
echo "<option value =".$fromid." ".($dump["fromid"]==$fromid?"selected=\"selected\"":"").">".$fromname."</option>";
}
?>
</select>
</div>
</li>
</ul>
</dd>
</dl>
<ul class="list">
<li style="font-weight:bold;">具体描述</li>
<li><textarea class="fullCol" rows="6" id="content" name="content" ><?php echo ($isnew==1 or $dump["content"]=="0")?"":$dump["content"];?></textarea></li>
</ul>
<input class="btnFixed" type="button" value="发布" id="sendmessage" />
<input type="hidden" name="cdkey" id="cdkey" value = <?php echo "\"".$cdkey."\""; ?>/>
</form>
<?php
}else{
echo "<script>window.location.href='signIn.php?type=2';</script>";
}
?>
</body>
<script src="http://libs.baidu.com/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="js/reminder.js"></script>
<script src="statics/js/config.js"></script>
<script type="text/javascript" src="lib/mobileFix.mini.js?v=ad62f13"></script>
<script type="text/javascript" src="lib/exif.js?v=0da8553"></script>
<script type="text/javascript" src="lrz.js?v=0589040"></script>
<script type="text/javascript" src="js/wxdumprelease.js"></script>
<script>
collapse();
fliter();
</script>
<script type="text/javascript">
$(function(){
uploadImg();
deleteImg();
// kindidChange();
/*我是货主*/
$("#shipper_btn").on("click",function(){
var $username = "<?php echo $username; ?>";
var $phone = "<?php echo $phone; ?>";
$("#contact").val($username);
$("#contactphone").val($phone);
})
})
/*动态给上传的四张图片赋宽和高*/
function uploadImg(){
var $img_width = $(".list li .upImg-display li").width();
$(".list li .upImg-display li").css({"width":$img_width,"height":$img_width});
$(".list li .upImg-display li .upImg").css({"width":$img_width,"height":$img_width});
$("#upload_img").css({"width":$img_width,"height":$img_width});
$(".list li .upImg-display li .images").css({"width":$img_width,"height":$img_width});
}
/*删除上传的图片*/
function deleteImg(){
$(".list li .upImg-display li").find(".upload_delete").click(function(){
$(this).siblings(".images").remove();
$(this).hide();
});
}
// function kindidChange(){
// var n = $("#kindid").val();
// switch(n){
// case '0':
// $(".op-1").addClass('hide');
// $(".op-2").addClass('hide');
// $(".op-3").addClass('hide');
// $(".op-4").addClass('hide');
// break;
// case '1':
// $(".op-1").removeClass('hide');
// $(".op-2").addClass('hide');
// $(".op-3").addClass('hide');
// $(".op-4").addClass('hide');
// break;
// case '2':
// $(".op-1").addClass('hide');
// $(".op-2").removeClass('hide');
// $(".op-3").addClass('hide');
// $(".op-4").addClass('hide');
// break;
// case '3':
// $(".op-1").addClass('hide');
// $(".op-2").removeClass('hide');
// $(".op-3").addClass('hide');
// $(".op-4").removeClass('hide');
// break;
// case '4':
// $(".op-1").addClass('hide');
// $(".op-2").removeClass('hide');
// $(".op-3").removeClass('hide');
// $(".op-4").removeClass('hide');
// break;
// case '5':
// $(".op-1").addClass('hide');
// $(".op-2").removeClass('hide');
// $(".op-3").removeClass('hide');
// $(".op-4").removeClass('hide');
// break;
// case '6':
// $(".op-1").addClass('hide');
// $(".op-2").removeClass('hide');
// $(".op-3").addClass('hide');
// $(".op-4").removeClass('hide');
// break;
// }
// }
//ios fixed修复
$('input').focus(function (){
$('.header').css('position','relative');
$('.btnFixed').css('position','relative');
$('body').css('padding','0');
})
$('input').blur(function(){
$('.header').css('position','relative');
$('.btnFixed').css('position','relative');
})
</script>
</html>