Fucking Book fucking 1 mostly fucking finished. Still got to the colors and the formula. FUCK
This commit is contained in:
parent
be49771830
commit
07dcd14dac
|
|
@ -34,13 +34,14 @@ class JobsController extends AppController {
|
|||
$this->layout = 'ajax';
|
||||
$this->set('job', $this->Job->find('first', array('conditions'=>array('Job.id'=>$id))));
|
||||
|
||||
|
||||
$this->set('currencies', $this->Job->Currency->find('list'));
|
||||
$this->set('sale_category_options', $this->sale_category_options());
|
||||
$this->set('sale_category_array', $this->sale_category_array());
|
||||
$this->set('job_type_options', $this->job_type_options());
|
||||
$this->set('shipment_options', $this->shipment_options());
|
||||
$this->set('freight_paid_by_options',$this->freight_paid_options());
|
||||
$this->set('gst_options', $this->gst_options());
|
||||
$this->set('job_status_options', $this->job_status_options());
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -57,10 +58,25 @@ class JobsController extends AppController {
|
|||
$this->set('freight_paid_by_options',$this->freight_paid_options());
|
||||
$this->set('gst_options', $this->gst_options());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function job_status_options() {
|
||||
$options = array('ORDER RECEIVED FROM CUSTOMER',
|
||||
'ORDER PLACED ON PRINCIPLE - WAITING ON DELIVERY',
|
||||
'GOODS SHIPPED TO CUSTOMER - CMC WAITING ON PAYMENT',
|
||||
'WAITING ON PAYMENT AND ANOTHER DELIVERY',
|
||||
'GOODS DELIVERED TO CUSTOMER - CMC PAID IN FULL',
|
||||
'PAID IN FULL WAITING ON DELIVERY',
|
||||
'JOB CANCELLED',
|
||||
'JOB ON HOLD',
|
||||
'CUSTOMER TO PAY 100% WITH ORDER');
|
||||
$options = $this->buildEnumOpts($options);
|
||||
return $options;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For the 'sale_category' column.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
if($date == "0000-00-00") {
|
||||
echo "-";
|
||||
echo "";
|
||||
}
|
||||
else {
|
||||
echo date("j M Y", strtotime($date));
|
||||
|
|
|
|||
|
|
@ -1,11 +1,80 @@
|
|||
|
||||
<tr id="<?=$job['Job']['id']?>">
|
||||
<? echo $form->create('Job', array('action'=>'ajax_edit', 'id'=>'form_'.$job['Job']['id'], 'class'=>'job_table_form')); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
|
||||
|
||||
$('#<?=$job['Job']['id']?>_date_order_received_display').datepicker({
|
||||
showButtonPanel: true,
|
||||
dateFormat: 'd M yy',
|
||||
altFormat: 'yy-mm-dd',
|
||||
altField: '#<?=$job['Job']['id']?>_date_order_received'
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#<?=$job['Job']['id']?>_date_order_placed_on_principle_display').datepicker({
|
||||
showButtonPanel: true,
|
||||
dateFormat: 'd M yy',
|
||||
altFormat: 'yy-mm-dd',
|
||||
altField: '#<?=$job['Job']['id']?>_date_order_placed_on_principle'
|
||||
|
||||
});
|
||||
|
||||
$('#<?=$job['Job']['id']?>_date_scheduled_ex_works_display').datepicker({
|
||||
showButtonPanel: true,
|
||||
dateFormat: 'd M yy',
|
||||
altFormat: 'yy-mm-dd',
|
||||
altField: '#<?=$job['Job']['id']?>_date_scheduled_ex_works'
|
||||
|
||||
});
|
||||
|
||||
$('#<?=$job['Job']['id']?>_date_order_sent_to_customer_display').datepicker({
|
||||
showButtonPanel: true,
|
||||
dateFormat: 'd M yy',
|
||||
altFormat: 'yy-mm-dd',
|
||||
altField: '#<?=$job['Job']['id']?>_date_order_sent_to_customer'
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
//format the mySQL date in the nice readable format.
|
||||
/*if($job['date_order_received'] != '0000-00-00') {
|
||||
$order_received_time = strtotime($job['Job']['date_order_received']);
|
||||
$order_received_readable = date('j M Y', $order_received_time );
|
||||
}
|
||||
else {
|
||||
$order_received_readable = "";
|
||||
}
|
||||
|
||||
if($job['date_order_sent_to_customer'] != '0000-00-00') {
|
||||
$order_sent_to_customer_time = strtotime($job['Job']['date_order_sent_to_customer']);
|
||||
$order_sent_readable = date('j M Y', $order_sent_to_customer_time);
|
||||
}
|
||||
else {
|
||||
$order_sent_readable = "";
|
||||
}*/
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?=$form->input('id', array('type'=>'hidden', 'value'=>$job['Job']['id'])); ?>
|
||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||
<td><?=$job['Job']['date_order_received'];?></td>
|
||||
<td><?=$job['Job']['job_status'];?></td>
|
||||
<td><button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||
<td><?=$form->input('date_order_received_display', array('value'=>$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_received'])), 'label'=>false, 'id'=>$job['Job']['id'].'_date_order_received_display'));?>
|
||||
<?=$form->input('date_order_received', array('type'=>'hidden', 'id'=>$job['Job']['id'].'_date_order_received', 'value'=>$job['Job']['date_order_received']));?>
|
||||
</td>
|
||||
<td><?=$form->input('job_status', array('type'=>'select', 'options'=>$job_status_options, 'value'=>$job['Job']['job_status'], 'label'=>false, 'div'=>false));?></td>
|
||||
<td>
|
||||
<?=$form->input('sale_category', array('options'=>$sale_category_options, 'label'=>false, 'selected'=>$job['Job']['sale_category'], 'class'=>'sale_category'));?>
|
||||
<?=$form->input('sale_category', array('options'=>$sale_category_options, 'type'=>'select', 'label'=>false, 'value'=>$job['Job']['sale_category'], 'class'=>'sale_category'));?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('job_type', array('options'=>$job_type_options, 'label' => false, 'selected'=>$job['Job']['job_type']));?></td>
|
||||
|
|
@ -20,6 +89,10 @@
|
|||
echo $poString;
|
||||
?>
|
||||
</td>
|
||||
<td><?=$form->input('date_order_placed_on_principle_display', array('value'=>$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_placed_on_principle'])), 'label'=>false, 'id'=>$job['Job']['id'].'_date_order_placed_on_principle_display'));?>
|
||||
<?=$form->input('date_order_placed_on_principle', array('type'=>'hidden', 'id'=>$job['Job']['id'].'_date_order_placed_on_principle', 'value'=>$job['Job']['date_order_placed_on_principle']));?>
|
||||
</td>
|
||||
|
||||
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
|
||||
<td>
|
||||
<?=$form->input('customer_order_number', array('value'=>$job['Job']['customer_order_number'], 'label'=>false ,'div'=>false));?>
|
||||
|
|
@ -30,16 +103,17 @@
|
|||
</td>
|
||||
|
||||
<td>
|
||||
<?=$form->input('date_scheduled_ex_works', array('value'=>$job['Job']['date_scheduled_ex_works'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$form->input('date_scheduled_ex_works_display', array('value'=>$this->element('isEmptyDate', array('date'=>$job['Job']['date_scheduled_ex_works'])), 'label'=>false, 'id'=>$job['Job']['id'].'_date_scheduled_ex_works_display'));?>
|
||||
<?=$form->input('date_scheduled_ex_works', array('type'=>'hidden', 'id'=>$job['Job']['id'].'_date_scheduled_ex_works', 'value'=>$job['Job']['date_scheduled_ex_works'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('date_order_sent_to_customer', array('value'=>$job['Job']['date_order_sent_to_customer'], 'label'=>false ,'div'=>false));?>
|
||||
|
||||
<?=$form->input('date_order_sent_to_customer_display', array('value'=>$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_sent_to_customer'])), 'label'=>false, 'id'=>$job['Job']['id'].'_date_order_sent_to_customer_display'));?>
|
||||
<?=$form->input('date_order_sent_to_customer', array('type'=>'hidden', 'id'=>$job['Job']['id'].'_date_order_sent_to_customer', 'value'=>$job['Job']['date_order_sent_to_customer'])); ?>
|
||||
</td>
|
||||
<td> <?=$form->input('domestic_freight_paid_by', array('value'=>$job['Job']['domestic_freight_paid_by'], 'label'=>false ,'div'=>false));?>
|
||||
<td> <?=$form->input('domestic_freight_paid_by', array('type'=>'select','options'=>$freight_paid_by_options, 'value'=>$job['Job']['domestic_freight_paid_by'], 'label'=>false ,'div'=>false));?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('currency_id', array('value'=>$job['Currency']['name'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$form->input('currency_id', array('value'=>$job['Job']['currency_id'], 'type'=>'select', 'options'=>$currencies, 'label'=>false ,'div'=>false));?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('company_gross_sales_aud', array('value'=>$job['Job']['company_gross_sales_aud'], 'label'=>false ,'div'=>false));?>
|
||||
|
|
@ -82,8 +156,6 @@
|
|||
</td>
|
||||
<td> <?=$form->input('net_commissions', array('value'=>$job['Job']['net_commissions'], 'label'=>false ,'div'=>false));?>
|
||||
</td>
|
||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||
<td><button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||
</tr>
|
||||
<?=$form->end();?>
|
||||
|
||||
<?php debug($job); ?>
|
||||
<?php //debug($job); ?>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<tr id="<?=$job['Job']['id']?>">
|
||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||
<td><?=$job['Job']['date_order_received'];?></td>
|
||||
<td><button class="editButton">Edit</button></td>
|
||||
<td><?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_received']));?></td>
|
||||
<td><?=$job['Job']['job_status'];?></td>
|
||||
<td>
|
||||
<?=$form->input('sale_category', array('options'=>$sale_category_options, 'label'=>false, 'selected'=>$job['Job']['sale_category'], 'class'=>'sale_category'));?>
|
||||
<?=$sale_category_array[$job['Job']['sale_category']];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('job_type', array('options'=>$job_type_options, 'label' => false, 'selected'=>$job['Job']['job_type']));?></td>
|
||||
<td><?=$form->input('shipment_category', array('options'=>$shipment_options, 'label'=>false,'selected'=>$job['Job']['shipment_category']));?></td>
|
||||
<?=$job['Job']['job_type'];?></td>
|
||||
<td><?=$job['Job']['shipment_category'];?></td>
|
||||
<td><?=$html->link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?></td>
|
||||
<td><?=$html->link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?>
|
||||
<td><?
|
||||
|
|
@ -18,68 +18,67 @@
|
|||
echo $poString;
|
||||
?>
|
||||
</td>
|
||||
<td><?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_placed_on_principle']));?></td>
|
||||
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
|
||||
<td>
|
||||
<?=$form->input('customer_order_number', array('value'=>$job['Job']['customer_order_number'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['customer_order_number'];?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?=$form->input('supplier_reference', array('value'=>$job['Job']['supplier_reference'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['supplier_reference'];?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?=$form->input('date_scheduled_ex_works', array('value'=>$job['Job']['date_scheduled_ex_works'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_scheduled_ex_works']));?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('date_order_sent_to_customer', array('value'=>$job['Job']['date_order_sent_to_customer'], 'label'=>false ,'div'=>false));?>
|
||||
|
||||
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_sent_to_customer']));?>
|
||||
</td>
|
||||
<td> <?=$form->input('domestic_freight_paid_by', array('value'=>$job['Job']['domestic_freight_paid_by'], 'label'=>false ,'div'=>false));?>
|
||||
<td> <?=$job['Job']['domestic_freight_paid_by'];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('currency_id', array('value'=>$job['Currency']['name'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Currency']['name'];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('company_gross_sales_aud', array('value'=>$job['Job']['company_gross_sales_aud'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['company_gross_sales_aud'];?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('net_sales_aud', array('value'=>$job['Job']['net_sales_aud'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['net_sales_aud'];?>
|
||||
</td>
|
||||
<td> <?=$form->input('gross_profit_aud', array('value'=>$job['Job']['gross_profit_aud'], 'label'=>false ,'div'=>false));?>
|
||||
<td> <?=$job['Job']['gross_profit_aud'];?>
|
||||
</td>
|
||||
<td>
|
||||
Net Export Sales Conv to AUD?
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('gross_profit_exports_aud', array('value'=>$job['Job']['gross_profit_exports_aud'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['gross_profit_exports_aud'];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('gp_percent', array('value'=>$job['Job']['gp_percent'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['gp_percent'];?>
|
||||
</td>
|
||||
<td>? Double column?</td>
|
||||
<td>
|
||||
<?=$form->input('ato_exchange_rate', array('value'=>$job['Job']['ato_exchange_rate'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['ato_exchange_rate'];?>
|
||||
</td>
|
||||
<td> <?=$form->input('gross_australian_sales_foreign_currency', array('value'=>$job['Job']['gross_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||
<td> <?=$job['Job']['gross_australian_sales_foreign_currency'];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('net_australian_sales_foreign_currency', array('value'=>$job['Job']['net_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['net_australian_sales_foreign_currency'];?>
|
||||
</td>
|
||||
<td> <?=$form->input('gross_profit_value_australian_sales_foreign_currency', array('value'=>$job['Job']['gross_profit_value_australian_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||
<td> <?=$job['Job']['gross_profit_value_australian_sales_foreign_currency'];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('gross_export_sales_foreign_currency', array('value'=>$job['Job']['gross_export_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['gross_export_sales_foreign_currency'];?>
|
||||
</td>
|
||||
<td> <?=$form->input('net_export_sales_foreign_currency', array('value'=>$job['Job']['net_export_sales_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||
<td> <?=$job['Job']['net_export_sales_foreign_currency'];?>
|
||||
</td>
|
||||
<td> <?=$form->input('gross_profit_value_after_discount_exports_foreign_currency', array('value'=>$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'], 'label'=>false ,'div'=>false));?>
|
||||
<td> <?=$job['Job']['gross_profit_value_after_discount_exports_foreign_currency'];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$form->input('gross_commissions', array('value'=>$job['Job']['gross_commissions'], 'label'=>false ,'div'=>false));?>
|
||||
<?=$job['Job']['gross_commissions'];?>
|
||||
</td>
|
||||
<td> <?=$form->input('net_commissions', array('value'=>$job['Job']['net_commissions'], 'label'=>false ,'div'=>false));?>
|
||||
<td> <?=$job['Job']['net_commissions'];?>
|
||||
</td>
|
||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||
<td><button class="editButton">Edit</button></td>
|
||||
</tr>
|
||||
<?=$form->end();?>
|
||||
|
|
@ -27,6 +27,7 @@ echo $paginator->counter(array(
|
|||
|
||||
|
||||
<div class="outer">
|
||||
<?php echo $form->create('Job', array('action'=>'/jobs/ajax_edit'));?>
|
||||
<table cellpadding="0" cellspacing="0" class="jobsTable">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -34,12 +35,13 @@ echo $paginator->counter(array(
|
|||
<th class="actions">Actions</th>
|
||||
<th><?php echo $paginator->sort('Order Received');?></th>
|
||||
<th><?php echo $paginator->sort('Status');?></th>
|
||||
<th><?php echo $paginator->sort('Sale Category');?></th>
|
||||
<th class="sale_category"><?php echo $paginator->sort('Sale Category');?></th>
|
||||
<th><?php echo $paginator->sort('Job Type');?></th>
|
||||
<th><?php echo $paginator->sort('Shipment Category');?></th>
|
||||
<th><?php echo $paginator->sort('Job Number');?></th>
|
||||
<th>Enquiry Number</th>
|
||||
<th>CMC POs</th>
|
||||
<th>Date Order Placed on Principle</th>
|
||||
<th><?php echo $paginator->sort('Customer');?></th>
|
||||
<th>Customer Order No</th>
|
||||
<th><?php echo $paginator->sort('Supplier Ref');?></th>
|
||||
|
|
@ -67,17 +69,19 @@ echo $paginator->counter(array(
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<? //echo $form->create('Job', array('action'=>'ajax_edit', 'class'=>'job_table_form', 'default'=>false));
|
||||
?>
|
||||
|
||||
<? foreach($jobs as $job):?>
|
||||
|
||||
|
||||
<tr id="<?=$job['Job']['id']?>">
|
||||
<? echo $form->create('Job', array('action'=>'ajax_edit', 'id'=>'form_'.$job['Job']['id'], 'class'=>'job_table_form')); ?>
|
||||
<?=$form->input('id', array('type'=>'hidden', 'value'=>$job['Job']['id'])); ?>
|
||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||
<td><?=$job['Job']['date_order_received'];?></td>
|
||||
<td><?=$job['Job']['job_status'];?></td>
|
||||
<td><button class="editButton">Edit</button></td>
|
||||
<td>
|
||||
<?=$job['Job']['sale_category'];?>
|
||||
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_received']));?></td>
|
||||
<td><?=$job['Job']['job_status'];?></td>
|
||||
<td class="sale_category">
|
||||
<?=$sale_category_array[$job['Job']['sale_category']];?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$job['Job']['job_type'];?></td>
|
||||
|
|
@ -92,6 +96,7 @@ echo $paginator->counter(array(
|
|||
echo $poString;
|
||||
?>
|
||||
</td>
|
||||
<td><?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_placed_on_principle']));?></td>
|
||||
<td><?=$html->link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?></td>
|
||||
<td>
|
||||
<?=$job['Job']['customer_order_number'];?>
|
||||
|
|
@ -102,11 +107,10 @@ echo $paginator->counter(array(
|
|||
</td>
|
||||
|
||||
<td>
|
||||
<?=$job['Job']['date_scheduled_ex_works'];?>
|
||||
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_scheduled_ex_works']));?>
|
||||
</td>
|
||||
<td>
|
||||
<?=$job['Job']['date_order_sent_to_customer'];?>
|
||||
|
||||
<?=$this->element('isEmptyDate', array('date'=>$job['Job']['date_order_sent_to_customer']));?>
|
||||
</td>
|
||||
<td> <?=$job['Job']['domestic_freight_paid_by'];?>
|
||||
</td>
|
||||
|
|
@ -154,14 +158,14 @@ echo $paginator->counter(array(
|
|||
</td>
|
||||
<td> <?=$job['Job']['net_commissions'];?>
|
||||
</td>
|
||||
<td><button class="editButton">Edit</button> <button class="saveButton">Save</button> <button class="cancelButton">Cancel</button></td>
|
||||
<td><button class="editButton">Edit</button></td>
|
||||
</tr>
|
||||
<?=$form->end();?>
|
||||
|
||||
|
||||
<? endforeach;?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<? echo $form->end(); ?>
|
||||
<div class="paging">
|
||||
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
|
|
|
|||
|
|
@ -1292,6 +1292,7 @@ table.jobsTable tr th {
|
|||
font-size: 70%;
|
||||
}
|
||||
|
||||
|
||||
table.jobsTable tr td {
|
||||
border: 1px solid;
|
||||
font-size: 60%;
|
||||
|
|
@ -1328,6 +1329,7 @@ select.sale_category {
|
|||
}
|
||||
|
||||
|
||||
|
||||
.outer {
|
||||
height: 650px;
|
||||
}
|
||||
|
|
@ -1,71 +1,62 @@
|
|||
$(function() {
|
||||
|
||||
// console.profile();
|
||||
//$(":input").hide();
|
||||
$(".editButton").show();
|
||||
$(".cancelButton").hide();
|
||||
$(".saveButton").hide();
|
||||
|
||||
$("input").attr("readonly","readonly");
|
||||
$("select").attr("disabled", "disabled");
|
||||
|
||||
$(".editButton").click(function() {
|
||||
|
||||
|
||||
|
||||
$(".editButton").live('click',function() {
|
||||
|
||||
var id = $(this).parents('tr').attr('id');
|
||||
//alert(id);
|
||||
makeEditable(id);
|
||||
getEditable(id);
|
||||
|
||||
$('.editButton').hide();
|
||||
|
||||
$("#"+id).find('.saveButton').show();
|
||||
$("#"+id).find('.cancelButton').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$(".cancelButton").click(function() {
|
||||
$(".cancelButton").live('click',function() {
|
||||
|
||||
var id = $(this).parents('tr').attr('id');
|
||||
$(this).hide();
|
||||
$("#"+id).find('.saveButton').hide();
|
||||
$("#"+id).find('.editButton').show();
|
||||
cancelEditable(id);
|
||||
getViewable(id);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$(".saveButton").click(function() {
|
||||
$(".saveButton").live('click',function() {
|
||||
var id = $(this).parents('tr').attr('id');
|
||||
var serializedForm = $("#"+'form_'+id).serialize();
|
||||
var thisJobInputs = $('#'+id).find('input,select');
|
||||
|
||||
$.post('/jobs/ajax_edit', serializedForm, function(data) {
|
||||
alert("Success! Job Edited"+data); //Need to do something here to update the Row.
|
||||
window.location.reload();
|
||||
$.post('/jobs/ajax_edit', thisJobInputs, function(data) {
|
||||
getViewable(id);
|
||||
});
|
||||
|
||||
//console.log($("#"+id).find('form').serialize());
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
$('form').submit(function() {
|
||||
//console.log($(this).serialize());
|
||||
return false;
|
||||
});
|
||||
|
||||
//console.profileEnd();
|
||||
|
||||
});
|
||||
|
||||
|
||||
function makeEditable(id) {
|
||||
$("#"+id).find('input').attr("readonly","");
|
||||
$("#"+id).find('select').attr("disabled","");
|
||||
function getEditable(id) {
|
||||
$.get('/jobs/getEditableRow/'+id+'/editedRowCount', false, function(data) {
|
||||
$("#"+id).replaceWith(data);
|
||||
$("#"+id).find("button").button();
|
||||
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
function getViewable(id) {
|
||||
$.get('/jobs/getViewableRow/'+id, false, function(data) {
|
||||
|
||||
$("#"+id).replaceWith(data);
|
||||
$("#"+id).find("button").button();
|
||||
|
||||
} );
|
||||
}
|
||||
|
||||
function cancelEditable(id) {
|
||||
$("#"+id).find('input').attr("readonly","readonly");
|
||||
$("#"+id).find('select').attr("disabled","disabled");
|
||||
|
|
|
|||
Loading…
Reference in a new issue