public function registraOpcao(array $opcoes) { parent::setTabela('sebraeprev_enquete_opcoes'); $this->deleteOpcao(); foreach ($opcoes as $opcao) { parent::sanitize($opcao); $resultado = parent::insert(array('titulo' => $opcao, 'id_enquete' => $this->id_enquete)); } return $resultado; }
<?php include "../../connection/phpmysqlconnect.php"; include "../../lib/CRUD_lib.php"; include "../../lib/miss_lib.php"; // post data // File processing $ext_array = array("jpeg", "jpg", "png"); $mime_array = array("image/jpeg", "image/jpg", "image/png"); $location = "../../media/featured_product/"; $image = new uploader(); if ($image->upload_validate($_FILES['files'], $ext_array, $mime_array) == true) { $image_name = $image->upload($_FILES['files'], $location); $column = array('logo'); $value = array($image_name); $insert = new crud($conn, 'featured-product', $column, $value); $insert->insert(); $move = new alert_redirect(); $move->moveWithAlert('Logo has been added', '../../pages/distributor-logo.php'); } $move->moveWithAlert('Error in uploading image', '../../pages/distributor-logo.php');
</div> </div> <div class="form-group"> <div class="col-sm-offset-4 col-sm-8"> <button type="submit" class="btn btn-lg btn-primary" name="submit" value="Submit">Submit</button> </div> </div> </form> </div> </div> </div></div> <?php if (empty($nameErr) && empty($websiteErr) && empty($mpErr) && !empty($name) && !empty($website) && !empty($mp) && !empty($pubid) && empty($pubidErr) && empty($widgetErr) && !empty($widget2)) { $crud = new crud(); $crud->insert($pubid, $name, $website, $piwik, $cache, $allowedParameters, $abtest, $mp, $widget2); } ?> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> </body> </html>
<?php session_start(); // included files include "../../../connection/phpmysqlconnect.php"; include "../../../library/CRUD_lib.php"; include "../../../library/miss_lib.php"; // post data $user_id = $_POST['user_id']; $name = $_POST['name']; $role = 'customer'; $date_of_enrollment = $_POST['date_of_enrollment']; $email = $_POST['email']; $mobile = $_POST['mobile']; $landline = $_POST['landline']; $password = $_POST['password']; $password = md5($password); $modifier = $_SESSION["user"]; // insertion $column = array('user_id', 'name', 'date_of_enrollment', 'email_id', 'mobile', 'landline', 'added_by', 'modified_by'); $value = array("{$user_id}", "{$name}", "{$date_of_enrollment}", "{$email}", "{$mobile}", "{$landline}", "{$modifier}", "{$modifier}"); $insert = new crud($conn, 'customer_details', $column, $value); $insert->insert(); $column1 = array('user_id', 'role', 'password', 'added_by', 'modified_by'); $value1 = array("{$user_id}", "{$role}", "{$password}", "{$modifier}", "{$modifier}"); $insert1 = new crud($conn, 'login_details', $column1, $value1); $insert1->insert(); $move = new alert_redirect(); $move->moveWithAlert('New User Customer has been added', '../../pages/add-customer.php');