This commit is contained in:
2022-08-13 20:26:23 -04:00
parent 7914a73df0
commit b2155d64ed
8 changed files with 137 additions and 42 deletions
+67 -3
View File
@@ -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);
+6
View File
@@ -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
*/
+1 -1
View File
@@ -80,7 +80,7 @@
</td>
<td>
<form name="job_detail">
<textarea cols="18" rows="3" name='jobdescription' class="wysihtml5 wysihtml5-min form-control" style="height:180px;" placeholder="Enter description here ..."> <?= $job_table_row->job_detail ?></textarea>
<textarea cols="18" rows="3" name='jobdescription' class="wysihtml5 wysihtml5-min form-control" style="height:180px;" placeholder="Enter description here ..."> <?= $job_description ?></textarea>
</form>
</td>
+15 -11
View File
@@ -1,5 +1,9 @@
<?php include('common/jobstrip.php'); ?>
<form method="post" name="post_nav_find" action="">
<input type="hidden" name="jobUid" value="">
</form>
<!--begin::Row-->
<div class="row g-5 g-xl-8">
<?php include('common/jobside.php'); ?>
@@ -76,7 +80,7 @@
foreach ($jobs_list as $row){
?>
<option value="<?=$row['uid']?>"><?=$row['title']?></option>
<?php
<?php
}
?>
</select>
@@ -85,9 +89,10 @@
<a href="#" onclick="return viewJob()" class="btn btn-bg-light btn-block btn-active-color-primary btn-sm px-4 me-2">View</a>
</div>
<div class="col col-lg-2">
<a href="#" onclick="return cloneJob()" class="btn btn-bg-light btn-block btn-active-color-secondary btn-sm px-4 me-2">Clone</a>
<a href="#" onclick="return cloneJob()" class="btn btn-bg-primary btn-block btn-active-color-secondary btn-sm px-4 me-2">Clone</a>
</div>
</div>
</div>
</div>
<hr size="1" />
@@ -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();
}
// -->
</script>
@@ -35,30 +35,21 @@
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">Date Added</label>
<!--end::Label-->
<!--begin::Col-->
<div class="col-lg-8">
<span class="fw-bolder fs-6 text-gray-800"><?php echo $added_date; ?></span>
</div>
<!--end::Col-->
</div>
<!--end::Row-->
<!--begin::Input group-->
<div class="row mb-7">
<!--begin::Label-->
<label class="col-lg-4 fw-bold text-muted">Description</label>
<!--end::Label-->
<!--begin::Col-->
<div class="col-lg-8 fv-row">
<span class="fw-bold text-gray-800 fs-6"><?php echo $description; ?></span>
</div>
<!--end::Col-->
</div>
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">Offer Expire
</label>
<div class="col-lg-8 d-flex align-items-center">
<span class="fw-bolder fs-6 text-gray-800 me-2"><?php echo $expire; ?></span>
<span class="fw-bolder fs-6 text-gray-800 me-2"><div id="extend_result"><?php echo $expire; ?></div></span>
<input type="button" name="extend_job" id="extend_job" onclick="return extendDuration();" value='Extend by a week' class="btn btn-info btn-sm" >
</div>
</div>
@@ -77,7 +68,7 @@
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">Detail</label>
<div class="col-lg-8">
<span class="fw-bolder fs-6 text-gray-800"><?php echo $job_description; ?></span>
<span class="fw-bolder fs-6 text-gray-800"><?php echo stripslashes(htmlspecialchars_decode($job_description)); ?></span>
</div>
</div>
<div class="row mb-10">
@@ -101,48 +92,32 @@
</div>
</div>
</div>
<!--end::Card body-->
</div>
<!--end::details View-->
</div>
<!--end::Charts Widget 1-->
</div>
<!--begin::Col-->
<div class="col-xl-4">
<!--begin::Tables Widget 5-->
<div class="card card-xl-stretch mb-5 mb-xl-8">
<!--begin::Header-->
<div class="card-header border-0 pt-5">
<h3 class="card-title align-items-start flex-column">
<span class="card-label fw-bolder fs-3 mb-1">Other Offers</span>
</h3>
</div>
<!--end::Header-->
<!--begin::Body-->
<div class="card-body py-3">
<div class="tab-content">
<!--begin::Tap pane-->
<div class="tab-pane fade show active" id="kt_table_widget_5_tab_1">
<!--begin::Table container-->
<div class="table-responsive">
<!--begin::Table-->
</div>
<!--end::Table-->
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<!--end::Tables Widget 5-->
</div>
<!--end::Col-->
</div>
<!--end::Row-->
@@ -67,6 +67,7 @@
<script src="/site3/assets/plugins/datatables/datatables.bundle.js"></script>
<script src="/site3/assets/js/custom/files/list.js"></script>
<script src="/site3/assets/js/custom/calendar/calendar.js"></script>
<!--end::Page Custom Javascript-->
<!--end::Javascript-->
</body>
@@ -28,6 +28,7 @@ $server_name = 'https://'. $_SERVER['HTTP_HOST'];
<!-- script type="text/javascript" src="/assets/js/plugins/ui/fullcalendar/fullcalendar.min.js"></script>
<script type="text/javascript" src="/assets/js/pages/extra_fullcalendar.js"></script -->
<link href="/site3/assets/css/custom/fullcalendar.bundle.css" rel="stylesheet" type="text/css" />
<link href="/site3/assets/css/custom/datatables.bundle.css" rel="stylesheet" type="text/css" />
+44
View File
@@ -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;
}