Advertisement
Guest User

Untitled

a guest
Nov 30th, 2016
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.10 KB | None | 0 0
  1. <?php
  2.  
  3. if(file_exists("install/index.php")){
  4.     //perform redirect if installer files exist
  5.     //this if{} block may be deleted once installed
  6.     header("Location: install/index.php");
  7. }
  8.  
  9. require_once 'users/init.php';
  10. require_once $abs_us_root.$us_url_root.'users/includes/header.php';
  11. require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';
  12. ?>
  13.  
  14. <div id="page-wrapper">
  15. <div class="container">
  16.  
  17.     <?php
  18.     //Forms posted
  19.     if (!empty($_POST)) {
  20.  
  21.       //Manually Add User
  22.       if(!empty($_POST['addTask'])) {
  23.             //$cine_post_task = Input::get('cine_post_task');
  24.             $cine_post_task = 'No form field for this';
  25.         $utilizator = Input::get('utilizator');
  26.         $titlu = Input::get('titlu');
  27.         $color = Input::get('color');
  28.         $descriere = Input::get('descriere');
  29.         $data_start = Input::get('data_start');
  30.         $data_end = Input::get('data_end');
  31.         $post_data = Input::get('post_data');
  32.         $post_time = Input::get('post_time');
  33.         $descriere = Input::get('descriere');
  34.  
  35.         // $form_valid=FALSE; // assume the worst
  36.         // $validation = new Validate();
  37.         // $validation->check($_POST,array(
  38.         //   'cine_post_task' => array(
  39.         //   'display' => '',
  40.         //   'required' => false,
  41.         //   'min' => 5,
  42.         //   'max' => 35,
  43.         //   ),
  44.         //   'utilizator' => array(
  45.         //   'display' => '',
  46.         //   'required' => false,
  47.         //   'min' => 2,
  48.         //   'max' => 35,
  49.         //   ),
  50.         //   'titlu' => array(
  51.         //   'display' => '',
  52.         //   'required' => false,
  53.         //   'min' => 2,
  54.         //   'max' => 35,
  55.         //   ),
  56.         //   'color' => array(
  57.         //   'display' => '',
  58.         //   'required' => false,
  59.         //   ),
  60.           // 'descriere' => array(
  61.         //   'display' => '',
  62.         //   'required' => false,
  63.         //   ),
  64.           // 'data_start' => array(
  65.         //   'display' => '',
  66.         //   'required' => false,
  67.         //   ),
  68.           // 'data_end' => array(
  69.         //   'display' => '',
  70.         //   'required' => false,
  71.         //   ),
  72.           // 'post_data' => array(
  73.         //   'display' => '',
  74.         //   'required' => false,
  75.         //   ),
  76.           // 'post_time' => array(
  77.         //   'display' => '',
  78.         //   'required' => false,
  79.         //   ),
  80.         // ));
  81.         // if($validation->passed()) {
  82.             // $form_valid=true;
  83.           try {
  84.             // echo "Trying to create user";
  85.             $fields=array(
  86.                         'cine_post_task' => $cine_post_task,
  87.               'utilizator' => $utilizator,
  88.                         'titlu'     =>  $titlu,
  89.               'descriere'  => $descriere,
  90.                         'color' => $color,
  91.                         'data_start' => $data_start,
  92.                         'data_end' =>$data_end,
  93.                         'post_data' =>$post_data,
  94.                         'post_time' =>$post_time,
  95.  
  96.             );
  97.              $db->insert('task',$fields);
  98.                      //die("Made it through step 1");
  99.             $theNewId=$db->lastId();
  100.             bold($theNewId);
  101.                     //die("Made it through step 2");
  102.  
  103.             $addNewTask = array('id' => $theNewId, 'task_id' => $perm);
  104.             $db->insert('task_list_sub',$addNewTask);
  105.  
  106.             $successes[] = lang("ACCOUNT_USER_ADDED");
  107.  
  108.           } catch (Exception $e) {
  109.             die($e->getMessage());
  110.           }
  111.  
  112.         }
  113.       }
  114. //  }
  115.     ?>
  116.  
  117.  
  118.     <form id="demo-form2" class="form-horizontal form-label-left " action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST" id="payment-form">
  119.     <br>
  120.                         <div class="form-group">
  121.  
  122.                           <label class="control-label col-md-3 col-sm-3 col-xs-12">Utilizator <span class="required"></span></label>
  123.                           <div class="col-md-7 col-sm-7 col-xs-12">
  124.                             <select id="first-name" name="utilizator" class="select2_single form-control" required="required" tabindex="-1">
  125.                               <option >Something Here</option>
  126.                                <?php
  127.                                         //I don't see a query for departmentCS so I used the something here above.
  128.                       foreach ($departamentCS as $permOp){
  129.                         echo "<option value='$permOp->id'>$permOp->lname</option>";
  130.                       }
  131.                       ?>
  132.  
  133.                             </select>
  134.                           </div>
  135.                         </div>
  136.  
  137.                         <div class="form-group">
  138.                           <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Titlu <span class="required">*</span>
  139.                           </label>
  140.                           <div class="col-md-7 col-sm-7 col-xs-12">
  141.                             <input type="text" id="last-name" name="titlu" required="required" class="form-control col-md-7 col-xs-12">
  142.                             <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">
  143.                             <input name="post_time" id='time' type="hidden" value="" />
  144.                             <input name="post_data" id='' type="hidden" value="<?php echo date("d/m/Y");?>" />
  145.  
  146.  
  147.                           </div>
  148.                         </div>
  149.  
  150.  
  151.  
  152.     <div class="form-group">
  153.                           <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Data start <span class="required">*</span>
  154.                           </label>
  155.                           <div class="col-md-7 col-sm-7 col-xs-12">
  156.                            <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">
  157.                                   <span class="fa fa-calendar-o form-control-feedback left" aria-hidden="true"></span>
  158.                                   </div>
  159.                         </div>
  160.     <div class="form-group">
  161.                           <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Data end <span class="required">*</span>
  162.                           </label>
  163.                           <div class="col-md-7 col-sm-7 col-xs-12">
  164.                            <input type="text" name="data_end" class="form-control has-feedback-left" required="required" id="single_cal3" placeholder="First Name" aria-describedby="inputSuccess2Status2">
  165.                                   <span class="fa fa-calendar-o form-control-feedback left" aria-hidden="true"></span>
  166.                                   </div>
  167.                         </div>
  168.  
  169.                         <div class="form-group">
  170.                           <label class="control-label col-md-3 col-sm-3 col-xs-12">Detalii<span class="required"></span>
  171.                           </label>
  172.                           <div class="col-md-7 col-sm-7 col-xs-12">
  173.                             <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"
  174.                               data-parsley-validation-threshold="10"></textarea>
  175.                           </div>
  176.                         </div>
  177.  
  178.                         <div class="form-group">
  179.                           <label class="control-label col-md-3 col-sm-3 col-xs-12">Culoare <span class="required"></span>
  180.                           </label>
  181.                           <div class="col-md-7 col-sm-7 col-xs-12">
  182.                             <select class="colorpicker-selectColor-unknown" name="color">
  183.        <option value="#000000">Black</option>
  184.       <option value="#7bd148">Green</option>
  185.       <option value="#5484ed">Bold blue</option>
  186.       <option value="#a4bdfc">Blue</option>
  187.       <option value="#46d6db">Turquoise</option>
  188.       <option value="#7ae7bf">Light green</option>
  189.       <option value="#51b749">Bold green</option>
  190.       <option value="#fbd75b">Yellow</option>
  191.       <option value="#ffb878">Orange</option>
  192.       <option value="#ff887c">Red</option>
  193.       <option value="#dc2127">Bold red</option>
  194.       <option value="#dbadff">Purple</option>
  195.     </select>
  196.                           </div>
  197.                         </div>
  198.  
  199.  
  200.                           </div>
  201.                           <div class="modal-footer">
  202.                             <input class='btn btn-success' type='submit' name='addTask' value='Adauga' />
  203.                           </div>
  204.     </form>
  205.  
  206. <div class="row">
  207. <div class="col-md-12">
  208.  
  209.  
  210. </div><!-- /.col -->
  211. </div><!-- /.row -->
  212.  
  213. </div> <!-- /container -->
  214.  
  215. </div> <!-- /#page-wrapper -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement