GET FORMS
This commit is contained in:
parent
6c84454ab1
commit
e023c4bb2a
@ -851,8 +851,9 @@ class Template_Management_Controller extends REST_Controller {
|
||||
$fields = array('form_id');
|
||||
$where_condition_array = array('fk_template_id'=>$template_id);
|
||||
$result_array = $this->Template_Management_Model->selectCustomRecords($fields,$where_condition_array,TEMPLATEFORMS);
|
||||
|
||||
//print_r($result_array);
|
||||
$insert_array = array();
|
||||
$count = 0;
|
||||
foreach($forms as $form)
|
||||
{
|
||||
$i = 0;
|
||||
@ -866,11 +867,30 @@ class Template_Management_Controller extends REST_Controller {
|
||||
}
|
||||
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));
|
||||
// $pk_id = $this->Template_Management_Model->updateRecords($fields,TEMPLATEFORMS,$where_condition_array);
|
||||
print_r($insert_array);
|
||||
|
||||
foreach($insert_array as $newform)
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ class Pdfgenerator
|
||||
public function generate($html, $filename='', $stream=TRUE, $paper = 'A4', $orientation = "portrait")
|
||||
{
|
||||
// echo 'stream'.$html.'tttt';
|
||||
$dompdf = new Dompdf();
|
||||
$dompdf = new Dompdf(array('enable_remote' => true));
|
||||
$dompdf->load_html($html);
|
||||
$dompdf->set_paper($paper, $orientation);
|
||||
$dompdf->render();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user