コード例 #1
0
ファイル: edit.php プロジェクト: nxtzh/sunshine-signin
 require 'head.php';
 $user = NULL;
 $s_submit = "button.new_customer";
 if ($userid !== NULL) {
     try {
         $user = db_Customer::load($dbh, $userid);
     } catch (PDOException $e) {
         print "Database error: " . htmlspecialchars($e->getMessage());
         die;
     }
     $s_submit = "button.update_customer";
 }
 if ($user === NULL) {
     $user = new db_Customer();
 }
 $s_submit = htmlspecialchars(getlocalstr($s_submit));
 $user_data = $user->to_array();
 echo "   <h1>{$title}</h1>\n";
 echo "   <form method=\"post\" enctype=\"application/x-www-form-urlencoded\" action=\"edit.php\" name=\"editform\">\n    <table class=\"formtable\">\n";
 foreach ($formfields as $field) {
     if (!$is_submit && array_key_exists($field->Name, $user_data)) {
         $field->Value = $user_data[$field->Name];
     }
     $labelclass = 'formlabel';
     if (!$field->IsValid() && $is_submit) {
         $labelclass = 'formerror';
     }
     echo "    <tr>\n";
     if ($field->InputType == 'checkbox' || $field->InputType == 'radio') {
         echo "     <td class=\"formcheckbox\">" . $field->getInputElement() . "</td>\n";
         echo "     <td class=\"{$labelclass}\">" . $field->getLabelElement() . "</td>\n";
コード例 #2
0
ファイル: lib.php プロジェクト: nxtzh/sunshine-signin
 function GetReadableValue()
 {
     if ($this->Value == "true" || $this->Value == "TRUE" || $this->Value === true) {
         return getlocalstr("values.Yes");
     } else {
         return getlocalstr("values.No");
     }
 }