" / >    
                <table width="100%" border="0" style="padding:10px 10px 10px 10px;">
                 <tr>
                    <td width="22%">Select Location:</td>
                    <td width="78%">
                        <?php 
echo DropDownUtils::getAllLocationsDropDown("locations", "", $user->getLocationSeq());
?>
                        
                    </td>
                  </tr>
                  <tr>
                    <td width="22%">Other Locations:</td>
                    <td width="78%">
                        <b> <?php 
echo DropDownUtils::getAllLocationsMultiDropDown("ol_DropDown", "", $user->getOtherLocationSeqs());
?>
</b> 
                    </td>
                  </tr>
                 <tr>
                    <td width="22%">Full Name :</td>
                    <td width="78%"><input name="fullName" type="text" value="<?php 
echo $user->getFullName();
?>
"  size="50"></td>
                  </tr>
                  <tr>
                    <td width="22%">User Name :</td>
                    <td width="78%"><input name="username" type="text" value="<?php 
echo $user->getUserName();
Example #2
0
 public function Save(User $user)
 {
     try {
         $SQL = self::$INSERT;
         $isUpdate = false;
         if ($user->getSeq() != null && $user->getSeq() != "" && $user->getSeq() > 0) {
             $SQL = self::$UPDATE;
             $isUpdate = true;
         }
         $conn = self::$db_New->getConnection();
         $stmt = $conn->prepare($SQL);
         $stmt->bindValue(':fullname', $user->getFullName());
         $stmt->bindValue(':username', $user->getUserName());
         $stmt->bindValue(':password', $user->getPassword());
         $stmt->bindValue(':emailid', $user->getEmailId());
         $stmt->bindValue(':dateofregistration', $user->getDateOfRegistration());
         $isActive = 0;
         if ($user->getIsActive() == "true" || $user->getIsActive() == 1) {
             $isActive = 1;
         }
         $stmt->bindValue(':isactive', $isActive);
         $isManager = 0;
         if ($user->getIsManager() == "true" || $user->getIsManager() == 1) {
             $isManager = 1;
         }
         $stmt->bindValue(':ismanager', $isManager);
         $stmt->bindValue(':locationseq', $user->getLocationSeq());
         $stmt->bindValue(':folderseq', $user->getFolderSeq());
         if ($isUpdate) {
             $stmt->bindValue(':seq', $user->getSeq());
             $stmt->execute();
         } else {
             $stmt->execute();
             $id = $conn->lastInsertId();
             $user->setSeq($id);
         }
         //i will put the code here for return the error and show on the screen
         $error = $stmt->errorInfo();
         if ($error[2] != "") {
             $logger = Logger::getLogger("logger");
             $logger->error("Error occured :" . $error[2]);
             throw new Exception($error[2]);
         }
         $otherLocations = $user->getOtherLocationSeqs();
         if (empty($otherLocations)) {
             $otherLocations = array();
         }
         if (!in_array($user->getLocationSeq(), $otherLocations)) {
             array_push($otherLocations, $user->getLocationSeq());
         }
         $this->saveOtherLocationUser($otherLocations, $user->getSeq());
     } catch (Exception $e) {
         $logger = Logger::getLogger($ConstantsArray["logger"]);
         $logger->error($e->getMessage());
     }
 }