Ejemplo n.º 1
0
     $list2 = $_POST['list2'];
 }
 if (isset($_POST['list3'])) {
     $list3 = $_POST['list3'];
 }
 if (isset($_POST['list4'])) {
     $list4 = $_POST['list4'];
 }
 if (isset($_POST['list5'])) {
     $list5 = $_POST['list5'];
 }
 $value = '';
 switch ($html_element) {
     case 'text':
         $data_html = $obj->text($var_name, $label, $value, $div_name);
         $data_css = $obj_css->styles($var_name, $color, $width, $height, $x_position, $y_position, $z_index, $font_size, $font_color);
         $obj->write_to_file($data_html, $html_file_name, $css_file_name, $data_css);
         $insert = "INSERT INTO `CMS`.`html_css` (`ID`, `HTML`, `CSS`,  `FORM_ID`,`STATUS`, `NAME`) VALUES (NULL, '{$data_html}', '{$data_css}', {$index_of_form},'1', '{$label}');";
         $result = $conn->query($insert);
         $ID = mysqli_insert_id($conn);
         $insert_div_data = "INSERT INTO `CMS`.`divs` (`ID`, `ELEMENT`, `HTML_CSS_ID`) VALUES (NULL, '{$data_html}',{$ID});";
         $result = $conn->query($insert_div_data);
         echo 'HTML & CSS Code created successfully<br/>';
         break;
     case 'text_area':
         $data_html = $obj->text_area($var_name, $label, $value, $div_name);
         $data_css = $obj_css->styles($var_name, $color, $width, $height, $x_position, $y_position, $z_index, $font_size, $font_color);
         $obj->write_to_file($data_html, $html_file_name, $css_file_name, $data_css);
         $insert = "INSERT INTO `CMS`.`html_css` (`ID`, `HTML`, `CSS`,  `FORM_ID`,`STATUS`, `NAME`) VALUES (NULL, '{$data_html}', '{$data_css}', {$index_of_form},'1', '{$label}');";
         $result = $conn->query($insert);
         $ID = mysqli_insert_id($conn);