GET FORMS

This commit is contained in:
velz 2018-12-31 11:15:32 +05:30
parent 6c84454ab1
commit e023c4bb2a
2 changed files with 26 additions and 6 deletions

View File

@ -851,8 +851,9 @@ class Template_Management_Controller extends REST_Controller {
$fields = array('form_id'); $fields = array('form_id');
$where_condition_array = array('fk_template_id'=>$template_id); $where_condition_array = array('fk_template_id'=>$template_id);
$result_array = $this->Template_Management_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATEFORMS); $result_array = $this->Template_Management_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATEFORMS);
//print_r($result_array);
$insert_array = array(); $insert_array = array();
$count = 0;
foreach($forms as $form) foreach($forms as $form)
{ {
$i = 0; $i = 0;
@ -866,10 +867,29 @@ class Template_Management_Controller extends REST_Controller {
} }
if($i == 0) {$insert_array[] = $form; } if($i == 0) {$insert_array[] = $form; }
} }
// $fields = array('isactive' => 1);
// $where_condition_array = array('fk_template_id' => $template_id, 'form_id not in' => array($f)); foreach($insert_array as $newform)
// $pk_id = $this->Template_Management_Model->updateRecords($fields,TEMPLATEFORMS,$where_condition_array); {
print_r($insert_array); $fields = array('isactive' => 1,'form_id' => $newform,'fk_template_id' => $template_id);
$pk_id = $this->Template_Management_Model->saveRecords($fields,TEMPLATEFORMS);
if($pk_id != "" || $pk_id != null) { $count++; }
}
if($count != 0 && ($count == count($insert_array)))
{
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $count;
$this->response($data,REST_Controller::HTTP_OK);
}
else
{
$data['dataStatus'] = false;
$data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
$data['msg'] = 'Something Went Wrong! Try again Later';
$this->response($data,REST_Controller::HTTP_OK);
}

View File

@ -21,7 +21,7 @@ class Pdfgenerator
public function generate($html, $filename='', $stream=TRUE, $paper = 'A4', $orientation = "portrait") public function generate($html, $filename='', $stream=TRUE, $paper = 'A4', $orientation = "portrait")
{ {
// echo 'stream'.$html.'tttt'; // echo 'stream'.$html.'tttt';
$dompdf = new Dompdf(); $dompdf = new Dompdf(array('enable_remote' => true));
$dompdf->load_html($html); $dompdf->load_html($html);
$dompdf->set_paper($paper, $orientation); $dompdf->set_paper($paper, $orientation);
$dompdf->render(); $dompdf->render();