-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrateSol.php
183 lines (170 loc) · 6.57 KB
/
rateSol.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
<?php require_once('DataAccess.php');
require_once('includes/functions.php');
$pid=$_GET['id'];
?>
<html>
<head>
<style>
.smallBox{
width:auto;
height: auto;
float:left;
}
#wrapper {
width: 90%;
max-width: 1366px;
min-width: 800px;
margin: 50px auto;
}
#columns {
-webkit-column-count: 4;
-webkit-column-gap: 10px;
-webkit-column-fill: auto;
-moz-column-count: 3;
-moz-column-gap: 10px;
-moz-column-fill: auto;
column-count: 3;
column-gap: 15px;
column-fill: auto;
}
.pin {
display: inline-block;
background: #FEFEFE;
border: 2px solid #FAFAFA;
box-shadow: 0 1px 2px rgba(34, 25, 25, 0.4);
margin: 0 2px 15px;
-webkit-column-break-inside: avoid;
-moz-column-break-inside: avoid;
column-break-inside: avoid;
padding: 15px;
padding-bottom: 5px;
background: -webkit-linear-gradient(45deg, #FFF, #F9F9F9);
opacity: 0.8;
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
transition: all .5s ease;
}
.pin:hover {
background: -webkit-linear-gradient(45deg, #FFF, #F9F9F9);
opacity: 1;
}
</style>
<script src="jquery-1.7.1.min.js"></script>
<link href="stylesheets/style.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div id="container" style="background: white;">
<div id="topbar" style="width: 100%;">
<ul>
<a style="color: black;" href="index.php"><li> মানচিত্রে খুঁজুন</li></a>
<a style="color: black;" href="problem-list.php"><li> সমস্যা গুলো</li></a>
</ul>
</div>
<div id="solution">
<div id="fade">
<div id="solution-form">
<table style="color:white;">
<tr>
<td>Name</td>
<td><input style="width: 300px" id="nameS" type="text" name="name" /></td>
</tr>
<tr>
<td>Description</td>
<td><textarea id="descS" style="width: 300px; height: 60px; max-width: 300px; max-height: 60px;" name="desc"> </textarea></td>
</tr>
<tr>
<td>Cost</td>
<td><input id="cost" style="width: 300px;" type="text" name="cost" /></td>
</tr>
<tr>
<td>Man Power</td>
<td><input id="man" style="width: 300px;" type="text" name="man" /></td>
</tr>
<tr>
<td>Duration (Days)</td>
<td><input id="duration" style="width: 300px;" type="text" name="duration" /></td>
<input type="hidden" id="pid" />
</tr>
</table>
<div style="margin-left: 220px">
<button id="submit">Submit</button>
</div>
</div>
</div>
</div>
<div id="wrapper" >
<div id="coloumns" >
<?php
$result=getItems(10,"solutions",$pid);
while($row=mysql_fetch_array($result)){
?>
<div class="pin">
<div class="problemName"><?php echo $row['name']; ?></div>
<div class="problemDesc"><?php echo $row['description']; ?></div>
<div class="problemRating"><?php echo $row['rating']; ?></div>
<select id="stars_<?php echo $row['id']; ?>" name="stars">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select> <br/>
<button id="rate" onclick="rateIt('<?php echo $row['id']; ?>')">Rate This Solution</button>
</div>
<?php
}
?>
</div>
</div>
</div>
<script>
var iframe=false;
function rateIt(id){
var table="solutions";
var star=$("#stars_"+id).val();
$.post('photoservice.php',{id:id,table:table,star:star},function(data){
alert(data);
$("#solution").fadeOut();
iframe=false;
});
};
function sol(id){
$("#solution").fadeIn(function(){
iframe=true;
$("#pid").val(id);
});
}
$(document).ready(function(){
$("#submit").click(function(){
var name=$("#nameS").val();
var desc=$("#descS").val();
var cost=$("#cost").val();
var man=$("#man").val();
var pid=$("#pid").val();
var duration=$("#duration").val();
$.post('saveSolution.php',{name:name,description:desc,cost:cost, man:man, pid:pid, duration:duration},function(data){
alert(data);
});
});
$(document).keyup(function(e) {
if (e.keyCode == 27) { // esc keycode
$('#solution').fadeOut();
iframe=false;
}
});
$("body").click(function(){
if(iframe) {
$("#solution").fadeOut();
iframe=false;
}
});
// Prevent events from getting pass .popup
$("#solution-form").click(function(e){
e.stopPropagation();
});
});
</script>
</body>
</html>