diff --git a/www/application/controllers/Jobs.php b/www/application/controllers/Jobs.php index 5ad5e5db..77637373 100644 --- a/www/application/controllers/Jobs.php +++ b/www/application/controllers/Jobs.php @@ -738,7 +738,9 @@ echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); $data["timeline_days"] = $out["timeline_days"]; $data["price"] = $out["price"]; $data["offer_code"] = $out["offer_code"]; - $data["job_description"] = $out["job_description"]; + $a_from = array('\t','\n','\r','\0','\v'); + $a_to = array("\t","\n","\r","",""); + $data["job_description"] = trim(trim(str_replace($a_from,$a_to,$out["job_description"])),'"'); // str_replace('"','\"',$out["job_description"]); // $out["job_description"]; $date = date_create($out["expire"]); $out["expire"] = date_format($date, 'Y-m-d H:i'); $data["expire"] = $out["expire"]; @@ -933,8 +935,12 @@ echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); $this->load->model('job_model'); return $this->job_model->addGroupMemberForm($group_id); } + public function clonejob(){ - redirect('/jobs/create/FACEBOOKSHARE'); + $jobUid = $this->input->post('jobUid'); + if ( $jobUid !=''){ + redirect('/jobs/create/'.$jobUid); + } } private function getJobTemplateFill($template_page){ @@ -945,8 +951,51 @@ echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); return $row; } } + // You get here if you dont find any template - let see if this is an existimg job + // d9bf082d-b72f-45d9-80d7-490d58a3bd2d + if (strlen($template_page) < 40){ // dont et attacked here , clean it up + $this->load->model('job_model'); + $jobDataRows = $this->job_model->selectUserJobUid($_SESSION['member_id'],$template_page); + if (count($jobDataRows) > 0 ){ + // var_dump( $jobData ); + // exit(); + $jobData = $jobDataRows[0]; + return [ + 'ID'=> $jobData['uid'], + 'name'=> $jobData['title'], + 'description'=> $jobData['description'], + 'delivery'=> trim(trim(str_replace('\n',"\n", $jobData['job_detail'])),'"'), + 'img'=>'/site3/assets/media/jobs/share-stories.jpg', + 'timeline_days'=> $jobData['timeline_days'], + 'price'=> $jobData['price'], + 'country' => $jobData['country'] + ]; + } + } + + // echo strlen($template_page); return []; } + /* + Table "public.members_jobs" + Column | Type | Collation | Nullable | Default +---------------+-----------------------------+-----------+----------+------------------------------------------ + id | integer | | not null | nextval('members_jobs_id_seq'::regclass) + member_id | integer | | | + title | character varying(150) | | | + description | character varying(300) | | | + job_detail | text | | | + timeline_days | integer | | not null | + price | integer | | not null | + loc | inet | | | + created | timestamp without time zone | | | now() + updated | timestamp without time zone | | | now() + status | integer | | | 1 + country | character varying(2) | | | + uid | uuid | | | uuid_generate_v4() +Indexes: + + */ public function create() { $data = $this->getSessionArray(); @@ -1146,6 +1195,8 @@ echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); $this->load->model('job_model'); // too bad I have to run again $jobData = $this->job_model->getJob($jobID); $data['job_description'] = $jobData->job_detail; + /*stripslashes(htmlspecialchars_decode( + trim(trim(str_replace($a_from,$a_to,$jobData->job_detail)),'"'))); */ $data['jobID'] = $jobID; $activeJobData = $this->job_model->selectMarketJob($jobID); @@ -1161,10 +1212,23 @@ echo $this->getMarketInterestMessage( $in['offer_code'], $out['client_id'] ); } else { redirect('/jobs/manage'); } - // echo "process job " . $jobID; } + /* + ./assets/js/pages/editor_wysihtml5.js + ./assets/js/plugins/editors/wysihtml5/parsers.js + ./assets/js/plugins/editors/wysihtml5/toolbar.js + ./assets/js/plugins/editors/wysihtml5/wysihtml5.min.js + ./assets/js/plugins/forms/editable/wysihtml5.js + ./assets/css/bootstrap.min.css + ./assets/css/bootstrap-wysihtml5.css + ./assets/js/core/libraries/bootstrap.min.js + + + */ + + public function viewjob_accept() { // echo 'home....0'; $this->concludeOffer(OFFER_ACCEPT); diff --git a/www/application/models/Job_model.php b/www/application/models/Job_model.php index 97223c69..aa243328 100644 --- a/www/application/models/Job_model.php +++ b/www/application/models/Job_model.php @@ -6,6 +6,12 @@ class Job_model extends CI_Model { } + public function selectUserJobUid($member_id,$uuid){ + $mysql = "SELECT * FROM members_jobs WHERE member_id = $member_id AND uid='$uuid' "; + $query = $this->db->query($mysql); + return $query->result_array(); + } + /* * Supply active list of jobs for this id */ diff --git a/www/application/views/jobs/view_joboffer.php b/www/application/views/jobs/view_joboffer.php index 6cee4a17..6a5f2b1e 100644 --- a/www/application/views/jobs/view_joboffer.php +++ b/www/application/views/jobs/view_joboffer.php @@ -80,7 +80,7 @@