The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (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 multiple from input checkbox
#14
ok,

INSERT query

<pre>
Code:
// prepare sql and bind parameters
   $task_id = $_POST['task_id'];
    $task_utilizator = $_POST['task_utilizator'];
    $task_sub_descriere = $_POST['task_sub_descriere'];
    $utilizator = $_POST['utilizator'];
    $titluu = $_POST['titluu'];
    $data_post = $_POST['data_post'];
    $descriere = $_POST['descriere'];
    $status_urgent = $_POST['status_urgent'];
    $status_normal = $_POST['status_normal'];
    $status_anulare = $_POST['status_anulare'];
    $status_gata = $_POST['status_gata'];
    $time_start = $_POST['time_start'];
    $time_end = $_POST['time_end'];
   $q = "INSERT INTO task_list_sub (task_id, task_utilizator, task_sub_descriere, utilizator, titluu, data_post, descriere, status_urgent, status_normal, status_anulare, status_gata, time_start, time_end )
    VALUES (
    :task_id ,
    :task_utilizator ,
    :task_sub_descriere ,
    :utilizator ,
    :titluu,
    :data_post ,
    :descriere ,
    :status_urgent ,
    :status_normal ,
    :status_anulare ,
    :status_gata ,
    :time_start ,
    :time_end
    )";
    $query = $odb->prepare($q);
    $results = $query->execute(array(
    ":task_id" => $task_id ,
    ":task_utilizator" => $task_utilizator ,
    ":task_sub_descriere" => $task_sub_descriere ,
    ":utilizator" => $utilizator ,
    ":titluu" => $titlu,
    ":data_post" => $data_post ,
    ":descriere" => $descriere ,
    ":status_urgent" => $status_urgent ,
    ":status_normal" => $status_normal ,
    ":status_anulare" => $status_anulare ,
    ":status_gata" => $status_gata ,
    ":time_start" => $time_start ,
    ":time_end" => $time_end
    
    ));
    
    
    header('Location: account.php');
}
</pre>


and here is 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">
<div class="searchable-container">
<?php
                    //Cycle through users
                    foreach ($departamentCS as $permOp){
                            echo "            
                <div class='items col-xs-5 col-sm-5 col-md-3 col-lg-3'>
                    <div class='info-block block-info clearfix'>
                        
                        <div data-toggle='buttons' class='btn-group bizmoduleselect'>
                            <label class='btn btn-default'>
                                <div class='bizcontent'>
                                    <input type='checkbox' name='utilizator' autocomplete='off' value=''>
                                    <span class='glyphicon glyphicon-ok glyphicon-lg'></span>
                                    <h5>$permOp->lname</h5>
                                </div>
                            </label>
                        </div>
                    </div>
                </div>";
     } ?>            
            </div>
        </div><br>
    </div><br>
</div>
                <input type="text" id="task_id" name="task_id" value="">        
                <input type="text" id="task_utilizator" name="task_utilizator" value="">        
                <input type="text" id="titluu" name="titluu" value="">        
                <input type="text" id="time_start" name="time_start" value="">        
                <input type="text" id="time_end" name="time_end" value="">        
                <input type="text" id="data_post" name="data_post" value="<?php echo date("Y-m-d H:i:s");?>">          
                <input type="text" id="colorr" name="color_sub" value="">          
            <textarea id="descriere" 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>
        
        <a href="javascript:history.go(-1)" class="btn btn-primary btn-lg" >Inapoi</a>
                        <input class='btn btn-success btn-lg' type='submit' name='submit' value='Adauga' />              
                  
                  
                  
                  </div></form>
</pre>

  Reply


Messages In This Thread
Insert multiple from input checkbox - by picassoo - 12-20-2016, 07:57 PM
Insert multiple from input checkbox - by picassoo - 12-20-2016, 08:15 PM
Insert multiple from input checkbox - by mudmin - 12-21-2016, 03:00 PM
Insert multiple from input checkbox - by picassoo - 12-21-2016, 06:06 PM
Insert multiple from input checkbox - by picassoo - 12-21-2016, 06:16 PM
Insert multiple from input checkbox - by picassoo - 12-21-2016, 06:44 PM
Insert multiple from input checkbox - by mudmin - 12-21-2016, 08:26 PM
Insert multiple from input checkbox - by picassoo - 12-21-2016, 10:09 PM
Insert multiple from input checkbox - by mudmin - 12-22-2016, 02:03 PM
Insert multiple from input checkbox - by picassoo - 12-22-2016, 08:49 PM
Insert multiple from input checkbox - by mudmin - 12-22-2016, 10:20 PM
Insert multiple from input checkbox - by picassoo - 12-23-2016, 09:47 AM
Insert multiple from input checkbox - by mudmin - 12-23-2016, 01:47 PM
Insert multiple from input checkbox - by picassoo - 12-23-2016, 10:52 PM
Insert multiple from input checkbox - by mudmin - 12-23-2016, 11:10 PM
Insert multiple from input checkbox - by mudmin - 12-23-2016, 11:12 PM
Insert multiple from input checkbox - by picassoo - 12-24-2016, 11:46 AM
Insert multiple from input checkbox - by picassoo - 12-24-2016, 11:48 AM
Insert multiple from input checkbox - by mudmin - 12-24-2016, 04:05 PM
Insert multiple from input checkbox - by picassoo - 12-24-2016, 08:25 PM
Insert multiple from input checkbox - by picassoo - 12-24-2016, 09:16 PM
Insert multiple from input checkbox - by mudmin - 12-25-2016, 07:35 PM
Insert multiple from input checkbox - by mudmin - 12-25-2016, 08:35 PM
Insert multiple from input checkbox - by picassoo - 12-26-2016, 06:54 PM
Insert multiple from input checkbox - by dan - 12-26-2016, 07:16 PM
Insert multiple from input checkbox - by picassoo - 12-26-2016, 08:07 PM
Insert multiple from input checkbox - by dan - 12-26-2016, 09:55 PM
Insert multiple from input checkbox - by picassoo - 12-27-2016, 05:52 AM
Insert multiple from input checkbox - by dan - 12-27-2016, 06:07 AM
Insert multiple from input checkbox - by picassoo - 02-10-2017, 09:53 PM
Insert multiple from input checkbox - by mudmin - 02-11-2017, 02:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)