The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
INSERT variabile
#1
Hey again, sory I needd again your help here. I have form and I need to add in DB in tow tabels. Here i trid to make the form but no luck, can you help my again pleasee.


INSERT POST SCRIPT

<pre>
Code:
//Forms posted
if (!empty($_POST)) {
  
  //Manually Add User
  if(!empty($_POST['addTask'])) {
    $cine_post_task = Input::get('cine_post_task');
      $utilizator = Input::get('utilizator');
      $titlu = Input::get('titlu');
      $color = Input::get('color');
    $descriere = Input::get('descriere');
    $data_start = Input::get('data_start');
    $data_end = Input::get('data_end');
    $post_data = Input::get('post_data');
    $post_time = Input::get('post_time');
    $descriere = Input::get('descriere');

    $form_valid=FALSE; // assume the worst
    $validation = new Validate();
    $validation->check($_POST,array(
      'cine_post_task' => array(
      'display' => '',
      'required' => false,
      'min' => 5,
      'max' => 35,
      ),
      'utilizator' => array(
      'display' => '',
      'required' => false,
      'min' => 2,
      'max' => 35,
      ),
      'titlu' => array(
      'display' => '',
      'required' => false,
      'min' => 2,
      'max' => 35,
      ),
      'color' => array(
      'display' => '',
      'required' => false,
      ),
      'descriere' => array(
      'display' => '',
      'required' => false,
      ),
      'data_start' => array(
      'display' => '',
      'required' => false,
      ),
      'data_end' => array(
      'display' => '',
      'required' => false,
      ),
      'post_data' => array(
      'display' => '',
      'required' => false,
      ),
      'post_time' => array(
      'display' => '',
      'required' => false,
      ),
    ));
      if($validation->passed()) {
        $form_valid=false;
      try {
        // echo "Trying to create user";
        $fields=array(
          'task_utilizator' => Input::get('utilizator'),
          'task_sub_descriere' => Input::get('descriere'),
        );
         $db->insert('task',$fields);
        $theNewId=$db->lastId();
        // bold($theNewId);
        $addNewTask = array('id' => $theNewId, 'task_id' => $perm);
        $db->insert('task_list_sub',$addNewTask);

        $successes[] = lang("ACCOUNT_USER_ADDED");

      } catch (Exception $e) {
        die($e->getMessage());
      }

    }
  }
}
</pre>



HERE THE FORM
<pre>
Code:
<form id="demo-form2" class="form-horizontal form-label-left " action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST" id="payment-form">
<br>
                    <div class="form-group">
                    
                      <label class="control-label col-md-3 col-sm-3 col-xs-12">Utilizator <span class="required"></span></label>
                      <div class="col-md-7 col-sm-7 col-xs-12">
                        <select id="first-name" name="utilizator" class="select2_single form-control" required="required" tabindex="-1">
                          <option ></option>
                           <?php

                  foreach ($departamentCS as $permOp){
                    echo "<option value='$permOp->id'>$permOp->lname</option>";
                  }
                  ?>
                  
                        </select>
                      </div>
                    </div>
                    
                    <div class="form-group">
                      <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Titlu <span class="required">*</span>
                      </label>
                      <div class="col-md-7 col-sm-7 col-xs-12">
                        <input type="text" id="last-name" name="titlu" required="required" class="form-control col-md-7 col-xs-12">
                        <input type="hidden" id="last-name" name="cine_post_task" required="required" value="<?=ucfirst($user->data()->lname)?>" class="form-control col-md-7 col-xs-12">
                        <input name="post_time" id='time' type="hidden" value="" />
                        <input name="post_data" id='' type="hidden" value="<?php echo date("d/m/Y");?>" />
                      </div>
                    </div>

<div class="form-group">
                      <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Data start <span class="required">*</span>
                      </label>
                      <div class="col-md-7 col-sm-7 col-xs-12">
                       <input type="text" name="data_start" class="form-control has-feedback-left" required="required" id="single_cal2" value="<?php echo date("d/m/Y");?>" placeholder="First Name" aria-describedby="inputSuccess2Status2">
                              <span class="fa fa-calendar-o form-control-feedback left" aria-hidden="true"></span>
                              </div>
                    </div>
<div class="form-group">
                      <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Data end <span class="required">*</span>
                      </label>
                      <div class="col-md-7 col-sm-7 col-xs-12">
                       <input type="text" name="data_end" class="form-control has-feedback-left" required="required" id="single_cal3" placeholder="First Name" aria-describedby="inputSuccess2Status2">
                              <span class="fa fa-calendar-o form-control-feedback left" aria-hidden="true"></span>
                              </div>
                    </div>                    
                    
                    <div class="form-group">
                      <label class="control-label col-md-3 col-sm-3 col-xs-12">Detalii<span class="required"></span>
                      </label>
                      <div class="col-md-7 col-sm-7 col-xs-12">
                        <textarea id="message" required="required" class="form-control" name="descriere" data-parsley-trigger="keyup" data-parsley-minlength="20" data-parsley-maxlength="100" data-parsley-minlength-message="Trebui sa pui celputin 20 caractere"
                          data-parsley-validation-threshold="10"></textarea>
                      </div>
                    </div>
                    
                    <div class="form-group">
                      <label class="control-label col-md-3 col-sm-3 col-xs-12">Culoare <span class="required"></span>
                      </label>
                      <div class="col-md-7 col-sm-7 col-xs-12">
                        <select class="colorpicker-selectColor-unknown" name="color">
   <option value="#000000">Black</option>                    
  <option value="#7bd148">Green</option>
  <option value="#5484ed">Bold blue</option>
  <option value="#a4bdfc">Blue</option>
  <option value="#46d6db">Turquoise</option>
  <option value="#7ae7bf">Light green</option>
  <option value="#51b749">Bold green</option>
  <option value="#fbd75b">Yellow</option>
  <option value="#ffb878">Orange</option>
  <option value="#ff887c">Red</option>
  <option value="#dc2127">Bold red</option>
  <option value="#dbadff">Purple</option>
</select>
                      </div>
                    </div>
                    
                    
                      </div>
                      <div class="modal-footer">
                        <input class='btn btn-success' type='submit' name='addTask' value='Adauga' />
                      </div>
</form>
</pre>


thank you
  Reply


Messages In This Thread
INSERT variabile - by picassoo - 11-27-2016, 07:08 PM
INSERT variabile - by mudmin - 11-27-2016, 08:06 PM
INSERT variabile - by picassoo - 11-29-2016, 08:56 PM
INSERT variabile - by picassoo - 11-29-2016, 08:58 PM
INSERT variabile - by mudmin - 11-30-2016, 01:58 AM
INSERT variabile - by picassoo - 11-30-2016, 10:13 AM
INSERT variabile - by picassoo - 11-30-2016, 12:07 PM
INSERT variabile - by mudmin - 12-01-2016, 01:07 AM
INSERT variabile - by picassoo - 12-01-2016, 09:04 PM
INSERT variabile - by mudmin - 12-01-2016, 09:10 PM
INSERT variabile - by picassoo - 12-02-2016, 04:55 PM
INSERT variabile - by dan - 12-02-2016, 05:05 PM
INSERT variabile - by picassoo - 12-02-2016, 05:32 PM
INSERT variabile - by dan - 12-02-2016, 05:34 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)