Changeset 2584 for build-queue
- Timestamp:
- 12/03/07 11:46:55 (5 years ago)
- Location:
- build-queue
- Files:
-
- 3 edited
-
data.php (modified) (1 diff)
-
developers/index.php (modified) (4 diffs)
-
package.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
build-queue/data.php
r2543 r2584 10 10 $dists_names = Array 11 11 ( 12 'Barry ',13 'Ramon (1.0 rx)'12 'Barry (0.90)', 13 'Ramon (1.0)' 14 14 ); 15 15 -
build-queue/developers/index.php
r2543 r2584 1 <? include('../data.php');?> 2 <? include('../package.php'); 1 <? 2 include('../data.php'); 3 include('../package.php'); 3 4 4 5 if(isset($_POST['sb'])) … … 11 12 echo "<h2>Data has been <span style='color:orange'>Saved</span>.</h2"; 12 13 } 13 14 14 ?> 15 15 <html> 16 <head> 17 <title>Parsix Build Queue System</title> 18 <link rel="icon" href="http://parsix.org/html/themes/parsix/images/icon.png" type="image/png" /> 19 <link rel="shortcut icon" href="http://parsix.org/html/themes/parsix/images/favicon.ico" /> 20 <link rel="stylesheet" href="themes/parsix/style/styleNN.css" type="text/css" /> 21 <style type="text/css"> 22 @import url("themes/parsix/style/style.css"); 23 </style> 24 </head> 16 25 <form method="post" > 17 26 <table border="0"> 18 27 <tr> 19 <th style="text-align:left"> 20 Choose Developer name 21 22 23 </th> 24 28 <th style="text-align:left">Choose Developer Name:</th> 25 29 <td> 26 30 <select name="devel"> 27 <?28 foreach($devels_names as $user=>$real_name):29 echo "<option value=\"$user\" >$real_name</option>\n";30 endforeach;31 ?>31 <? 32 foreach($devels_names as $user=>$real_name): 33 echo "<option value=\"$user\" >$real_name</option>\n"; 34 endforeach; 35 ?> 32 36 </select> 33 34 37 </td> 35 38 </tr> 36 39 <tr> 37 <th style="text-align:left"> 38 Type source package name 39 </th> 40 <th style="text-align:left">Type source package name:</th> 40 41 <th> 41 42 <input type="text" size="40" name="package" /> (e.g gedit,control-center etc.) … … 44 45 45 46 <tr> 46 <th style="text-align:left"> 47 Choose Distribution name 48 49 50 </th> 51 47 <th style="text-align:left">Choose Distribution name:</th> 52 48 <td> 53 49 <select name="distro"> 54 <?55 foreach($dists_names as $name):56 echo "<option value=\"$name\" >$name</option>\n";57 endforeach;58 ?>50 <? 51 foreach($dists_names as $name): 52 echo "<option value=\"$name\" >$name</option>\n"; 53 endforeach; 54 ?> 59 55 </select> 60 61 56 </td> 62 57 </tr> … … 70 65 <input type="hidden" name="sb" value="1" /> 71 66 </form> 67 </html> -
build-queue/package.php
r2543 r2584 3 3 class Package 4 4 { 5 6 5 private $_id; 7 6 private $_pkgname; … … 19 18 if($id != NULL) { 20 19 $this->_connect(); 21 $result=$this->_query("select * from queue where id='$id'"); 22 $row=$this->_fetch($result); 23 24 $this->setPkgName($row['pkgname']); 25 $this->setId($row['id']); 26 $this->setDeveloper($row['developer']); 27 $this->setDistro($row['distro']); 28 $this->setStatus($row['status']); 29 $this->_setUpdate(FALSE); 30 31 20 $result=$this->_query("select * from queue where id='$id'"); 21 $row=$this->_fetch($result); 22 23 $this->setPkgName($row['pkgname']); 24 $this->setId($row['id']); 25 $this->setDeveloper($row['developer']); 26 $this->setDistro($row['distro']); 27 $this->setStatus($row['status']); 28 $this->_setUpdate(FALSE); 32 29 } 33 30 } … … 119 116 120 117 protected function _setUpdate($value){ 121 $this->_update=$value;118 $this->_update=$value; 122 119 } 123 120 … … 126 123 $this->_connect(); 127 124 $this->_query("insert into queue values (NULL,'{$this->_pkgname}','{$this->_developer}','{$this->_distro}','{$this->_status}')"); 128 $this->_update=FALSE;125 $this->_update=FALSE; 129 126 } 130 131 127 132 128 private function _edit() 133 129 { 134 130 $this->_query("update queue set pkgname='{$this->_pkgname}', developer='{$this->_developer}', ". 135 131 "distro='{$this->_distro}', status='{$this->_status}' where id='{$this->_id}'"); 136 $this->_update=FALSE;132 $this->_update=FALSE; 137 133 } 138 134 139 135 private function _delete($id){ 140 $this->_query("delete from queue where id='$id'");136 $this->_query("delete from queue where id='$id'"); 141 137 } 142 138 143 144 139 public function delete(){ 145 if($this->_id!=null)146 $this->_delete($this->_id);140 if($this->_id!=null) 141 $this->_delete($this->_id); 147 142 } 148 143 144 public function save(){ 145 if($this->_id == NULL) { 146 $this->_new(); 147 } else { 148 $this->_edit(); 149 } 150 } 149 151 150 public function save(){151 152 if($this->_id == NULL) {153 $this->_new();154 } else {155 $this->_edit();156 }157 158 }159 152 public function __destruct() 160 153 { 161 154 if($this->_update==TRUE) 162 $this->save();163 $this->_disconnect();155 $this->save(); 156 $this->_disconnect(); 164 157 } 165 158 … … 171 164 172 165 $this->_connect(); 173 if($condition!='')174 $condition= ' And ' . $condition;166 if($condition!='') 167 $condition= ' And ' . $condition; 175 168 $result = $this->_query("select * from queue where 1 $condition"); 176 169 177 $objs=array();170 $objs=array(); 178 171 while($row = $this->_fetch($result)) { 179 $obj=new Package();180 $obj->setPkgName($row['pkgname']);181 $obj->setId($row['id']);182 $obj->setDeveloper($row['developer']);183 $obj->setDistro($row['distro']);184 $obj->setStatus($row['status']);185 $obj->_setUpdate(FALSE);186 $objs[]=$obj;172 $obj=new Package(); 173 $obj->setPkgName($row['pkgname']); 174 $obj->setId($row['id']); 175 $obj->setDeveloper($row['developer']); 176 $obj->setDistro($row['distro']); 177 $obj->setStatus($row['status']); 178 $obj->_setUpdate(FALSE); 179 $objs[]=$obj; 187 180 188 181 } 189 182 190 return ($objs);183 return ($objs); 191 184 } 192 185 193 186 public function deleteAll() { 194 $this->_connect(); 195 $this->_query("delete from queue where 1"); 196 } 187 $this->_connect(); 188 $this->_query("delete from queue where 1"); 189 } 190 } 197 191 198 199 }
Note: See TracChangeset
for help on using the changeset viewer.


