From b2155d64ede3e973ee94ff12df2fc75c8b30edc6 Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Sat, 13 Aug 2022 20:26:23 -0400 Subject: [PATCH] fix --- www/application/controllers/Jobs.php | 70 ++++++++++++++++++- www/application/models/Job_model.php | 6 ++ www/application/views/jobs/view_joboffer.php | 2 +- .../views/jobs/view_startcreate.php | 26 ++++--- .../views/jobs/view_viewmyjoboffer.php | 29 +------- .../internal/template/view_securefooter.php | 1 + .../internal/template/view_securehead.php | 1 + www/assets/css/bootstrap-wysihtml5.css | 44 ++++++++++++ 8 files changed, 137 insertions(+), 42 deletions(-) create mode 100644 www/assets/css/bootstrap-wysihtml5.css 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 @@
- +
diff --git a/www/application/views/jobs/view_startcreate.php b/www/application/views/jobs/view_startcreate.php index d39a052a..e61736b8 100644 --- a/www/application/views/jobs/view_startcreate.php +++ b/www/application/views/jobs/view_startcreate.php @@ -1,5 +1,9 @@ +
+ +
+
@@ -76,7 +80,7 @@ foreach ($jobs_list as $row){ ?> - @@ -85,9 +89,10 @@ View
- Clone + Clone
+
@@ -159,7 +164,9 @@ } var job_id = $("select#select_job option").filter(":selected").val(); if (!job_id.length> 0 ) return; - alert(job_id); + // alert(job_id); + + $.ajax({ url: "/jobs/job_modal?job_uid="+job_id }).done(function (data) { @@ -170,17 +177,14 @@ function cloneJob() { if (typeof event !== 'undefined') { - event.preventDefault(); + // event.preventDefault(); } var job_id = $("select#select_job option").filter(":selected").val(); if (!job_id.length> 0 ) return; - alert(job_id); - $.ajax({ - url: "/jobs/clonejob?job_uid="+job_id - }).done(function (data) { -//alert(data); - $('#modal-content').html(data); - }); + // alert("Clone this job " + job_id); + document.post_nav_find.action = '/jobs/clonejob'; + document.post_nav_find.jobUid.value = job_id; + document.post_nav_find.submit(); } // --> diff --git a/www/application/views/jobs/view_viewmyjoboffer.php b/www/application/views/jobs/view_viewmyjoboffer.php index ea508038..0bea2c55 100644 --- a/www/application/views/jobs/view_viewmyjoboffer.php +++ b/www/application/views/jobs/view_viewmyjoboffer.php @@ -35,30 +35,21 @@
- -
-
- -
- - -
-
- +
@@ -77,7 +68,7 @@
- +
@@ -101,48 +92,32 @@
- - - -
-
-

Other Offers

- -
-
-
-
-
-
-
- - diff --git a/www/application/views/site3/internal/template/view_securefooter.php b/www/application/views/site3/internal/template/view_securefooter.php index 2c9674fe..029de55a 100644 --- a/www/application/views/site3/internal/template/view_securefooter.php +++ b/www/application/views/site3/internal/template/view_securefooter.php @@ -67,6 +67,7 @@ + diff --git a/www/application/views/site3/internal/template/view_securehead.php b/www/application/views/site3/internal/template/view_securehead.php index 9b033a38..74511525 100644 --- a/www/application/views/site3/internal/template/view_securehead.php +++ b/www/application/views/site3/internal/template/view_securehead.php @@ -28,6 +28,7 @@ $server_name = 'https://'. $_SERVER['HTTP_HOST']; + diff --git a/www/assets/css/bootstrap-wysihtml5.css b/www/assets/css/bootstrap-wysihtml5.css new file mode 100644 index 00000000..934c5153 --- /dev/null +++ b/www/assets/css/bootstrap-wysihtml5.css @@ -0,0 +1,44 @@ +ul.wysihtml5-toolbar { + margin: 0; + padding: 0; + display: block; +} + +ul.wysihtml5-toolbar::after { + clear: both; + display: table; + content: ""; +} + +ul.wysihtml5-toolbar > li { + float: left; + display: list-item; + list-style: none; + margin: 0 5px 10px 0; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] { + font-weight: bold; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] { + font-style: italic; +} + +ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] { + text-decoration: underline; +} + +ul.wysihtml5-toolbar a.btn.wysihtml5-command-active { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); + background-color: #E6E6E6; + background-color: #D9D9D9 9; + outline: 0; +} + +ul.wysihtml5-commands-disabled .dropdown-menu { + display: none !important; +}