Fixes : ps

This commit is contained in:
VE10-Sanjeev 2023-12-02 17:20:32 +05:30
parent dbc9e7a397
commit 9a9bd8536c
4 changed files with 16 additions and 7 deletions

View File

@ -301,7 +301,9 @@ class Customer extends BaseController
['value'=>'','fieldflag'=>1,'text'=> 'Choose the Field','disable' => false],
['value'=>'C.type','fieldflag'=>1,'text'=> 'Type','disable' => false],
['value'=>'CA.city','fieldflag'=>1,'text'=> 'City','disable' => false],
['value'=>'CA.state','fieldflag'=>1,'text'=> 'State','disable' => false],
// ['value'=>'CA.state','fieldflag'=>1,'text'=> 'State','disable' => false],
['value'=>'CA.postal_code','fieldflag'=>1,'text'=> 'Postal Code','disable' => false],
['value'=>'C.mode','fieldflag'=>3,'text'=> 'Mode','disable' => false],
['value'=>'CM.name','fieldflag'=>1,'text'=> 'Category','disable' => false],
['value'=>'I.invoice_date','fieldflag'=>2,'text'=> 'Invoice Date','disable' => false],
['value'=>'S.to_subscription','fieldflag'=>2,'text'=> 'Expiry Date','disable' => false]];
@ -355,7 +357,7 @@ class Customer extends BaseController
$result = $model->where($where)->findAll();
$db = \Config\Database::connect();
$sql = (string)$result[0]['group_query'];
// print_r($sql);die;
print_r($sql);die;
if($sql){
$query = $db->query($sql);
$results = $query->getResultArray();
@ -428,7 +430,6 @@ class Customer extends BaseController
$column = $request_data['column'][$i];
$operator = $request_data['operator'][$i];
$value = $request_data['values'][$i];
// Handle different operators and build corresponding conditions
switch ($operator) {
case 'equal':

View File

@ -77,7 +77,7 @@ class NotificationHelper
$this->logger->info('Helper : Whatsapp');
$curl = curl_init();
$headers = array('Content-Type:application/json');
$jsonencoded = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE);
$jsonencoded = json_encode($data);
curl_setopt( $curl,CURLOPT_URL, $url);
$this->logger->info('Helper : Whatsapp url = '.$url);
switch ($method) {

View File

@ -64,6 +64,12 @@
<input type="text" class="form-control" id=<?= "values".$i; ?> name="values[]" placeholder="Enter the Multiple Values with comma Seprator" onkeypress="return restriction(event,'M')" value="<?= (isset($customer_group['values'][$i]) && $customer_group['values'][$i] != "" ) ? $customer_group['values'][$i] : '' ?>" />
<?php }else if($customer_group['operator'][$i] === 'is null' || $customer_group['operator'][$i] == 'is not null') { ?>
<input type="hidden" class="form-control" id=<?= "values".$i; ?> name="values[]" placeholder="Enter the Values" value="<?= (isset($customer_group['values'][$i]) && $customer_group['values'][$i] != "" ) ? $customer_group['values'][$i] : '' ?>" />
<?php }else if($customer_group['column'][$i] == 'C.mode' && ($customer_group['operator'][$i] === 'equal' || $customer_group['operator'][$i] == 'not equal' || $customer_group['operator'][$i] == 'like' )) { ?>
<select class="form-control" id=<?= "values".$i; ?> name="values[]">
<option value="">Choose the mode</option>
<option value="Online" <?= (isset($customer_group['values'][$i]) && $customer_group['values'][$i] == "Online") ? 'selected' : '' ?>>Online</option>
<option value="Offline" <?= (isset($customer_group['values'][$i]) && $customer_group['values'][$i] == "Offline") ? 'selected' : '' ?>>Offline</option>
</select>
<?php } else { ?>
<input type="text" class="form-control" id=<?= "values".$i; ?> name="values[]" placeholder="Enter the Values" onkeypress="return restriction(event,2)"
value="<?= (isset($customer_group['values'][$i]) && $customer_group['values'][$i] != "" ) ? $customer_group['values'][$i] : '' ?>" />
@ -485,7 +491,9 @@ function FieldChange(selectElement, rowCounter) {
$('#' + inputId).replaceWith('<input type="text" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Multiple Values with comma Seprator" onkeypress="return restriction(event,2)" />');
}else if(selectedOperator === 'is null' || selectedOperator == 'is not null') {
$('#' + inputId).replaceWith('<input type="hidden" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Values" value="0" />');
} else {
}else if(column == 3 && (selectedOperator === 'equal' || selectedOperator == 'not equal' || selectedOperator == 'like' )){
$('#' + inputId).replaceWith('<select class="form-control" id="' + inputId + '" name="values[]" ><option value="">Choose the mode</option><option value="Online">Online</option><option value="Offline">Offline</option></select>');
}else{
$('#' + inputId).replaceWith('<input type="text" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Values" onkeypress="return restriction(event,1)" />');
}

View File

@ -119,7 +119,7 @@
</div>
</div>
<div class="form-group text-right m-b-0">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="submitBtn">
Send
</button>
</div>
@ -180,7 +180,7 @@
</div>
</div>
<div class="form-group text-right m-b-0">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="submitBtn">
Send
</button>
</div>