-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard_tasker.php
1060 lines (452 loc) · 27.1 KB
/
dashboard_tasker.php
1
<?php// top part of pageinclude_once "include/header.php";// end top partheader("Content-Type: text/html; charset=Windows-1256\n");include_once "include/classes/class.paging.php";$Paging = new Paging();// getting aboutme,linkedin detail from database, so that can show the message on first bid$select_linkedin = mysql_fetch_array(mysql_query("SELECT linkedin,about_me FROM members WHERE id=" . $_SESSION['userid']));if ($select_linkedin['linkedin'] == '' || $select_linkedin['about_me'] == '') { $checkSts = mysql_num_rows(mysql_query("SELECT * FROM sts_check where user_id=" . $_SESSION['userid'] . " AND type='0'")); if ($checkSts <= 0) { $value_bid = 1; }}//end linkedin, about me?><script> // function for first bid if linkedin detail or about me is missing var sts_bid = 0; function bid(id_bid, confirm_msg) { var r = false; if (confirm_msg == 2) { $.ajax({ url: 'ajax/commonAjax.php', type: 'POST', data: 'action=bid_start&taskid=' + id_bid, success: function (msg) { if (msg == 'error1') { $("#bid" + id_bid).hide(); alert("Sorry this task has been deleted"); return false; } else if (msg == 1) { jQuery.noConflict();$('#myModal').modal('show'); } else if(msg == 2){ $('#bid-slide' + id_bid).slideDown('slow'); } } }); } $('#paid').click(function () { var name = $("#name").val(); //var email = $("#email").val(); //var taxid = $("#tax-id").val(); var routing = $("#routing").val(); var account_number = $("#account_number").val(); if (name == '') { $("#errordiv").html('<span style="color:red;"> Please Enter Name.. Name must contain First name and Last name </span>'); } else if (routing == '') { $("#errordiv").html('<span style="color:red;"> Please Enter Routing Number </span>'); } else if (account_number == '') { $("#errordiv").html('<span style="color:red;"> Please Enter Account Number </span>'); } else { var data = $("#paidform").serialize(); $.post("bankacc1.php", data, function (response) { //alert(response); if (response == 'success') { window.location.reload(); } else { $("#errordiv").html(response); } }); } }); if (confirm_msg == 1 && sts_bid == 0) { $.ajax({ url: 'ajax/commonAjax.php', type: 'POST', data: 'action=bid_sts', success: function (msg) { } }); sts_bid = 1; var width = $(window).innerWidth(); var height = $("html").height(); $("#popUp").css({"width": width, "height": height}).show(); $("#popUp-message_bid_first").show(); // var r = confirm("You will be more likely to get the job if you have your profile completed."); } else { // $('#bid-slide' + id_bid).slideDown('slow'); } }</script><!-- /.row --> <!-- Project One --><!--- pop up ------> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Bank Details</h4> </div> <form role="form" method="post" id="paidform" class="form-horizontal"> <div class="modal-body"> <div style="width: 100%; text-align: center; padding: 10px; float: left;" id="errordiv"></div> <div class="form-group"> <label class="col-lg-5 control-label">Name</label> <div class="col-lg-5"> <input type="text" id="name" class="form-control" name="name" autocomplete="off" placeholder="John Doe" /> </div> </div> <!-- <div class="form-group"> <label class="col-lg-5 control-label">Email Id</label> <div class="col-lg-5"> <input type="email" id="email" class="form-control" name="email" autocomplete="off" placeholder="John @gmail.com" /> </div> </div> <div class="form-group"> <label class="col-lg-5 control-label">Type</label> <div class="col-lg-5"> <select name="type" class="form-control"> <option value="individual"> Individual </option> <option value="corporation"> Corporation </option> </select> </div> </div> <div class="form-group"> <label class="col-lg-5 control-label">Tax-Id</label> <div class="col-lg-5"> <input type="text" id="tax-id" class="form-control" name="tax-id" autocomplete="off" placeholder="000000000" /> </div> </div> <div class="modal-header"> <h4 class="modal-title">Add Bank Account Detail</h4> </div> <div style="clear:both"> </div> --> <div class="form-group"> <label class="col-lg-5 control-label">Bank Country</label> <div class="col-lg-5"> <select class="field" name="bank_country" disabled="disabled"> <option value="US">United States</option> </select> </div> </div> <div class="form-group"> <label class="col-lg-5 control-label">Routing Number</label> <div class="col-lg-5"> <input type="text" id="routing" class="form-control" name="routing_number" autocomplete="off" placeholder="110000000" maxlength="9" /> </div> </div> <div class="form-group"> <label class="col-lg-5 control-label">Account Number</label> <div class="col-lg-5"> <input type="text" id="account_number" name="account_number" class="form-control" autocomplete="off" placeholder="000123456789" maxlength="34" size="34" /> </div> </div> <input type="hidden" value="<?php echo $_SESSION['userid']; ?>" name="userid"> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <input name="Submit" id="paid" type="button" value="Encrypted and Save" class="btn btn-primary"/> </div> </form> </div> </div> </div><!---- end popup --------><div id="popUp-message_bid_first" style="width: 50%; position: absolute; top: 25%; left: 25%; z-index: 4; background: none repeat scroll 0% 0% rgb(255, 255, 255);padding:20px;display:none;"> <div style="font-size:20px;line-height:40px;margin-bottom:10px;">You are more likely to get the job if you have your profile completed in the Account.</div> <ul class="nav navbar-nav" style="margin:0 !important"><li><a href="profile-edit">Update the profile</a></li></ul><ul class="nav navbar-nav" style="margin: 0px !important; margin-left:12px !important;"><li><a href="javascript:void(0);" onclick="$('#popUp-message_bid_first').hide(); $('#popUp').hide();">Continue to bid</a></li></ul></div><div class="row" id="con1"> <div class="col-md-12"> <div class="col-xs-8" style=""> <form action="" method="get" id="form-search" onsubmit="if ($('#search').val() == '' && $('#type').val() == '') return false;"> <ul class="confst"> <li><input class="sea" type="text" style="background: #fff url(images/src.png) no-repeat;border: 0px none; width: 176px;background-size:176px;border:1px solid #aaa; float: left; height: 28px;padding-left:28px;" id="search" placeholder="search" name="search" value="<?= $_GET['search']; ?>"></li> <li><select name="type" style="height:28px;float:left;" id="type"><option value=''>Type</option><option value='all' <?php if ($_GET['type'] == 'all') echo "selected"; ?>>All</option><option value="transportation" <?php if ($_GET['type'] == 'transportation') echo "selected"; ?>>Transportation</option><option value="movinghelp" <?php if ($_GET['type'] == 'movinghelp') echo "selected"; ?>>Moving Help</option><option value="handy man">Handy Man</option><option value="tutoring" <?php if ($_GET['type'] == 'tutoring') echo "selected"; ?>>Tutoring</option><option value="general" <?php if ($_GET['type'] == 'general') echo "selected"; ?>>General</option></select></li> <li><input type="submit" value="Search" class="sechyi" style="border:0;margin-top:-7px;padding:5px 15px"></li> <li><input type="button" value="Refresh" class="sechyi" style="border:0;margin-top:-7px;padding:5px 15px" onclick="window.location = '/dashboard_tasker'"></li> </ul> </form> <hr class="clr"> <?php // code for getting requests details from database, so that user can bid on tasks if (isset($_GET['search']) AND ( $_GET['type'] == '' || $_GET['type'] == 'all')) { $search = ' AND (a.taskname like "%' . $_GET['search'] . '%" || a.taskdescription like "%' . $_GET['search'] . '%" || a.taskname like "%' . $_GET['search'] . '%" || a.taskto like "%' . $_GET['search'] . '%" || a.taskfrom like "%' . $_GET['search'] . '%" || a.taskdate like "%' . $_GET['search'] . '%" || a.taskduration like "%' . $_GET['search'] . '%")'; } else if (isset($_GET['type']) AND $_GET['search'] == '') { $search = ' AND a.tasktype = "' . $_GET['type'] . '"'; } else if (isset($_GET['type']) AND isset($_GET['search'])) { $search = ' AND a.taskname like "%' . $_GET['search'] . '%" AND a.tasktype = "' . $_GET['type'] . '"'; } $html = '';// $getTopListQry = "SELECT * FROM (SELECT DATE_FORMAT(a.taskdate, '%d-%M-%Y') DATEONLY, DATE_FORMAT(a.taskdate,'%h:%I %p') TIMEONLY,a.id,a.taskto,a.taskfrom,a.taskname,a.taskdate,a.taskduration,a.taskdescription,a.tasklocation,a.userid,a.tasktype,people,a.other,a.taskmulti // FROM tasks as a LEFT JOIN bids as b ON a.id=b.task_id // LEFT JOIN members c ON a.userid=c.id// WHERE (a.status='1' or a.status ='2')".$search." AND c.university_id='".$_SESSION['university']."' group by a.id order by a.id DESC) as t WHERE NOT EXISTS (SELECT * FROM bids a WHERE a.task_id=t.id AND a.tasker_id=".$_SESSION['userid'].")"; $getTopListQry = "SELECT * FROM (SELECT DATE_FORMAT(a.taskdate, '%d-%M-%Y') DATEONLY, DATE_FORMAT(a.taskdate,'%h:%I %p') TIMEONLY,a.id,a.taskto,a.taskfrom,a.taskname,a.taskdate,a.taskduration,a.taskdescription,a.tasklocation,a.userid,a.tasktype,people,a.other,a.taskmulti FROM tasks as a LEFT JOIN bids as b ON a.id=b.task_id LEFT JOIN members c ON a.userid=c.id WHERE (CASE WHEN taskmulti>'0' THEN (a.status='1') else a.status='1' end) " . $search . " AND c.university_id='" . $_SESSION['university'] . "' group by a.id order by a.id DESC) as t WHERE NOT EXISTS (SELECT * FROM bids a WHERE a.task_id=t.id AND a.tasker_id=" . $_SESSION['userid'] . ")"; /* $getTopListQry ="SELECT * FROM (SELECT DATE_FORMAT(a.taskdate, '%d-%M-%Y') DATEONLY, DATE_FORMAT(a.taskdate,'%h:%I %p') TIMEONLY,a.id,a.taskto,a.taskfrom,a.taskname,a.taskdate,a.taskduration,a.taskdescription,a.tasklocation,a.userid,a.tasktype,people,a.other,a.taskmulti FROM tasks as a LEFT JOIN bids as b ON a.id=b.task_id LEFT JOIN members c ON a.userid=c.id WHERE (a.status='1' or a.status ='2')".$search." group by a.id order by a.id DESC) as t WHERE NOT EXISTS (SELECT * FROM bids a WHERE a.task_id=t.id AND a.tasker_id=".$_SESSION['userid'].")"; */ /* SELECT * FROM (SELECT DATE_FORMAT(a.taskdate, '%d-%M-%Y') DATEONLY, DATE_FORMAT(a.taskdate,'%h:%I %p') TIMEONLY,a.id,a.taskto,a.taskfrom,a.taskname,a.taskdate,a.taskduration,a.taskdescription,a.tasklocation,a.userid,a.tasktype,people,a.other,a.taskmulti FROM tasks as a LEFT JOIN bids as b ON a.id=b.task_id LEFT JOIN members c ON a.userid=c.id WHERE (a.status='1' or a.status ='2') group by a.id order by a.id DESC) as t WHERE NOT EXISTS (SELECT * FROM bids a WHERE a.task_id=t.id AND a.tasker_id=22)and t.id NOT IN(SELECT bid_id FROM satisfiedstatus s WHERE s.bid_id=t.id ) */ $PageNo = isset($_GET['page']) ? $_GET['page'] : 1; $file = rtrim($_SERVER[REQUEST_URI], "/" . $PageNo); $type = $_GET['type']; $pagingStr = '&tagName=' . $_GET['tagName']; /* if(!isset($_SESSION['userid']) || $_SESSION['userid']==""){ $objForum->objPaging->chkPageNo($PageNo, $getTopListQry, 5, 5,$file, "", "STATIC_PAGING"); }else{ */ $Paging->chkPageNo($PageNo, $getTopListQry, 7, 5, "ajax/bids.php?page", "", "showTopId"); $taskTotal = 0; $getRecentQry = $Paging->showRecord($getTopListQry); if (mysql_num_rows($getRecentQry) > 0) { $tasktype = ucwords($row['tasktype']); $tasktype = $tasktype == 'Handyman' ? 'Handy Man' : $tasktype; $html .= '<div id="showTopId">'; while ($row = mysql_fetch_array($getRecentQry)) { $taskmulti = $row['taskmulti'] == '1' ? 'Multi' : 'Single'; $taskTotal+=1; $value_bid = '2'; $bidStatus = '<img src="images/ajax-loader.gif" id="bid-img' . $row['id'] . '" style="display:none;"> <a class="btn btn-primary" id="a-bid' . $row['id'] . '" href="javascript:void(0)" onclick="bid(' . $row['id'] . ',\'' . $value_bid . '\')">Bid</a>'; //echo "SELECT id FROM bids WHERE task_id='".$row['id']."' AND tasker_id='".$_SESSION['userid']."'"; //$chkBid = mysql_num_rows(mysql_query("SELECT id FROM bids WHERE task_id='".$row['id']."' AND tasker_id='".$_SESSION['userid']."'")); //if($chkBid == 0) //{ $html .= '<div><div id="bid' . $row['id'] . '"><hr> <div class="row" id="con1" style="margin:0;"> <div class="col-md-12" id="v11"> <div class="col-xs-7" style="overflow:hidden">'; $html .='<h4 class="hgr1">' . ucwords($row['taskname']) . ' - ' . ucwords($row['tasktype']) . ' (' . $taskmulti . ')</h4>'; if ($row['taskfrom'] != '') { $html.='<p>From : ' . $row['taskfrom'] . '</p>'; } if ($row['taskto'] != '') { $html.='<p>To : ' . $row['taskto'] . '</p>'; } if ($row['DATEONLY'] != '') { $html .= '<p>Date : ' . $row['DATEONLY'] . '</p>'; } if ($row['TIMEONLY'] != '') { $html .= '<p>Time : ' . $row['TIMEONLY'] . '</p>'; } $html .= '<p>People : ' . $row['people'] . '</p>'; if ($row['tastkduration'] != '') { $html.='<p>Duration : ' . $row['taskduration'] . '</p>'; } if ($row['tasklocation'] != '') { $html .= '<p>Location : ' . $row['tasklocation'] . '</p>'; } if ($row['other'] != '') { $html .= '<p>Other : ' . $row['other'] . '</p>'; } if ($row['taskdescription'] != '') { $html .= '<p>Description : ' . $row['taskdescription'] . '</p>'; } $html .=' </div><div class="clearfix"></div>'; if ($row['userid'] != $_SESSION['userid']) { $html .= '<div class="col-xs-5"> <div class="con6">' . $bidStatus . '</div> </div>'; } $html .= '<div class="clearfix"></div></div> </div> </div>'; $secretkey = mysql_query("select * from stripecredentials where id ='1'"); $sresult = mysql_fetch_array($secretkey); $getdata = mysql_query("select * from taskerdetails where userid='" . $_SESSION['userid'] . "' && secretkey='" . $sresult['secretkey'] . "'"); if (mysql_num_rows($getdata) > 0) { $html .= '<div id="bid-slide' . $row['id'] . '" style="display:none;width: 100%; background: none repeat scroll 0% 0% rgb(255, 255, 255); border-right: 1px solid rgb(204, 204, 204); border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color rgb(204, 204, 204) rgb(204, 204, 204); -moz-border-top-colors: none; -moz-border-right-colors: none; -moz-border-bottom-colors: none; -moz-border-left-colors: none; border-image: none; min-height: 61px;"> <form><textarea style="border:none;resize: none;float:left;width:74%;padding-left:2px;" rows="2" placeholder="Enter your message (Optional)" name="bid-message" id="bid-message' . $row['id'] . '"></textarea> <div style="border-left:1px solid #ccc;float:left;min-height:60px;width:25%"> <span style="width:13%;float:left">$</span> <input type="text" name="bid-amount" value="0" style="width:86%;float:left;" id="bid-amount' . $row['id'] . '" class="bid-amount"><br> <input type="button" value="confirm" onclick="taskAction(\'bid\',' . $row['id'] . ',\'addBid\')" id="a-bid' . $row['id'] . '" style="width:100%;border:0;margin-top:-5px;border-radius:0" class="sechyi" value="Confirm"> </form> </div> </div>'; } else { $html .= '<div id="bid-slide' . $row['id'] . '" style="display:none;width: 100%; background: none repeat scroll 0% 0% rgb(255, 255, 255); border-right: 1px solid rgb(204, 204, 204); border-width: medium 1px 1px; border-style: none solid solid; border-color: -moz-use-text-color rgb(204, 204, 204) rgb(204, 204, 204); -moz-border-top-colors: none; -moz-border-right-colors: none; -moz-border-bottom-colors: none; -moz-border-left-colors: none; border-image: none; min-height: 61px;"> <form><textarea style="border:none;resize: none;float:left;width:74%;padding-left:2px;" rows="2" cols="80" placeholder="Enter your message (Optional)" name="bid-message" id="bid-message' . $row['id'] . '"></textarea> </form> </div> '; } $html.='</div>'; } //} $html .= '<div class="pagination" style="margin:10px 2.5% 20px;float:right">'; $html .= $Paging->showNavigation(); $html .= '</div><div class="clearfix"></div></div>'; } else { $html = '<div class="no-record">No Request found yet...</div>'; } if ($taskTotal == 0) { $html = '<div class="no-record">No Request found yet...</div>'; } echo $html; // end here request details from database ?> <hr> </div> <div class="col-xs-4" id="taskercont1"> <h4 class="sidehd">My Bids</h4> <?php // my bids details, showing on the right side on tasker page $html = ''; //echo "SELECT DATE_FORMAT(b.taskdate, '%d-%M-%Y') DATEONLY, DATE_FORMAT(b.taskdate,'%h:%i %p') TIMEONLY,a.task_id,b.taskname,b.taskfrom,b.taskto,b.taskdate,b.tasktype,b.tasklocation,b.taskdescription,b.taskduration,a.amount,a.message,a.status,people,b.other FROM bids as a LEFT JOIN tasks as b ON a.task_id = b.id WHERE tasker_id='".$_SESSION['userid']."' order by a.id desc LIMIT 3"; $query = mysql_query("SELECT DATE_FORMAT(b.taskdate, '%d-%M-%Y') DATEONLY, DATE_FORMAT(b.taskdate,'%h:%I %p') TIMEONLY,a.id,a.task_id,b.taskname,b.refund, b.taskfrom, b.taskto, b.taskdate, b.tasktype, b.tasklocation, b.taskdescription, b.taskduration, a.firstamnt,a.message,a.status,people,b.other,c.fname,c.lname,c.email FROM bids as a LEFT JOIN tasks as b ON a.task_id = b.id LEFT JOIN members as c ON c.id=b.userid WHERE tasker_id='" . $_SESSION['userid'] . "' and hide_bid='0' order by a.id desc LIMIT 3"); if (mysql_num_rows($query) > 0) { while ($row = mysql_fetch_array($query)) { $tasktype = ucwords($row['tasktype']); $tasktype = $tasktype == 'Handyman' ? 'Handy Man' : $tasktype; $status = $row['status'] == 0 ? "Pending" : " Confirmed"; if ($row['status'] == '3' || $row['status'] == '4') { $status = 'Rejected'; } if ($row['refund'] == '1') { $status.= ' and Refunded'; } $st = mysql_result(mysql_query("SELECT status from satisfiedstatus where bid_id='" . $row['task_id'] . "' AND tasker_id='" . $_SESSION['userid'] . "'"), 0); if ($st != '') { if ($st == '1') { $status = 'Satisfied'; } else if ($st == '0') { $status = 'Disatisfied'; } } $requestrDetail = ''; if ($row['status'] == '1') { $requestrDetail = '<tr><td>Requester</td><td> : </td><td>' . ucfirst($row['fname']) . ' ' . ucfirst($row['lname']) . '</td></tr> <tr><td>Email </td><td> : </td><td>' . $row['email'] . '</td></tr>'; } $html .= '<div class="contxtinner1" style="overflow:hidden"> <table border="0" width="100%"> <tr> <td valign="top" width="19%">Task</td> <td valign="top" width="4%">:</td> <td valign="top">' . $row['taskname'] . ' - ' . $tasktype . '</td> </tr>'; if ($row['taskfrom'] != '') { $html.='<tr> <td valign="top" width="19%">From</td> <td valign="top" width="4%">:</td> <td valign="top">' . $row['taskfrom'] . '</td> </tr>'; } if ($row['taskto'] != '') { $html.='<tr> <td valign="top" width="19%">To</td> <td valign="top" width="4%">:</td> <td valign="top">' . $row['taskto'] . '</td> </tr>'; } if ($row['DATEONLY'] != '') { $html .='<tr> <td valign="top" width="19%">Date</td> <td valign="top" width="4%">:</td> <td valign="top">' . $row['DATEONLY'] . '</td> </tr>'; } if ($row['TIMEONLY'] != '') { $html .='<tr> <td valign="top" width="19%">Time</td> <td valign="top" width="4%">:</td> <td valign="top">' . $row['TIMEONLY'] . '</td> </tr>'; } if ($row['people'] != '0') { $html .='<tr> <td valign="top" width="19%">People</td> <td valign="top" width="4%">:</td> <td valign="top">' . $row['people'] . '</td> </tr>'; } if ($row['tastkduration'] != '') { $html.=' <tr> <td valign="top" width="19%">Duration</td> <td valign="top" width="4%">:</td> <td valign="top">' . $row['taskduration'] . '</td> </tr>'; } if ($row['tasklocation'] != '') { $html .= ' <tr> <td valign="top" width="19%">Location</td> <td valign="top" width="4%">:</td> <td valign="top">' . $row['tasklocation'] . '</td> </tr>'; } if ($row['taskdescription'] != '') { $html .= ' <tr> <td valign="top" valign="top" width="19%">Description</td> <td valign="top" width="4%">:</td> <td valign="top">' . substr($row['taskdescription'], 0, 125) . '...</td> </tr>'; } if ($row['firstamnt'] != '') { $html .= ' <tr> <td valign="top" width="19%">Amount</td> <td valign="top" width="4%">:</td> <td valign="top">$' . $row['firstamnt'] . '</td> </tr>'; } if ($row['other'] != '') { $html .= ' <tr> <td valign="top" valign="top" width="19%">Other</td> <td valign="top" valign="top" width="4%">:</td> <td valign="top">' . substr($row['other'], 0, 125) . '...</td> </tr>'; } if ($row['status'] != '') { $html .= ' <tr> <td valign="top" width="19%">Status</td> <td valign="top" width="4%">:</td> <td valign="top">' . $status . '</td> </tr>'; } $html.=$requestrDetail; $html.='</table> </div>'; } $html .= '<div class="contxtinner1" style="text-align:right"> <a href="mybids">View Details</a></div>'; } else { $html = '<div class="no-record">No Bid accept yet...</div>'; } echo $html; ?> </div> <div style="clear:both;"> </div> </div></div><!-- /.row --> <?php// bottom part of the pageinclude_once "include/footer.php";// end here?>